MLK-17468-2: hdp: Enable imx8qm hdmi/dp 4kp30 support
authorSandor Yu <Sandor.yu@nxp.com>
Mon, 29 Jan 2018 08:43:16 +0000 (16:43 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Add link rate select function.
Change max support pixel clock rate to 297MHz(4kp30).

Because edid read function is not enabled.
For such TV that max support 1080p60 or 720p60,
the followed cmdline mode should be added to kernel boot args:
video=HDMI-A-1:1920x1080-32@60 or
video=HDMI-A-1:1280x720-32@60

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/gpu/drm/imx/hdp/imx-hdp.c

index 6988a90..87d788c 100644 (file)
@@ -572,6 +572,16 @@ static int imx_get_vic_index(struct drm_display_mode *mode)
        return -1;
 }
 
+static u8 imx_hdp_link_rate(struct drm_display_mode *mode)
+{
+       if (mode->clock < 297000)
+               return AFE_LINK_RATE_1_6;
+       else if (mode->clock > 297000)
+               return AFE_LINK_RATE_5_4;
+       else
+               return AFE_LINK_RATE_2_7;
+}
+
 static void imx_hdp_mode_setup(struct imx_hdp *hdp, struct drm_display_mode *mode)
 {
        int dp_vic;
@@ -594,6 +604,7 @@ static void imx_hdp_mode_setup(struct imx_hdp *hdp, struct drm_display_mode *mod
        /* Config pixel link mux */
        imx_hdp_call(hdp, pixel_link_mux, &hdp->state, mode);
 
+       hdp->link_rate = imx_hdp_link_rate(mode);
        /* mode set */
        ret = imx_hdp_call(hdp, phy_init, &hdp->state, dp_vic, 1, 8);
        if (ret < 0) {
@@ -716,7 +727,7 @@ imx_hdp_connector_mode_valid(struct drm_connector *connector,
 
        if (hdp->is_4kp60 && mode->clock > 594000)
                return MODE_CLOCK_HIGH;
-       else if (!hdp->is_4kp60 && mode->clock > 150000)
+       else if (!hdp->is_4kp60 && mode->clock > 297000)
                return MODE_CLOCK_HIGH;
 
        /* 4096x2160 is not supported now */