Skip to content

Commit

Permalink
drm/bridge: tc358767: reject modes which require too much BW
Browse files Browse the repository at this point in the history
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
supported.

Add code to reject modes that require more bandwidth that is available.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-6-tomi.valkeinen@ti.com
  • Loading branch information
Tomi Valkeinen authored and Andrzej Hajda committed Jan 9, 2019
1 parent 9a63bd6 commit 51b9e62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/gpu/drm/bridge/tc358767.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return MODE_CLOCK_HIGH;

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;
}

Expand Down

0 comments on commit 51b9e62

Please sign in to comment.