msm: display: Set max MDP bandwidths for larger primary resolutions
To avoid underruns for larger primary display resolutions,
set max MDP clock/bandwidths for dynamic boot parameter
cases with HDMI as primary and WUXGA panels
Change-Id: I1e020de0cbd4082edd26d4b03ebee4d4b976c26a
Signed-off-by: Ravishangar Kalyanam <rkalya@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index f181133..3736eb2 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -2765,6 +2765,8 @@
}
};
+static void set_mdp_clocks_for_wuxga(void);
+
static int msm_fb_detect_panel(const char *name)
{
if (machine_is_msm8x60_fluid()) {
@@ -2819,8 +2821,11 @@
if (!strncmp(name, HDMI_PANEL_NAME,
strnlen(HDMI_PANEL_NAME,
- PANEL_NAME_MAX_LEN)))
+ PANEL_NAME_MAX_LEN))) {
+ if (hdmi_is_primary)
+ set_mdp_clocks_for_wuxga();
return 0;
+ }
if (!strncmp(name, TVOUT_PANEL_NAME,
strnlen(TVOUT_PANEL_NAME,
@@ -3185,6 +3190,7 @@
pr_debug("HDMI is the primary display by"
" boot parameter\n");
hdmi_is_primary = 1;
+ set_mdp_clocks_for_wuxga();
}
}
if (strnlen(ext_panel, PANEL_NAME_MAX_LEN)) {
@@ -9224,51 +9230,6 @@
},
};
-#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
-static struct msm_bus_vectors hdmi_as_primary_vectors[] = {
- /* If HDMI is used as primary */
- {
- .src = MSM_BUS_MASTER_MDP_PORT0,
- .dst = MSM_BUS_SLAVE_SMI,
- .ab = 2000000000,
- .ib = 2000000000,
- },
- /* Master and slaves can be from different fabrics */
- {
- .src = MSM_BUS_MASTER_MDP_PORT0,
- .dst = MSM_BUS_SLAVE_EBI_CH0,
- .ab = 2000000000,
- .ib = 2000000000,
- },
-};
-
-static struct msm_bus_paths mdp_bus_scale_usecases[] = {
- {
- ARRAY_SIZE(mdp_init_vectors),
- mdp_init_vectors,
- },
- {
- ARRAY_SIZE(hdmi_as_primary_vectors),
- hdmi_as_primary_vectors,
- },
- {
- ARRAY_SIZE(hdmi_as_primary_vectors),
- hdmi_as_primary_vectors,
- },
- {
- ARRAY_SIZE(hdmi_as_primary_vectors),
- hdmi_as_primary_vectors,
- },
- {
- ARRAY_SIZE(hdmi_as_primary_vectors),
- hdmi_as_primary_vectors,
- },
- {
- ARRAY_SIZE(hdmi_as_primary_vectors),
- hdmi_as_primary_vectors,
- },
-};
-#else
#ifdef CONFIG_FB_MSM_LCDC_DSUB
static struct msm_bus_vectors mdp_sd_smi_vectors[] = {
/* Default case static display/UI/2d/3d if FB SMI */
@@ -9463,7 +9424,6 @@
mdp_1080p_vectors,
},
};
-#endif
static struct msm_bus_scale_pdata mdp_bus_scale_pdata = {
mdp_bus_scale_usecases,
ARRAY_SIZE(mdp_bus_scale_usecases),
@@ -9819,6 +9779,45 @@
#endif
}
+/**
+ * Set MDP clocks to high frequency to avoid underflow when
+ * using high resolution 1200x1920 WUXGA/HDMI as primary panels
+ */
+static void set_mdp_clocks_for_wuxga(void)
+{
+ int i;
+
+ mdp_sd_smi_vectors[0].ab = 2000000000;
+ mdp_sd_smi_vectors[0].ib = 2000000000;
+ mdp_sd_smi_vectors[1].ab = 2000000000;
+ mdp_sd_smi_vectors[1].ib = 2000000000;
+
+ mdp_sd_ebi_vectors[0].ab = 2000000000;
+ mdp_sd_ebi_vectors[0].ib = 2000000000;
+ mdp_sd_ebi_vectors[1].ab = 2000000000;
+ mdp_sd_ebi_vectors[1].ib = 2000000000;
+
+ mdp_vga_vectors[0].ab = 2000000000;
+ mdp_vga_vectors[0].ib = 2000000000;
+ mdp_vga_vectors[1].ab = 2000000000;
+ mdp_vga_vectors[1].ib = 2000000000;
+
+ mdp_720p_vectors[0].ab = 2000000000;
+ mdp_720p_vectors[0].ib = 2000000000;
+ mdp_720p_vectors[1].ab = 2000000000;
+ mdp_720p_vectors[1].ib = 2000000000;
+
+ mdp_1080p_vectors[0].ab = 2000000000;
+ mdp_1080p_vectors[0].ib = 2000000000;
+ mdp_1080p_vectors[1].ab = 2000000000;
+ mdp_1080p_vectors[1].ib = 2000000000;
+
+ mdp_pdata.mdp_core_clk_rate = 200000000;
+
+ for (i = 0; i < ARRAY_SIZE(mdp_core_clk_rate_table); i++)
+ mdp_core_clk_rate_table[i] = 200000000;
+}
+
#if (defined(CONFIG_MARIMBA_CORE)) && \
(defined(CONFIG_MSM_BT_POWER) || defined(CONFIG_MSM_BT_POWER_MODULE))