video: meson: dw-hdmi: add EDID mode filtering to only select supported modes
authorNeil Armstrong <narmstrong@baylibre.com>
Thu, 4 Jul 2019 13:52:08 +0000 (15:52 +0200)
committerAnatolij Gustschin <agust@denx.de>
Sun, 28 Jul 2019 22:22:02 +0000 (00:22 +0200)
Add support for the new mode_valid() display op to filter out unsupported
display DMT timings.

This is useful when connected to 4k displays, since we only support DMT
monitors up to 1920x1080, the 4k native timings are discarded to select
supported timings.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
drivers/video/meson/meson_dw_hdmi.c

index 483c93f6b6cb50a185340e32e80f4773926661ec..617f75724b544163095ed5fbe87fcfbc49ad5231 100644 (file)
@@ -426,9 +426,16 @@ static int meson_dw_hdmi_probe(struct udevice *dev)
        return ret;
 }
 
+static bool meson_dw_hdmi_mode_valid(struct udevice *dev,
+                                    const struct display_timing *timing)
+{
+       return meson_venc_hdmi_supported_mode(timing);
+}
+
 static const struct dm_display_ops meson_dw_hdmi_ops = {
        .read_edid = meson_dw_hdmi_read_edid,
        .enable = meson_dw_hdmi_enable,
+       .mode_valid = meson_dw_hdmi_mode_valid,
 };
 
 static const struct udevice_id meson_dw_hdmi_ids[] = {