[PATCH libdrm] libdrm: Fix drmNodeIsDRM() on DragonFly

Eric Engestrom eric.engestrom at intel.com
Wed Dec 19 13:32:26 UTC 2018


On Tuesday, 2018-12-18 20:11:27 +0100, Francois Tigeot wrote:
> On Mon, Dec 17, 2018 at 06:09:47PM +0000, Emil Velikov wrote:
> > On Tue, 11 Dec 2018 at 22:15, François Tigeot <ftigeot at wolfpond.org> wrote:
> > >
> > > * There is no way to check if a device name is really a drm device
> > >   by looking it up in a virtual filesystem like on Linux
> > >
> > > * The major device number is also dynamically allocated from a pool,
> > >   comparing it to a constant makes no sense
> > >
> > > * In the absence of better ideas, just assume the device name really
> > >   points to a drm device and always return true
> > >
> > I guess one could use the sysfs path, although that may require a few
> > extra lines to the linux emulation layer.
> 
> We currently have such a thing living in local patches and it's a source
> of pain; it regularly breaks for one reason or another.
> It's not using sysfs but a hw.dri sysctl mechanism originating from FreeBSD.
> Some of the patches are visible here:
> https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c

I'm going through those right now, and I'll send patches for those that
make sense upstream. Apologies in advance for the rebase pains :]

> 
> > What's the reason behind the dynamic allocation of the major? FWIW
> > some userspace requires a fixed DRM_MAJOR - they will need patching to
> > run :-(
> 
> Major/minor numbers were required when device files had to be created on
> regular filesystem like UFS but when a devfs filesystem was implemented
> for DragonFly almost a decade ago, nobody thought it was important anymore.
> 
> There have been no fixed major numbers on DragonFly since 2009 or so.

Fwiw, this `if dragonfly return true` patch is:
Acked-by: Eric Engestrom <eric.engestrom at intel.com>


More information about the dri-devel mailing list