summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorranjeet kumar <ranjeet1.kumar@intel.com>2020-04-28 19:01:41 +0530
committerChris Wilson <chris@chris-wilson.co.uk>2020-05-11 20:16:27 +0100
commit22d0955e019020f9ecda4124707801214e279a0c (patch)
tree6f43a7cc405399eb892e905bae59311f9f0ab8ae /benchmarks
parent5a5a3162a7638b3ae38b6dc2545622c204d1b97c (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 'benchmarks')
-rw-r--r--benchmarks/gem_blt.c11
-rw-r--r--benchmarks/gem_busy.c19
-rw-r--r--benchmarks/gem_create.c7
-rw-r--r--benchmarks/gem_exec_ctx.c7
-rw-r--r--benchmarks/gem_exec_fault.c12
-rw-r--r--benchmarks/gem_exec_nop.c14
-rw-r--r--benchmarks/gem_exec_reloc.c7
-rw-r--r--benchmarks/gem_exec_tracer.c5
-rw-r--r--benchmarks/gem_latency.c18
-rw-r--r--benchmarks/gem_syslatency.c12
-rw-r--r--benchmarks/gem_userptr_benchmark.c4
11 files changed, 35 insertions, 81 deletions
diff --git a/benchmarks/gem_blt.c b/benchmarks/gem_blt.c
index 6fb72394..5c6d28d3 100644
--- a/benchmarks/gem_blt.c
+++ b/benchmarks/gem_blt.c
@@ -42,9 +42,6 @@
#include "drm.h"
-#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
-#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
-
#define COPY_BLT_CMD (2<<29|0x53<<22|0x6)
#define BLT_WRITE_ALPHA (1<<21)
#define BLT_WRITE_RGB (1<<20)
@@ -229,7 +226,7 @@ static int run(int object, int batch, int time, int reps, int ncpus, unsigned fl
execbuf.buffer_count = 3;
execbuf.batch_len = len;
execbuf.flags = ring;
- execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT;
+ execbuf.flags |= I915_EXEC_HANDLE_LUT;
if (__gem_execbuf(fd, &execbuf)) {
gem_set_domain(fd, handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
@@ -241,7 +238,7 @@ static int run(int object, int batch, int time, int reps, int ncpus, unsigned fl
gem_sync(fd, handle);
if (batch > 1) {
- if (execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT) {
+ if (execbuf.flags & I915_EXEC_HANDLE_LUT) {
src = 0;
dst = 1;
}
@@ -258,8 +255,8 @@ static int run(int object, int batch, int time, int reps, int ncpus, unsigned fl
gem_execbuf(fd, &execbuf);
gem_sync(fd, handle);
}
- if (execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT)
- execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
+ if (execbuf.flags & I915_EXEC_HANDLE_LUT)
+ execbuf.flags |= I915_EXEC_NO_RELOC;
/* Guess how many loops we need for 0.1s */
count = baseline((uint64_t)object * batch, 100) / ncpus;
diff --git a/benchmarks/gem_busy.c b/benchmarks/gem_busy.c
index 405cc9b0..50410150 100644
--- a/benchmarks/gem_busy.c
+++ b/benchmarks/gem_busy.c
@@ -47,13 +47,7 @@
#include "igt_stats.h"
#include "i915/gem_mman.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 WRITE 0x1
#define IDLE 0x2
@@ -62,12 +56,9 @@
#define SYNC 0x10
#define SYNCOBJ 0x20
-#define LOCAL_I915_EXEC_FENCE_ARRAY (1 << 19)
struct local_gem_exec_fence {
uint32_t handle;
uint32_t flags;
-#define LOCAL_EXEC_FENCE_WAIT (1 << 0)
-#define LOCAL_EXEC_FENCE_SIGNAL (1 << 1)
};
static void gem_busy(int fd, uint32_t handle)
@@ -193,8 +184,8 @@ static int loop(unsigned ring, int reps, int ncpus, unsigned flags)
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;
if (__gem_execbuf(fd, &execbuf)) {
execbuf.flags = 0;
if (__gem_execbuf(fd, &execbuf))
@@ -203,11 +194,11 @@ static int loop(unsigned ring, int reps, int ncpus, unsigned flags)
if (flags & SYNCOBJ) {
syncobj.handle = syncobj_create(fd);
- syncobj.flags = LOCAL_EXEC_FENCE_SIGNAL;
+ syncobj.flags = I915_EXEC_FENCE_SIGNAL;
execbuf.cliprects_ptr = to_user_pointer(&syncobj);
execbuf.num_cliprects = 1;
- execbuf.flags |= LOCAL_I915_EXEC_FENCE_ARRAY;
+ execbuf.flags |= I915_EXEC_FENCE_ARRAY;
}
if (ring == -1) {
diff --git a/benchmarks/gem_create.c b/benchmarks/gem_create.c
index bb3e7b64..5dd996c9 100644
--- a/benchmarks/gem_create.c
+++ b/benchmarks/gem_create.c
@@ -47,9 +47,6 @@
#define OBJECT_SIZE (1<<23)
-#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
-#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
-
static double elapsed(const struct timespec *start,
const struct timespec *end)
{
@@ -70,8 +67,8 @@ static void make_busy(int fd, uint32_t handle)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)&gem_exec;
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/benchmarks/gem_exec_ctx.c b/benchmarks/gem_exec_ctx.c
index e55275f3..a2e8d93e 100644
--- a/benchmarks/gem_exec_ctx.c
+++ b/benchmarks/gem_exec_ctx.c
@@ -48,9 +48,6 @@
enum mode { NOP, CREATE, SWITCH, DEFAULT };
#define SYNC 0x1
-#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
-#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
-
static double elapsed(const struct timespec *start,
const struct timespec *end)
{
@@ -99,8 +96,8 @@ static int loop(unsigned ring,
execbuf.buffers_ptr = (uintptr_t)&obj;
execbuf.buffer_count = 1;
execbuf.flags = ring;
- 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 (mode != DEFAULT) {
execbuf.rsvd1 = __gem_context_create_local(fd);
if (execbuf.rsvd1 == 0)
diff --git a/benchmarks/gem_exec_fault.c b/benchmarks/gem_exec_fault.c
index 3f58c77d..4bd05372 100644
--- a/benchmarks/gem_exec_fault.c
+++ b/benchmarks/gem_exec_fault.c
@@ -47,13 +47,7 @@
#include "intel_reg.h"
#include "igt_stats.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)
@@ -88,8 +82,8 @@ static int loop(uint64_t size, unsigned ring, int reps, int ncpus, unsigned flag
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)&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;
if (__gem_execbuf(fd, &execbuf))
diff --git a/benchmarks/gem_exec_nop.c b/benchmarks/gem_exec_nop.c
index b327e2e8..0f17d232 100644
--- a/benchmarks/gem_exec_nop.c
+++ b/benchmarks/gem_exec_nop.c
@@ -45,13 +45,7 @@
#include "intel_reg.h"
#include "igt_stats.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 SYNC 0x1
#define WRITE 0x2
@@ -95,15 +89,15 @@ static int loop(unsigned ring, int reps, int ncpus, unsigned flags)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)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;
if (__gem_execbuf(fd, &execbuf)) {
execbuf.flags = 0;
if (__gem_execbuf(fd, &execbuf))
return 77;
}
- if (flags & WRITE && !(execbuf.flags & LOCAL_I915_EXEC_HANDLE_LUT))
+ if (flags & WRITE && !(execbuf.flags & I915_EXEC_HANDLE_LUT))
return 77;
all_nengine = 0;
diff --git a/benchmarks/gem_exec_reloc.c b/benchmarks/gem_exec_reloc.c
index 0a2454cb..a0736b51 100644
--- a/benchmarks/gem_exec_reloc.c
+++ b/benchmarks/gem_exec_reloc.c
@@ -42,9 +42,6 @@
#include "drmtest.h"
#include "i915/gem_mman.h"
-#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
-#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
-
#define SKIP_RELOC 0x1
#define NO_RELOC 0x2
#define CYCLE_BATCH 0x4
@@ -131,9 +128,9 @@ static int run(unsigned batch_size,
execbuf.buffers_ptr = (uintptr_t)objects;
execbuf.buffer_count = num_objects + 1;
if (flags & LUT)
- execbuf.flags |= LOCAL_I915_EXEC_HANDLE_LUT;
+ execbuf.flags |= I915_EXEC_HANDLE_LUT;
if (flags & NO_RELOC)
- execbuf.flags |= LOCAL_I915_EXEC_NO_RELOC;
+ execbuf.flags |= I915_EXEC_NO_RELOC;
for (n = 0; n < num_relocs; n++) {
target[n] = hars_petruska_f54_1_random() % num_objects;
diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
index 8ee29b5d..c8f4e84b 100644
--- a/benchmarks/gem_exec_tracer.c
+++ b/benchmarks/gem_exec_tracer.c
@@ -136,9 +136,6 @@ fail_if(int cond, const char *format, ...)
abort();
}
-#define LOCAL_I915_EXEC_FENCE_IN (1<<16)
-#define LOCAL_I915_EXEC_FENCE_OUT (1<<17)
-
static void
trace_exec(struct trace *trace,
const struct drm_i915_gem_execbuffer2 *execbuffer2)
@@ -147,7 +144,7 @@ trace_exec(struct trace *trace,
const struct drm_i915_gem_exec_object2 *exec_objects =
to_ptr(typeof(*exec_objects), execbuffer2->buffers_ptr);
- fail_if(execbuffer2->flags & (LOCAL_I915_EXEC_FENCE_IN | LOCAL_I915_EXEC_FENCE_OUT),
+ fail_if(execbuffer2->flags & (I915_EXEC_FENCE_IN | I915_EXEC_FENCE_OUT),
"fences not supported yet\n");
flockfile(trace->file);
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 7269e22d..e89b5c5a 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -44,9 +44,6 @@
#include <sys/resource.h>
#include "drm.h"
-#define LOCAL_I915_EXEC_FENCE_IN (1<<16)
-#define LOCAL_I915_EXEC_FENCE_OUT (1<<17)
-
#define CONTEXT 0x1
#define REALTIME 0x2
#define CMDPARSER 0x4
@@ -140,7 +137,6 @@ struct producer {
struct consumer *consumers;
};
-#define LOCAL_EXEC_NO_RELOC (1<<11)
#define COPY_BLT_CMD (2<<29|0x53<<22|0x6)
#define BLT_WRITE_ALPHA (1<<21)
#define BLT_WRITE_RGB (1<<20)
@@ -226,7 +222,7 @@ static void setup_workload(struct producer *p, int gen,
eb->buffer_count = 2;
if (flags & CMDPARSER)
eb->batch_len = 4096;
- eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC;
+ eb->flags = I915_EXEC_BLT | I915_EXEC_NO_RELOC;
eb->rsvd1 = p->ctx;
}
@@ -272,9 +268,9 @@ static void setup_latency(struct producer *p, int gen, unsigned flags)
eb->buffer_count = 1;
if (flags & CMDPARSER)
eb->batch_len = sizeof(*map) * ((i + 1) & ~1);
- eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC;
+ eb->flags = I915_EXEC_BLT | I915_EXEC_NO_RELOC;
if (flags & FENCE_OUT)
- eb->flags |= LOCAL_I915_EXEC_FENCE_OUT;
+ eb->flags |= I915_EXEC_FENCE_OUT;
eb->rsvd1 = p->ctx;
}
@@ -300,7 +296,7 @@ static void setup_nop(struct producer *p, uint32_t batch, unsigned flags)
eb->buffer_count = 1;
if (flags & CMDPARSER)
eb->batch_len = 8;
- eb->flags = I915_EXEC_BLT | LOCAL_EXEC_NO_RELOC;
+ eb->flags = I915_EXEC_BLT | I915_EXEC_NO_RELOC;
eb->rsvd1 = p->ctx;
}
@@ -312,7 +308,7 @@ static void fence_wait(int fence)
static void measure_latency(struct producer *p, struct igt_mean *mean)
{
- if (!(p->latency_dispatch.execbuf.flags & LOCAL_I915_EXEC_FENCE_OUT))
+ if (!(p->latency_dispatch.execbuf.flags & I915_EXEC_FENCE_OUT))
gem_sync(fd, p->latency_dispatch.exec[0].handle);
else
fence_wait(p->latency_dispatch.execbuf.rsvd2 >> 32);
@@ -348,7 +344,7 @@ static void *producer(void *arg)
/* Finally, execute a batch that just reads the current
* TIMESTAMP so we can measure the latency.
*/
- if (p->latency_dispatch.execbuf.flags & LOCAL_I915_EXEC_FENCE_OUT)
+ if (p->latency_dispatch.execbuf.flags & I915_EXEC_FENCE_OUT)
gem_execbuf_wr(fd, &p->latency_dispatch.execbuf);
else
gem_execbuf(fd, &p->latency_dispatch.execbuf);
@@ -374,7 +370,7 @@ static void *producer(void *arg)
p->complete++;
- if (p->latency_dispatch.execbuf.flags & LOCAL_I915_EXEC_FENCE_OUT)
+ if (p->latency_dispatch.execbuf.flags & I915_EXEC_FENCE_OUT)
close(p->latency_dispatch.execbuf.rsvd2 >> 32);
}
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index 40230630..456b1f4b 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -71,13 +71,7 @@ static void force_low_latency(void)
strerror(errno));
}
-#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 void *gem_busyspin(void *arg)
{
@@ -111,8 +105,8 @@ static void *gem_busyspin(void *arg)
execbuf.buffers_ptr = (uintptr_t)&obj[1];
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/benchmarks/gem_userptr_benchmark.c b/benchmarks/gem_userptr_benchmark.c
index b63fdedf..eccc65be 100644
--- a/benchmarks/gem_userptr_benchmark.c
+++ b/benchmarks/gem_userptr_benchmark.c
@@ -58,13 +58,13 @@
#define PAGE_SIZE 4096
#endif
-static uint32_t userptr_flags = LOCAL_I915_USERPTR_UNSYNCHRONIZED;
+static uint32_t userptr_flags = I915_USERPTR_UNSYNCHRONIZED;
#define BO_SIZE (65536)
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)