xf86drm: test for render nodes before primary nodes
Unlike Linux the OpenBSD primary "drm" device name is substring of the "drmR" render node device name and strncmp() tests resulted in render nodes being flagged as primary nodes. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>main
parent
dcc586c66c
commit
13e2c35603
|
@ -3141,10 +3141,6 @@ drm_public int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b)
|
|||
|
||||
static int drmGetNodeType(const char *name)
|
||||
{
|
||||
if (strncmp(name, DRM_PRIMARY_MINOR_NAME,
|
||||
sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0)
|
||||
return DRM_NODE_PRIMARY;
|
||||
|
||||
if (strncmp(name, DRM_CONTROL_MINOR_NAME,
|
||||
sizeof(DRM_CONTROL_MINOR_NAME ) - 1) == 0)
|
||||
return DRM_NODE_CONTROL;
|
||||
|
@ -3153,6 +3149,10 @@ static int drmGetNodeType(const char *name)
|
|||
sizeof(DRM_RENDER_MINOR_NAME) - 1) == 0)
|
||||
return DRM_NODE_RENDER;
|
||||
|
||||
if (strncmp(name, DRM_PRIMARY_MINOR_NAME,
|
||||
sizeof(DRM_PRIMARY_MINOR_NAME) - 1) == 0)
|
||||
return DRM_NODE_PRIMARY;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue