diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-25 10:12:21 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2007-10-25 10:12:21 +0200 |
commit | 11f3e5e53f8fc4de90d1c289e0ba218ddfca23dc (patch) | |
tree | 788f1bfbafe608fa55b377673b540f9f5a3de401 /libdrm | |
parent | b5cad27e05ad3666be8ccdf71e10d743efa5849e (diff) |
Buffer manager:
Implement a version check IOCTL for drivers that don't use
drmMMInit from user-space.
Remove the minor check from the kernel code. That's really up
to the driver.
Bump major.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 24 |
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; |