All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] aubdump: Fix GTT setup for Gen8+.
@ 2016-11-01 21:50 Francisco Jerez
  2016-11-01 21:50 ` [PATCH 2/2] aubdump: Bump GTT size to 128MB Francisco Jerez
  0 siblings, 1 reply; 2+ messages in thread
From: Francisco Jerez @ 2016-11-01 21:50 UTC (permalink / raw)
  To: intel-gfx

Gen8+ have 64 bit GTT entries, so we need to allocate twice as much
space for the GTT table in order to cover the same number of GTT
pages.  Fixes sporadic page-fault crashes on the simulator.
---
 tools/aubdump.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/tools/aubdump.c b/tools/aubdump.c
index 30dc742..d0774c1 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -54,7 +54,6 @@ static char *filename;
 static FILE *file;
 static int gen = 0;
 static int verbose = 0;
-static const uint32_t gtt_size = 0x10000;
 static bool device_override;
 static uint32_t device;
 
@@ -149,9 +148,18 @@ data_out(const void *data, size_t size)
 	fwrite(data, 1, size, file);
 }
 
+static uint32_t
+gtt_size(void)
+{
+	/* Enough for 64MB assuming 4kB pages. */
+	const unsigned entries = 0x4000;
+	return entries * (gen >= 8 ? 8 : 4);
+}
+
 static void
 write_header(void)
 {
+	const unsigned gtt_entry_size = gen >= 8 ? 8 : 4;
 	uint32_t entry = 0x200003;
 
 	/* Start with a (required) version packet. */
@@ -171,11 +179,14 @@ write_header(void)
 		  AUB_TRACE_TYPE_NOTYPE | AUB_TRACE_OP_DATA_WRITE);
 	dword_out(0); /* subtype */
 	dword_out(0); /* offset */
-	dword_out(gtt_size); /* size */
+	dword_out(gtt_size()); /* size */
 	if (gen >= 8)
 		dword_out(0);
-	for (uint32_t i = 0; i < gtt_size; i += 4, entry += 0x1000)
-		dword_out(entry);
+	for (uint32_t i = 0; i * gtt_entry_size < gtt_size(); i++) {
+		dword_out(entry + 0x1000 * i);
+		if (gen >= 8)
+			dword_out(0);
+	}
 }
 
 /**
@@ -332,7 +343,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
 	struct drm_i915_gem_exec_object2 *exec_objects =
 		(struct drm_i915_gem_exec_object2 *) (uintptr_t) execbuffer2->buffers_ptr;
 	uint32_t ring_flag = execbuffer2->flags & I915_EXEC_RING_MASK;
-	uint32_t offset = gtt_size;
+	uint32_t offset = gtt_size();
 	struct drm_i915_gem_exec_object2 *obj;
 	struct bo *bo, *batch_bo;
 	void *data;
-- 
2.10.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 2/2] aubdump: Bump GTT size to 128MB.
  2016-11-01 21:50 [PATCH 1/2] aubdump: Fix GTT setup for Gen8+ Francisco Jerez
@ 2016-11-01 21:50 ` Francisco Jerez
  0 siblings, 0 replies; 2+ messages in thread
From: Francisco Jerez @ 2016-11-01 21:50 UTC (permalink / raw)
  To: intel-gfx

You can easily run out of GTT space with the current fixed allocation
of 64MB.  Bump it to 128MB to avoid sporadic page-fault errors with
the simulator.
---
 tools/aubdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/aubdump.c b/tools/aubdump.c
index d0774c1..80c9d1c 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -151,8 +151,8 @@ data_out(const void *data, size_t size)
 static uint32_t
 gtt_size(void)
 {
-	/* Enough for 64MB assuming 4kB pages. */
-	const unsigned entries = 0x4000;
+	/* Enough for 128MB assuming 4kB pages. */
+	const unsigned entries = 0x8000;
 	return entries * (gen >= 8 ? 8 : 4);
 }
 
-- 
2.10.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-11-01 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 21:50 [PATCH 1/2] aubdump: Fix GTT setup for Gen8+ Francisco Jerez
2016-11-01 21:50 ` [PATCH 2/2] aubdump: Bump GTT size to 128MB Francisco Jerez

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.