[PATCH i-g-t v6 09/12] benchmarks/kms_fb_stress: Log the KMS structure
Arthur Grillo
arthurgrillo at riseup.net
Fri Sep 13 00:39:33 UTC 2024
In the future, the KMS structure could be dynamically changed. So, log
the KMS structure to the user.
Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
---
benchmarks/kms_fb_stress.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/benchmarks/kms_fb_stress.c b/benchmarks/kms_fb_stress.c
index 45e03f97919a..0adb296304fa 100644
--- a/benchmarks/kms_fb_stress.c
+++ b/benchmarks/kms_fb_stress.c
@@ -8,6 +8,9 @@
#define FRAME_COUNT 100
#define NUM_FBS 2
+#define RECT_FMT "%dx%d%+d%+d"
+#define RECT_ARG(r) (r)->width, (r)->height, (r)->x, (r)->y
+
struct rect_t {
int x, y;
int width, height;
@@ -150,6 +153,34 @@ static void stress_driver(struct data_t *data)
struct timespec then, now;
double elapsed;
+ igt_info("KMS structure:\n");
+ igt_info("\tCRTC:\n");
+ igt_info("\t\trectangle: " RECT_FMT "\n", RECT_ARG(&data->kms.crtc));
+
+ if (data->kms.primary.enable) {
+ igt_info("\tprimary:\n");
+ igt_info("\t\tformat: %s\n", igt_format_str(data->kms.primary.format));
+ igt_info("\t\trectangle: " RECT_FMT "\n", RECT_ARG(&data->kms.primary.rect));
+ }
+
+ if (data->kms.overlay_a.enable) {
+ igt_info("\toverlay A:\n");
+ igt_info("\t\tformat: %s\n", igt_format_str(data->kms.overlay_a.format));
+ igt_info("\t\trectangle: " RECT_FMT "\n", RECT_ARG(&data->kms.overlay_a.rect));
+ }
+
+ if (data->kms.overlay_b.enable) {
+ igt_info("\toverlay B:\n");
+ igt_info("\t\tformat: %s\n", igt_format_str(data->kms.overlay_b.format));
+ igt_info("\t\trectangle: " RECT_FMT "\n", RECT_ARG(&data->kms.overlay_b.rect));
+ }
+
+ if (data->kms.writeback.enable) {
+ igt_info("\twriteback:\n");
+ igt_info("\t\tformat: %s\n", igt_format_str(data->kms.writeback.format));
+ igt_info("\t\trectangle: " RECT_FMT "\n", RECT_ARG(&data->kms.writeback.rect));
+ }
+
gen_fbs(data);
igt_assert_eq(igt_gettime(&then), 0);
--
2.46.0
More information about the igt-dev
mailing list