diff options
author | Dave Airlie | 2007-05-05 20:35:11 -0500 |
---|---|---|
committer | Dave Airlie | 2007-05-05 20:35:11 -0500 |
commit | 6a62941ecaa7d2b8f14b30920856bfa52aee4775 (patch) | |
tree | fb327e94c6609822d366c197af6ccd607bd2dbaa /libdrm | |
parent | ee8954cb53e4964a5565833b5a937f1cbcb60d44 (diff) | |
download | external-libdrm-6a62941ecaa7d2b8f14b30920856bfa52aee4775.tar.gz external-libdrm-6a62941ecaa7d2b8f14b30920856bfa52aee4775.tar.xz external-libdrm-6a62941ecaa7d2b8f14b30920856bfa52aee4775.zip |
drm/ttm: cleanup most of fence ioctl split out
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index d776fedd..b53fe2fb 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c | |||
@@ -2272,8 +2272,7 @@ int drmFenceCreate(int fd, unsigned flags, int class, unsigned type, | |||
2272 | arg.flags = flags; | 2272 | arg.flags = flags; |
2273 | arg.type = type; | 2273 | arg.type = type; |
2274 | arg.class = class; | 2274 | arg.class = class; |
2275 | arg.op = drm_fence_create; | 2275 | if (ioctl(fd, DRM_IOCTL_FENCE_CREATE, &arg)) |
2276 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | ||
2277 | return -errno; | 2276 | return -errno; |
2278 | fence->handle = arg.handle; | 2277 | fence->handle = arg.handle; |
2279 | fence->class = arg.class; | 2278 | fence->class = arg.class; |
@@ -2295,8 +2294,8 @@ int drmFenceBuffers(int fd, unsigned flags, drmFence *fence) | |||
2295 | 2294 | ||
2296 | memset(&arg, 0, sizeof(arg)); | 2295 | memset(&arg, 0, sizeof(arg)); |
2297 | arg.flags = flags; | 2296 | arg.flags = flags; |
2298 | arg.op = drm_fence_buffers; | 2297 | |
2299 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2298 | if (ioctl(fd, DRM_IOCTL_FENCE_BUFFERS, &arg)) |
2300 | return -errno; | 2299 | return -errno; |
2301 | fence->handle = arg.handle; | 2300 | fence->handle = arg.handle; |
2302 | fence->class = arg.class; | 2301 | fence->class = arg.class; |
@@ -2312,8 +2311,8 @@ int drmFenceDestroy(int fd, const drmFence *fence) | |||
2312 | 2311 | ||
2313 | memset(&arg, 0, sizeof(arg)); | 2312 | memset(&arg, 0, sizeof(arg)); |
2314 | arg.handle = fence->handle; | 2313 | arg.handle = fence->handle; |
2315 | arg.op = drm_fence_destroy; | 2314 | |
2316 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2315 | if (ioctl(fd, DRM_IOCTL_FENCE_DESTROY, &arg)) |
2317 | return -errno; | 2316 | return -errno; |
2318 | return 0; | 2317 | return 0; |
2319 | } | 2318 | } |
@@ -2324,8 +2323,8 @@ int drmFenceReference(int fd, unsigned handle, drmFence *fence) | |||
2324 | 2323 | ||
2325 | memset(&arg, 0, sizeof(arg)); | 2324 | memset(&arg, 0, sizeof(arg)); |
2326 | arg.handle = handle; | 2325 | arg.handle = handle; |
2327 | arg.op = drm_fence_reference; | 2326 | |
2328 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2327 | if (ioctl(fd, DRM_IOCTL_FENCE_REFERENCE, &arg)) |
2329 | return -errno; | 2328 | return -errno; |
2330 | fence->handle = arg.handle; | 2329 | fence->handle = arg.handle; |
2331 | fence->class = arg.class; | 2330 | fence->class = arg.class; |
@@ -2341,8 +2340,8 @@ int drmFenceUnreference(int fd, const drmFence *fence) | |||
2341 | 2340 | ||
2342 | memset(&arg, 0, sizeof(arg)); | 2341 | memset(&arg, 0, sizeof(arg)); |
2343 | arg.handle = fence->handle; | 2342 | arg.handle = fence->handle; |
2344 | arg.op = drm_fence_unreference; | 2343 | |
2345 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2344 | if (ioctl(fd, DRM_IOCTL_FENCE_UNREFERENCE, &arg)) |
2346 | return -errno; | 2345 | return -errno; |
2347 | return 0; | 2346 | return 0; |
2348 | } | 2347 | } |
@@ -2354,8 +2353,8 @@ int drmFenceFlush(int fd, drmFence *fence, unsigned flush_type) | |||
2354 | memset(&arg, 0, sizeof(arg)); | 2353 | memset(&arg, 0, sizeof(arg)); |
2355 | arg.handle = fence->handle; | 2354 | arg.handle = fence->handle; |
2356 | arg.type = flush_type; | 2355 | arg.type = flush_type; |
2357 | arg.op = drm_fence_flush; | 2356 | |
2358 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2357 | if (ioctl(fd, DRM_IOCTL_FENCE_FLUSH, &arg)) |
2359 | return -errno; | 2358 | return -errno; |
2360 | fence->class = arg.class; | 2359 | fence->class = arg.class; |
2361 | fence->type = arg.type; | 2360 | fence->type = arg.type; |
@@ -2369,8 +2368,8 @@ int drmFenceUpdate(int fd, drmFence *fence) | |||
2369 | 2368 | ||
2370 | memset(&arg, 0, sizeof(arg)); | 2369 | memset(&arg, 0, sizeof(arg)); |
2371 | arg.handle = fence->handle; | 2370 | arg.handle = fence->handle; |
2372 | arg.op = drm_fence_signaled; | 2371 | |
2373 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2372 | if (ioctl(fd, DRM_IOCTL_FENCE_SIGNALED, &arg)) |
2374 | return -errno; | 2373 | return -errno; |
2375 | fence->class = arg.class; | 2374 | fence->class = arg.class; |
2376 | fence->type = arg.type; | 2375 | fence->type = arg.type; |
@@ -2413,8 +2412,8 @@ int drmFenceEmit(int fd, unsigned flags, drmFence *fence, unsigned emit_type) | |||
2413 | arg.flags = flags; | 2412 | arg.flags = flags; |
2414 | arg.handle = fence->handle; | 2413 | arg.handle = fence->handle; |
2415 | arg.type = emit_type; | 2414 | arg.type = emit_type; |
2416 | arg.op = drm_fence_emit; | 2415 | |
2417 | if (ioctl(fd, DRM_IOCTL_FENCE, &arg)) | 2416 | if (ioctl(fd, DRM_IOCTL_FENCE_EMIT, &arg)) |
2418 | return -errno; | 2417 | return -errno; |
2419 | fence->class = arg.class; | 2418 | fence->class = arg.class; |
2420 | fence->type = arg.type; | 2419 | fence->type = arg.type; |
@@ -2447,9 +2446,9 @@ int drmFenceWait(int fd, unsigned flags, drmFence *fence, unsigned flush_type) | |||
2447 | arg.handle = fence->handle; | 2446 | arg.handle = fence->handle; |
2448 | arg.type = flush_type; | 2447 | arg.type = flush_type; |
2449 | arg.flags = flags; | 2448 | arg.flags = flags; |
2450 | arg.op = drm_fence_wait; | 2449 | |
2451 | do { | 2450 | do { |
2452 | ret = ioctl(fd, DRM_IOCTL_FENCE, &arg); | 2451 | ret = ioctl(fd, DRM_IOCTL_FENCE_WAIT, &arg); |
2453 | } while (ret != 0 && errno == EAGAIN); | 2452 | } while (ret != 0 && errno == EAGAIN); |
2454 | 2453 | ||
2455 | if (ret) | 2454 | if (ret) |