summaryrefslogtreecommitdiff
path: root/xf86drm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-02-21 11:27:19 +1000
committerDave Airlie <airlied@redhat.com>2011-03-04 15:25:51 +1000
commit5c6c6913d1260024e5d156db7973c9e46fe1ff03 (patch)
tree5db622ccb0cbb5c8b80ca53782cdb0b1abcc031d /xf86drm.c
parent4473a7e8234da6d16f4ccfa660fbd72ff1b7dd95 (diff)
Implement drmGetCap() to query device/driver capabilities
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xf86drm.c b/xf86drm.c
index 799fcddf..bc7a97fe 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -810,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 cap.value;
+}
/**
* Free the bus ID information.