summaryrefslogtreecommitdiff
path: root/libdrm/xf86drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r--libdrm/xf86drm.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index bee50824..78efcf2a 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -3153,13 +3153,13 @@ int drmBOFenceList(int fd, drmBOList *list, unsigned fenceHandle)
int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
unsigned memType)
{
- struct drm_mm_init_arg arg;
+ drm_mm_init_arg_t arg;
memset(&arg, 0, sizeof(arg));
-
- arg.p_offset = pOffset;
- arg.p_size = pSize;
- arg.mem_type = memType;
+ arg.req.op = mm_init;
+ 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;
@@ -3169,12 +3169,14 @@ int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
int drmMMTakedown(int fd, unsigned memType)
{
- struct drm_mm_type_arg arg;
+ drm_mm_init_arg_t arg;
+
memset(&arg, 0, sizeof(arg));
- arg.mem_type = memType;
+ arg.req.op = mm_takedown;
+ arg.req.mem_type = memType;
- if (ioctl(fd, DRM_IOCTL_MM_TAKEDOWN, &arg))
+ if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
return -errno;
return 0;
@@ -3182,14 +3184,15 @@ int drmMMTakedown(int fd, unsigned memType)
int drmMMLock(int fd, unsigned memType)
{
- struct drm_mm_type_arg arg;
+ drm_mm_init_arg_t arg;
int ret;
memset(&arg, 0, sizeof(arg));
- arg.mem_type = memType;
+ arg.req.op = mm_lock;
+ arg.req.mem_type = memType;
do{
- ret = ioctl(fd, DRM_IOCTL_MM_LOCK, &arg);
+ ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg);
} while (ret && errno == EAGAIN);
return -errno;
@@ -3197,15 +3200,15 @@ int drmMMLock(int fd, unsigned memType)
int drmMMUnlock(int fd, unsigned memType)
{
- struct drm_mm_type_arg arg;
+ drm_mm_init_arg_t arg;
int ret;
memset(&arg, 0, sizeof(arg));
-
- arg.mem_type = memType;
+ arg.req.op = mm_unlock;
+ arg.req.mem_type = memType;
do{
- ret = ioctl(fd, DRM_IOCTL_MM_UNLOCK, &arg);
+ ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg);
} while (ret && errno == EAGAIN);
return -errno;