public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/igt_kms: Dump mode picture aspect ratio
Date: Thu, 20 Jun 2019 18:58:29 +0300	[thread overview]
Message-ID: <20190620155830.20500-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Include the mode picture aspect ratio in kmstest_dump_mode().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index da188a394cd6..dc8992cb043b 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -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 ? ")" : "");
 }
 
 /**
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-06-20 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 15:58 Ville Syrjala [this message]
2019-06-20 15:58 ` [igt-dev] [PATCH i-g-t 2/2] tests/testdisplay: Allow testing aspect ratios Ville Syrjala
2019-06-24  7:39   ` Ser, Simon
2019-06-20 17:21 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] lib/igt_kms: Dump mode picture aspect ratio Patchwork
2019-06-24  7:34 ` [igt-dev] [PATCH i-g-t 1/2] " Ser, Simon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190620155830.20500-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox