From 73af3e72d7d859f5151e75e1bf885bd978d4c1c7 Mon Sep 17 00:00:00 2001 From: Pierre Equoy Date: Wed, 8 Jun 2022 11:58:20 +0800 Subject: Change: graphics/*_maximum_resolution_* compatible with X and Wayland On Wayland, xrandr returns the current resolution as the maximum resolution, even when it is not. For instance, if a laptop has a 3840x2160 screen but is currently set to 2560x1440, xrandr would return 2560x1440 as the maximum available resolution. Moreover, the python oneliner to check current resolution breaks on recent versions of Gtk because Gdk.Screen has been deprecated. Introduce a new script that: - retrieves monitor(s) info from sysfs (port, max resolution, status, etc.) - uses up-to-date Gtk 3 methods to grab the current resolution and scale factor for each connected monitors - displays this information for tester to review - compares data from sysfs and Gtk and returns an error if their data does not match (so that the graphics/*_maximum_resolution_* job status is automatically set to Passed or Failed depending of the outcome) Update the graphics/*_maximum_resolution_* job to call this script. LP: #1968943 --- units/graphics/jobs.pxu | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'units/graphics') diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu index 4dde304..f18aa07 100644 --- a/units/graphics/jobs.pxu +++ b/units/graphics/jobs.pxu @@ -133,13 +133,7 @@ category_id: com.canonical.plainbox::graphics requires: device.category == 'VIDEO' command: - # shellcheck disable=SC1091 - source graphics_env.sh {driver} {index} - maxi="$(xrandr -q |grep -A 1 "connected\( primary\)* [0-9]" |tail -1 |awk '{{print $1}}')" - now="$(python3 -c 'from gi.repository import Gdk; screen=Gdk.Screen.get_default(); geo = screen.get_monitor_geometry(screen.get_primary_monitor()); print(geo.width, "x", geo.height, sep="")')" - test "$maxi" != "$now" && notify="\nPlease switch to the maximum resolution \nfor every graphic tests" - echo "Maximum resolution: $maxi" - echo "Current resolution: $now $notify" + graphics_max_resolution.py estimated_duration: 10.0 _summary: Test maximum supported resolution for {vendor} {product} _description: -- cgit v1.2.3 From a028a44bb18f0f2e9e26c91c3e7f216c70911509 Mon Sep 17 00:00:00 2001 From: Pierre Equoy Date: Wed, 8 Jun 2022 12:00:46 +0800 Subject: Remove: graphics_modes_info.py script and related jobs The graphics_modes_info.py script is used in two jobs that are not called in any of our test plans. Moreover, since it uses xrandr, the output might be incorrect on recent versions of Ubuntu (22.04+) using Wayland as default. --- units/graphics/jobs.pxu | 10 ---------- units/graphics/legacy.pxu | 8 -------- 2 files changed, 18 deletions(-) (limited to 'units/graphics') diff --git a/units/graphics/jobs.pxu b/units/graphics/jobs.pxu index f18aa07..8206f1a 100644 --- a/units/graphics/jobs.pxu +++ b/units/graphics/jobs.pxu @@ -146,16 +146,6 @@ _description: VERIFICATION: Is this the maximum resolution for the display connected to the {vendor} {product} graphics card? -unit: template -template-resource: graphics_card -id: graphics/{index}_modes_{product_slug} -plugin: shell -category_id: com.canonical.plainbox::graphics -command: graphics_modes_info.py -estimated_duration: 0.250 -_description: Collect info on graphics modes (screen resolution and refresh rate) for {vendor} {product} -_summary: Test graphic modes info for {vendor} {product} - unit: template template-resource: graphics_card id: graphics/{index}_color_depth_{product_slug} diff --git a/units/graphics/legacy.pxu b/units/graphics/legacy.pxu index 14969b0..2b9545d 100644 --- a/units/graphics/legacy.pxu +++ b/units/graphics/legacy.pxu @@ -96,14 +96,6 @@ _description: VERIFICATION: Is this the display's maximum resolution? -id: graphics/modes -plugin: shell -category_id: com.canonical.plainbox::graphics -command: graphics_modes_info.py -estimated_duration: 0.250 -_description: Collect info on graphics modes (screen resolution and refresh rate) -_summary: Collect info on graphics modes - id: graphics/color_depth plugin: shell category_id: com.canonical.plainbox::graphics -- cgit v1.2.3