]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/vc4/vc4_hdmi.c
Merge tag 'drm-misc-next-2017-11-30' of git://anongit.freedesktop.org/drm/drm-misc...
[linux.git] / drivers / gpu / drm / vc4 / vc4_hdmi.c
index 0b2088264039131f05c2f09bc9ba84d2d3793e39..984501e3f0b0adc02ed12342eb8f1fbafd8e3dd4 100644 (file)
@@ -287,7 +287,6 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
 
        drm_mode_connector_update_edid_property(connector, edid);
        ret = drm_add_edid_modes(connector, edid);
-       drm_edid_to_eld(connector, edid);
        kfree(edid);
 
        return ret;
@@ -695,7 +694,22 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
        }
 }
 
+static enum drm_mode_status
+vc4_hdmi_encoder_mode_valid(struct drm_encoder *crtc,
+                           const struct drm_display_mode *mode)
+{
+       /* HSM clock must be 108% of the pixel clock.  Additionally,
+        * the AXI clock needs to be at least 25% of pixel clock, but
+        * HSM ends up being the limiting factor.
+        */
+       if (mode->clock > HSM_CLOCK_FREQ / (1000 * 108 / 100))
+               return MODE_CLOCK_HIGH;
+
+       return MODE_OK;
+}
+
 static const struct drm_encoder_helper_funcs vc4_hdmi_encoder_helper_funcs = {
+       .mode_valid = vc4_hdmi_encoder_mode_valid,
        .disable = vc4_hdmi_encoder_disable,
        .enable = vc4_hdmi_encoder_enable,
 };
This page took 0.034708 seconds and 4 git commands to generate.