tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: non-PCI driver name lookup



On Tue, Jul 09, 2019 at 05:37:58AM +0000, maya%netbsd.org@localhost wrote:
> On Sun, Jul 07, 2019 at 11:23:14PM +0100, Robert Swindells wrote:
> > 
> > The pinebook uses the modesetting X11 driver.
> > 
> > An application that calls DRI2Connect() doesn't get back valid values
> > for device name and driver name so typically assumes that DRI2 isn't
> > available.
> > 
> > This looks to be down to how libdrm tries to work out which driver is
> > being used from an open file descriptor. I presume the NetBSD specific
> > code in it does work for PCI devices but it looks like we need to add
> > something for display devices that are built into the CPU.
> > 
> > 
> 
> I assume, although I can't find proof that it's the case, that you want
> to adjust the 'unique' value.
> 
> arm/nvidia/tegra_nouveau.c
> 257:	master->unique = kmem_asprintf("platform:tegra_nouveau:%02d", id);
> 
> I think the code in libdrm looks at this value via DRM_IOCTL_GET_UNIQUE,
> but I'm not sure.

Oh yeah, our netbsd-specific code awkwardly assumes PCI.
xsrc/external/mit/libdrm/dist/xf86drm.c

This might be a start.

Index: dist/xf86drm.c
===================================================================
RCS file: /cvsroot/xsrc/external/mit/libdrm/dist/xf86drm.c,v
retrieving revision 1.23
diff -u -r1.23 xf86drm.c
--- dist/xf86drm.c	4 Mar 2019 08:36:42 -0000	1.23
+++ dist/xf86drm.c	9 Jul 2019 05:56:11 -0000
@@ -3072,6 +3072,9 @@
     if (strncmp(buf, "pci:", 4) == 0)
 	ret = DRM_BUS_PCI;
 
+    if (strncmp(buf, "platform:", 9) == 0)
+	ret = DRM_BUS_PLATFORM;
+
     /* We're done with the bus id.  */
     free(buf);
 



I seem to recall that modesetting has its own duplicate implementation
of this, too (probe_hw_pci), and not adjusted to netbsd.

I was looking at it because modesetting doesn't successfully use GLAMOR
even on x86, but stopped.



Home | Main Index | Thread Index | Old Index