summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c31
-rw-r--r--libdrm/xf86mm.h9
2 files changed, 27 insertions, 13 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index c7683182..039c9b32 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -3155,19 +3155,16 @@ int drmBOFenceList(int fd, drmBOList *list, unsigned fenceHandle)
return 0;
}
-int drmMMInit(int fd, unsigned long vramPOffset, unsigned long vramPSize,
- unsigned long ttPOffset, unsigned long ttPSize,
- unsigned long max_locked_size)
+int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
+ unsigned memType)
{
drm_mm_init_arg_t arg;
memset(&arg, 0, sizeof(arg));
arg.req.op = mm_init;
- arg.req.vr_p_offset = vramPOffset;
- arg.req.vr_p_size = vramPSize;
- arg.req.tt_p_offset = ttPOffset;
- arg.req.tt_p_size = ttPSize;
- arg.req.max_locked_pages = max_locked_size / getpagesize();
+ arg.req.p_offset = pOffset;
+ arg.req.p_size = pSize;
+ arg.req.mem_type = memType;
if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
return -errno;
@@ -3175,13 +3172,29 @@ int drmMMInit(int fd, unsigned long vramPOffset, unsigned long vramPSize,
return 0;
}
-int drmMMTakedown(int fd)
+int drmMMTakedown(int fd, unsigned memType)
{
drm_mm_init_arg_t arg;
memset(&arg, 0, sizeof(arg));
arg.req.op = mm_takedown;
+ arg.req.mem_type = memType;
+
+ if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
+ return -errno;
+
+ return 0;
+}
+
+int drmMMMaxLockedSize(int fd, unsigned long maxLockedSize)
+{
+ drm_mm_init_arg_t arg;
+
+
+ memset(&arg, 0, sizeof(arg));
+ arg.req.op = mm_set_max_pages;
+ arg.req.p_size = maxLockedSize / getpagesize();
if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
return -errno;
diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h
index 78df37c3..b2ba24d5 100644
--- a/libdrm/xf86mm.h
+++ b/libdrm/xf86mm.h
@@ -195,10 +195,11 @@ extern int drmBOWaitIdle(int fd, drmBO *buf, unsigned hint);
* Initialization functions.
*/
-extern int drmMMInit(int fd, unsigned long vramPOffset, unsigned long vramPSize,
- unsigned long ttPOffset, unsigned long ttPSize,
- unsigned long max_locked_size);
-extern int drmMMTakedown(int fd);
+extern int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
+ unsigned memType);
+extern int drmMMTakedown(int fd, unsigned memType);
+extern int drmMMMaxLockedSize(int fd, unsigned long maxLockedSize);
+
#endif