egl/drm: Don't "fall back" to /dev/dri/card0 if the first open fails
authorAdam Jackson <ajax@redhat.com>
Thu, 24 Aug 2017 18:52:14 +0000 (14:52 -0400)
committerAdam Jackson <ajax@redhat.com>
Fri, 25 Aug 2017 20:21:43 +0000 (16:21 -0400)
The snprintf stuff here already constructs the right name for the device
node, and if it doesn't, you configured Mesa wrong, don't do that.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/platform_drm.c

index 259b1cd5194994af02ac771db21ff31c68d28dd0..0ccbd9a30a039591c991c23f2753adae066f5a93 100644 (file)
@@ -667,8 +667,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
       int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0);
       if (n != -1 && n < sizeof(buf))
          dri2_dpy->fd = loader_open_device(buf);
-      if (dri2_dpy->fd < 0)
-         dri2_dpy->fd = loader_open_device("/dev/dri/card0");
       gbm = gbm_create_device(dri2_dpy->fd);
       if (gbm == NULL) {
          err = "DRI2: failed to create gbm device";