]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdrm.git/blobdiff - xf86drm.c
libdrm: oops fix get cap return value.
[glsdk/libdrm.git] / xf86drm.c
index 896b9ba0219bb244f14b977733d2981a07a19e9d..a183eee9dd065299bd4efadf78a56616ef478ce7 100644 (file)
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -370,6 +370,7 @@ wait_for_udev:
     if (fd >= 0)
        return fd;
 
+#if !defined(UDEV)
     /* Check if the device node is not what we expect it to be, and recreate it
      * and try again if so.
      */
@@ -391,6 +392,7 @@ wait_for_udev:
 
     drmMsg("drmOpenDevice: Open failed\n");
     remove(buf);
+#endif
     return -errno;
 }
 
@@ -808,6 +810,18 @@ drmVersionPtr drmGetLibVersion(int fd)
     return (drmVersionPtr)version;
 }
 
+int drmGetCap(int fd, uint64_t capability, uint64_t *value)
+{
+       struct drm_get_cap cap = { capability, 0 };
+       int ret;
+
+       ret = drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap);
+       if (ret)
+               return ret;
+
+       *value = cap.value;
+       return 0;
+}
 
 /**
  * Free the bus ID information.