Skip to contentSkip to conversation

video: meson: add HDMI fail-save FullHD option

PATCH New Artem Lapkin 2 participants 2 messages Jan 15, 2021

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

PATCH 1/1 video: meson: add HDMI fail-save FullHD option

add VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD configuration option

ABOUT:

Force setup FullHD display mode, if proper timing cant readed. from display! Its happens for some 4K display, which send unsupported high timings, but same time can works as FullHD! Also its will be useful for suspended or disconnected displays.

NOTE: this option disabled by default

---
 drivers/video/meson/Kconfig     | 10 ++++++++++
 drivers/video/meson/meson_vpu.c | 19 +++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)
drivers/video/meson/Kconfig +10 -0
index 0c9ddeb8..55d67700 100644
@@ -10,3 +10,13 @@ config VIDEO_MESON
 	select DISPLAY
 	help
 	  Enable Amlogic Meson Video Processing Unit video support.
+
+config VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD
+	bool "Enable HDMI fail-save FullHD mode"
+	depends on VIDEO_MESON
+	default n
+	help
+	  Force setup FullHD display mode, if proper timing cant readed.
+	  from display! Its happens for some 4K display, which send
+	  unsupported high timings, but same time can works as FullHD!
+	  Also its will be useful for suspended or disconnected displays
drivers/video/meson/meson_vpu.c +17 -2
index 4868839f..af677a45 100644
@@ -52,8 +52,23 @@ static int meson_vpu_setup_mode(struct udevice *dev, struct udevice *disp)
 	if (disp) {
 		ret = display_read_timing(disp, &timing);
 		if (ret) {
-			debug("%s: Failed to read timings\n", __func__);
-			goto cvbs;
+			if (IS_ENABLED(CONFIG_VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD)) {
+				printf("DISPLAY: setup failsave FullHD mode\n");
+				timing.pixelclock.typ = 148500000;
+				timing.hactive.typ = 1920;
+				timing.hfront_porch.typ = 88;
+				timing.hback_porch.typ = 148;
+				timing.hsync_len.typ = 44;
+				timing.vactive.typ = 1080;
+				timing.vfront_porch.typ = 4;
+				timing.vback_porch.typ = 36;
+				timing.vsync_len.typ = 5;
+				timing.flags = 10;
+				timing.hdmi_monitor = true;
+			} else {
+				debug("%s: Failed to read timings\n", __func__);
+				goto cvbs;
+			}
 		}
 
 		uc_priv->xsize = timing.hactive.typ;
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 video: meson: add HDMI fail-save FullHD option

Hi,

Quoted 8 lines · Artem Lapkin

add VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD configuration option

ABOUT:

Force setup FullHD display mode, if proper timing cant readed. from display! Its happens for some 4K display, which send unsupported high timings, but same time can works as FullHD! Also its will be useful for suspended or disconnected displays.

Thanks ! It was in my TODO list....

Quoted 17 lines

NOTE: this option disabled by default

---
 drivers/video/meson/Kconfig     | 10 ++++++++++
 drivers/video/meson/meson_vpu.c | 19 +++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)
drivers/video/meson/Kconfig +0 -0
index 0c9ddeb8..55d67700 100644
@@ -10,3 +10,13 @@ config VIDEO_MESON
 	select DISPLAY
 	help
 	  Enable Amlogic Meson Video Processing Unit video support.

drivers/video/meson/Kconfig config VIDEO_MESON · line 22

Quoted 10 lines
drivers/video/meson/Kconfig +10 -0
+
+config VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD
+	bool "Enable HDMI fail-save FullHD mode"
+	depends on VIDEO_MESON
+	default n
+	help
+	  Force setup FullHD display mode, if proper timing cant readed.
+	  from display! Its happens for some 4K display, which send
+	  unsupported high timings, but same time can works as FullHD!
+	  Also its will be useful for suspended or disconnected displays

I don't think it's necessary to have an option for that.

Quoted 16 lines
drivers/video/meson/meson_vpu.c +6 -2
index 4868839f..af677a45 100644
@@ -52,8 +52,23 @@ static int meson_vpu_setup_mode(struct udevice *dev, struct udevice *disp)
 	if (disp) {
 		ret = display_read_timing(disp, &timing);
 		if (ret) {
-			debug("%s: Failed to read timings\n", __func__);
-			goto cvbs;
+			if (IS_ENABLED(CONFIG_VIDEO_MESON_HDMI_FAIL_SAVE_FULL_HD)) {
+				printf("DISPLAY: setup failsave FullHD mode\n");
+				timing.pixelclock.typ = 148500000;
+				timing.hactive.typ = 1920;
+				timing.hfront_porch.typ = 88;
+				timing.hback_porch.typ = 148;

drivers/video/meson/meson_vpu.c static int meson_vpu_setup_mode(struct udevice *dev, struct udevice *disp) · line 70

Quoted 10 lines
drivers/video/meson/meson_vpu.c +10 -0
+				timing.hsync_len.typ = 44;
+				timing.vactive.typ = 1080;
+				timing.vfront_porch.typ = 4;
+				timing.vback_porch.typ = 36;
+				timing.vsync_len.typ = 5;
+				timing.flags = 10;
+				timing.hdmi_monitor = true;
+			} else {
+				debug("%s: Failed to read timings\n", __func__);
+				goto cvbs;

So, 1080p is not a good idea for DVI screens, only for HDMI displays. And I don't think it's the right place, since when I will add support for DSI output, it won't work.

So it should go in the meson_dw_hdmi, but you'll need to add a read_timing() callback instead of the read_edid, that would do the same as display_read_timing() but return a fallback mode if edid_get_timing_validate() fails.

You could get the info about HDMI or DVI in timing->hdmi_monitor, then you should return 1024x768 for DVI and 1080p for HDMI displays, but you'll need to fix the edid_get_timing_validate to check for HDMI stuff before validating the timings.

Neil

Quoted 5 lines
drivers/video/meson/meson_vpu.c +1 -0
+			}
 		}
 
 		uc_priv->xsize = timing.hactive.typ;