Get the major/minor via fstat and after checking that this is a drm node construct the full device node name using devname. Note that we should be able to use fdevname to avoid calling fstat + devname but for some reason it doesn't work on drm node (probably due to how the device node are created in the linux compat code for drm on FreeBSD).
6818a50b libdrm: drmGetDeviceNameFromFd: Add FreeBSD variant
xf86drm.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)