Commit 13e2c356 authored by Jonathan Gray's avatar Jonathan Gray Committed by Eric Engestrom

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: default avatarJonathan Gray <jsg@jsg.id.au>
Reviewed-by: default avatarEric Engestrom <eric.engestrom@intel.com>
Acked-by: default avatarEric Engestrom <eric.engestrom@intel.com>
parent dcc586c6
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment