aboutsummaryrefslogtreecommitdiff
path: root/libdrm/xf86drm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-05-26 03:48:08 +1000
committerDave Airlie <airlied@linux.ie>2007-05-26 03:48:08 +1000
commit58b2ed78329305d5760c6df55175f958477f89ae (patch)
tree830836a9ec295b3d8f3a67e47afb848791b5eeb4 /libdrm/xf86drm.c
parent375f3f2884cd1437e9ec2608647face0c3cbef3a (diff)
Revert "drm/ttm: cleanup mm_ioctl ioctls to be separate ioctls."
This reverts commit 3fdef0dc2000308b16907b95f637c60acde80a74. ditto not on master yet
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;