Skip to contentSkip to conversation

drm: Dump mode picture aspect ratio

PATCH In review Ville Syrjala 3 participants 4 messages Jun 20, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Dump mode picture aspect ratio

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

Currently the logs show nothing about the mode's aspect ratio. Include that information in the normal mode dump.

---
 drivers/video/hdmi.c    | 3 ++-
 include/drm/drm_modes.h | 4 ++--
 include/linux/hdmi.h    | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/video/hdmi.c +2 -1
index b939bc28d886..bc593fe1c268 100644
@@ -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)
include/drm/drm_modes.h +2 -2
index 083f16747369..2b1809c74fbe 100644
@@ -431,7 +431,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"
+#define DRM_MODE_FMT    "\"%s\": %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x %s"
 
 /**
  * DRM_MODE_ARG - printf arguments for &struct drm_display_mode
@@ -441,7 +441,7 @@ struct drm_display_mode {
 	(m)->name, (m)->vrefresh, (m)->clock, \
 	(m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
 	(m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
-	(m)->type, (m)->flags
+	(m)->type, (m)->flags, hdmi_picture_aspect_get_name((m)->picture_aspect_ratio)
 
 #define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
 
include/linux/hdmi.h +3 -0
index 9918a6c910c5..de7cbe385dba 100644
@@ -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 */
Signature · 6 lines
2.21.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 28 lines · Ville Syrjala

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

Currently the logs show nothing about the mode's aspect ratio. Include that information in the normal mode dump.

---
 drivers/video/hdmi.c    | 3 ++-
 include/drm/drm_modes.h | 4 ++--
 include/linux/hdmi.h    | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/video/hdmi.c +1 -1
index b939bc28d886..bc593fe1c268 100644
@@ -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) {

drivers/video/hdmi.c hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect) · line 1079

Quoted 4 lines
drivers/video/hdmi.c +1 -0
@@ -1076,6 +1076,7 @@ hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect)
        }
        return "Invalid";
 }
+EXPORT_SYMBOL(hdmi_picture_aspect_get_name);

So this will return "No Data" most of the time (since the DRM_CAP won't be enabled)? This will look awkward, esp since the person seeing this print will have no idea what "No Data" is referring to.

Quoted 17 lines
drivers/video/hdmi.c +0 -0
 static const char *
 hdmi_active_aspect_get_name(enum hdmi_active_aspect active_aspect)
include/drm/drm_modes.h +1 -1
index 083f16747369..2b1809c74fbe 100644
@@ -431,7 +431,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"
+#define DRM_MODE_FMT    "\"%s\": %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x %s"
 
 /**
  * DRM_MODE_ARG - printf arguments for &struct drm_display_mode

include/drm/drm_modes.h struct drm_display_mode { · line 444

Quoted 5 lines
include/drm/drm_modes.h +1 -1
@@ -441,7 +441,7 @@ struct drm_display_mode {
        (m)->name, (m)->vrefresh, (m)->clock, \
        (m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
        (m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
-       (m)->type, (m)->flags
+       (m)->type, (m)->flags, hdmi_picture_aspect_get_name((m)->picture_aspect_ratio)

Flags are printed as a literal integer value. Given that AR stuff is fairly esoteric, I might just print an integer here too. (Why was picture_aspect_ratio not stuffed into ->flags in the first place?)

Quoted 16 lines
include/drm/drm_modes.h +0 -0
 #define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
 
include/linux/hdmi.h +3 -1
index 9918a6c910c5..de7cbe385dba 100644
@@ -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 */
--
Quoted 2 lines

2.21.0

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

#2 lore raw
Quoted 24 lines · Ilia Mirkin
Quoted 22 lines · Ville Syrjala

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

Currently the logs show nothing about the mode's aspect ratio. Include that information in the normal mode dump.

---
 drivers/video/hdmi.c    | 3 ++-
 include/drm/drm_modes.h | 4 ++--
 include/linux/hdmi.h    | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/video/hdmi.c +0 -0
index b939bc28d886..bc593fe1c268 100644
@@ -1057,7 +1057,7 @@ static const char *hdmi_colorimetry_get_name(enum hdmi_colorimetry colorimetry)
        return "Invalid";
 }
 
Quoted 14 lines

drivers/video/hdmi.c hdmi_picture_aspect_get_name(enum hdmi_picture_aspect picture_aspect) · line 1079

Quoted 10 lines
drivers/video/hdmi.c +2 -1
-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);

So this will return "No Data" most of the time (since the DRM_CAP won't be enabled)? This will look awkward, esp since the person seeing this print will have no idea what "No Data" is referring to.

I suppose we could do
picture_aspet_ratio ? hdmi_picture_aspect_get_name(picture_aspet_ratio) : ""

Quoted 15 lines
Quoted 15 lines
drivers/video/hdmi.c +0 -0
 static const char *
 hdmi_active_aspect_get_name(enum hdmi_active_aspect active_aspect)
include/drm/drm_modes.h +1 -1
index 083f16747369..2b1809c74fbe 100644
@@ -431,7 +431,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"
+#define DRM_MODE_FMT    "\"%s\": %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x %s"
 
Quoted 11 lines

include/drm/drm_modes.h struct drm_display_mode { · line 444

Quoted 8 lines
include/drm/drm_modes.h +1 -1
 /**
  * DRM_MODE_ARG - printf arguments for &struct drm_display_mode
@@ -441,7 +441,7 @@ struct drm_display_mode {
        (m)->name, (m)->vrefresh, (m)->clock, \
        (m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
        (m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
-       (m)->type, (m)->flags
+       (m)->type, (m)->flags, hdmi_picture_aspect_get_name((m)->picture_aspect_ratio)

Flags are printed as a literal integer value. Given that AR stuff is fairly esoteric, I might just print an integer here too.

I hate those thing. I can't even remember which is one the type (absolutely useless) and which on is the flags. And I always end up going through the headers to figure out which bit is what sync polarity. So I'd rather like to decode those too, just been too lazy to do it.

Quoted 2 lines

(Why was
picture_aspect_ratio not stuffed into ->flags in the first place?)

It's also in there. I think the reason for having this odd duplication was that we didn't have the flags initially, and just had the prop. I've not looked how hard it would be to get rid of that.

Quoted 19 lines
Quoted 19 lines
include/drm/drm_modes.h +0 -0
 #define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
 
include/linux/hdmi.h +3 -1
index 9918a6c910c5..de7cbe385dba 100644
@@ -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

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✗ Fi.CI.BAT: failure for drm: Dump mode picture aspect ratio

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm: Dump mode picture aspect ratio
URL : https://patchwork.freedesktop.org/series/62467/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6316 -> Patchwork_13372
====================================================

Summary
-------

**FAILURE**

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

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

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6316/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/fi-bdw-gvtdvm/igt@i915_selftest@live_contexts.html

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_switch@basic-default:
- fi-icl-guc: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713] / [fdo#108569])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6316/fi-icl-guc/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/fi-icl-guc/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [PASS][5] -> [FAIL][6] ([fdo#108511])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6316/fi-skl-6770hq/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/fi-skl-6770hq/igt@[email protected]

#### Possible fixes ####

* igt@i915_module_load@reload:
- fi-blb-e6850: [INCOMPLETE][7] ([fdo#107718]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6316/fi-blb-e6850/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/fi-blb-e6850/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-icl-dsi: [INCOMPLETE][9] ([fdo#107713] / [fdo#108840]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6316/fi-icl-dsi/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13372/fi-icl-dsi/igt@[email protected]

[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108511]: https://bugs.freedesktop.org/show_bug.cgi?id=108511
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840

Participating hosts (53 -> 44)
------------------------------

Missing (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-skl-iommu fi-icl-y fi-byt-clapper fi-bdw-samus

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

* Linux: CI_DRM_6316 -> Patchwork_13372

CI_DRM_6316: 8c1cf5bd27307e6cb0cdc02a1ac9d29bcdcb5056 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5064: 22850c1906550fb97b405c019275dcfb34be8cf7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13372: b2645f26a073844c8c70f1ecf6a0f2eb7141e8f9 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

b2645f26a073 drm: Dump mode picture aspect ratio

== Logs ==

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