Comment 1 for bug 1968943

Revision history for this message
Pierre Equoy (pieq) wrote :

Summary of my researches so far:

The job is in plainbox-provider-checkbox:

https://git.launchpad.net/plainbox-provider-checkbox/tree/units/graphics/jobs.pxu#n130

1. It sources graphics_env.sh[1] for AMD discrete GPUs
2. It uses xrandr to guess the max resolution from the primary screen output.
3. Then it uses a Python one-liner and Gdk to find the resolution of the current default screen.

I'm not sure if 1. is needed at all for this job.

xrandr cannot be used in Wayland, so we have to replace 2. with either

- a "if wayland then... else if xorg then..." version, so we can use xrandr in one case and gnome-randr in the other
- find a more "close to the metal" option that would work in any cases. For instance, access /sys/class/drm/*/modes that contain a list of supported resolutions for every monitor available.

3. As shown in the bug description, Gdk.Screen has been removed in Gdk 4.0 (it was deprecated in Gdk 3.22). Unfortunately, Gdk 3 and Gdk 4 have different classes and methods to access what we want (the current resolution of the default screen), so it would become quite complicated (but possible) to handle both 20.04 and 22.04 with the same script. Might need to find a better approach to this.

[1] https://git.launchpad.net/plainbox-provider-checkbox/tree/bin/graphics_env.sh