9

I am porting some tests from X11 to Wayland and there is little to no information on how to list the available resolutions supported.

All the examples that use Wayland and EGL manually specify the screen resolution to be used. I would like to list all the resolutions available and use the best.

Thank you, I didn't find anything.

Matthias Braun
  • 24,493
  • 16
  • 114
  • 144
000Camus000
  • 119
  • 1
  • 5

3 Answers3

14

The reply is so late but still can be useful to you or someone :)

You can see all supported video adapters by using this command

$ ls /sys/class/drm
card0
card0-VGA-1
card1
card1-DVI-I-1
card1-HDMI-A-1
card1-VGA-2

You can get all supported resolutions by this command, use the adapter which you are using

$ cat /sys/class/drm/card0-LVDS-1/modes 
1366x768
1366x768
ganeshredcobra
  • 1,271
  • 3
  • 24
  • 37
2

If you want to list all the modes the compositor supports (might not be the same as your monitor), you can run weston-info

It's a simple wayland-client that just connects to the display and logs all the global interfaces (including the wl_outputs (screens) and their modes).

You could also do that yourself inside your Wayland-client and pick the mode you prefer for your test.

bobbaluba
  • 2,812
  • 2
  • 27
  • 38
2

My reply is too late but this might be helpful to someone. The simplest way is to check the weston log which will give you all supported modes for each connector(VGA,LVDS and HDMI) below are the log which highlights these.

Additional info: If you have not connected a physical monitor to connector port and port is enabled then it will by default take 1024x768 as preferred.

[09:23:40.144] Output VGA-1 (crtc 59) video modes:
           1024x768@60.0, preferred, current, 65.0 MHz
           1440x900@59.9, 88.8 MHz
           1366x768@59.8, 85.5 MHz
           1366x768@60.0, 72.0 MHz
           1360x768@60.0, 85.5 MHz
           1280x800@59.8, 83.5 MHz
           1280x800@59.9, 71.0 MHz
           1280x768@59.9, 79.5 MHz
           1280x768@60.0, 68.2 MHz
           1280x720@60.0, 74.2 MHz
           800x600@60.3, 40.0 MHz
           800x600@56.2, 36.0 MHz
           848x480@60.0, 33.8 MHz
           640x480@59.9, 25.2 MHz
[09:23:40.144] Output 'VGA-1' enabled with head(s) VGA-1
[09:23:40.145] Chosen EGL config details:
           RGBA bits: 8 8 8 0
           swap interval range: 1 - 1
[09:23:40.151] Output HDMI-A-2 (crtc 58) video modes:
           1920x1080@60.0, preferred, current, 138.8 MHz
           1920x1080@60.0, 148.5 MHz
           1920x1080@59.9, 148.4 MHz
           1920x1080@60.0, 74.2 MHz
           1920x1080@59.9, 74.2 MHz
           1920x1080@50.0, 148.5 MHz
           1920x1080@50.0, 74.2 MHz
           1920x1080@40.0, 92.5 MHz
           1280x720@60.0, 74.2 MHz
           1280x720@59.9, 74.2 MHz
           1280x720@50.0, 74.2 MHz
           720x576@50.0, 27.0 MHz
           720x480@60.0, 27.0 MHz
           720x480@59.9, 27.0 MHz
           640x480@60.0, 25.2 MHz
           640x480@59.9, 25.2 MHz
[09:23:40.152] Output 'HDMI-A-2' enabled with head(s) HDMI-A-2
[09:23:40.152] Chosen EGL config details:
           RGBA bits: 8 8 8 0
           swap interval range: 1 - 1
[09:23:40.155] Output LVDS-1 (crtc 56) video modes:
           1024x768@60.2, preferred, current, 65.0 MHz
[09:23:40.155] Output 'LVDS-1' enabled with head(s) LVDS-1
Tyson
  • 41
  • 9
  • Thank you for answering, I'll bookmark this response for later use, I am no longer working with wayland, but this is really useful. – 000Camus000 Jan 10 '20 at 01:30