diff options
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r-- | libdrm/xf86drm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 39a849c6..13e99555 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -2883,6 +2883,21 @@ int drmMMUnlock(int fd, unsigned memType, int unlockBM) return drmIoctlTimeout(fd, DRM_IOCTL_MM_UNLOCK, &arg); } +int drmMMInfo(int fd, unsigned memType, uint64_t *size) +{ + struct drm_mm_info_arg arg; + + memset(&arg, 0, sizeof(arg)); + + arg.mem_type = memType; + + if (ioctl(fd, DRM_IOCTL_MM_INFO, &arg)) + return -errno; + + *size = arg.p_size; + return 0; +} + int drmBOVersion(int fd, unsigned int *major, unsigned int *minor, unsigned int *patchlevel) |