libdrm
Robert Swindells <[email protected]> Mon, 01 Jul 2024 13:49:36 +0100
| Newsgroups | gmane.os.netbsd.devel.x11 |
|---|---|
| Message-ID | <[email protected]> |
Our libdrm, in base and pkgsrc, currently only handles PCI graphics controllers. 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. 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. We want the retained device node to be the one for the framebuffer, Mesa expects this. It is easy enough to make the GPU device driver have a later fdt pass number than the framebuffer driver in the kernel config to fix which one will be card0 and which card1. The unsorted order of the nodes in the directory will depend on when they were created though, this can mean you end up with the retained device node being for the GPU itself and Mesa initialization fails. I have made this work on my test evbarm systems by deleting all the nodes in /dev/dri then running: # sh MAKEDEV drm1 # sh MAKEDEV drm0 This means that /dev/dri/card0 gets retained in the pruned list of devices as the one to use and everything works. We need something more robust though, any ideas?