OSDN Git Service

libdrm: Allow dynamic drm majors on linux
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 31 Aug 2018 11:47:05 +0000 (13:47 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 9 Oct 2018 12:47:09 +0000 (14:47 +0200)
commitf8392583418aef5e27bfed9989aeb601e20cc96d
tree8a6f5780aaec11efaca803d5d03fe1fae77b9b9e
parent4f1c76539692253247fd2022111873601e50b1d9
libdrm: Allow dynamic drm majors on linux

To determine whether a device node is a drm device node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,
https://cgit.freedesktop.org/mesa/vmwgfx
and any future attempt to introduce dynamic device numbers for drm.

So instead of checking for the device major, instead check for the presence
of the /sys/dev/char/<major>:<minor>/device/drm directory.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dave Airlie <airlied@redhat.com>
xf86drm.c