xserver/hw/xfree86/common
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
..
.gitignore
Makefile.am Promote file containing date & time build was configured to top-level 2019-05-02 15:42:58 +00:00
compiler.h compiler.h: Do not include sys/io.h on ARM with glibc 2019-07-15 18:59:59 +00:00
dgaproc.h dga: Make shutdown less magical and/or terrifying 2018-09-12 19:18:05 +00:00
extramodes xfree86: add default modes for 16:9 and 16:10 2018-01-18 14:16:35 -05:00
fourcc.h xfree86: define FOURCC_NV12 and XVIMAGE_NV12 2018-09-11 15:54:57 -04:00
meson.build Promote file containing date & time build was configured to top-level 2019-05-02 15:42:58 +00:00
modeline2c.awk Use ARRAY_SIZE all over the tree 2017-10-30 13:45:20 -04:00
vesamodes
xaarop.h
xf86.h xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
xf86AutoConfig.c xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86Bus.c xfree86: Remove vestigial lastScrnFlag 2018-09-12 20:47:15 +00:00
xf86Bus.h xfree86: Remove vestigial lastScrnFlag 2018-09-12 20:47:15 +00:00
xf86Config.c xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
xf86Config.h loader: Turn LoaderListDirs into LoaderListDir 2017-01-25 14:22:06 -05:00
xf86Configure.c dix: Merge AbortDDX into ddxGiveUp 2018-09-28 16:25:12 -04:00
xf86Cursor.c Remove SIGIO support for input [v5] 2016-05-26 16:07:54 -07:00
xf86DGA.c dga: Make shutdown less magical and/or terrifying 2018-09-12 19:18:05 +00:00
xf86DPMS.c dix: Lift DPMS to a screen hook 2017-03-27 15:59:42 -04:00
xf86Events.c dix: Remove LegalModifier() 2018-09-28 16:25:17 -04:00
xf86Extensions.c vidmode: move to a separate library of its own 2016-02-29 16:29:01 -05:00
xf86Extensions.h
xf86Globals.c xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
xf86Helper.c xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
xf86InPriv.h xfree86/common: Warning fixes. Mostly const string handling. 2014-01-12 10:14:48 -08:00
xf86Init.c hw/xfree86/common/xf86Init.c: fix build without glx 2020-01-08 15:55:40 +00:00
xf86MatchDrivers.h xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86Mode.c glamor: Implement GetSupportedModifiers 2018-03-05 13:27:55 -05:00
xf86Module.h modesetting: Use EGL_MESA_query_driver to select DRI driver if possible 2019-11-26 01:36:10 -08:00
xf86Opt.h hw: Rename boolean config value field from bool to boolean 2019-07-22 20:28:27 -04:00
xf86Option.c hw: Rename boolean config value field from bool to boolean 2019-07-22 20:28:27 -04:00
xf86Optionstr.h hw/xfree86: Lots of constant string support 2014-01-12 10:14:48 -08:00
xf86PM.c xfree86: Remove driver entity hooks and private 2017-03-30 11:32:02 -04:00
xf86PciInfo.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xf86Priv.h xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
xf86Privstr.h xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
xf86RandR.c xfree86: Remove pointless xf86RandRCreateScreenResources 2014-07-29 09:53:01 -04:00
xf86VGAarbiter.c mi: Add a default no-op miSourceValidate 2019-10-30 16:26:01 +00:00
xf86VGAarbiter.h
xf86VGAarbiterPriv.h xfree86: Hold input_lock across SPRITE functions in VGA arbiter 2017-12-13 12:06:31 -05:00
xf86VidMode.c vidmode: remove redundant DIX function 2016-02-29 16:29:14 -05:00
xf86Xinput.c Fix maybe-uninitialized warning in xf86NewInputDevice() 2019-04-17 13:57:38 +01:00
xf86Xinput.h Drop valuator mask argument from GetKeyboardEvents 2015-03-13 12:31:21 +10:00
xf86cmap.c xfree86: Hook up colormaps and RandR 1.2 gamma code v6 2016-07-28 10:12:05 +09:00
xf86cmap.h
xf86fbBus.c
xf86fbman.c Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
xf86fbman.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
xf86noBus.c
xf86pciBus.c xfree86: Try nouveau on NetBSD as well. 2019-01-10 21:24:49 +00:00
xf86pciBus.h xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86platformBus.c Fix modesetting device matching through kmsdev device path 2020-02-12 21:29:52 +00:00
xf86platformBus.h xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86sbusBus.c Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
xf86sbusBus.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
xf86str.h xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
xf86xv.c Convert hw/xfree86 to new *allocarray functions 2015-04-21 16:58:08 -07:00
xf86xv.h xfree86: Remove xv clip notify driver hook 2014-09-26 15:27:18 -04:00
xf86xvmc.c xf86XvMCScreenInit: Clear pScreenPriv->dixinfo when freeing pAdapt 2018-01-24 11:21:08 -05:00
xf86xvmc.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xf86xvpriv.h xfree86: Remove xv clip notify driver hook 2014-09-26 15:27:18 -04:00
xisb.c
xisb.h
xorgHelper.c
xorgVersion.h