Skip to contentSkip to conversation

Introduce i915 pipe stress test

PATCH Superseded Stanislav Lisovskiy 1 participant 4 messages Dec 12, 2019

Subsystems (2)

v15 of 16 Superseded Latest is v16 →

lore
Share & tools
lore
#0 lore raw

v15 cover Introduce i915 pipe stress test

From: "Lisovskiy, Stanislav" <[email protected]>

This test case will challenge hardware, by using as maximum display buffer/memory bandwidth as possible. To achieve that it runs some workload on each CPU core, also it runs some GPU load simultaneously, also uses kms to add as much planes as possible using highest possible mode.

Lisovskiy, Stanislav (2):
igt/lib: Check if query_info is null igt/lib: Use proper functions to gen11+ gpgpu_fill

Stanislav Lisovskiy (1):
igt/tests: kms_plane_stress: Add plane stress test

 lib/gpgpu_fill.c               |  54 +-
 lib/i915/intel_memory_region.c |   4 +
 tests/Makefile.sources         |   1 +
 tests/i915/i915_pipe_stress.c  | 885 +++++++++++++++++++++++++++++++++
 tests/meson.build              |   1 +
 5 files changed, 943 insertions(+), 2 deletions(-)
 create mode 100644 tests/i915/i915_pipe_stress.c
Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH v15 1/3 igt/lib: Check if query_info is null

From: "Lisovskiy, Stanislav" <[email protected]>

On TGL ocassionally got a crash, as query_info was 0, which caused crash. Don't know why it wasn't(or if it was) noticed else where.

Regardless of what's the reason probably checking is still better than crashing.

Change-Id Ia407e44592a6357126bad3ed0c5fcaed1bd365d6
---
 lib/i915/intel_memory_region.c | 4 ++++
 1 file changed, 4 insertions(+)
lib/i915/intel_memory_region.c +4 -0
index c3d9c814..c62ac6ad 100644
@@ -127,6 +127,10 @@ uint8_t gem_get_lmem_region_count(int fd)
 	uint8_t lmem_regions = 0;
 
 	query_info = gem_get_query_memory_regions(fd);
+
+	if (!query_info)
+		return 0;
+
 	num_regions = query_info->num_regions;
 
 	for (int i = 0; i < num_regions; i++) {
Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

PATCH v15 2/3 igt/lib: Use proper functions to gen11+ gpgpu_fill

In reply to Stanislav Lisovskiy

From: "Lisovskiy, Stanislav" <[email protected]>

gen11_fill_curbe_buffer_data and gen11_fill_interface_descriptor are there but for some reason gen12_gpgpu_fill still uses those from gen8, which seems to cause ocassional input/output error in gen7_render_flush.

Change-Id I99e6f65230d242235cf037a40e7def471eb097ac
---
 lib/gpgpu_fill.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 52 insertions(+), 2 deletions(-)
lib/gpgpu_fill.c +52 -2
index ec7204b8..15931782 100644
@@ -276,6 +276,56 @@ __gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 	intel_batchbuffer_reset(batch);
 }
 
+static void
+__gen11_gpgpu_fillfunc(struct intel_batchbuffer *batch,
+		      const struct igt_buf *dst,
+		      unsigned int x, unsigned int y,
+		      unsigned int width, unsigned int height,
+		      uint8_t color, const uint32_t kernel[][4],
+		      size_t kernel_size)
+{
+	uint32_t curbe_buffer, interface_descriptor;
+	uint32_t batch_end;
+
+	intel_batchbuffer_flush(batch);
+
+	/* setup states */
+	batch->ptr = &batch->buffer[BATCH_STATE_SPLIT];
+
+	/*
+	 * const buffer needs to fill for every thread, but as we have just 1
+	 * thread per every group, so need only one curbe data.
+	 * For each thread, just use thread group ID for buffer offset.
+	 */
+	curbe_buffer = gen11_fill_curbe_buffer_data(batch);
+
+	interface_descriptor = gen11_fill_interface_descriptor(batch, dst, dst,
+				kernel, kernel_size);
+
+	igt_assert(batch->ptr < &batch->buffer[4095]);
+
+	batch->ptr = batch->buffer;
+
+	/* GPGPU pipeline */
+	OUT_BATCH(GEN7_PIPELINE_SELECT | GEN9_PIPELINE_SELECTION_MASK |
+		  PIPELINE_SELECT_GPGPU);
+
+	gen9_emit_state_base_address(batch);
+	gen8_emit_vfe_state(batch, THREADS, GEN8_GPGPU_URB_ENTRIES,
+			    GPGPU_URB_SIZE, GPGPU_CURBE_SIZE);
+	gen7_emit_curbe_load(batch, curbe_buffer);
+	gen7_emit_interface_descriptor_load(batch, interface_descriptor);
+	gen8_emit_gpgpu_walk(batch, x, y, width, height);
+
+	OUT_BATCH(MI_BATCH_BUFFER_END);
+
+	batch_end = intel_batchbuffer_align(batch, 8);
+	igt_assert(batch_end < BATCH_STATE_SPLIT);
+
+	gen7_render_flush(batch, batch_end);
+	intel_batchbuffer_reset(batch);
+}
+
 void gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 			 const struct igt_buf *dst,
 			 unsigned int x, unsigned int y,
@@ -292,7 +342,7 @@ void gen11_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 			  unsigned int width, unsigned int height,
 			  uint8_t color)
 {
-	__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
+	__gen11_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
 			      gen11_gpgpu_kernel, sizeof(gen11_gpgpu_kernel));
 }
 void gen12p1_gpgpu_fillfunc(struct intel_batchbuffer *batch,
@@ -301,6 +351,6 @@ void gen12p1_gpgpu_fillfunc(struct intel_batchbuffer *batch,
 			  unsigned int width, unsigned int height,
 			  uint8_t color)
 {
-	__gen9_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
+	__gen11_gpgpu_fillfunc(batch, dst, x, y, width, height, color,
 			      gen12p1_gpgpu_kernel, sizeof(gen12p1_gpgpu_kernel));
 }
Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

PATCH v15 3/3 igt/tests: kms_plane_stress: Add plane stress test

In reply to Stanislav Lisovskiy

This test attempts to utilize all connected
outputs at the same time, using maximum possible
resolution and amount of planes, to check whether
we are hiting any kind of bandwidth, watermark or
other limitations.

v2: Added cpu and gpu load threads, which consume
additional bandwidth.

v3: Removed binary picture file, using pattern fb
instead.

v4: Moved FB creation/removal to better place.

v5: Fixed rebase conflict and changed "fb->tiling"

    to "fb->modifier".

v6: Removed unnecessary new macro for iterating on
pipes. Taken into use igt_gettime instead of clock_gettime.

v7: Put fb reinit into igt_fixture to avoid problems.
Move stress function under igt_subtest. Release planes, remove redundant commit, assert if no planes can be used.

v8: - Add blitting also, to have more fun
- Now using separate framebuffer per each plane.
- Fixed magic number for bpp value(now based on format)
- Some optimizations, like not applying same mode if it hasn't change, also don't do highest mode search on each iteration, just calculate once and use it.
- Some code refactoring: extracted some lengthy code to separate functions.
- Fixed wrong index for cursor FB(cursor FB is one per pipe)

v9:
- More helper functions(start/stop threads, test init)
- Now doing GPU work in pthreads also
- Do GPU work in a separate framebuffer(not displayed)

v10:
- Fix issue in main testing cycle, code refactoring
- Rebased

v11:
- Fixed issue with suspending/resuming GPU threads to get crc. Added num_rectangles to be able to customize number of gpgpu_fill calls.

v12:
- Removed unneeded shared fb functionality and gpu thread pause/resume.
- Now also using different formats for cursor fb.
- Removed unnecessary parameters for stress function.
- Changed plane_stress function name to pipe_stress(makes sense)
- Put gpgpu_walk x and y bug fix into separate patch.

v13:
- Added tests documentation.

v14:
- Start using igt_get_pipe_crc_current instead in order to analyze crc in a more efficient way.
- Now checking every frame
- Also now using for_each_connected_output for iterating on pipes.

v15:
- Code refactoring, extracted gpu fill into separate function.
- Renamed kms_plane_stress to i915_pipe_stress
- Moved to i915 specific folder, where it should be

Change-Id I79ad756685801abdc86edd9a83a03816399d4a8d
---
 tests/Makefile.sources        |   1 +
 tests/i915/i915_pipe_stress.c | 885 ++++++++++++++++++++++++++++++++++
 tests/meson.build             |   1 +
 3 files changed, 887 insertions(+)
 create mode 100644 tests/i915/i915_pipe_stress.c
tests/Makefile.sources +1 -0
index 549a350f..1f649ef9 100644
@@ -66,6 +66,7 @@ TESTS_progs = \
 	kms_plane_multiple \
 	kms_plane_scaling \
 	kms_prime \
+	kms_plane_stress \
 	kms_prop_blob \
 	kms_properties \
 	kms_psr \
tests/i915/i915_pipe_stress.c new file +885 -0

885 lines not on this page · raw message

tests/meson.build +1 -0
index e14c827a..7c3468d0 100644
@@ -230,6 +230,7 @@ i915_progs = [
 	'i915_fb_tiling',
 	'i915_getparams_basic',
 	'i915_hangman',
+	'i915_pipe_stress',
 	'i915_module_load',
 	'i915_pm_backlight',
 	'i915_pm_lpsp',
Signature · 6 lines
2.17.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev