[Display]: complete the mode config of PIPEA when start os
authorshi yang <yang.a.shi@intel.com>
Thu, 12 Apr 2012 05:12:12 +0000 (13:12 +0800)
committerbuildbot <buildbot@intel.com>
Sat, 14 Apr 2012 10:41:34 +0000 (03:41 -0700)
BZ: 30129

in function of mdfld_crtc_dsi_mode_set,display will set pipe config base
on different Panel. But this don't set when panel first power on.
So we add this config when commit MIPI show.

/* Setup pipe configuration for different panels
 * The formula recommended from hw team is as below:
 * (htotal * 5ns * hdelay) >= 8000ns
 * hdelay is the count of delayed HBLANK scan lines
 * And the max hdelay is 4
 * by programming of PIPE(A/C) CONF bit 28:27:
 * 00 = 1 scan line, 01 = 2 scan line,
 * 02 = 3 scan line, 03 = 4 scan line
 */

Change-Id: If20521d48d83d0925e42c22d50eff20e007b0bd0
Signed-off-by: shi yang <yang.a.shi@intel.com>
Reviewed-on: http://android.intel.com:8080/43220
Reviewed-by: Xu, Randy <randy.xu@intel.com>
Reviewed-by: Liu, Chuansheng <chuansheng.liu@intel.com>
Tested-by: Xu, Randy <randy.xu@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/staging/mrst/drv/mdfld_dsi_dpi.c

index f1425d2..39e96e6 100644 (file)
@@ -1979,17 +1979,32 @@ void mdfld_dsi_dpi_commit(struct drm_encoder *encoder)
 {
        struct mdfld_dsi_encoder *dsi_encoder;
        struct mdfld_dsi_dpi_output *dpi_output;
+       struct mdfld_dsi_hw_context *ctx;
+       struct mdfld_dsi_config *dsi_config;
+       struct drm_device *dev;
+       u32 temp_val = 0;
 
        PSB_DEBUG_ENTRY("\n");
 
        dsi_encoder = MDFLD_DSI_ENCODER(encoder);
        dpi_output = MDFLD_DSI_DPI_OUTPUT(dsi_encoder);
+       dsi_config = mdfld_dsi_encoder_get_config(dsi_encoder);
+       dev = dsi_config->dev;
+       ctx = &dsi_config->dsi_hw_context;
 
 #if  defined(CONFIG_SUPPORT_TOSHIBA_MIPI_DISPLAY)
        mdfld_dsi_dpi_set_power(encoder, false);
 #elif defined(CONFIG_SUPPORT_TOSHIBA_MIPI_LVDS_BRIDGE)
        mdfld_dsi_dpi_set_power(encoder, true);
 #else
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON))
+               return;
+       temp_val = REG_READ(PIPEACONF);
+       temp_val &= ~(BIT27 | BIT28);
+       /* Setup pipe configuration for different panels*/
+       REG_WRITE(PIPEACONF, temp_val | (ctx->pipeconf & (BIT27 | BIT28)));
+       ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
+
        /*Everything is ready, commit DSI hw context to HW*/
        __mdfld_dsi_dpi_set_power(encoder, true);
 #endif