[PATCH i-g-t v6 10/12] benchmarks/kms_fb_stress: Create a benchmark for primary plane formats

Arthur Grillo arthurgrillo at riseup.net
Fri Sep 13 00:39:34 UTC 2024


Create an benchmark that tests the performance of each supported format
for the primary plane.

Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
---
 benchmarks/kms_fb_stress.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/benchmarks/kms_fb_stress.c b/benchmarks/kms_fb_stress.c
index 0adb296304fa..57df3ae2bac9 100644
--- a/benchmarks/kms_fb_stress.c
+++ b/benchmarks/kms_fb_stress.c
@@ -324,6 +324,26 @@ igt_main
 		stress_driver(&data);
 	}
 
+	igt_subtest("primary-plane") {
+		data.kms.primary.enable = true;
+		data.kms.overlay_a.enable = false;
+		data.kms.overlay_b.enable = false;
+		data.kms.writeback.enable = false;
+
+		for (size_t i = 0; i < data.kms.primary.base->format_mod_count; i++) {
+			data.kms.primary.format = data.kms.primary.base->formats[i];
+
+			if (!igt_fb_supported_format(data.kms.primary.format)) {
+				igt_warn("Format 0x%x(%.4s) is not supported by IGT\n",
+					 data.kms.primary.format,
+					 (char *)&data.kms.primary.format);
+				continue;
+			}
+
+			stress_driver(&data);
+		}
+	}
+
 	igt_fixture {
 		igt_display_fini(&data.display);
 		drm_close_driver(data.fd);

-- 
2.46.0



More information about the igt-dev mailing list