xserver/hw/xfree86
Zoltán Böszörményi 42aaf37241 Fix modesetting device matching through kmsdev device path
xf86platformProbeDev didn't check the device path, fix it.

This is a problem when trying to set up a non-PCI device via
explicit xorg.conf.d configuration.

An USB DisplayLink device, being non-PCI was always set up
as a GPU device assigned to screen 0 instead of a regular
framebuffer, potentially having its own dedicated screen,
despite such configuration as below. Only the relevant parts
of the configuration are quoted, it's part of a larger context
with an Intel chip that has 3 outputs:
* DP1 connected to an LCD panel,
* VGA1 connected to an external monitor,
* HDMI1 unconnected and having no user visible connector

Section "ServerFlags"
        Option          "AutoBindGPU" "false"
EndSection

...

Section "Device"
        Identifier      "Intel2"
        Driver          "intel"
        BusID           "PCI:0:2:0"
        Screen          2
        Option          "Monitor-HDMI1" "HDMI1"
        Option          "ZaphodHeads" "HDMI1"
EndSection

Section "Device"
        Identifier      "UDL"
        Driver          "modesetting"
        Option          "kmsdev" "/dev/dri/card0"
        #BusID          "usb:0:1.2:1.0"
        Option          "Monitor-DVI-I-1" "DVI-I-1"
        Option          "ShadowFB" "on"
        Option          "DoubleShadow" "on"
EndSection

...

Section "Screen"
        Identifier      "SCREEN2"
        Option          "AutoServerLayout" "on"
        Device          "UDL"
        GPUDevice       "Intel2"
        Monitor         "Monitor-DVI-I-1"
        SubSection      "Display"
                Modes   "1024x768"
                Depth   24
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "LAYOUT"
        Option          "AutoServerLayout" "on"
        Screen          0 "SCREEN"
        Screen          1 "SCREEN1" RightOf "SCREEN"
        Screen          2 "SCREEN2" RightOf "SCREEN1"
EndSection

On the particular machine I was trying to set up an UDL device,
I found the following structure was being used to match
the device to a platform device while I was debugging the issue:

xf86_platform_devices[0] == Intel, /dev/dri/card1, primary platform device
xf86_platform_devices[1] == UDL, /dev/dri/card0

devList[0] == "Intel0", ZaphodHeads: DP1
devList[1] == "Intel1", ZaphodHeads: VGA1
devList[2] == "UDL"
devList[3] == "Intel2", ZaphodHeads: HDMI1 (intended GPU device to UDL)

When xf86platformProbeDev() matched the UDL device, the BusID
check failed in both cases of:
* BusID "usb:0:1.2:1.0" was specified
* Option "kmsdev" "/dev/dri/card0" was specified

As a result, xf86platformProbeDev() went on to call probeSingleDevice()
with xf86_platform_devices[0] and devList[2], resulting in the
UDL device being set up as a GPU device assigned to the first screen
instead of as a framebuffer on the third screen as the configuration
specified.

Checking Option "kmsdev" in code code may be a layering violation.
But the modesetting driver is actually part of the Xorg sources
instead of being an external driver, so he "kmsdev" path knowledge
may be used here.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2020-02-12 21:29:52 +00:00
..
common Fix modesetting device matching through kmsdev device path 2020-02-12 21:29:52 +00:00
ddc Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
dixmods Fix NO_UNDEFINED build with statically linked fb 2019-08-04 10:28:51 -07:00
doc xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
dri hw/xfree86: unvalidated lengths 2017-10-10 23:33:44 +02:00
dri2 dri2: Set fallback driver names for Intel and AMD chips 2019-09-30 12:57:22 -04:00
drivers modesetting: Remove local variable only used with glamor enabled 2020-02-11 15:58:26 +01:00
exa meson: Install man pages 2018-03-27 10:28:33 -04:00
fbdevhw xfree86: ensure the readlink buffer is null-terminated 2018-10-17 09:41:15 +10:00
glamor_egl glamor: Make Xv extension initialize at depth 30. 2018-02-27 10:18:06 -05:00
i2c Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
int10 xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
loader loader: strdup const string assigned to local variable name 2020-01-28 20:35:06 +00:00
man xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
modes xfree86/modes: Bail from xf86RotateRedisplay if pScreen->root is NULL 2020-01-30 17:53:12 +01:00
os-support xfree86: Test presence of isastream() 2019-11-22 15:22:43 -05:00
parser Fix various spelling errors 2019-10-01 17:05:28 +00:00
ramdac ramdac: Remove core ramdac code 2019-01-30 21:08:48 +00:00
shadowfb meson: Fix linkage of loadable modules for PE/COFF 2017-10-12 15:22:04 -04:00
utils gtf: Warning fix 2018-04-05 14:18:16 -04:00
vgahw xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
x86emu Fix various spelling errors 2019-10-01 17:05:28 +00:00
xkb Move statically linked xorgxkb files from dixmods to a separate directory 2017-06-27 12:42:06 -04:00
.gitignore Xorg: Add Xorg.wrap to hw/xfree86/.gitignore 2014-04-18 11:39:16 +02:00
Makefile.am xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
Xorg.sh.in xfree86: rename Xorg.bin to Xorg 2015-01-05 09:53:58 +10:00
meson.build xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
sdksyms.sh include: Remove now-empty site.h 2019-10-30 16:17:04 +00:00
xorg-wrapper.c Fix various spelling errors 2019-10-01 17:05:28 +00:00
xorgconf.cpp xfree86: Remove NoTrapSignals 2018-09-12 20:47:15 +00:00