All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_faulting_reloc: Use a coherent mapping
@ 2020-02-01  0:11 Antonio Argenziano
  2020-02-01  0:56 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Antonio Argenziano @ 2020-02-01  0:11 UTC (permalink / raw)
  To: igt-dev

With mappable aperture not being available on some platforms, use a
different mapping. While this is changing a portion of the test, it
should keep intact the spirit of the same by submitting relocations to
faulting addresses.

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/i915/gem_exec_faulting_reloc.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_exec_faulting_reloc.c b/tests/i915/gem_exec_faulting_reloc.c
index c2aea039..82d67a68 100644
--- a/tests/i915/gem_exec_faulting_reloc.c
+++ b/tests/i915/gem_exec_faulting_reloc.c
@@ -39,12 +39,11 @@
 #include <sys/time.h>
 #include "drm.h"
 
-/* Testcase: Submit patches with relocations in memory that will fault
+/* Testcase: Submit batches with relocations in memory that will fault
  *
- * To be really evil, use a gtt mmap for them.
  */
 
-IGT_TEST_DESCRIPTION("Submit patches with relocations in memory that will"
+IGT_TEST_DESCRIPTION("Submit batches with relocations in memory that will"
 		     " fault.");
 
 #define OBJECT_SIZE 16384
@@ -111,7 +110,7 @@ static int gem_linear_blt(uint32_t *batch,
 			b += 8;
 		length -= height * 16*1024;
 	}
-	
+
 	if (length) {
 		int i = 0;
 		b[i++] = COPY_BLT_CMD_NOLEN | BLT_WRITE_ALPHA | BLT_WRITE_RGB;
@@ -167,7 +166,7 @@ static void run(int object_size)
 	struct drm_i915_gem_relocation_entry reloc[4];
 	uint32_t buf[40];
 	uint32_t handle, handle_relocs, src, dst;
-	void *gtt_relocs;
+	void *relocs;
 	int fd, len;
 	int ring;
 
@@ -203,7 +202,7 @@ static void run(int object_size)
 
 	handle_relocs = gem_create(fd, 4096);
 	gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc));
-	gtt_relocs = gem_mmap__gtt(fd, handle_relocs, 4096,
+	relocs = gem_mmap__device_coherent(fd, handle_relocs, 0, 4096,
 				   PROT_READ | PROT_WRITE);
 
 	exec[2].handle = handle;
@@ -212,7 +211,7 @@ static void run(int object_size)
 	else
 		exec[2].relocation_count = len > 40 ? 4 : 2;
 	/* A newly mmap gtt bo will fault on first access. */
-	exec[2].relocs_ptr = to_user_pointer(gtt_relocs);
+	exec[2].relocs_ptr = to_user_pointer(relocs);
 	exec[2].alignment = 0;
 	exec[2].offset = 0;
 	exec[2].flags = 0;
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-04 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01  0:11 [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_faulting_reloc: Use a coherent mapping Antonio Argenziano
2020-02-01  0:56 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-01  3:55 ` [igt-dev] [PATCH i-g-t] " Dixit, Ashutosh
2020-02-03 10:34   ` Chris Wilson
2020-02-04 19:18 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.