[igt-dev] [RFC v2 01/43] test/i915: gem_bad_reloc: use the gem_engine_topology library

Ramalingam C
2019-06-21T10:00:58Z

tests/i915/gem_bad_reloc.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_bad_reloc.c b/tests/i915/gem_bad_reloc.c
index 7624cd8e0949..26a932a3a933 100644
--- a/tests/i915/gem_bad_reloc.c
+++ b/tests/i915/gem_bad_reloc.c
@@ -50,7 +50,8 @@ IGT_TEST_DESCRIPTION("Simulates SNA behaviour using negative self-relocations"
* than the total size of the GTT), the GPU will hang.
* See https://bugs.freedesktop.org/show_bug.cgi?id=78533
*/
-static void negative_reloc(int fd, unsigned engine, unsigned flags)
+static void negative_reloc(int fd, const struct intel_execution_engine2 *e,
+ unsigned flags)
{
struct drm_i915_gem_execbuffer2 execbuf;
struct drm_i915_gem_exec_object2 obj;
@@ -60,7 +61,6 @@ static void negative_reloc(int fd, unsigned engine, unsigned flags)
uint64_t *offsets;
int i;

- gem_require_ring(fd, engine);
igt_require(intel_gen(intel_get_drm_devid(fd)) >= 7);

memset(&obj, 0, sizeof(obj));
@@ -70,7 +70,7 @@ static void negative_reloc(int fd, unsigned engine, unsigned flags)
memset(&execbuf, 0, sizeof(execbuf));
execbuf.buffers_ptr = (uintptr_t)&obj;
execbuf.buffer_count = 1;
- execbuf.flags = engine | (flags & USE_LUT);
+ execbuf.flags = e->flags | (flags & USE_LUT);
igt_require(__gem_execbuf(fd, &execbuf) == 0);

igt_info("Found offset %lld for 4k batch\n", (long long)obj.offset);
@@ -185,7 +185,7 @@ static void negative_reloc_blt(int fd)

igt_main
{
- const struct intel_execution_engine *e;
+ const struct intel_execution_engine2 *e;
int fd = -1;

igt_fixture {
@@ -193,12 +193,12 @@ igt_main
igt_require_gem(fd);
}

- for (e = intel_execution_engines; e->name; e++) {
+ __for_each_physical_engine(fd, e) {
igt_subtest_f("negative-reloc-%s", e->name)
- negative_reloc(fd, e->exec_id | e->flags, 0);
+ negative_reloc(fd, e, 0);

igt_subtest_f("negative-reloc-lut-%s", e->name)
- negative_reloc(fd, e->exec_id | e->flags, USE_LUT);
+ negative_reloc(fd, e, USE_LUT);
}

igt_subtest("negative-reloc-bltcopy")