[PATCH xserver 3/4] dri2: refine dri2_probe_driver_name
Yu, Qiang
Qiang.Yu at amd.com
Tue Jan 10 14:07:03 UTC 2017
Hi Emil,
> /* For non-PCI devices, just assume that the 3D driver is named
> * the same as the kernel driver. This is currently true for vc4
> * and msm (freedreno).
> */
> - if (!pdev) {
> + if (drmGetDevice(info->fd, &dev)) {
This does not align with the comment above. Bail out in the [very]
unlikely case that the function fails.
Then honour _drmDevice::bustype for the respective PCI vs other case(s).
[yuq] Yes, seems drmGetDevice only support PCI devices, non-PCI device just return error.
I can't separate the normal error and non-PCI device error here. So when normal error, just
assume non-PCI device and use drmGetVersion.
> drmVersionPtr version = drmGetVersion(info->fd);
> - char *kernel_driver;
>
> if (!version) {
> xf86DrvMsg(pScreen->myNum, X_ERROR,
> @@ -1463,29 +1458,35 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
> return NULL;
> }
>
> - kernel_driver = strndup(version->name, version->name_len);
> + driver = strndup(version->name, version->name_len);
> drmFreeVersion(version);
> - return kernel_driver;
> + return driver;
> }
>
> for (i = 0; driver_map[i].driver; i++) {
> - if (pdev->vendor_id != driver_map[i].vendor_id)
> + if (dev->deviceinfo.pci->vendor_id != driver_map[i].vendor_id)
... or in other words.
This will cause a _lot_ of grief as we merge Thierry's work to support
!PCI devices.
[yuq] Then Thierry's work is useful for the problem above. It's better to wait
for his work upstream and bump the xserver libdrm depend version.
Regards,
Qiang
More information about the xorg-devel
mailing list