From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, Ilia Mirkin <imirkin@alum.mit.edu>
Subject: [PATCH v2 2/2] drm: Dump mode picture aspect ratio
Date: Thu, 20 Jun 2019 21:50:49 +0300 [thread overview]
Message-ID: <20190620185049.8974-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190620185049.8974-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Currently the logs show nothing about the mode's aspect ratio.
Include that information in the normal mode dump.
v2: Don't print anything for NONE (Ilia)
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/video/hdmi.c | 3 ++-
include/drm/drm_modes.h | 6 ++++--
include/linux/hdmi.h | 3 +++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index b939bc28d886..bc593fe1c268 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -1057,7 +1057,7 @@ static const char *hdmi_colorimetry_get_name(enum hdmi_colorimetry colorimetry)
return "Invalid";
}
-static const char *
+const char *
hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
{
switch (picture_aspect) {
@@ -1076,6 +1076,7 @@ hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
}
return "Invalid";
}
+EXPORT_SYMBOL(hdmi_picture_aspect_get_name);
static const char *
hdmi_active_aspect_get_name(enum hdmi_active_aspect active_aspect)
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 3962dbf82100..0a724874fd84 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -436,7 +436,7 @@ struct drm_display_mode {
/**
* DRM_MODE_FMT - printf string for &struct drm_display_mode
*/
-#define DRM_MODE_FMT "\"%s\": %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x %s"
+#define DRM_MODE_FMT "\"%s\": %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x %s %s"
/**
* DRM_MODE_ARG - printf arguments for &struct drm_display_mode
@@ -448,7 +448,9 @@ struct drm_display_mode {
(m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
(m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
(m)->type, (m)->flags, \
- drm_get_mode_flags_name(b, sizeof(b), (m)->flags)
+ drm_get_mode_flags_name(b, sizeof(b), (m)->flags), \
+ (m)->picture_aspect_ratio ? \
+ hdmi_picture_aspect_get_name((m)->picture_aspect_ratio) : ""
#define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 9918a6c910c5..de7cbe385dba 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -434,4 +434,7 @@ int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
void hdmi_infoframe_log(const char *level, struct device *dev,
const union hdmi_infoframe *frame);
+const char *
+hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect);
+
#endif /* _DRM_HDMI_H */
--
2.21.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-20 18:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 18:50 [PATCH 1/2] drm: Pretty print mode flags Ville Syrjala
2019-06-20 18:50 ` Ville Syrjala [this message]
2019-06-20 20:25 ` Sam Ravnborg
[not found] ` <20190620202542.GA12106-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2019-06-24 12:37 ` Ville Syrjälä
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=20190620185049.8974-2-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imirkin@alum.mit.edu \
--cc=intel-gfx@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