Commit b5e7155e authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Greg Kroah-Hartman

drm/bridge: tc358767: reject modes which require too much BW

[ Upstream commit 51b9e62e ]

The current driver accepts any videomode with pclk < 154MHz. This is not
correct, as with 1 lane and/or 1.62Mbps speed not all videomodes can be

Add code to reject modes that require more bandwidth that is available.
Signed-off-by: default avatarTomi Valkeinen <>
Reviewed-by: default avatarAndrzej Hajda <>
Signed-off-by: default avatarAndrzej Hajda <>
Link: default avatarSasha Levin <>
parent 57781d8b
......@@ -1114,10 +1114,20 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,
static enum drm_mode_status tc_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
struct tc_data *tc = connector_to_tc(connector);
u32 req, avail;
u32 bits_per_pixel = 24;
/* DPI interface clock limitation: upto 154 MHz */
if (mode->clock > 154000)
req = mode->clock * bits_per_pixel / 8;
avail = tc->link.base.num_lanes * tc->link.base.rate;
if (req > avail)
return MODE_BAD;
return MODE_OK;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment