Skip to contentSkip to conversation

VC4 load tracker testing

RFC PATCH New Paul Kocialkowski 2 participants 7 messages Feb 6, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover VC4 load tracker testing

This series introduces helpers and a simple test (with three subtests) for testing the VC4 load tracker. See the final commit message for more details about the test.

This series is posted as RFC since the kernel piece are still under review. It allows testing the series with IGT in the meantime (and was used for testing the kernel side).

The two preliminary patches were already sent as part of another series and are included so that CI can attempt to build the whole series.

Changes since RFC v1:
* Split sub-tests into underrun-detection and bandwidth-detection;
* Updated preliminary patches;
* Rebased to latest upstream master;
* Dropped autotools support.

Cheers,

Paul

Paul Kocialkowski (4):
lib/igt_kms: Add helpers to count and iterate planes from pipe lib/igt_kms: Add helpers to count and iterate planes from output lib/igt_vc4: Add helpers for underrun count and load tracker state
tests: Add VC4 load tracker tests

 lib/igt_kms.c            |  84 +++++++++++++
 lib/igt_kms.h            |   6 +
 lib/igt_vc4.c            |  32 +++++
 lib/igt_vc4.h            |   6 +
 tests/meson.build        |   1 +
 tests/vc4_load_tracker.c | 254 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 383 insertions(+)
 create mode 100644 tests/vc4_load_tracker.c
Signature · 6 lines
2.20.1

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

RFC PATCH v2 1/4 lib/igt_kms: Add helpers to count and iterate planes from pipe

This introduces helpers that allow counting how many planes of a given type are present from a pipe and getting the n-th plane of a given type.

---
 lib/igt_kms.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  3 +++
 2 files changed, 51 insertions(+)
lib/igt_kms.c +48 -0
index 85a911e11060..88a16c81caa3 100644
@@ -2279,6 +2279,54 @@ igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type)
 	return &pipe->planes[plane_idx];
 }
 
+/**
+ * igt_pipe_count_plane_type:
+ * @pipe: Target pipe
+ * @plane_type: Cursor, primary or an overlay plane
+ *
+ * Counts the number of planes of type @plane_type for the provided @pipe.
+ *
+ * Returns: The number of planes that match the requested plane type
+ */
+int igt_pipe_count_plane_type(igt_pipe_t *pipe, int plane_type)
+{
+	int i, count = 0;
+
+	for(i = 0; i < pipe->n_planes; i++)
+		if (pipe->planes[i].type == plane_type)
+			count++;
+
+	return count;
+}
+
+/**
+ * igt_pipe_get_plane_type_index:
+ * @pipe: Target pipe
+ * @plane_type: Cursor, primary or an overlay plane
+ * @index: the index of the plane among planes of the same type
+ *
+ * Get the @index th plane of type @plane_type for the provided @pipe.
+ *
+ * Returns: The @index th plane that matches the requested plane type
+ */
+igt_plane_t *igt_pipe_get_plane_type_index(igt_pipe_t *pipe, int plane_type,
+					   int index)
+{
+	int i, type_index = 0;
+
+	for(i = 0; i < pipe->n_planes; i++) {
+		if (pipe->planes[i].type != plane_type)
+			continue;
+
+		if (type_index == index)
+			return &pipe->planes[i];
+
+		type_index++;
+	}
+
+	return NULL;
+}
+
 static bool output_is_internal_panel(igt_output_t *output)
 {
 	switch (output->config.connector->connector_type) {
lib/igt_kms.h +3 -0
index 679d4e84fab8..3b3cf659035b 100644
@@ -407,6 +407,9 @@ igt_output_t *igt_output_from_connector(igt_display_t *display,
     drmModeConnector *connector);
 
 igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type);
+int igt_pipe_count_plane_type(igt_pipe_t *pipe, int plane_type);
+igt_plane_t *igt_pipe_get_plane_type_index(igt_pipe_t *pipe, int plane_type,
+					   int index);
 igt_output_t *igt_get_single_output_for_pipe(igt_display_t *display, enum pipe pipe);
 
 void igt_pipe_request_out_fence(igt_pipe_t *pipe);
Signature · 6 lines
2.20.1

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

RFC PATCH v2 2/4 lib/igt_kms: Add helpers to count and iterate planes from output

In reply to Paul Kocialkowski

With helpers to count and iterate among planes of a given type from the pipe in place, we can use them with the current pipe for the output to make it possible for tests to use them (the pipe struct is not currently easily exposed to tests and exposing it adds unnecessary complexity).

---
 lib/igt_kms.c | 36 ++++++++++++++++++++++++++++++++++++
 lib/igt_kms.h |  3 +++
 2 files changed, 39 insertions(+)
lib/igt_kms.c +36 -0
index 88a16c81caa3..1cab9e80d52a 100644
@@ -3720,6 +3720,42 @@ igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int plane_type)
 	return igt_pipe_get_plane_type(pipe, plane_type);
 }
 
+/**
+ * igt_output_count_plane_type:
+ * @output: Target output
+ * @plane_type: Cursor, primary or an overlay plane
+ *
+ * Counts the number of planes of type @plane_type for the provided @output.
+ *
+ * Returns: The number of planes that match the requested plane type
+ */
+int igt_output_count_plane_type(igt_output_t *output, int plane_type)
+{
+	igt_pipe_t *pipe = igt_output_get_driving_pipe(output);
+	igt_assert(pipe);
+
+	return igt_pipe_count_plane_type(pipe, plane_type);
+}
+
+/**
+ * igt_output_get_plane_type_index:
+ * @output: Target output
+ * @plane_type: Cursor, primary or an overlay plane
+ * @index: the index of the plane among planes of the same type
+ *
+ * Get the @index th plane of type @plane_type for the provided @output.
+ *
+ * Returns: The @index th plane that matches the requested plane type
+ */
+igt_plane_t *igt_output_get_plane_type_index(igt_output_t *output,
+					     int plane_type, int index)
+{
+	igt_pipe_t *pipe = igt_output_get_driving_pipe(output);
+	igt_assert(pipe);
+
+	return igt_pipe_get_plane_type_index(pipe, plane_type, index);
+}
+
 /**
  * igt_plane_set_fb:
  * @plane: Plane
lib/igt_kms.h +3 -0
index 3b3cf659035b..727ac2d186ed 100644
@@ -403,6 +403,9 @@ void igt_output_override_mode(igt_output_t *output, drmModeModeInfo *mode);
 void igt_output_set_pipe(igt_output_t *output, enum pipe pipe);
 igt_plane_t *igt_output_get_plane(igt_output_t *output, int plane_idx);
 igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int plane_type);
+int igt_output_count_plane_type(igt_output_t *output, int plane_type);
+igt_plane_t *igt_output_get_plane_type_index(igt_output_t *output,
+					     int plane_type, int index);
 igt_output_t *igt_output_from_connector(igt_display_t *display,
     drmModeConnector *connector);
 
Signature · 6 lines
2.20.1

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

RFC PATCH v2 3/4 lib/igt_vc4: Add helpers for underrun count and load tracker state

In reply to Paul Kocialkowski

Introduce new helpers that allow getting the current underrun count from debugfs and getting/setting the enabled state of the load tracker.

---
 lib/igt_vc4.c | 32 ++++++++++++++++++++++++++++++++
 lib/igt_vc4.h |  6 ++++++
 2 files changed, 38 insertions(+)
lib/igt_vc4.c +32 -0
index 16dfe67a44b1..1e2c2e636509 100644
@@ -34,6 +34,7 @@
 #include "drmtest.h"
 #include "igt_aux.h"
 #include "igt_core.h"
+#include "igt_sysfs.h"
 #include "igt_vc4.h"
 #include "ioctl_wrappers.h"
 #include "intel_reg.h"
@@ -176,3 +177,34 @@ bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable)
 
 	return arg.retained;
 }
+
+int igt_vc4_get_underrun_count(int debugfs)
+{
+	int underrun_count;
+	char *underrun = igt_sysfs_get(debugfs, VC4_UNDERRUN_DEBUGFS);
+
+	igt_assert(underrun);
+
+	underrun_count = atoi(underrun);
+	free(underrun);
+
+	return underrun_count;
+}
+
+void igt_vc4_set_load_tracker(int debugfs, bool enable)
+{
+	igt_sysfs_set(debugfs, VC4_LOAD_TRACKER_DEBUGFS, enable ? "Y" : "N");
+}
+
+bool igt_vc4_get_load_tracker(int debugfs)
+{
+	bool enabled;
+	char *load_tracker = igt_sysfs_get(debugfs, VC4_LOAD_TRACKER_DEBUGFS);
+
+	igt_assert(load_tracker);
+
+	enabled = (load_tracker[0] == 'Y');
+	free(load_tracker);
+
+	return enabled;
+}
lib/igt_vc4.h +6 -0
index ebc8a3881b5e..0f7dba6b25e6 100644
@@ -24,6 +24,9 @@
 #ifndef IGT_VC4_H
 #define IGT_VC4_H
 
+#define VC4_LOAD_TRACKER_DEBUGFS	"hvs_load_tracker"
+#define VC4_UNDERRUN_DEBUGFS		"hvs_underrun"
+
 uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
 int igt_vc4_create_bo(int fd, size_t size);
 void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
@@ -32,5 +35,8 @@ bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable);
 
 void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier);
 uint64_t igt_vc4_get_tiling(int fd, uint32_t handle);
+int igt_vc4_get_underrun_count(int debugfs);
+void igt_vc4_set_load_tracker(int debugfs, bool enable);
+bool igt_vc4_get_load_tracker(int debugfs);
 
 #endif /* IGT_VC4_H */
Signature · 6 lines
2.20.1

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

RFC PATCH v2 4/4 tests: Add VC4 load tracker tests

In reply to Paul Kocialkowski

This introduces new tests for the VC4 load tracking mechanism, that will attempt to add "as many planes as possibles" in the mode resolution. The associated sub-tests are the following:
- bandwidth-detection: checks that bandwidth limitation is detected;
- underrun-detection: checks that hardware underruns are detected;
- consistency: checks that bandwidth and underrun reports are consistent;

---
 tests/meson.build        |   1 +
 tests/vc4_load_tracker.c | 254 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 255 insertions(+)
 create mode 100644 tests/vc4_load_tracker.c
tests/meson.build +1 -0
index 0f12df26d9fb..beff2568cf78 100644
@@ -86,6 +86,7 @@ test_progs = [
 	'vc4_create_bo',
 	'vc4_dmabuf_poll',
 	'vc4_label_bo',
+	'vc4_load_tracker',
 	'vc4_lookup_fail',
 	'vc4_purgeable_bo',
 	'vc4_tiling',
tests/vc4_load_tracker.c new file +254 -0

254 lines not on this page · raw message

Signature · 6 lines
2.20.1

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

[igt-dev] ✓ Fi.CI.BAT: success for VC4 load tracker testing (rev3)

In reply to Paul Kocialkowski
== Series Details ==

== Series Details ==

Series: VC4 load tracker testing (rev3)
URL : https://patchwork.freedesktop.org/series/54887/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5551 -> IGTPW_2348
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/54887/revisions/3/mbox/

Known issues
------------

Here are the changes found in IGTPW_2348 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live_execlists:
- fi-apl-guc: PASS -> INCOMPLETE [fdo#103927]

* igt@kms_busy@basic-flip-b:
- fi-gdg-551: PASS -> FAIL [fdo#103182]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: FAIL [fdo#109485] -> PASS

* igt@pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: {SKIP} [fdo#109271] -> PASS

* igt@pm_rpm@basic-rte:
- fi-bsw-kefka: FAIL [fdo#108800] -> PASS

* igt@pm_rpm@module-reload:
- {fi-icl-y}: DMESG-FAIL [fdo#109513] -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#109513]: https://bugs.freedesktop.org/show_bug.cgi?id=109513

Participating hosts (48 -> 46)
------------------------------

Additional (1): fi-ivb-3770
Missing (3): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan

Build changes
-------------

* IGT: IGT_4812 -> IGTPW_2348

CI_DRM_5551: 417d0e0cd0275705aed001d938e646879ee5afe9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2348: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2348/
IGT_4812: 592b854fead32c2b0dac7198edfb9a6bffd66932 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@vc4_load_tracker@bandwidth-detection
+igt@vc4_load_tracker@consistency
+igt@vc4_load_tracker@underrun-detection

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2348/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#6 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for VC4 load tracker testing (rev3)

In reply to Paul Kocialkowski
== Series Details ==

== Series Details ==

Series: VC4 load tracker testing (rev3)
URL : https://patchwork.freedesktop.org/series/54887/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5551_full -> IGTPW_2348_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/54887/revisions/3/mbox/

Known issues
------------

Here are the changes found in IGTPW_2348_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_schedule@pi-ringfull-render:
- shard-glk: NOTRUN -> FAIL [fdo#103158]

* igt@gem_mmap_gtt@hang:
- shard-glk: PASS -> FAIL [fdo#109469]

* igt@kms_color@pipe-b-ctm-max:
- shard-apl: PASS -> FAIL [fdo#108147]
- shard-kbl: PASS -> FAIL [fdo#108147]

* igt@kms_cursor_crc@cursor-128x128-onscreen:
- shard-kbl: PASS -> FAIL [fdo#103232] +1

* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-hsw: PASS -> INCOMPLETE [fdo#103540]

* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: PASS -> FAIL [fdo#103232] +3

* igt@kms_flip@2x-plain-flip-fb-recreate:
- shard-glk: PASS -> FAIL [fdo#100368]

* igt@kms_flip@modeset-vs-vblank-race:
- shard-glk: PASS -> FAIL [fdo#103060]

* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-wc:
- shard-glk: PASS -> FAIL [fdo#103167] +2

* igt@kms_frontbuffer_tracking@fbc-1p-rte:
- shard-kbl: PASS -> DMESG-FAIL [fdo#103167] / [fdo#103558] / [fdo#105602]
- shard-apl: PASS -> FAIL [fdo#103167] / [fdo#105682]

* igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
- shard-glk: PASS -> FAIL [fdo#108145] +1

* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-kbl: PASS -> FAIL [fdo#103166]

* igt@kms_plane_multiple@atomic-pipe-c-tiling-x:
- shard-glk: PASS -> FAIL [fdo#103166] +3

* igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
- shard-apl: PASS -> FAIL [fdo#103166] +6

#### Possible fixes ####

* igt@kms_color@pipe-a-degamma:
- shard-apl: FAIL [fdo#104782] / [fdo#108145] -> PASS
- shard-kbl: FAIL [fdo#104782] / [fdo#108145] -> PASS

* igt@kms_cursor_crc@cursor-128x128-dpms:
- shard-kbl: FAIL [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-256x85-random:
- shard-apl: FAIL [fdo#103232] -> PASS +5
- shard-glk: FAIL [fdo#103232] -> PASS +2

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS
- shard-kbl: FAIL [fdo#103191] / [fdo#103232] -> PASS

* igt@kms_cursor_crc@cursor-alpha-opaque:
- shard-glk: FAIL [fdo#109350] -> PASS

* igt@kms_cursor_legacy@cursor-vs-flip-atomic:
- shard-hsw: FAIL [fdo#103355] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
- shard-apl: FAIL [fdo#103167] -> PASS
- shard-kbl: FAIL [fdo#103167] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-glk: FAIL [fdo#103167] -> PASS +3

* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-apl: FAIL [fdo#108948] -> PASS

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-glk: FAIL [fdo#103166] -> PASS +1
- shard-kbl: FAIL [fdo#103166] -> PASS

* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: DMESG-FAIL [fdo#105763] -> PASS

* igt@kms_setmode@basic:
- shard-hsw: FAIL [fdo#99912] -> PASS

* igt@kms_universal_plane@universal-plane-pipe-a-functional:
- shard-apl: FAIL [fdo#103166] -> PASS

* igt@pm_rpm@system-suspend:
- shard-kbl: INCOMPLETE [fdo#103665] / [fdo#107807] -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#100368]: https://bugs.freedesktop.org/show_bug.cgi?id=100368
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[fdo#103158]: https://bugs.freedesktop.org/show_bug.cgi?id=103158
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108147]: https://bugs.freedesktop.org/show_bug.cgi?id=108147
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
[fdo#109469]: https://bugs.freedesktop.org/show_bug.cgi?id=109469
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (6 -> 4)
------------------------------

Missing (2): shard-skl shard-iclb

Build changes
-------------

* IGT: IGT_4812 -> IGTPW_2348
* Piglit: piglit_4509 -> None

CI_DRM_5551: 417d0e0cd0275705aed001d938e646879ee5afe9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2348: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2348/
IGT_4812: 592b854fead32c2b0dac7198edfb9a6bffd66932 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2348/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev