drm/bridge: tc358767: filter out too high modes
authorAndrey Gusakov <andrey.gusakov@cogentembedded.com>
Tue, 7 Nov 2017 16:56:20 +0000 (19:56 +0300)
committerAndrzej Hajda <a.hajda@samsung.com>
Thu, 30 Nov 2017 06:55:53 +0000 (07:55 +0100)
Pixel clock limitation for DPI is 154 MHz. Do not accept modes
with higher pixel clock rate.

Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1510073785-16108-3-git-send-email-andrey.gusakov@cogentembedded.com
drivers/gpu/drm/bridge/tc358767.c

index e1996dbfb0a18f068b06d655d949ef3974123b6a..e571b5e29ae7869354701491da444c2b8950156e 100644 (file)
@@ -1103,7 +1103,10 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge,
 static int tc_connector_mode_valid(struct drm_connector *connector,
                                   struct drm_display_mode *mode)
 {
-       /* Accept any mode */
+       /* DPI interface clock limitation: upto 154 MHz */
+       if (mode->clock > 154000)
+               return MODE_CLOCK_HIGH;
+
        return MODE_OK;
 }