summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-29 10:45:34 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-29 10:45:34 +0200
commit279e8d26c6cf7347aa9cb6d50d025a41dff9a5be (patch)
tree99a18283601f80f59f74bcff273bbe3b0fcd2dd2 /libdrm
parent205740647060bc3bdec2b4402a666eb1015932ff (diff)
64-bit IOCTL integer (Michel Dänzer & Brian Paul)
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 06c64303..3731ee12 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -2237,6 +2237,8 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data,
return 0;
}
+#ifdef __linux__
+
int drmFenceCreate(int fd, int shareable, int class,unsigned type,
int emit,
drmFence *fence)
@@ -2362,36 +2364,13 @@ int drmFenceWait(int fd, drmFence *fence, unsigned flush_type,
return 0;
}
-static unsigned long drmUL(drm_u64_t val)
-{
- unsigned long ret = val.lo;
- if (sizeof(ret) == 8) {
- int shift = 32;
- ret |= (val.hi << shift);
- }
- return ret;
-}
-
-static drm_u64_t drmU64(unsigned long val)
-{
- drm_u64_t ret;
- ret.lo = val & 0xFFFFFFFFUL;
- if (sizeof(val) == 8) {
- int shift = 32;
- ret.hi = val >> shift;
- } else {
- ret.hi = 0;
- }
- return ret;
-}
-
int drmTTMCreate(int fd, drmTTM *ttm, unsigned long size, unsigned flags)
{
drm_ttm_arg_t arg;
arg.op = drm_ttm_create;
arg.flags = flags;
- arg.size = drmU64(size);
+ arg.size = size;
if (ioctl(fd, DRM_IOCTL_TTM, &arg))
return -errno;
@@ -2399,7 +2378,7 @@ int drmTTMCreate(int fd, drmTTM *ttm, unsigned long size, unsigned flags)
ttm->handle = arg.handle;
ttm->user_token = (drm_handle_t) arg.user_token;
ttm->flags = arg.flags;
- ttm->size = drmUL(arg.size);
+ ttm->size = arg.size;
return 0;
}
@@ -2426,7 +2405,7 @@ int drmTTMReference(int fd, unsigned handle, drmTTM *ttm)
ttm->handle = arg.handle;
ttm->user_token = (drm_handle_t) arg.user_token;
ttm->flags = arg.flags;
- ttm->size = drmUL(arg.size);
+ ttm->size = arg.size;
return 0;
}
@@ -2446,3 +2425,4 @@ drm_handle_t drmTTMMapHandle(int fd, const drmTTM *ttm)
(void) fd;
return ttm->user_token;
}
+#endif