Skip to contentSkip to conversation

lib/igt_kms: Dump mode picture aspect ratio

PATCH Superseded Ville Syrjala 3 participants 5 messages Jun 20, 2019 – Jun 24, 2019 Library code

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/igt_kms: Dump mode picture aspect ratio

From: Ville Syrjälä <[email protected]>

Include the mode picture aspect ratio in kmstest_dump_mode().

---
 lib/igt_kms.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
lib/igt_kms.c +23 -2
index da188a394cd6..dc8992cb043b 100644
@@ -595,6 +595,24 @@ static const char *mode_stereo_name(const drmModeModeInfo *mode)
 	}
 }
 
+static const char *mode_picture_aspect_name(const drmModeModeInfo *mode)
+{
+	switch (mode->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
+	case DRM_MODE_FLAG_PIC_AR_NONE:
+		return NULL;
+	case DRM_MODE_FLAG_PIC_AR_4_3:
+		return "4:3";
+	case DRM_MODE_FLAG_PIC_AR_16_9:
+		return "16:9";
+	case DRM_MODE_FLAG_PIC_AR_64_27:
+		return "64:27";
+	case DRM_MODE_FLAG_PIC_AR_256_135:
+		return "256:135";
+	default:
+		return "invalid";
+	}
+}
+
 /**
  * kmstest_dump_mode:
  * @mode: libdrm mode structure
@@ -604,8 +622,9 @@ static const char *mode_stereo_name(const drmModeModeInfo *mode)
 void kmstest_dump_mode(drmModeModeInfo *mode)
 {
 	const char *stereo = mode_stereo_name(mode);
+	const char *aspect = mode_picture_aspect_name(mode);
 
-	igt_info("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s\n",
+	igt_info("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s%s%s%s\n",
 		 mode->name, mode->vrefresh,
 		 mode->hdisplay, mode->hsync_start,
 		 mode->hsync_end, mode->htotal,
@@ -613,7 +632,9 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
 		 mode->vsync_end, mode->vtotal,
 		 mode->flags, mode->type, mode->clock,
 		 stereo ? " (3D:" : "",
-		 stereo ? stereo : "", stereo ? ")" : "");
+		 stereo ? stereo : "", stereo ? ")" : "",
+		 aspect ? " (PAR:" : "",
+		 aspect ? aspect : "", aspect ? ")" : "");
 }
 
 /**
Signature · 6 lines
2.21.0

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

PATCH 2/2 tests/testdisplay: Allow testing aspect ratios

From: Ville Syrjälä <[email protected]>

Add a new knob "-A" to enable the aspect ratio client cap and thus test modes with potentially different aspect ratios.

---
 tests/testdisplay.c | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)
tests/testdisplay.c +34 -4
index 32590547e9f8..2fdc0236984b 100644
@@ -80,7 +80,7 @@ struct termios saved_tio;
 drmModeRes *resources;
 int drm_fd, modes;
 int test_all_modes = 0, test_preferred_mode = 0, force_mode = 0, test_plane,
-    test_stereo_modes;
+    test_stereo_modes, test_aspect_ratio;
 uint64_t tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 int sleep_between_modes = 0;
 int do_dpms = 0; /* This aliases to DPMS_ON */
@@ -248,6 +248,24 @@ static void paint_image(cairo_t *cr, const char *file)
 	igt_paint_image(cr, file, img_x, img_y, img_h, img_w);
 }
 
+static const char *picture_aspect_ratio_str(uint32_t flags)
+{
+	switch (flags & DRM_MODE_FLAG_PIC_AR_MASK) {
+	case DRM_MODE_FLAG_PIC_AR_NONE:
+		return "";
+	case DRM_MODE_FLAG_PIC_AR_4_3:
+		return "(4:3) ";
+	case DRM_MODE_FLAG_PIC_AR_16_9:
+		return "(16:9) ";
+	case DRM_MODE_FLAG_PIC_AR_64_27:
+		return "(64:27) ";
+	case DRM_MODE_FLAG_PIC_AR_256_135:
+		return "(256:135) ";
+	default:
+		return "(invalid) ";
+	}
+}
+
 static void paint_output_info(struct connector *c, struct igt_fb *fb)
 {
 	cairo_t *cr = igt_get_cairo_ctx(drm_fd, fb);
@@ -288,8 +306,10 @@ static void paint_output_info(struct connector *c, struct igt_fb *fb)
 			cairo_move_to(cr, x, top_y);
 		}
 		str_width = igt_cairo_printf_line(cr, align_right, 10,
-			"%s @ %dHz", c->connector->modes[i].name,
-			 c->connector->modes[i].vrefresh);
+						  "%s%s @ %dHz",
+						  picture_aspect_ratio_str(c->connector->modes[i].flags),
+						  c->connector->modes[i].name,
+						  c->connector->modes[i].vrefresh);
 		if (str_width > max_width)
 			max_width = str_width;
 	}
@@ -573,7 +593,7 @@ static void set_termio_mode(void)
 	tcsetattr(tio_fd, TCSANOW, &tio);
 }
 
-static char optstr[] = "3iaf:s:d:p:mrto:j:y";
+static char optstr[] = "3Aiaf:s:d:p:mrto:j:y";
 static struct option long_opts[] = {
 	{"yb", 0, 0, OPT_YB},
 	{"yf", 0, 0, OPT_YF},
@@ -588,6 +608,7 @@ static const char *help_str =
 	"  -p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n"
 	"  -m\ttest the preferred mode\n"
 	"  -3\ttest all 3D modes\n"
+	"  -A\ttest all aspect ratios\n"
 	"  -t\tuse an X-tiled framebuffer\n"
 	"  -y, --yb\n"
 	"  \tuse a Y-tiled framebuffer\n"
@@ -609,6 +630,9 @@ static int opt_handler(int opt, int opt_index, void *data)
 	case '3':
 		test_stereo_modes = 1;
 		break;
+	case 'A':
+		test_aspect_ratio = 1;
+		break;
 	case 'i':
 		opt_dump_info = true;
 		break;
@@ -697,6 +721,12 @@ igt_simple_main_args(optstr, long_opts, help_str, opt_handler, NULL)
 		goto out_close;
 	}
 
+	if (test_aspect_ratio &&
+	    drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1) < 0) {
+		igt_warn("DRM_CLIENT_CAP_ASPECT_RATIO failed\n");
+		goto out_close;
+	}
+
 	if (opt_dump_info) {
 		dump_info();
 		goto out_close;
Signature · 6 lines
2.21.0

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

Re: [igt-dev] [PATCH i-g-t 2/2] tests/testdisplay: Allow testing aspect ratios

Quoted 6 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Add a new knob "-A" to enable the aspect ratio client cap and thus test modes with potentially different aspect ratios.

This also LGTM.

Quoted 85 lines
---
 tests/testdisplay.c | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)
tests/testdisplay.c +28 -4
index 32590547e9f8..2fdc0236984b 100644
@@ -80,7 +80,7 @@ struct termios saved_tio;
 drmModeRes *resources;
 int drm_fd, modes;
 int test_all_modes = 0, test_preferred_mode = 0, force_mode = 0, test_plane,
-    test_stereo_modes;
+    test_stereo_modes, test_aspect_ratio;
 uint64_t tiling = LOCAL_DRM_FORMAT_MOD_NONE;
 int sleep_between_modes = 0;
 int do_dpms = 0; /* This aliases to DPMS_ON */
@@ -248,6 +248,24 @@ static void paint_image(cairo_t *cr, const char *file)
 	igt_paint_image(cr, file, img_x, img_y, img_h, img_w);
 }
 
+static const char *picture_aspect_ratio_str(uint32_t flags)
+{
+	switch (flags & DRM_MODE_FLAG_PIC_AR_MASK) {
+	case DRM_MODE_FLAG_PIC_AR_NONE:
+		return "";
+	case DRM_MODE_FLAG_PIC_AR_4_3:
+		return "(4:3) ";
+	case DRM_MODE_FLAG_PIC_AR_16_9:
+		return "(16:9) ";
+	case DRM_MODE_FLAG_PIC_AR_64_27:
+		return "(64:27) ";
+	case DRM_MODE_FLAG_PIC_AR_256_135:
+		return "(256:135) ";
+	default:
+		return "(invalid) ";
+	}
+}
+
 static void paint_output_info(struct connector *c, struct igt_fb *fb)
 {
 	cairo_t *cr = igt_get_cairo_ctx(drm_fd, fb);
@@ -288,8 +306,10 @@ static void paint_output_info(struct connector *c, struct igt_fb *fb)
 			cairo_move_to(cr, x, top_y);
 		}
 		str_width = igt_cairo_printf_line(cr, align_right, 10,
-			"%s @ %dHz", c->connector->modes[i].name,
-			 c->connector->modes[i].vrefresh);
+						  "%s%s @ %dHz",
+						  picture_aspect_ratio_str(c->connector->modes[i].flags),
+						  c->connector->modes[i].name,
+						  c->connector->modes[i].vrefresh);
 		if (str_width > max_width)
 			max_width = str_width;
 	}
@@ -573,7 +593,7 @@ static void set_termio_mode(void)
 	tcsetattr(tio_fd, TCSANOW, &tio);
 }
 
-static char optstr[] = "3iaf:s:d:p:mrto:j:y";
+static char optstr[] = "3Aiaf:s:d:p:mrto:j:y";
 static struct option long_opts[] = {
 	{"yb", 0, 0, OPT_YB},
 	{"yf", 0, 0, OPT_YF},
@@ -588,6 +608,7 @@ static const char *help_str =
 	"  -p\t<planew,h>,<crtcx,y>,<crtcw,h> test overlay plane\n"
 	"  -m\ttest the preferred mode\n"
 	"  -3\ttest all 3D modes\n"
+	"  -A\ttest all aspect ratios\n"
 	"  -t\tuse an X-tiled framebuffer\n"
 	"  -y, --yb\n"
 	"  \tuse a Y-tiled framebuffer\n"
@@ -609,6 +630,9 @@ static int opt_handler(int opt, int opt_index, void *data)
 	case '3':
 		test_stereo_modes = 1;
 		break;
+	case 'A':
+		test_aspect_ratio = 1;
+		break;
 	case 'i':
 		opt_dump_info = true;
 		break;
@@ -697,6 +721,12 @@ igt_simple_main_args(optstr, long_opts, help_str, opt_handler, NULL)
 		goto out_close;
 	}

tests/testdisplay.c igt_simple_main_args(optstr, long_opts, help_str, opt_handler, NULL) · line 732

Quoted 10 lines
tests/testdisplay.c +6 -0
 
+	if (test_aspect_ratio &&
+	    drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1) < 0) {
+		igt_warn("DRM_CLIENT_CAP_ASPECT_RATIO failed\n");
+		goto out_close;
+	}
+
 	if (opt_dump_info) {
 		dump_info();
 		goto out_close;

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

#3 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] lib/igt_kms: Dump mode picture aspect ratio

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/igt_kms: Dump mode picture aspect ratio
URL : https://patchwork.freedesktop.org/series/62469/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6314 -> IGTPW_3184
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_3184 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_3184, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/62469/revisions/1/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_3184:

### IGT changes ###

#### Possible regressions ####

* igt@i915_pm_rpm@module-reload:
- fi-skl-guc: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-skl-guc/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-skl-guc/igt@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3:
- fi-cfl-8109u: [PASS][3] -> [FAIL][4] ([fdo#103375])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-cfl-8109u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-cfl-8109u/igt@[email protected]
- fi-blb-e6850: [PASS][5] -> [INCOMPLETE][6] ([fdo#107718])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-blb-e6850/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-blb-e6850/igt@[email protected]

* igt@i915_pm_rpm@basic-rte:
- fi-icl-dsi: [PASS][7] -> [INCOMPLETE][8] ([fdo#107713] / [fdo#108840])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-icl-dsi/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-icl-dsi/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: [DMESG-FAIL][9] ([fdo#110235]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][11] ([fdo#109485]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-kbl-7500u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-kbl-7500u/igt@[email protected]

* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [DMESG-WARN][13] ([fdo#102614]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-hsw-peppy/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-hsw-peppy/igt@[email protected]
- fi-icl-u2: [FAIL][15] ([fdo#103167]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6314/fi-icl-u2/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/fi-icl-u2/igt@[email protected]

[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110235]: https://bugs.freedesktop.org/show_bug.cgi?id=110235

Participating hosts (51 -> 45)
------------------------------

Additional (1): fi-icl-u3
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus

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

* IGT: IGT_5064 -> IGTPW_3184

CI_DRM_6314: 1180972dbd2a00f60a4d707772bd7e7ae6732ed5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3184: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3184/
IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

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

Reviewed-by on v1 1/2
#4 lore raw
In reply to Ville Syrjala
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Include the mode picture aspect ratio in kmstest_dump_mode().

Quoted 45 lines
---
 lib/igt_kms.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
lib/igt_kms.c +20 -1
index da188a394cd6..dc8992cb043b 100644
@@ -595,6 +595,24 @@ static const char *mode_stereo_name(const drmModeModeInfo *mode)
 	}
 }
 
+static const char *mode_picture_aspect_name(const drmModeModeInfo *mode)
+{
+	switch (mode->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
+	case DRM_MODE_FLAG_PIC_AR_NONE:
+		return NULL;
+	case DRM_MODE_FLAG_PIC_AR_4_3:
+		return "4:3";
+	case DRM_MODE_FLAG_PIC_AR_16_9:
+		return "16:9";
+	case DRM_MODE_FLAG_PIC_AR_64_27:
+		return "64:27";
+	case DRM_MODE_FLAG_PIC_AR_256_135:
+		return "256:135";
+	default:
+		return "invalid";
+	}
+}
+
 /**
  * kmstest_dump_mode:
  * @mode: libdrm mode structure
@@ -604,8 +622,9 @@ static const char *mode_stereo_name(const drmModeModeInfo *mode)
 void kmstest_dump_mode(drmModeModeInfo *mode)
 {
 	const char *stereo = mode_stereo_name(mode);
+	const char *aspect = mode_picture_aspect_name(mode);
 
-	igt_info("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s\n",
+	igt_info("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s%s%s%s\n",
 		 mode->name, mode->vrefresh,
 		 mode->hdisplay, mode->hsync_start,
 		 mode->hsync_end, mode->htotal,

lib/igt_kms.c void kmstest_dump_mode(drmModeModeInfo *mode) · line 640

Quoted 10 lines
lib/igt_kms.c +3 -1
@@ -613,7 +632,9 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
 		 mode->vsync_end, mode->vtotal,
 		 mode->flags, mode->type, mode->clock,
 		 stereo ? " (3D:" : "",
-		 stereo ? stereo : "", stereo ? ")" : "");
+		 stereo ? stereo : "", stereo ? ")" : "",
+		 aspect ? " (PAR:" : "",
+		 aspect ? aspect : "", aspect ? ")" : "");
 }
 
 /**

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