Re: libdrm

Taylor R Campbell <[email protected]> Thu, 18 Jul 2024 15:07:51 +0000
Newsgroups gmane.os.netbsd.devel.x11
Message-ID <[email protected]>
> Date: Mon, 01 Jul 2024 13:49:36 +0100
> From: Robert Swindells <[email protected]>
> 
> Our libdrm, in base and pkgsrc, currently only handles PCI graphics
> controllers.

Which at the moment is all we have in the kernel.  But presumably the
kernel driver can report a different bus id like `fdt:...' and then
drmParseSubsystemType can just check for that, no?

> I have got some local changes to it to get it to default to identifying
> a device as a 'platform' one if it isn't PCI. This will be used for the
> on chip GPU on ARM systems, should also eventually work for MIPS and
> RISC-V.

Doesn't the device already describe what kind of bus it lives on via
drmGetBusid/DRM_IOCTL_GET_UNIQUE?

> The default code in drmGetDeviceFromDevId() calls readdir(3) on the
> "/dev/dri" directory to get a list of the devices then prunes this
> down to one on each bus.

What logic prunes it to one per bus?  I see that
drmFoldDuplicatedDevices deletes duplicate _devices_ but I don't see
anything that would narrow it down to one per bus.