From 8e11c85eb89f8594aa268cc0a6fbe9191f3d2c19 Mon Sep 17 00:00:00 2001 From: Jayant Shekhar Date: Wed, 6 Apr 2016 12:01:11 +0530 Subject: [PATCH] msm: mdss: Fix destination bpp on writeback panel Default bpp for destination format is set if mixer type for WB is MIXER_TYPE_WRITEBACK. Ensure that correct bpp is fetched from format type. Change-Id: Iff7cf58363a83e9a4999115382c5551110104ead Signed-off-by: Jayant Shekhar --- drivers/video/fbdev/msm/mdss_mdp_ctl.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index f0f855efc290..8a65f9feab79 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -1221,8 +1221,13 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer, memset(perf, 0, sizeof(*perf)); if (!mixer->rotator_mode) { + pinfo = &mixer->ctl->panel_data->panel_info; + if (!pinfo) { + pr_err("pinfo is NULL\n"); + goto exit; + } + if (mixer->type == MDSS_MDP_MIXER_TYPE_INTF) { - pinfo = &mixer->ctl->panel_data->panel_info; if (pinfo->type == MIPI_VIDEO_PANEL) { fps = pinfo->panel_max_fps; v_total = pinfo->panel_max_vtotal; @@ -1230,18 +1235,19 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer, fps = mdss_panel_get_framerate(pinfo); v_total = mdss_panel_get_vtotal(pinfo); } - - if (pinfo->type == WRITEBACK_PANEL) { - fmt = mdss_mdp_get_format_params( - mixer->ctl->dst_format); - if (fmt) - bpp = fmt->bpp; - pinfo = NULL; - } } else { v_total = mixer->height; } + /* For writeback panel, mixer type can be other than intf */ + if (pinfo->type == WRITEBACK_PANEL) { + fmt = mdss_mdp_get_format_params( + mixer->ctl->dst_format); + if (fmt) + bpp = fmt->bpp; + pinfo = NULL; + } + perf->mdp_clk_rate = mixer->width * v_total * fps; perf->mdp_clk_rate = mdss_mdp_clk_fudge_factor(mixer, perf->mdp_clk_rate);