Closed Bug 1732436 Opened 8 months ago Closed 8 months ago

Use Xrandr to detect displays on X11

Categories

(Core :: Graphics, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: rmader, Assigned: rmader)

References

Details

Attachments

(6 files)

Right now we use a legacy method to detect display modes on X11[1]. This method is not able to detect multiple screen on composited desktop - which are by far the majority these days. On such desktops, we currently report only one display with the combined size of the actual displays.

In bug 1710400 we started to use Xrandr in glxtest in order to detect DDX drivers. Lets build on that and use Xrandr for display detection as well. This will improve our telemetry and, crucially, make debugging easier as about:support will be clear about multi-display setups.

For the record: we already have correct display detection on Wayland, see bug 1640053

1: https://searchfox.org/mozilla-central/source/toolkit/xre/glxtest.cpp#706-721

Summary: Use Xrandr to detect to detect displays on X11 → Use Xrandr to detect displays on X11

We already require Xrandr 1.3 inderectly through GTK3 (`>=1.2.99).
This bumps the requirement to 1.4, which got released in 2012 and
is thus part of RHEL 7 and Ubuntu 14.04.

Karl, can I ask you for some help here? I'm trying to link Xrandr (-lXrandr) and the above patch successfully makes it part of MOZ_X11_LIBS. When running mach build -v, -lXrandr shows up in line with -lX11 and -lxcb, but still the linker complains: ld.lld: error: undefined hidden symbol: XRRGetProviderResources.

What am I missing to make the linker happy?

Flags: needinfo?(karlt)

Martin, maybe you also know how to solve the linker problem above?

Flags: needinfo?(stransky)

You can investigate the objects by nm or objdump tool. The symbol is perhaps created as local/hidden but should be global.
Visibility is driven by system headers wrappers as Darkspirit pointed out so you need to add the headers to wrapper list to compile symbols there as global.

Flags: needinfo?(stransky)

(In reply to Darkspirit from comment #4)

Does it need to be put in https://searchfox.org/mozilla-central/rev/f953948db2ac26698487f5fc5c03046c29922f26/config/system-headers.mozbuild#1019?

That indeed did the trick, thanks a lot!

Flags: needinfo?(karlt)
Attachment #9242818 - Attachment description: WIP: Bug 1732436 - Link Xrandr directly instead of using dlopen → Bug 1732436 - Link Xrandr directly instead of using dlopen, r=karlt,stransky

Previously we used a legacy method to detect display modes on X11. This
method was not able to detect multiple screen on composited desktop - which
are by far the majority these days and also include Xwayland.
On such desktops, we reported only one display with the combined size
of the actual displays.

Use the more modern Xrandr to properly detect the right display modes.
This will improve our telemetry and, crucially, make debugging easier.

Try build: https://treeherder.mozilla.org/jobs?repo=try&revision=a9a84457830e6d3963b146065cc7ed87fb7cef00

Jan, can you help me testing this one? Especially on nvidia?

Flags: needinfo?(jan)

That killed HW WR and WebGL.
mozregression --repo try --launch a9a84457830e6d3963b146065cc7ed87fb7cef00 -P stdout -a about:support

0:28.31 INFO: b'[GFX1-]: glxtest: process failed (exited with status 1)'

Flags: needinfo?(jan)

(In reply to Darkspirit from comment #9)

That killed HW WR and WebGL.

Thanks! Can you post the output of xrandr on your system? So I can check for what to expect / which fallback paths xrandr uses?

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 8 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x208 cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting

$ xrandr --primary
xrandr: --primary must be used after --output

$ xrandr --output --primary
warning: output --primary not found; ignoring

$ xrandr --noprimary --listactivemonitors

$ xrandr --listactivemonitors
Monitors: 1
 0: +HDMI-0 2560/553x1440/311+0+0  HDMI-0

$ xrandr --listmonitors
Monitors: 1
 0: +HDMI-0 2560/553x1440/311+0+0  HDMI-0

$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      60.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

$ xrandr --current
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      60.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

$ xrandr --screen 0
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98    60.05    60.00    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      60.00  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)
Attached image nvidia.png

Replaced the HDMI cable with a mini display port cable and connected my TV via HDMI.

$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b8 cap: 0x1, Source Output crtcs: 4 outputs: 9 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x20b cap: 0x6, Sink Output, Source Offload crtcs: 3 outputs: 3 associated providers: 1 name:modesetting

$ xrandr --listactivemonitors
Monitors: 2
 0: +*DP-4.8 2560/553x1440/311+0+0  DP-4.8
 1: +HDMI-0 1920/1280x1080/720+2560+0  HDMI-0

$ xrandr --listmonitors
Monitors: 2
 0: +*DP-4.8 2560/553x1440/311+0+0  DP-4.8
 1: +HDMI-0 1920/1280x1080/720+2560+0  HDMI-0

$ xrandr
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
DP-4.8 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      59.90  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 1280mm x 720mm
   1920x1080     60.00*+  59.94    50.00    29.97    25.00    24.00    23.98    60.05    60.00    50.04  
   1600x1200     60.00  
   1360x765      60.00  
   1280x1024     60.02  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

$ xrandr --current
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
DP-4.8 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      59.90  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 1280mm x 720mm
   1920x1080     60.00*+  59.94    50.00    29.97    25.00    24.00    23.98    60.05    60.00    50.04  
   1600x1200     60.00  
   1360x765      60.00  
   1280x1024     60.02  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

$ xrandr --screen 0
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
DP-4.8 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 553mm x 311mm
   2560x1440     59.95*+
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080     60.00    59.94    50.00    29.97    25.00    23.98  
   1680x1050     59.95  
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1280x720      60.00    59.94    50.00  
   1200x960      59.90  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 1280mm x 720mm
   1920x1080     60.00*+  59.94    50.00    29.97    25.00    24.00    23.98    60.05    60.00    50.04  
   1600x1200     60.00  
   1360x765      60.00  
   1280x1024     60.02  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-1 disconnected (normal left inverted right x axis y axis)

$ xrandr --screen 1
Invalid screen number 1 (display has 1)

$ xrandr --display 0
Can't open display 0
$ xrandr --verbose
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 32767 x 32767
DP-4.8 connected primary 2560x1440+0+0 (0x1be) normal (normal left inverted right x axis y axis) 553mm x 311mm
	Identifier: 0x1bd
	Timestamp:  191102
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       0
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	_MUTTER_PRESENTATION_OUTPUT: 0 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	GUID: {10DE9070-0005-CCBF-9FE0-ABF5000000D1}
	EDID: 
		00ffffffffffff0010ac6fd04c374330
		2d190104a5371f783e4455a9554d9d26
		0f5054a54b00b300d100714fa9408180
		778001010101565e00a0a0a029503020
		350029372100001a000000ff00395832
		56593542383043374c0a000000fc0044
		454c4c205532353135480a20000000fd
		0038561e711e010a2020202020200184
		02031cf14f1005040302071601141f12
		132021222309070783010000023a8018
		71382d40582c450029372100001e011d
		8018711c1620582c250029372100009e
		011d007251d01e206e28550029372100
		001e8c0ad08a20e02d10103e96002937
		21000018483f00ca808030401a501300
		29372100001e00000000000000000057
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 1 
	_ConnectorLocation: 1 
	non-desktop: 0 
		supported: 0, 1
  2560x1440 (0x1be) 241.500MHz +HSync -VSync *current +preferred
        h: width  2560 start 2608 end 2640 total 2720 skew    0 clock  88.79KHz
        v: height 1440 start 1443 end 1448 total 1481           clock  59.95Hz
  2048x1152 (0x1bf) 162.000MHz +HSync +VSync
        h: width  2048 start 2074 end 2154 total 2250 skew    0 clock  72.00KHz
        v: height 1152 start 1153 end 1156 total 1200           clock  60.00Hz
  1920x1200 (0x1c0) 193.250MHz -HSync +VSync
        h: width  1920 start 2056 end 2256 total 2592 skew    0 clock  74.56KHz
        v: height 1200 start 1203 end 1209 total 1245           clock  59.88Hz
  1920x1080 (0x1c1) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x1c2) 148.350MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.43KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  59.94Hz
  1920x1080 (0x1c3) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1920x1080 (0x1c4) 74.180MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.72KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  29.97Hz
  1920x1080 (0x1c5) 74.250MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  28.12KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  25.00Hz
  1920x1080 (0x1c6) 74.180MHz +HSync +VSync
        h: width  1920 start 2558 end 2602 total 2750 skew    0 clock  26.97KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  23.98Hz
  1680x1050 (0x1c7) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1600x1200 (0x1c8) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1280x1024 (0x1c9) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x1ca) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x720 (0x1cb) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1280x720 (0x1cc) 74.180MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  44.96KHz
        v: height  720 start  725 end  730 total  750           clock  59.94Hz
  1280x720 (0x1cd) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1200x960 (0x1ce) 94.500MHz -HSync +VSync
        h: width  1200 start 1272 end 1392 total 1584 skew    0 clock  59.66KHz
        v: height  960 start  963 end  973 total  996           clock  59.90Hz
  1152x864 (0x1cf) 108.000MHz +HSync +VSync
        h: width  1152 start 1216 end 1344 total 1600 skew    0 clock  67.50KHz
        v: height  864 start  865 end  868 total  900           clock  75.00Hz
  1024x768 (0x1d0) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x1d1) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1d2) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x1d3) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  720x576 (0x1d4) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x1d5) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x1d6) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x1d7) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  640x480 (0x1d8) 25.170MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.46KHz
        v: height  480 start  490 end  492 total  525           clock  59.93Hz
DVI-D-0 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1d9
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DVI-D 
	ConnectorNumber: 0 
	_ConnectorLocation: 0 
	non-desktop: 0 
		supported: 0, 1
HDMI-0 connected 1920x1080+2560+0 (0x1c1) normal (normal left inverted right x axis y axis) 1280mm x 720mm
	Identifier: 0x1da
	Timestamp:  191102
	Subpixel:   unknown
	Gamma:      1.0:1.0:1.0
	Brightness: 1.0
	Clones:    
	CRTC:       1
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	_MUTTER_PRESENTATION_OUTPUT: 0 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	EDID: 
		00ffffffffffff00410c000001010101
		08130103808048780ae692a3544a9926
		0f4a4c2108008bc08180a94001010101
		010101010101023a801871382d40582c
		450000d05200001e023a80d072382d40
		102c458000d05200001e000000fc0050
		68696c697073204654560a20000000fd
		00303e0f460f000a20202020202001c7
		020331f1521f10202122140513041203
		1102160715060126091f071507508301
		00006a030c002000382d801010e30503
		01011d803e73382d407e2c458000d052
		00001e011d80d0721c1620102c258000
		d05200009e011d00bc52d01e20b82855
		4000d05200001e011d8018711c162058
		2c250000d05200009e0000000000004e
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: HDMI 
	ConnectorNumber: 3 
	_ConnectorLocation: 3 
	non-desktop: 0 
		supported: 0, 1
  1920x1080 (0x1c1) 148.500MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x1c2) 148.350MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.43KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  59.94Hz
  1920x1080 (0x1c3) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1920x1080 (0x1c4) 74.180MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.72KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  29.97Hz
  1920x1080 (0x1c5) 74.250MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  28.12KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  25.00Hz
  1920x1080 (0x1db) 74.250MHz +HSync +VSync
        h: width  1920 start 2558 end 2602 total 2750 skew    0 clock  27.00KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  24.00Hz
  1920x1080 (0x1c6) 74.180MHz +HSync +VSync
        h: width  1920 start 2558 end 2602 total 2750 skew    0 clock  26.97KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  23.98Hz
  1920x1080 (0x1dc) 74.250MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.75KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  60.05Hz
  1920x1080 (0x1dd) 74.180MHz +HSync +VSync Interlace
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  33.72KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  60.00Hz
  1920x1080 (0x1de) 74.250MHz +HSync +VSync Interlace
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  28.12KHz
        v: height 1080 start 1084 end 1094 total 1124           clock  50.04Hz
  1600x1200 (0x1c8) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1360x765 (0x1df) 84.400MHz -HSync +VSync
        h: width  1360 start 1424 end 1568 total 1776 skew    0 clock  47.52KHz
        v: height  765 start  766 end  769 total  792           clock  60.00Hz
  1280x1024 (0x1ca) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x720 (0x1cc) 74.180MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  44.96KHz
        v: height  720 start  725 end  730 total  750           clock  59.94Hz
  1280x720 (0x1cd) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1024x768 (0x1d1) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1d3) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  720x576 (0x1d4) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x1d5) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x1d7) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  640x480 (0x1d8) 25.170MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.46KHz
        v: height  480 start  490 end  492 total  525           clock  59.93Hz
DP-0 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e0
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1
DP-1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e1
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 4 
	_ConnectorLocation: 4 
	non-desktop: 0 
		supported: 0, 1
DP-2 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e2
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 2 
	_ConnectorLocation: 2 
	non-desktop: 0 
		supported: 0, 1
DP-3 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e3
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 2 
	_ConnectorLocation: 2 
	non-desktop: 0 
		supported: 0, 1
DP-4 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e4
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: DisplayPort 
		supported: DisplayPort
	ConnectorType: DisplayPort 
	ConnectorNumber: 1 
	_ConnectorLocation: 1 
	non-desktop: 0 
		supported: 0, 1
DP-5 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x1e5
	Timestamp:  191102
	Subpixel:   unknown
	Clones:    
	CRTCs:      1 0 2 3
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	CTM: 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 
		0 1 
	CscMatrix: 65536 0 0 0 0 65536 0 0 0 0 65536 0 
	BorderDimensions: 4 
		supported: 4
	Border: 0 0 0 0 
		range: (0, 65535)
	SignalFormat: TMDS 
		supported: TMDS
	ConnectorType: DisplayPort 
	ConnectorNumber: 1 
	_ConnectorLocation: 1 
	non-desktop: 0 
		supported: 0, 1
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x208
	Timestamp:  186240
	Subpixel:   unknown
	Clones:    
	CRTCs:      4 5 6
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	PRIME Synchronization: 1 
		supported: 0, 1
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	max bpc: 12 
		range: (8, 12)
	content type: No Data 
		supported: No Data, Graphics, Photo, Cinema, Game
	Colorspace: Default 
		supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
	aspect ratio: Automatic 
		supported: Automatic, 4:3, 16:9
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 95 
		supported: 95
	non-desktop: 0 
		range: (0, 1)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x209
	Timestamp:  186240
	Subpixel:   unknown
	Clones:    
	CRTCs:      4 5 6
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	PRIME Synchronization: 1 
		supported: 0, 1
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	max bpc: 12 
		range: (8, 12)
	content type: No Data 
		supported: No Data, Graphics, Photo, Cinema, Game
	Colorspace: Default 
		supported: Default, SMPTE_170M_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, opRGB, BT2020_CYCC, BT2020_RGB, BT2020_YCC, DCI-P3_RGB_D65, DCI-P3_RGB_Theater
	aspect ratio: Automatic 
		supported: Automatic, 4:3, 16:9
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 105 
		supported: 105
	non-desktop: 0 
		range: (0, 1)
DP-1-1 disconnected (normal left inverted right x axis y axis)
	Identifier: 0x20a
	Timestamp:  186240
	Subpixel:   unknown
	Clones:    
	CRTCs:      4 5 6
	Transform:  1.000000 0.000000 0.000000
	            0.000000 1.000000 0.000000
	            0.000000 0.000000 1.000000
	           filter: 
	PRIME Synchronization: 1 
		supported: 0, 1
	HDCP Content Type: HDCP Type0 
		supported: HDCP Type0, HDCP Type1
	Content Protection: Undesired 
		supported: Undesired, Desired, Enabled
	Colorspace: Default 
		supported: Default, RGB_Wide_Gamut_Fixed_Point, RGB_Wide_Gamut_Floating_Point, opRGB, DCI-P3_RGB_D65, BT2020_RGB, BT601_YCC, BT709_YCC, XVYCC_601, XVYCC_709, SYCC_601, opYCC_601, BT2020_CYCC, BT2020_YCC
	max bpc: 12 
		range: (6, 12)
	Broadcast RGB: Automatic 
		supported: Automatic, Full, Limited 16:235
	audio: auto 
		supported: force-dvi, off, auto, on
	subconnector: Unknown 
		supported: Unknown, VGA, DVI-D, HDMI, DP, Wireless, Native
	link-status: Good 
		supported: Good, Bad
	CONNECTOR_ID: 109 
		supported: 109
	non-desktop: 0 
		range: (0, 1)
Attached file xrandr_monitors.c

The crash seemed to be caused by invalid output_info->crtc. (?)

X Error of failed request: BadRRCrtc (invalid Crtc parameter)
Major opcode of failed request: 140 (RANDR)
Minor opcode of failed request: 20 (RRGetCrtcInfo)
Crtc id in failed request: 0x0
Serial number of failed request: 19
Current serial number in output stream: 19

Attached test works on Ubuntu 21.04/Nvidia and Debian Testing/Intel.

Attachment #9242889 - Attachment mime type: text/x-csrc → text/plain

(In reply to Darkspirit from comment #15)

Attached test works on Ubuntu 21.04/Nvidia and Debian Testing/Intel.

Thanks, that's very helpful. XRRMonitorInfo and friends unfortunately is Xrandr 1.5 API, released in 2016. I suppose we can't require that as long as RHEL 7 and Ubuntu 14.04 are still around and supported by us. But there's another fallback path in xrandr.c for cases where no ctrc is available, will try to add that.

3x '*'
2x "*", but one is out of the game.
At the moment I'm trying to reduce the code to get here: https://gitlab.freedesktop.org/xorg/app/xrandr/-/blob/824484e5ba50f1e6858ea990393c181a249c3a5e/xrandr.c#L3972
(What is k, what is j? Horrible variable names. :D)

It would be great if we could get correct refresh rates at the same time to replace GLX_SGI_video_sync with a correct software timer (bug 1716049 comment 63, bug 1640779, https://gitlab.gnome.org/GNOME/mutter/-/issues/1713#note_1062590).

(In reply to Darkspirit from comment #19)

It would be great if we could get correct refresh rates at the same time to replace GLX_SGI_video_sync with a correct software timer (bug 1716049 comment 63, bug 1640779, https://gitlab.gnome.org/GNOME/mutter/-/issues/1713#note_1062590).

I've looked into this before for Wayland (to avoid main thread janks) and it turned out to be harder than I first thought. For once you need high precision timers (milliseconds is not enough, otherwise you end up with e.g. 17ms instead of 16.666 - that's why you usually don't have 60 FPS on Xwayland). Secondly, it's hard to get the phase right without any hardware feedback. So I don't think using data from Xrandr is feasible here.

Flags: needinfo?(jan)

works :)

Display0 2560x1440 default
Display1 1920x1080
DisplayCount 2

Flags: needinfo?(jan)

(In reply to Darkspirit from comment #23)

works :)

Display0 2560x1440 default
Display1 1920x1080
DisplayCount 2

Nice, thanks :) Will thus just land it - most possible regressions will likely only show up once distros try to build it.

Pushed by robert.mader@posteo.de:
https://hg.mozilla.org/integration/autoland/rev/474308da6834
Link Xrandr directly instead of using dlopen, r=stransky,glandium
https://hg.mozilla.org/integration/autoland/rev/77ee40b13a11
Use Xrandr to detect display modes on X11, r=stransky
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
See Also: → 1733389
You need to log in before you can comment on or make changes to this bug.