eyxnos: install exynos tests if HAVE_INSTALL_TESTS
[platform/upstream/libdrm.git] / xf86drm.c
index 2a74c80..e94f2cd 100644 (file)
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -104,12 +104,16 @@ void drmSetServerInfo(drmServerInfoPtr info)
  * This function is a wrapper around vfprintf().
  */
 
-static int drmDebugPrint(const char *format, va_list ap)
+static int DRM_PRINTFLIKE(1, 0)
+drmDebugPrint(const char *format, va_list ap)
 {
     return vfprintf(stderr, format, ap);
 }
 
-static int (*drm_debug_print)(const char *format, va_list ap) = drmDebugPrint;
+typedef int DRM_PRINTFLIKE(1, 0) (*debug_msg_func_t)(const char *format,
+                                                    va_list ap);
+
+static debug_msg_func_t drm_debug_print = drmDebugPrint;
 
 void
 drmMsg(const char *format, ...)
@@ -129,7 +133,7 @@ drmMsg(const char *format, ...)
 }
 
 void
-drmSetDebugMsgFunction(int (*debug_msg_ptr)(const char *format, va_list ap))
+drmSetDebugMsgFunction(debug_msg_func_t debug_msg_ptr)
 {
     drm_debug_print = debug_msg_ptr;
 }
@@ -499,7 +503,7 @@ static int drmOpenByBusid(const char *busid)
                sv.drm_di_minor = 1;
                sv.drm_dd_major = -1;       /* Don't care */
                sv.drm_dd_minor = -1;       /* Don't care */
-               drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n",fd);
+               drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n");
                drmSetInterfaceVersion(fd, &sv);
            }
            buf = drmGetBusid(fd);
@@ -823,6 +827,13 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value)
        return 0;
 }
 
+int drmSetClientCap(int fd, uint64_t capability, uint64_t value)
+{
+       struct drm_set_client_cap cap  = { capability, value };
+
+       return drmIoctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &cap);
+}
+
 /**
  * Free the bus ID information.
  *
@@ -1946,7 +1957,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
 
     ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
     if (ret < 0) {
-       fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
+       fprintf(stderr, "clock_gettime failed: %s\n", strerror(errno));
        goto out;
     }
     timeout.tv_sec++;