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).
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:
- Document formatting
- Squash 2 patches in a single one