summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 82b77d7f..2f9d5c80 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -2855,6 +2855,30 @@ int drmMMUnlock(int fd, unsigned memType, int unlockBM)
return (ret) ? -errno : 0;
}
+int drmBOVersion(int fd, unsigned int *major,
+ unsigned int *minor,
+ unsigned int *patchlevel)
+{
+ struct drm_bo_version_arg arg;
+ int ret;
+
+ memset(&arg, 0, sizeof(arg));
+ ret = ioctl(fd, DRM_IOCTL_BO_VERSION, &arg);
+ if (ret)
+ return ret;
+
+ if (major)
+ *major = arg.major;
+ if (minor)
+ *minor = arg.minor;
+ if (patchlevel)
+ *patchlevel = arg.patchlevel;
+
+ return (ret) ? -errno : 0;
+}
+
+
+
#define DRM_MAX_FDS 16
static struct {
char *BusID;