aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Ripard <[email protected]>2020-12-15 16:42:37 +0100
committerMaxime Ripard <[email protected]>2020-12-16 10:11:28 +0100
commit320e84dc6111ecc1c957e2b186d4d2bafee6bde2 (patch)
treecba56ab43a2c1098c55e90a5a963c3b1be03faba
parent8d9147466776c44b6d259077041fa24dcca63abc (diff)
drm/vc4: hdmi: Take into account the clock doubling flag in atomic_check
Commit 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits") was intended to compute the pixel rate to make sure we remain within the boundaries of what the hardware can provide. However, unlike what mode_valid was checking for, we forgot to take into account the clock doubling flag that can be set for modes. Let's honor that flag if it's there. Acked-by: Thomas Zimmermann <[email protected]> Reported-by: Thomas Zimmermann <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Fixes: 63495f6b4aed ("drm/vc4: hdmi: Make sure our clock rate is within limits") Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/vc4/vc4_hdmi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 8ce5dd65f6e4..3dac839b0fa5 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -799,6 +799,9 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
pixel_rate = mode->clock * 1000;
}
+ if (mode->flags & DRM_MODE_FLAG_DBLCLK)
+ pixel_rate = pixel_rate * 2;
+
if (pixel_rate > vc4_hdmi->variant->max_pixel_clock)
return -EINVAL;