diff options
author | Jernej Skrabec <jernej.skrabec@siol.net> | 2021-04-22 01:14:26 +0100 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2021-04-24 13:44:28 +0200 |
commit | 3b9021a545d235f6bf53f37140e173318d79f9f8 (patch) | |
tree | 35302f12ca4be34ab6760900287359450ba072aa | |
parent | 84baa65dffdbce20752279101548ba888be53b3e (diff) | |
download | u-boot-3b9021a545d235f6bf53f37140e173318d79f9f8.zip u-boot-3b9021a545d235f6bf53f37140e173318d79f9f8.tar.gz u-boot-3b9021a545d235f6bf53f37140e173318d79f9f8.tar.bz2 |
video: sunxi: Add mode_valid callback to sunxi_dw_hdmi
Currently driver accepts all resolution which won't work on 4k screens.
Add validation callback which limits acceptable resolutions to 297 MHz.
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
-rw-r--r-- | drivers/video/sunxi/sunxi_dw_hdmi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index 0b8cefc..e3811a2 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -305,6 +305,12 @@ static int sunxi_dw_hdmi_read_edid(struct udevice *dev, u8 *buf, int buf_size) return dw_hdmi_read_edid(&priv->hdmi, buf, buf_size); } +static bool sunxi_dw_hdmi_mode_valid(struct udevice *dev, + const struct display_timing *timing) +{ + return timing->pixelclock.typ <= 297000000; +} + static int sunxi_dw_hdmi_enable(struct udevice *dev, int panel_bpp, const struct display_timing *edid) { @@ -388,6 +394,7 @@ static int sunxi_dw_hdmi_probe(struct udevice *dev) static const struct dm_display_ops sunxi_dw_hdmi_ops = { .read_edid = sunxi_dw_hdmi_read_edid, .enable = sunxi_dw_hdmi_enable, + .mode_valid = sunxi_dw_hdmi_mode_valid, }; U_BOOT_DRIVER(sunxi_dw_hdmi) = { |