diff options
author | ranjeet kumar <ranjeet1.kumar@intel.com> | 2020-04-28 19:01:41 +0530 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-05-11 20:16:27 +0100 |
commit | 22d0955e019020f9ecda4124707801214e279a0c (patch) | |
tree | 6f43a7cc405399eb892e905bae59311f9f0ab8ae /tests | |
parent | 5a5a3162a7638b3ae38b6dc2545622c204d1b97c (diff) |
Macros fixes: Removed unused & redundant macros
Local macros were declared in several files as a prelude to upstream
implementations. Now that we ship include/drm-uapi, we can remove LOCAL
as we upstream.
Cc: Dixit, Ashutosh <ashutosh.dixit@intel.com>
Cc: Tahvanainen Jari <jari.tahvanainen@intel.com>
Signed-off-by: ranjeet kumar <ranjeet1.kumar@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
25 files changed, 113 insertions, 206 deletions
diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c index 0d036ea22..eb2b6d5c3 100644 --- a/tests/i915/gem_busy.c +++ b/tests/i915/gem_busy.c @@ -31,7 +31,6 @@ #include "igt_rand.h" #include "igt_vgem.h" -#define LOCAL_EXEC_NO_RELOC (1<<11) #define PAGE_ALIGN(x) ALIGN(x, 4096) /* Exercise the busy-ioctl, ensuring the ABI is never broken */ diff --git a/tests/i915/gem_concurrent_all.c b/tests/i915/gem_concurrent_all.c index fecb2b22e..80278c757 100644 --- a/tests/i915/gem_concurrent_all.c +++ b/tests/i915/gem_concurrent_all.c @@ -237,12 +237,12 @@ static void create_userptr_require(const struct create *create, unsigned count) arg.user_ptr = -4096ULL; arg.user_size = 8192; errno = 0; - drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg); + drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &arg); if (errno == EFAULT) { igt_assert(posix_memalign((void **)&arg.user_ptr, 4096, arg.user_size) == 0); has_userptr = drmIoctl(fd, - LOCAL_IOCTL_I915_GEM_USERPTR, + DRM_IOCTL_I915_GEM_USERPTR, &arg) == 0; free(from_user_pointer(arg.user_ptr)); } @@ -254,7 +254,7 @@ static void create_userptr_require(const struct create *create, unsigned count) static drm_intel_bo * userptr_create_bo(const struct buffers *b) { - struct local_i915_gem_userptr userptr; + struct drm_i915_gem_userptr userptr; drm_intel_bo *bo; void *ptr; @@ -267,7 +267,7 @@ userptr_create_bo(const struct buffers *b) userptr.user_ptr = to_user_pointer(ptr); #if 0 - do_or_die(drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr)); + do_or_die(drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr)); bo = gem_handle_to_libdrm_bo(b->bufmgr, fd, "userptr", userptr.handle); gem_close(fd, userptr.handle); #else diff --git a/tests/i915/gem_ctx_create.c b/tests/i915/gem_ctx_create.c index f651710aa..39305f026 100644 --- a/tests/i915/gem_ctx_create.c +++ b/tests/i915/gem_ctx_create.c @@ -35,10 +35,7 @@ #include "igt_rand.h" #include "sw_sync.h" -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static unsigned all_engines[16]; static unsigned all_nengine; diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c index 43ff60ad7..ebe8b1504 100644 --- a/tests/i915/gem_ctx_shared.c +++ b/tests/i915/gem_ctx_shared.c @@ -48,8 +48,8 @@ #define HI 1 #define NOISE 2 -#define MAX_PRIO LOCAL_I915_CONTEXT_MAX_USER_PRIORITY -#define MIN_PRIO LOCAL_I915_CONTEXT_MIN_USER_PRIORITY +#define MAX_PRIO I915_CONTEXT_MAX_USER_PRIORITY +#define MIN_PRIO I915_CONTEXT_MIN_USER_PRIORITY static int priorities[] = { [LO] = MIN_PRIO / 2, diff --git a/tests/i915/gem_ctx_switch.c b/tests/i915/gem_ctx_switch.c index 3d34c3560..874dc5ae0 100644 --- a/tests/i915/gem_ctx_switch.c +++ b/tests/i915/gem_ctx_switch.c @@ -43,9 +43,6 @@ #include "i915/gem.h" #include "igt.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - #define INTERRUPTIBLE 0x1 #define QUEUE 0x2 @@ -154,8 +151,8 @@ static void single(int fd, uint32_t handle, execbuf.buffer_count = 1; execbuf.rsvd1 = contexts[0]; execbuf.flags = e2->flags; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; igt_require(__gem_execbuf(fd, &execbuf) == 0); if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = e2->flags; @@ -246,8 +243,8 @@ static void all(int fd, uint32_t handle, unsigned flags, int timeout) execbuf.buffers_ptr = to_user_pointer(obj + 1); execbuf.buffer_count = 1; execbuf.rsvd1 = contexts[0]; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; igt_require(__gem_execbuf(fd, &execbuf) == 0); gem_sync(fd, handle); diff --git a/tests/i915/gem_exec_async.c b/tests/i915/gem_exec_async.c index f4198eed4..035e78377 100644 --- a/tests/i915/gem_exec_async.c +++ b/tests/i915/gem_exec_async.c @@ -24,9 +24,6 @@ #include "i915/gem.h" #include "igt.h" -#define LOCAL_OBJECT_ASYNC (1 << 6) -#define LOCAL_PARAM_HAS_EXEC_ASYNC 43 - IGT_TEST_DESCRIPTION("Check that we can issue concurrent writes across the engines."); static void store_dword(int fd, unsigned ring, @@ -48,7 +45,7 @@ static void store_dword(int fd, unsigned ring, memset(obj, 0, sizeof(obj)); obj[0].handle = target; - obj[0].flags = LOCAL_OBJECT_ASYNC; + obj[0].flags = EXEC_OBJECT_ASYNC; obj[1].handle = gem_create(fd, 4096); memset(&reloc, 0, sizeof(reloc)); @@ -123,7 +120,7 @@ static bool has_async_execbuf(int fd) drm_i915_getparam_t gp; int async = -1; - gp.param = LOCAL_PARAM_HAS_EXEC_ASYNC; + gp.param = I915_PARAM_HAS_EXEC_ASYNC; gp.value = &async; drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); diff --git a/tests/i915/gem_exec_await.c b/tests/i915/gem_exec_await.c index 4c1771e27..fc0e57d3d 100644 --- a/tests/i915/gem_exec_await.c +++ b/tests/i915/gem_exec_await.c @@ -32,13 +32,7 @@ #include "igt_sysfs.h" #include "igt_vgem.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static double elapsed(const struct timespec *start, const struct timespec *end) { @@ -108,8 +102,8 @@ static void wide(int fd, int ring_size, int timeout, unsigned int flags) exec[e].execbuf.buffers_ptr = to_user_pointer(exec[e].exec); exec[e].execbuf.buffer_count = 1; exec[e].execbuf.flags = (engines[e] | - LOCAL_I915_EXEC_NO_RELOC | - LOCAL_I915_EXEC_HANDLE_LUT); + I915_EXEC_NO_RELOC | + I915_EXEC_HANDLE_LUT); if (flags & CONTEXTS) { exec[e].execbuf.rsvd1 = gem_context_create(fd); @@ -196,8 +190,8 @@ static void wide(int fd, int ring_size, int timeout, unsigned int flags) clock_gettime(CLOCK_MONOTONIC, &start); for (unsigned e = 0; e < nengine; e++) { execbuf.flags = (engines[e] | - LOCAL_I915_EXEC_NO_RELOC | - LOCAL_I915_EXEC_HANDLE_LUT); + I915_EXEC_NO_RELOC | + I915_EXEC_HANDLE_LUT); gem_execbuf(fd, &execbuf); } clock_gettime(CLOCK_MONOTONIC, &now); diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c index dc721c1ae..1a53d2fb7 100644 --- a/tests/i915/gem_exec_capture.c +++ b/tests/i915/gem_exec_capture.c @@ -29,9 +29,6 @@ #include "igt_rand.h" #include "igt_sysfs.h" -#define LOCAL_OBJECT_CAPTURE (1 << 7) -#define LOCAL_PARAM_HAS_EXEC_CAPTURE 45 - IGT_TEST_DESCRIPTION("Check that we capture the user specified objects on a hang"); static void check_error_state(int dir, struct drm_i915_gem_exec_object2 *obj) @@ -78,7 +75,7 @@ static void __capture1(int fd, int dir, unsigned ring, uint32_t target) memset(obj, 0, sizeof(obj)); obj[SCRATCH].handle = gem_create(fd, 4096); obj[CAPTURE].handle = target; - obj[CAPTURE].flags = LOCAL_OBJECT_CAPTURE; + obj[CAPTURE].flags = EXEC_OBJECT_CAPTURE; obj[NOCAPTURE].handle = gem_create(fd, 4096); obj[BATCH].handle = gem_create(fd, 4096); @@ -217,7 +214,7 @@ static struct offset { for (i = 0; i < count; i++) { obj[i + 1].handle = gem_create(fd, size); obj[i + 1].flags = - LOCAL_OBJECT_CAPTURE | EXEC_OBJECT_SUPPORTS_48B_ADDRESS; + EXEC_OBJECT_CAPTURE | EXEC_OBJECT_SUPPORTS_48B_ADDRESS; if (flags & INCREMENTAL) { uint32_t *ptr; @@ -513,7 +510,7 @@ static bool has_capture(int fd) drm_i915_getparam_t gp; int async = -1; - gp.param = LOCAL_PARAM_HAS_EXEC_CAPTURE; + gp.param = I915_PARAM_HAS_EXEC_CAPTURE; gp.value = &async; drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); diff --git a/tests/i915/gem_exec_create.c b/tests/i915/gem_exec_create.c index d3dd78ffb..ee7d4e5d8 100644 --- a/tests/i915/gem_exec_create.c +++ b/tests/i915/gem_exec_create.c @@ -42,13 +42,7 @@ #include "i915/gem.h" #include "igt.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static double elapsed(const struct timespec *start, const struct timespec *end) { @@ -77,8 +71,8 @@ static void all(int fd, unsigned flags, int timeout, int ncpus) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; gem_execbuf(fd, &execbuf); diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c index 0b85fd2e9..198e54fd2 100644 --- a/tests/i915/gem_exec_latency.c +++ b/tests/i915/gem_exec_latency.c @@ -48,13 +48,7 @@ #include "i915/gem.h" #include "i915/gem_ring.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) #define LIVE 0x1 #define CORK 0x2 @@ -137,7 +131,7 @@ static void latency_on_ring(int fd, execbuf.buffers_ptr = to_user_pointer(&obj[1]); execbuf.buffer_count = 2; execbuf.flags = ring; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC | LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC | I915_EXEC_HANDLE_LUT; memset(obj, 0, sizeof(obj)); obj[1].handle = gem_create(fd, 4096); @@ -289,7 +283,7 @@ static void latency_from_ring(int fd, execbuf.buffers_ptr = to_user_pointer(&obj[1]); execbuf.buffer_count = 2; execbuf.flags = ring; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC | LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC | I915_EXEC_HANDLE_LUT; execbuf.rsvd1 = ctx[1]; memset(obj, 0, sizeof(obj)); diff --git a/tests/i915/gem_exec_lut_handle.c b/tests/i915/gem_exec_lut_handle.c index bd69e9417..e642686db 100644 --- a/tests/i915/gem_exec_lut_handle.c +++ b/tests/i915/gem_exec_lut_handle.c @@ -43,11 +43,6 @@ IGT_TEST_DESCRIPTION("Exercises the basic execbuffer using the handle LUT" " interface."); -#define BATCH_SIZE (1024*1024) - -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - #define MAX_NUM_EXEC 2048 #define MAX_NUM_RELOC 4096 @@ -76,7 +71,7 @@ static int has_exec_lut(int fd) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer((gem_exec + MAX_NUM_EXEC)); execbuf.buffer_count = 1; - execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags = I915_EXEC_HANDLE_LUT; return __gem_execbuf(fd, &execbuf) == 0; } @@ -152,9 +147,9 @@ igt_simple_main memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(objects); execbuf.buffer_count = n + 1; - execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags = I915_EXEC_HANDLE_LUT; if (p->flags & NO_RELOC) - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_NO_RELOC; for (j = 0; j < m; j++) { target[j] = hars_petruska_f54_1_random() % n; @@ -183,7 +178,7 @@ igt_simple_main gem_exec[MAX_NUM_EXEC].handle = cycle[c]; elapsed[i][1] = ELAPSED(&start, &end); - execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags &= ~I915_EXEC_HANDLE_LUT; for (j = 0; j < m; j++) reloc[j].target_handle = objects[target[j]].handle; diff --git a/tests/i915/gem_exec_nop.c b/tests/i915/gem_exec_nop.c index 1c17d023d..4051e0fd7 100644 --- a/tests/i915/gem_exec_nop.c +++ b/tests/i915/gem_exec_nop.c @@ -47,16 +47,10 @@ #include "igt_sysfs.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) +#define ENGINE_FLAGS (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) - -#define MAX_PRIO LOCAL_I915_CONTEXT_MAX_USER_PRIORITY -#define MIN_PRIO LOCAL_I915_CONTEXT_MIN_USER_PRIORITY +#define MAX_PRIO I915_CONTEXT_MAX_USER_PRIORITY +#define MIN_PRIO I915_CONTEXT_MIN_USER_PRIORITY #define MAX_ENGINES (I915_EXEC_RING_MASK + 1) #define FORKED (1 << 0) @@ -85,8 +79,8 @@ static double nop_on_ring(int fd, uint32_t handle, execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; execbuf.flags = e->flags; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = e->flags; gem_execbuf(fd, &execbuf); @@ -463,8 +457,8 @@ static void parallel(int fd, uint32_t handle, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; gem_execbuf(fd, &execbuf); @@ -525,8 +519,8 @@ static void independent(int fd, uint32_t handle, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; gem_execbuf(fd, &execbuf); @@ -580,8 +574,8 @@ static void multiple(int fd, execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; execbuf.flags = e->flags; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = e->flags; gem_execbuf(fd, &execbuf); @@ -652,8 +646,8 @@ static void series(int fd, uint32_t handle, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; gem_execbuf(fd, &execbuf); @@ -729,8 +723,8 @@ static void sequential(int fd, uint32_t handle, unsigned flags, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(obj); execbuf.buffer_count = 2; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; igt_require(__gem_execbuf(fd, &execbuf) == 0); if (flags & CONTEXT) { @@ -800,7 +794,6 @@ static void sequential(int fd, uint32_t handle, unsigned flags, int timeout) munmap(results, 4096); } -#define LOCAL_EXEC_FENCE_OUT (1 << 17) static bool fence_enable_signaling(int fence) { return poll(&(struct pollfd){fence, POLLIN}, 1, 0) == 0; @@ -846,7 +839,7 @@ static void fence_signal(int fd, uint32_t handle, memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; - execbuf.flags = LOCAL_EXEC_FENCE_OUT; + execbuf.flags = I915_EXEC_FENCE_OUT; n = 0; count = 0; @@ -909,8 +902,8 @@ static void preempt(int fd, uint32_t handle, execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; execbuf.flags = e->flags; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = e->flags; gem_execbuf(fd, &execbuf); diff --git a/tests/i915/gem_exec_parallel.c b/tests/i915/gem_exec_parallel.c index 6d7cb3b8e..bf94b93d4 100644 --- a/tests/i915/gem_exec_parallel.c +++ b/tests/i915/gem_exec_parallel.c @@ -33,13 +33,7 @@ #include "igt.h" #include "igt_gt.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) #define VERIFY 0 @@ -122,8 +116,8 @@ static void *thread(void *data) execbuf.buffers_ptr = to_user_pointer(obj); execbuf.buffer_count = 2; execbuf.flags = t->engine; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (t->gen < 6) execbuf.flags |= I915_EXEC_SECURE; if (t->flags & CONTEXTS) { diff --git a/tests/i915/gem_exec_params.c b/tests/i915/gem_exec_params.c index bea857add..f969fb417 100644 --- a/tests/i915/gem_exec_params.c +++ b/tests/i915/gem_exec_params.c @@ -42,16 +42,6 @@ #include "igt.h" #include "igt_device.h" -#define LOCAL_I915_EXEC_VEBOX (4<<0) -#define LOCAL_I915_EXEC_BSD_MASK (3<<13) -#define LOCAL_I915_EXEC_BSD_RING1 (1<<13) -#define LOCAL_I915_EXEC_BSD_RING2 (2<<13) -#define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<15) -#define LOCAL_I915_EXEC_FENCE_IN (1 << 16) -#define LOCAL_I915_EXEC_FENCE_OUT (1 << 17) -#define LOCAL_I915_EXEC_BATCH_FIRST (1 << 18) -#define LOCAL_I915_EXEC_FENCE_ARRAY (1 << 19) - static bool has_ring(int fd, unsigned ring_exec_flags) { switch (ring_exec_flags & I915_EXEC_RING_MASK) { @@ -60,7 +50,7 @@ static bool has_ring(int fd, unsigned ring_exec_flags) return true; case I915_EXEC_BSD: - if (ring_exec_flags & LOCAL_I915_EXEC_BSD_MASK) + if (ring_exec_flags & I915_EXEC_BSD_MASK) return gem_has_bsd2(fd); else return gem_has_bsd(fd); @@ -183,7 +173,7 @@ static void test_batch_first(int fd) igt_assert_eq_u32(value, 2); /* Batch first mode */ - execbuf.flags |= LOCAL_I915_EXEC_BATCH_FIRST; + execbuf.flags |= I915_EXEC_BATCH_FIRST; gem_execbuf(fd, &execbuf); gem_read(fd, obj[1].handle, 0, &value, sizeof(value)); igt_assert_eq_u32(value, 1); @@ -384,7 +374,7 @@ igt_main } igt_subtest("no-vebox") { igt_require(!gem_has_vebox(fd)); - execbuf.flags = LOCAL_I915_EXEC_VEBOX; + execbuf.flags = I915_EXEC_VEBOX; RUN_FAIL(EINVAL); } igt_subtest("invalid-ring") { @@ -393,45 +383,45 @@ igt_main } igt_subtest("invalid-ring2") { - execbuf.flags = LOCAL_I915_EXEC_VEBOX+1; + execbuf.flags = I915_EXEC_VEBOX+1; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd-ring") { igt_require(gem_has_bsd2(fd)); - execbuf.flags = I915_EXEC_BSD | LOCAL_I915_EXEC_BSD_MASK; + execbuf.flags = I915_EXEC_BSD | I915_EXEC_BSD_MASK; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd1-flag-on-render") { - execbuf.flags = I915_EXEC_RENDER | LOCAL_I915_EXEC_BSD_RING1; + execbuf.flags = I915_EXEC_RENDER | I915_EXEC_BSD_RING1; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd2-flag-on-render") { - execbuf.flags = I915_EXEC_RENDER | LOCAL_I915_EXEC_BSD_RING2; + execbuf.flags = I915_EXEC_RENDER | I915_EXEC_BSD_RING2; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd1-flag-on-blt") { - execbuf.flags = I915_EXEC_BLT | LOCAL_I915_EXEC_BSD_RING1; + execbuf.flags = I915_EXEC_BLT | I915_EXEC_BSD_RING1; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd2-flag-on-blt") { - execbuf.flags = I915_EXEC_BLT | LOCAL_I915_EXEC_BSD_RING2; + execbuf.flags = I915_EXEC_BLT | I915_EXEC_BSD_RING2; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd1-flag-on-vebox") { igt_require(gem_has_vebox(fd)); - execbuf.flags = LOCAL_I915_EXEC_VEBOX | LOCAL_I915_EXEC_BSD_RING1; + execbuf.flags = I915_EXEC_VEBOX | I915_EXEC_BSD_RING1; RUN_FAIL(EINVAL); } igt_subtest("invalid-bsd2-flag-on-vebox") { igt_require(gem_has_vebox(fd)); - execbuf.flags = LOCAL_I915_EXEC_VEBOX | LOCAL_I915_EXEC_BSD_RING2; + execbuf.flags = I915_EXEC_VEBOX | I915_EXEC_BSD_RING2; RUN_FAIL(EINVAL); } @@ -501,7 +491,7 @@ igt_main /* NOTE: This test intentionally exercise the next available * flag. Don't "fix" this testcase without adding the required * tests for the new flag first. */ - execbuf.flags = I915_EXEC_RENDER | (LOCAL_I915_EXEC_FENCE_ARRAY << 1); + execbuf.flags = I915_EXEC_RENDER | (I915_EXEC_FENCE_ARRAY << 1); RUN_FAIL(EINVAL); } @@ -526,14 +516,14 @@ igt_main expect = 0; execbuf.flags = - eb_ring(it) | LOCAL_I915_EXEC_RESOURCE_STREAMER; + eb_ring(it) | I915_EXEC_RESOURCE_STREAMER; igt_assert_eq(__gem_execbuf(fd, &execbuf), expect); } } igt_subtest("invalid-fence-in") { igt_require(gem_has_exec_fence(fd)); - execbuf.flags = LOCAL_I915_EXEC_FENCE_IN; + execbuf.flags = I915_EXEC_FENCE_IN; execbuf.rsvd2 = -1; RUN_FAIL(EINVAL); execbuf.rsvd2 = fd; diff --git a/tests/i915/gem_exec_reloc.c b/tests/i915/gem_exec_reloc.c index f6fa55a36..3951aab2f 100644 --- a/tests/i915/gem_exec_reloc.c +++ b/tests/i915/gem_exec_reloc.c @@ -31,13 +31,7 @@ IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl relocations."); -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static uint32_t find_last_set(uint64_t x) { @@ -561,7 +555,7 @@ static void basic_reloc(int fd, unsigned before, unsigned after, unsigned flags) execbuf.buffers_ptr = to_user_pointer(&obj); execbuf.buffer_count = 1; if (flags & NORELOC) - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_NO_RELOC; for (reloc_offset = 4096 - 8; reloc_offset <= 4096 + 8; reloc_offset += 4) { igt_spin_t *spin = NULL; diff --git a/tests/i915/gem_exec_schedule.c b/tests/i915/gem_exec_schedule.c index 22acd2776..82209bfac 100644 --- a/tests/i915/gem_exec_schedule.c +++ b/tests/i915/gem_exec_schedule.c @@ -47,8 +47,8 @@ #define HI 1 #define NOISE 2 -#define MAX_PRIO LOCAL_I915_CONTEXT_MAX_USER_PRIORITY -#define MIN_PRIO LOCAL_I915_CONTEXT_MIN_USER_PRIORITY +#define MAX_PRIO I915_CONTEXT_MAX_USER_PRIORITY +#define MIN_PRIO I915_CONTEXT_MIN_USER_PRIORITY #define MAX_CONTEXTS 1024 #define MAX_ELSP_QLEN 16 diff --git a/tests/i915/gem_exec_store.c b/tests/i915/gem_exec_store.c index b37d63af3..272ab9cd8 100644 --- a/tests/i915/gem_exec_store.c +++ b/tests/i915/gem_exec_store.c @@ -34,10 +34,7 @@ #include "igt_device.h" #include "igt_gt.h" -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static void store_dword(int fd, const struct intel_execution_engine2 *e) { diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c index 8f2a781b5..d768db911 100644 --- a/tests/i915/gem_exec_suspend.c +++ b/tests/i915/gem_exec_suspend.c @@ -44,10 +44,7 @@ #define HIBERNATE 5 #define mode(x) ((x) & 0xff) -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) #define UNCACHED (0<<8) #define CACHED (1<<8) diff --git a/tests/i915/gem_exec_whisper.c b/tests/i915/gem_exec_whisper.c index 6e8943422..2db8dede6 100644 --- a/tests/i915/gem_exec_whisper.c +++ b/tests/i915/gem_exec_whisper.c @@ -35,13 +35,7 @@ #include "igt_rand.h" #include "igt_sysfs.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) #define VERIFY 0 @@ -274,8 +268,8 @@ static void whisper(int fd, unsigned engine, unsigned flags) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(tmp); execbuf.buffer_count = 2; - execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; + execbuf.flags = I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; igt_require(__gem_execbuf(fd, &execbuf) == 0); diff --git a/tests/i915/gem_reset_stats.c b/tests/i915/gem_reset_stats.c index b6927daf5..4ba1ec8ee 100644 --- a/tests/i915/gem_reset_stats.c +++ b/tests/i915/gem_reset_stats.c @@ -65,8 +65,6 @@ struct local_drm_i915_reset_stats { #define GET_RESET_STATS_IOCTL DRM_IOWR(DRM_COMMAND_BASE + 0x32, struct local_drm_i915_reset_stats) -#define LOCAL_I915_EXEC_VEBOX (4 << 0) - static void sync_gpu(void) { int fd = drm_open_driver(DRIVER_INTEL); diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c index 10d639423..5715ef688 100644 --- a/tests/i915/gem_shrink.c +++ b/tests/i915/gem_shrink.c @@ -225,7 +225,7 @@ static void hang(int fd, uint64_t alloc) static void userptr(int fd, uint64_t alloc, unsigned int flags) #define UDIRTY (1 << 0) { - struct local_i915_gem_userptr userptr; + struct drm_i915_gem_userptr userptr; void *ptr; igt_assert((alloc & 4095) == 0); @@ -238,7 +238,7 @@ static void userptr(int fd, uint64_t alloc, unsigned int flags) memset(&userptr, 0, sizeof(userptr)); userptr.user_size = alloc; userptr.user_ptr = to_user_pointer(ptr); - do_ioctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + do_ioctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); if (flags & UDIRTY) gem_set_domain(fd, userptr.handle, @@ -251,7 +251,7 @@ static void userptr(int fd, uint64_t alloc, unsigned int flags) static bool has_userptr(void) { - struct local_i915_gem_userptr userptr; + struct drm_i915_gem_userptr userptr; int fd = drm_open_driver(DRIVER_INTEL); int err; @@ -260,7 +260,7 @@ static bool has_userptr(void) userptr.user_ptr = -4096; err = 0; - if (drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr)) + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr)) err = errno; close(fd); diff --git a/tests/i915/gem_streaming_writes.c b/tests/i915/gem_streaming_writes.c index bd44e1340..b18ff8487 100644 --- a/tests/i915/gem_streaming_writes.c +++ b/tests/i915/gem_streaming_writes.c @@ -48,8 +48,6 @@ #define BLT_WRITE_RGB (1<<20) #define BLT_WRITE_ARGB (BLT_WRITE_ALPHA | BLT_WRITE_RGB) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) - IGT_TEST_DESCRIPTION("Test of streaming writes into active GPU sources"); #define SRC 0 @@ -104,7 +102,7 @@ static void test_streaming(int fd, int mode, int sync) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(exec); execbuf.buffer_count = 2; - execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags = I915_EXEC_HANDLE_LUT; if (__gem_execbuf(fd, &execbuf)) { execbuf.flags = 0; igt_require(__gem_execbuf(fd, &execbuf) == 0); @@ -117,7 +115,7 @@ static void test_streaming(int fd, int mode, int sync) for (i = 0; i < 64; i++) { reloc[2*i+0].offset = 64*i + 4 * sizeof(uint32_t); reloc[2*i+0].delta = 0; - reloc[2*i+0].target_handle = execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT ? DST : dst; + reloc[2*i+0].target_handle = execbuf.flags & I915_EXEC_HANDLE_LUT ? DST : dst; reloc[2*i+0].presumed_offset = dst_offset; reloc[2*i+0].read_domains = I915_GEM_DOMAIN_RENDER; reloc[2*i+0].write_domain = I915_GEM_DOMAIN_RENDER; @@ -126,7 +124,7 @@ static void test_streaming(int fd, int mode, int sync) if (has_64bit_reloc) reloc[2*i+1].offset += sizeof(uint32_t); reloc[2*i+1].delta = 0; - reloc[2*i+1].target_handle = execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT ? SRC : src; + reloc[2*i+1].target_handle = execbuf.flags & I915_EXEC_HANDLE_LUT ? SRC : src; reloc[2*i+1].presumed_offset = src_offset; reloc[2*i+1].read_domains = I915_GEM_DOMAIN_RENDER; reloc[2*i+1].write_domain = 0; @@ -258,7 +256,7 @@ static void test_batch(int fd, int mode, int reverse) memset(reloc, 0, sizeof(reloc)); reloc[0].offset = 4 * sizeof(uint32_t); reloc[0].delta = 0; - reloc[0].target_handle = execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT ? DST : dst; + reloc[0].target_handle = execbuf.flags & I915_EXEC_HANDLE_LUT ? DST : dst; reloc[0].presumed_offset = dst_offset; reloc[0].read_domains = I915_GEM_DOMAIN_RENDER; reloc[0].write_domain = I915_GEM_DOMAIN_RENDER; @@ -267,7 +265,7 @@ static void test_batch(int fd, int mode, int reverse) if (has_64bit_reloc) reloc[1].offset += sizeof(uint32_t); reloc[1].delta = 0; - reloc[1].target_handle = execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT ? SRC : src; + reloc[1].target_handle = execbuf.flags & I915_EXEC_HANDLE_LUT ? SRC : src; reloc[1].presumed_offset = src_offset; reloc[1].read_domains = I915_GEM_DOMAIN_RENDER; reloc[1].write_domain = 0; @@ -298,11 +296,11 @@ static void test_batch(int fd, int mode, int reverse) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(exec); execbuf.buffer_count = 3; - execbuf.flags = LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags = I915_EXEC_HANDLE_LUT; if (gem_has_blt(fd)) execbuf.flags |= I915_EXEC_BLT; if (__gem_execbuf(fd, &execbuf)) { - execbuf.flags &= ~LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags &= ~I915_EXEC_HANDLE_LUT; gem_execbuf(fd, &execbuf); } execbuf.flags |= I915_EXEC_NO_RELOC; diff --git a/tests/i915/gem_sync.c b/tests/i915/gem_sync.c index 6b3c76ec0..b317a3927 100644 --- a/tests/i915/gem_sync.c +++ b/tests/i915/gem_sync.c @@ -31,16 +31,10 @@ #include "igt.h" #include "igt_sysfs.h" -#define LOCAL_I915_EXEC_NO_RELOC (1<<11) -#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) +#define MAX_PRIO I915_CONTEXT_MAX_USER_PRIORITY +#define MIN_PRIO I915_CONTEXT_MIN_USER_PRIORITY -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define MAX_PRIO LOCAL_I915_CONTEXT_MAX_USER_PRIORITY -#define MIN_PRIO LOCAL_I915_CONTEXT_MIN_USER_PRIORITY - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) IGT_TEST_DESCRIPTION("Basic check of ring<->ring write synchronisation."); @@ -517,8 +511,8 @@ store_ring(int fd, unsigned ring, int num_children, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(object); execbuf.flags = ied_flags(&ied, child); - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; @@ -621,8 +615,8 @@ switch_ring(int fd, unsigned ring, int num_children, int timeout) memset(&c->execbuf, 0, sizeof(c->execbuf)); c->execbuf.buffers_ptr = to_user_pointer(c->object); c->execbuf.flags = ied_flags(&ied, child); - c->execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - c->execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + c->execbuf.flags |= I915_EXEC_NO_RELOC; + c->execbuf.flags |= I915_EXEC_HANDLE_LUT; if (gen < 6) c->execbuf.flags |= I915_EXEC_SECURE; c->execbuf.rsvd1 = gem_context_create(fd); @@ -785,8 +779,8 @@ __store_many(int fd, unsigned ring, int timeout, unsigned long *cycles) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(object); execbuf.flags = ring; - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; @@ -995,8 +989,8 @@ store_all(int fd, int num_children, int timeout) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = to_user_pointer(object); - execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC; - execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT; + execbuf.flags |= I915_EXEC_NO_RELOC; + execbuf.flags |= I915_EXEC_HANDLE_LUT; if (gen < 6) execbuf.flags |= I915_EXEC_SECURE; diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c index 05f96e759..d66cbf1d4 100644 --- a/tests/i915/gem_userptr_blits.c +++ b/tests/i915/gem_userptr_blits.c @@ -70,9 +70,7 @@ #define PAGE_SIZE 4096 #endif -#define LOCAL_EXEC_OBJECT_SUPPORTS_48B (1 << 3) - -static uint32_t userptr_flags = LOCAL_I915_USERPTR_UNSYNCHRONIZED; +static uint32_t userptr_flags = I915_USERPTR_UNSYNCHRONIZED; static bool *can_mmap; @@ -102,7 +100,7 @@ static bool has_mmap(int i915, const struct mmap_offset *t) igt_assert(posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE) == 0); if (__gem_userptr(i915, ptr, 4096, 0, - LOCAL_I915_USERPTR_UNSYNCHRONIZED, &handle)) + I915_USERPTR_UNSYNCHRONIZED, &handle)) goto out_ptr; igt_assert(handle != 0); @@ -122,7 +120,7 @@ out_ptr: static void gem_userptr_test_unsynchronized(void) { - userptr_flags = LOCAL_I915_USERPTR_UNSYNCHRONIZED; + userptr_flags = I915_USERPTR_UNSYNCHRONIZED; } static void gem_userptr_test_synchronized(void) @@ -191,19 +189,19 @@ static int copy(int fd, uint32_t dst, uint32_t src) memset(obj, 0, sizeof(obj)); obj[exec.buffer_count].handle = dst; - obj[exec.buffer_count].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[exec.buffer_count].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; exec.buffer_count++; if (src != dst) { obj[exec.buffer_count].handle = src; - obj[exec.buffer_count].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[exec.buffer_count].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; exec.buffer_count++; } obj[exec.buffer_count].handle = handle; obj[exec.buffer_count].relocation_count = 2; obj[exec.buffer_count].relocs_ptr = to_user_pointer(reloc); - obj[exec.buffer_count].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[exec.buffer_count].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; exec.buffer_count++; exec.buffers_ptr = to_user_pointer(obj); exec.flags = HAS_BLT_RING(intel_get_drm_devid(fd)) ? I915_EXEC_BLT : 0; @@ -270,10 +268,10 @@ blit(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo, int n_bo) obj = calloc(n_bo + 1, sizeof(*obj)); for (n = 0; n < n_bo; n++) { obj[n].handle = all_bo[n]; - obj[n].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[n].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; } obj[n].handle = handle; - obj[n].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[n].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; obj[n].relocation_count = 2; obj[n].relocs_ptr = to_user_pointer(reloc); @@ -516,7 +514,7 @@ static int has_userptr(int fd) static int test_input_checking(int fd) { - struct local_i915_gem_userptr userptr; + struct drm_i915_gem_userptr userptr; int ret; /* Invalid flags. */ @@ -524,7 +522,7 @@ static int test_input_checking(int fd) userptr.user_ptr = 0; userptr.user_size = 0; userptr.flags = ~0; - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); igt_assert_neq(ret, 0); /* Too big. */ @@ -532,7 +530,7 @@ static int test_input_checking(int fd) userptr.user_ptr = 0; userptr.user_size = ~0; userptr.flags = 0; - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); igt_assert_neq(ret, 0); /* Both wrong. */ @@ -540,7 +538,7 @@ static int test_input_checking(int fd) userptr.user_ptr = 0; userptr.user_size = ~0; userptr.flags = ~0; - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); igt_assert_neq(ret, 0); /* Zero user_size. */ @@ -548,7 +546,7 @@ static int test_input_checking(int fd) userptr.user_ptr = 0; userptr.user_size = 0; userptr.flags = 0; - ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + ret = drmIoctl(fd, DRM_IOCTL_I915_GEM_USERPTR, &userptr); igt_assert_neq(ret, 0); return 0; @@ -1065,7 +1063,7 @@ static int test_dmabuf(void) memset(get_handle_ptr(handle), counter, sizeof(linear)); ret = export_handle(fd1, handle, &dma_buf_fd); - if (userptr_flags & LOCAL_I915_USERPTR_UNSYNCHRONIZED && ret) { + if (userptr_flags & I915_USERPTR_UNSYNCHRONIZED && ret) { igt_assert(ret == EINVAL || ret == ENODEV); free_userptr_bo(fd1, handle); close(fd1); @@ -1131,7 +1129,7 @@ static void store_dword_rand(int i915, unsigned int engine, memset(obj, 0, sizeof(obj)); obj[0].handle = target; - obj[0].flags = LOCAL_EXEC_OBJECT_SUPPORTS_48B; + obj[0].flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS; obj[1].handle = gem_create(i915, batchsz); obj[1].relocation_count = count; obj[1].relocs_ptr = to_user_pointer(reloc); diff --git a/tests/i915/i915_module_load.c b/tests/i915/i915_module_load.c index 7d9a5cfd2..77aaac5c6 100644 --- a/tests/i915/i915_module_load.c +++ b/tests/i915/i915_module_load.c @@ -36,11 +36,7 @@ #include <sys/ioctl.h> #include <fcntl.h> - -#define LOCAL_I915_EXEC_BSD_SHIFT (13) -#define LOCAL_I915_EXEC_BSD_MASK (3 << LOCAL_I915_EXEC_BSD_SHIFT) - -#define ENGINE_MASK (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) +#define ENGINE_MASK (I915_EXEC_RING_MASK | I915_EXEC_BSD_MASK) static void store_dword(int fd, unsigned ring) { |