egl/dri2: use drm macros to construct device name
authorJonathan Gray <jsg@jsg.id.au>
Thu, 3 Apr 2014 05:22:26 +0000 (16:22 +1100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 5 Apr 2014 12:36:29 +0000 (13:36 +0100)
commitc973e440d5b4057d93b4ce1298da77c3449c9f33
tree74d06e0824bcc84baa23ffa0fe1d457b3dd5293f
parent81799c82e47b34db6eeca34113016d2d8389669d
egl/dri2: use drm macros to construct device name

Don't hardcode /dev/dri/card0 but instead use the drm
macros which allows the correct /dev/drm0 device to be
opened on OpenBSD.

v2: use snprintf and fallback to /dev/dri/card0
v3: check for snprintf truncation

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/egl/drivers/dri2/platform_drm.c