libdrm: drmGetDeviceNameFromFd: Add FreeBSD variant
authorEmmanuel Vadot <manu@FreeBSD.Org>
Tue, 21 Jan 2020 16:50:15 +0000 (17:50 +0100)
committerEmmanuel Vadot <manu@FreeBSD.org>
Tue, 21 Apr 2020 17:26:54 +0000 (19:26 +0200)
commit6818a50b1215081d6a7b7b710f504a6b182320c8
tree7c6d6c0e9a3b2d678f471b747db1d1314bf0dc95
parentc55a1e564cf6c9d42ce250af11101b7fc7e88a4e
libdrm: drmGetDeviceNameFromFd: Add FreeBSD variant

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).

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
xf86drm.c