xserver/hw/xfree86/common
Shashank Sharma 82bf391c93 xf86: allow DDX driver for GPU/PCI hot-plug
The current X server infrastructure sets modesetting driver as default driver
to handle PCI-hotplug of a GPU device. This prevents the respective DDX driver
(like AMDGPU DDX driver) to take control of the card.

This patch:
- Adds a few functions and fine-tunes the GPU hotplug infrastructure to allow
  the DDX driver to be loaded, if it is configured in the X config file
  options as "hotplug-driver".
- Scans and updates the PCI device list before adding the new GPU device
  in platform, so that the association of the platform device and PCI device
  is in place (dev->pdev).
- Adds documentation of this new option

An example usage in the config file would look like:

Section "OutputClass"
        Identifier "AMDgpu"
        MatchDriver "amdgpu"
        Driver "amdgpu"
	HotplugDriver "amdgpu"
EndSection

V2:
Fixed typo in commit message (Martin)
Added R-B from Adam.
Added ACK from Alex and Martin.

V3:
Added an output class based approach for finding the DDX driver (Aaron)
Rebase

V4:
Addressed review comment from Aaron:
GPU hot-plug handling driver's name to be read from the DDX config file options.
In this way only the DDX drivers interested in handling GPU hot-plug will be
picked and loaded, for others modesetting driver will be used as usual.

V5:
Addressed review comments from Aaron:
- X config option to be listed in CamelCase.
- Indentation fix at one place.
- Code readability related optimization.

V6:
Addressed review comments from Aaron:
- Squash the doc in the same patch
- Doc formatting changes

Cc: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Aaron Plattner aplattner@nvidia.com (v3)
Acked-by: Martin Roukala martin.roukala@mupuf.org(v1)
Acked-by: Alex Deucher alexander.deucher@amd.com (v1)
Reviewed-by: Adam Jackson ajax@redhat.com(v1)
Signed-off-by: Shashank Sharma shashank.sharma@amd.com
2022-11-16 15:47:46 +00:00
..
.gitignore Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
compiler.h compiler.h: don't define inb/outb and friends on mips 2021-01-27 19:29:35 +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
meson.build hw/xfree86: fix sbus build for SPARC 2021-12-14 16:00:39 +00:00
modeline2c.awk Use ARRAY_SIZE all over the tree 2017-10-30 13:45:20 -04:00
vesamodes
xaarop.h xfree86: Drop some dead XAA decls from SDK headers 2012-07-25 14:03:31 -07:00
xf86.h xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
xf86AutoConfig.c xf86AutoConfig: try modesetting on all platforms we build it on 2022-09-20 18:26:03 +00:00
xf86Bus.c xf86: Assign GPUs to screens according to configuration 2021-07-30 00:27:39 +00:00
xf86Bus.h xfree86: Remove vestigial lastScrnFlag 2018-09-12 20:47:15 +00:00
xf86Config.c xfree86: Fix NULL pointer dereference crash 2021-06-21 14:11:37 +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 Fix spelling/wording issues 2020-07-05 13:07:33 -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 xf86/logind: Fix compilation error when built without logind/platform bus 2021-12-20 16:56:14 +01:00
xf86Extensions.c vidmode: move to a separate library of its own 2016-02-29 16:29:01 -05:00
xf86Extensions.h xf86: Re-export extension disable flags 2012-07-16 18:24:49 -07:00
xf86Globals.c xf86: autobind GPUs to the screen 2019-08-07 12:26:59 +02:00
xf86Helper.c Revert "hw/xfree86: Propagate physical dimensions from DRM connector" 2021-11-16 22:34:56 +00:00
xf86InPriv.h xfree86/common: Warning fixes. Mostly const string handling. 2014-01-12 10:14:48 -08:00
xf86Init.c remove the PRE_RELEASE message. 2021-12-10 23:07:32 +01:00
xf86MatchDrivers.h xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86Mode.c xfree86: finish removing numTimings in xf86ValidateModes() 2022-04-05 16:08:56 -07:00
xf86Module.h randr: add new interface to allow delaying lease responses 2021-12-07 10:02:29 +00: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 xfree86: On Linux, while only seat0 can have TTYs, don't assmume all seat0s have TTYs 2021-11-06 17:17:01 +00:00
xf86Privstr.h Remove check for useSIGIO option 2020-12-08 11:23:31 -05: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 Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
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 hw/xfree86: Implement public APIs to submit gesture events 2021-05-30 13:26:41 +03:00
xf86Xinput.h hw/xfree86: Implement public APIs to submit gesture events 2021-05-30 13:26:41 +03:00
xf86cmap.c xfree86: Hook up colormaps and RandR 1.2 gamma code v6 2016-07-28 10:12:05 +09:00
xf86cmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xf86fbBus.c xfree86: use udev to provide device enumeration for kms devices (v10) 2012-07-06 10:20:19 +01:00
xf86fbman.c Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xf86fbman.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
xf86noBus.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xf86pciBus.c Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xf86pciBus.h xfree86: Improved autoconfig drivers matching 2017-05-09 17:36:05 -07:00
xf86platformBus.c xf86: allow DDX driver for GPU/PCI hot-plug 2022-11-16 15:47:46 +00:00
xf86platformBus.h xf86: allow DDX driver for GPU/PCI hot-plug 2022-11-16 15:47:46 +00: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: Change displays array to pointers array to fix invalid pointer issues after table reallocation 2021-06-15 10:01:14 +00:00
xf86xv.c Fix spelling/wording issues 2020-07-05 13:07:33 -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 Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xisb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xorgHelper.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xorgVersion.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00