summaryrefslogtreecommitdiff
path: root/units/graphics
diff options
authorPierre Equoy <pierre.equoy@canonical.com>2022-06-08 11:58:20 +0800
committerPierre Equoy <pierre.equoy@canonical.com>2022-06-15 15:31:17 +0800
commit73af3e72d7d859f5151e75e1bf885bd978d4c1c7 (patch)
treecf369f5d040c1e68558ca5fdbd88d780709693dd /units/graphics
parent30714610c15365019d2effa761bcb5f113e37ee6 (diff)
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
Diffstat (limited to 'units/graphics')
-rw-r--r--units/graphics/jobs.pxu8
1 files changed, 1 insertions, 7 deletions
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: