Skip to content

Commit 26eed9f

Browse files
committed
ayufan: rk3399: hdmi: reject edid not matching current res
1 parent 756798b commit 26eed9f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/video/rockchip/rk3399_hdmi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,20 @@ static int rk3399_hdmi_probe(struct udevice *dev)
5959
return rk_hdmi_probe(dev);
6060
}
6161

62+
static bool rk3999_hdmi_mode_valid(struct udevice *dev, const struct display_timing *mode)
63+
{
64+
if (mode->hactive.typ < 640 || mode->hactive.typ > CONFIG_VIDEO_ROCKCHIP_MAX_XRES)
65+
return false;
66+
67+
if (mode->vactive.typ < 480 || mode->vactive.typ > CONFIG_VIDEO_ROCKCHIP_MAX_YRES)
68+
return false;
69+
70+
return true;
71+
}
72+
6273
static const struct dm_display_ops rk3399_hdmi_ops = {
6374
.read_edid = rk_hdmi_read_edid,
75+
.mode_valid = rk3999_hdmi_mode_valid,
6476
.enable = rk3399_hdmi_enable,
6577
};
6678

0 commit comments

Comments
 (0)