summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-05-06 11:17:30 +1000
committerDave Airlie <airlied@linux.ie>2007-05-26 03:32:34 +1000
commit3fdef0dc2000308b16907b95f637c60acde80a74 (patch)
treeab9eaaf2eabdf61764274dfeac638630c13f9ca8 /libdrm
parent7b48f0022a24bc5f565ae64b450dda77dee616c1 (diff)
drm/ttm: cleanup mm_ioctl ioctls to be separate ioctls.
This is the first bunch of ioctls
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 78efcf2a..bee50824 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)
{
- drm_mm_init_arg_t arg;
+ struct drm_mm_init_arg arg;
memset(&arg, 0, sizeof(arg));
- arg.req.op = mm_init;
- arg.req.p_offset = pOffset;
- arg.req.p_size = pSize;
- arg.req.mem_type = memType;
+
+ arg.p_offset = pOffset;
+ arg.p_size = pSize;
+ arg.mem_type = memType;
if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
return -errno;
@@ -3169,14 +3169,12 @@ int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize,
int drmMMTakedown(int fd, unsigned memType)
{
- drm_mm_init_arg_t arg;
-
+ struct drm_mm_type_arg arg;
memset(&arg, 0, sizeof(arg));
- arg.req.op = mm_takedown;
- arg.req.mem_type = memType;
+ arg.mem_type = memType;
- if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg))
+ if (ioctl(fd, DRM_IOCTL_MM_TAKEDOWN, &arg))
return -errno;
return 0;
@@ -3184,15 +3182,14 @@ int drmMMTakedown(int fd, unsigned memType)
int drmMMLock(int fd, unsigned memType)
{
- drm_mm_init_arg_t arg;
+ struct drm_mm_type_arg arg;
int ret;
memset(&arg, 0, sizeof(arg));
- arg.req.op = mm_lock;
- arg.req.mem_type = memType;
+ arg.mem_type = memType;
do{
- ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg);
+ ret = ioctl(fd, DRM_IOCTL_MM_LOCK, &arg);
} while (ret && errno == EAGAIN);
return -errno;
@@ -3200,15 +3197,15 @@ int drmMMLock(int fd, unsigned memType)
int drmMMUnlock(int fd, unsigned memType)
{
- drm_mm_init_arg_t arg;
+ struct drm_mm_type_arg arg;
int ret;
memset(&arg, 0, sizeof(arg));
- arg.req.op = mm_unlock;
- arg.req.mem_type = memType;
+
+ arg.mem_type = memType;
do{
- ret = ioctl(fd, DRM_IOCTL_MM_INIT, &arg);
+ ret = ioctl(fd, DRM_IOCTL_MM_UNLOCK, &arg);
} while (ret && errno == EAGAIN);
return -errno;