public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] i915/gen9_exec_parse: Check parsing of large objects
@ 2020-09-28 22:00 Chris Wilson
  2020-09-29  9:14 ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2020-09-28 22:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Simply check that we support parsing of batches as large as the uAPI
allows.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 tests/i915/gen9_exec_parse.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
index 8cd82f568..db291d17b 100644
--- a/tests/i915/gen9_exec_parse.c
+++ b/tests/i915/gen9_exec_parse.c
@@ -566,6 +566,30 @@ static void test_bb_start(const int i915, const uint32_t handle, int test)
 	gem_close(i915, target_bo);
 }
 
+static void test_bb_large(int i915)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	uint32_t size = (1ull << 32) - 4096;
+	struct drm_i915_gem_exec_object2 obj = {
+		.handle = gem_create(i915, size),
+	};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&obj),
+		.buffer_count = 1,
+		.flags = I915_EXEC_BLT,
+	};
+
+	intel_require_memory(2, size, CHECK_RAM);
+
+	gem_write(i915, obj.handle, size - 64, &bbe, sizeof(bbe));
+	igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
+
+	execbuf.batch_start_offset = size - 64;
+	igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
+
+	gem_close(i915, obj.handle);
+}
+
 static void test_bb_chained(const int i915, const uint32_t handle)
 {
 	const uint32_t batch[] = {
@@ -1053,6 +1077,9 @@ igt_main
 	igt_subtest("bb-start-far")
 		test_bb_start(i915, handle, BB_START_FAR);
 
+	igt_subtest("bb-large")
+		test_bb_large(i915);
+
 	igt_fixture {
 		igt_stop_hang_detector();
 		gem_close(i915, handle);
-- 
2.28.0

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

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

* [Intel-gfx] [PATCH i-g-t v2] i915/gen9_exec_parse: Check parsing of large objects
  2020-09-28 22:00 [Intel-gfx] [PATCH i-g-t] i915/gen9_exec_parse: Check parsing of large objects Chris Wilson
@ 2020-09-29  9:14 ` Chris Wilson
  2020-09-29 13:19   ` Mika Kuoppala
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2020-09-29  9:14 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Chris Wilson

Simply check that we support parsing of batches as large as the uAPI
allows.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
Try a few intermediate object sizes since CI machines do not have enough
memory to reach the upper bounds of the uAPI.
---
 tests/i915/gen9_exec_parse.c | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
index 8cd82f568..f735e7e1c 100644
--- a/tests/i915/gen9_exec_parse.c
+++ b/tests/i915/gen9_exec_parse.c
@@ -566,6 +566,50 @@ static void test_bb_start(const int i915, const uint32_t handle, int test)
 	gem_close(i915, target_bo);
 }
 
+static void test_bb_large(int i915)
+{
+	const uint32_t bbe = MI_BATCH_BUFFER_END;
+	static const uint32_t sizes[] = {
+		(1ull << 30) - 4096,
+		(1ull << 30) + 4096,
+		(2ull << 30) - 4096,
+		(2ull << 30) + 4096,
+		(3ull << 30) - 4096,
+		(3ull << 30) + 4096,
+		(4ull << 30) - 4096,
+	};
+	struct drm_i915_gem_exec_object2 obj = {};
+	struct drm_i915_gem_execbuffer2 execbuf = {
+		.buffers_ptr = to_user_pointer(&obj),
+		.buffer_count = 1,
+		.flags = I915_EXEC_BLT,
+	};
+	uint64_t required, total;
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(sizes); i++) {
+		if (!__intel_check_memory(2, sizes[i], CHECK_RAM,
+					  &required, &total))
+			break;
+
+		igt_debug("Using object size %#x\n", sizes[i]);
+		obj.handle = gem_create(i915, sizes[i]),
+		gem_write(i915, obj.handle, sizes[i] - 64, &bbe, sizeof(bbe));
+
+		execbuf.batch_start_offset = 0;
+		igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
+
+		execbuf.batch_start_offset = sizes[i] - 64;
+		igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
+
+		gem_close(i915, obj.handle);
+	}
+
+	igt_require_f(i > 0 && sizes[i - 1] > 1ull << 31,
+		      "Insufficient free memory, require at least %'"PRIu64"MiB but only have %'"PRIu64"MiB available",
+		      required >> 20, total >> 20);
+}
+
 static void test_bb_chained(const int i915, const uint32_t handle)
 {
 	const uint32_t batch[] = {
@@ -1053,6 +1097,9 @@ igt_main
 	igt_subtest("bb-start-far")
 		test_bb_start(i915, handle, BB_START_FAR);
 
+	igt_subtest("bb-large")
+		test_bb_large(i915);
+
 	igt_fixture {
 		igt_stop_hang_detector();
 		gem_close(i915, handle);
-- 
2.28.0

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

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

* Re: [Intel-gfx] [PATCH i-g-t v2] i915/gen9_exec_parse: Check parsing of large objects
  2020-09-29  9:14 ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
@ 2020-09-29 13:19   ` Mika Kuoppala
  0 siblings, 0 replies; 3+ messages in thread
From: Mika Kuoppala @ 2020-09-29 13:19 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev, Chris Wilson

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Simply check that we support parsing of batches as large as the uAPI
> allows.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
> Try a few intermediate object sizes since CI machines do not have enough
> memory to reach the upper bounds of the uAPI.
> ---
>  tests/i915/gen9_exec_parse.c | 47 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
>
> diff --git a/tests/i915/gen9_exec_parse.c b/tests/i915/gen9_exec_parse.c
> index 8cd82f568..f735e7e1c 100644
> --- a/tests/i915/gen9_exec_parse.c
> +++ b/tests/i915/gen9_exec_parse.c
> @@ -566,6 +566,50 @@ static void test_bb_start(const int i915, const uint32_t handle, int test)
>  	gem_close(i915, target_bo);
>  }
>  
> +static void test_bb_large(int i915)
> +{
> +	const uint32_t bbe = MI_BATCH_BUFFER_END;
> +	static const uint32_t sizes[] = {
> +		(1ull << 30) - 4096,
> +		(1ull << 30) + 4096,
> +		(2ull << 30) - 4096,
> +		(2ull << 30) + 4096,
> +		(3ull << 30) - 4096,
> +		(3ull << 30) + 4096,
> +		(4ull << 30) - 4096,
> +	};
> +	struct drm_i915_gem_exec_object2 obj = {};
> +	struct drm_i915_gem_execbuffer2 execbuf = {
> +		.buffers_ptr = to_user_pointer(&obj),
> +		.buffer_count = 1,
> +		.flags = I915_EXEC_BLT,
> +	};
> +	uint64_t required, total;
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(sizes); i++) {
> +		if (!__intel_check_memory(2, sizes[i], CHECK_RAM,
> +					  &required, &total))
> +			break;
> +
> +		igt_debug("Using object size %#x\n", sizes[i]);
> +		obj.handle = gem_create(i915, sizes[i]),
> +		gem_write(i915, obj.handle, sizes[i] - 64, &bbe, sizeof(bbe));
> +
> +		execbuf.batch_start_offset = 0;
> +		igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
> +
> +		execbuf.batch_start_offset = sizes[i] - 64;
> +		igt_assert_eq(__checked_execbuf(i915, &execbuf), 0);
> +
> +		gem_close(i915, obj.handle);
> +	}
> +
> +	igt_require_f(i > 0 && sizes[i - 1] > 1ull << 31,
> +		      "Insufficient free memory, require at least %'"PRIu64"MiB but only have %'"PRIu64"MiB available",
> +		      required >> 20, total >> 20);
> +}
> +
>  static void test_bb_chained(const int i915, const uint32_t handle)
>  {
>  	const uint32_t batch[] = {
> @@ -1053,6 +1097,9 @@ igt_main
>  	igt_subtest("bb-start-far")
>  		test_bb_start(i915, handle, BB_START_FAR);
>  
> +	igt_subtest("bb-large")
> +		test_bb_large(i915);
> +
>  	igt_fixture {
>  		igt_stop_hang_detector();
>  		gem_close(i915, handle);
> -- 
> 2.28.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2020-09-29 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 22:00 [Intel-gfx] [PATCH i-g-t] i915/gen9_exec_parse: Check parsing of large objects Chris Wilson
2020-09-29  9:14 ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
2020-09-29 13:19   ` Mika Kuoppala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox