anv/meta_clear: Don't trash state if no clears are needed
[mesa.git] / src / glx / dri2_glx.c
index 462d5602a1c0729a4fe2dc5d8407470b3ca4b47a..27ea9521e50a68df780c047ad3ec9178089f05ea 100644 (file)
@@ -1183,15 +1183,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       return NULL;
    }
 
-#ifdef O_CLOEXEC
-   psc->fd = open(deviceName, O_RDWR | O_CLOEXEC);
-   if (psc->fd == -1 && errno == EINVAL)
-#endif
-   {
-      psc->fd = open(deviceName, O_RDWR);
-      if (psc->fd != -1)
-         fcntl(psc->fd, F_SETFD, fcntl(psc->fd, F_GETFD) | FD_CLOEXEC);
-   }
+   psc->fd = loader_open_device(deviceName);
    if (psc->fd < 0) {
       ErrorMessageF("failed to open drm device: %s\n", strerror(errno));
       goto handle_error;
@@ -1310,6 +1302,8 @@ dri2CreateScreen(int screen, struct glx_display * priv)
    if (psc->show_fps_interval < 0)
       psc->show_fps_interval = 0;
 
+   InfoMessageF("Using DRI2 for screen %d\n", screen);
+
    return &psc->base;
 
 handle_error: