aboutsummaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-02-20 13:27:10 +1000
committerDave Airlie <airlied@redhat.com>2008-02-22 13:49:51 +1000
commitcdad850ebc3570e5ff5a0996f36832c965aa8a1d (patch)
tree4e084d4a2be9ba4c3ac90f708c32255b4f823f64 /libdrm
parent0d1cb1e8408d497fec66d9f31603f93800049c75 (diff)
add ioctl to get back memory managed area sized - used for kernel inited areas
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c15
-rw-r--r--libdrm/xf86mm.h1
2 files changed, 16 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)
diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h
index c80288a7..bb573407 100644
--- a/libdrm/xf86mm.h
+++ b/libdrm/xf86mm.h
@@ -172,6 +172,7 @@ extern int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
extern int drmMMTakedown(int fd, unsigned memType);
extern int drmMMLock(int fd, unsigned memType, int lockBM, int ignoreNoEvict);
extern int drmMMUnlock(int fd, unsigned memType, int unlockBM);
+extern int drmMMInfo(int fd, unsigned memType, uint64_t *size);
extern int drmBOSetStatus(int fd, drmBO *buf,
uint64_t flags, uint64_t mask,
unsigned int hint,