diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index b0f9ca6b5edf89..e4cfeada082c7f 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1823,6 +1823,11 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder, (mode->hsync_end % 2) || (mode->htotal % 2))) return -EINVAL; + /* 4096x2160@60 is not reliable without overclocking core */ + if (mode->hdisplay > 3840 && mode->vdisplay >= 2160 && + drm_mode_vrefresh(mode) >= 50) + return -EINVAL; + /* * The 1440p@60 pixel rate is in the same range than the first * WiFi channel (between 2.4GHz and 2.422GHz with 22MHz @@ -1861,6 +1866,10 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder, (mode->hsync_end % 2) || (mode->htotal % 2))) return MODE_H_ILLEGAL; + if (mode->hdisplay > 3840 && mode->vdisplay >= 2160 && + drm_mode_vrefresh(mode) >= 50) + return MODE_CLOCK_HIGH; + return vc4_hdmi_encoder_clock_valid(vc4_hdmi, mode->clock * 1000); }