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
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to