Loading drivers/video/msm/mdss/mdss_mdp.h +12 −27 Original line number Diff line number Diff line Loading @@ -517,33 +517,18 @@ int mdss_mdp_smp_setup(struct mdss_data_type *mdata, u32 cnt, u32 size); int mdss_hw_init(struct mdss_data_type *mdata); int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, u32 *copyback); int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel); int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, struct mdp_pgc_lut_data *config, u32 *copyback); int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_hist_lut_data *config, u32 *copyback); int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, struct mdp_dither_cfg_data *config, u32 *copyback); int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, struct mdp_gamut_cfg_data *config, u32 *copyback); int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, struct mdp_histogram_start_req *req); int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block); int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist); int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback); int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); int mdss_mdp_igc_lut_config(struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel); int mdss_mdp_argc_config(struct mdp_pgc_lut_data *config, u32 *copyback); int mdss_mdp_hist_lut_config(struct mdp_hist_lut_data *config, u32 *copyback); int mdss_mdp_dither_config(struct mdp_dither_cfg_data *config, u32 *copyback); int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config, u32 *copyback); int mdss_mdp_histogram_start(struct mdp_histogram_start_req *req); int mdss_mdp_histogram_stop(u32 block); int mdss_mdp_hist_collect(struct mdp_histogram_data *hist); void mdss_mdp_hist_intr_done(u32 isr); int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, Loading drivers/video/msm/mdss/mdss_mdp_ctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -908,7 +908,7 @@ struct mdss_mdp_ctl *mdss_mdp_ctl_init(struct mdss_panel_data *pdata, ctl->dst_format = MDSS_MDP_PANEL_FORMAT_RGB888; break; } mdss_mdp_dither_config(ctl, &dither, NULL); mdss_mdp_dither_config(&dither, NULL); } return ctl; Loading drivers/video/msm/mdss/mdss_mdp_overlay.c +8 −18 Original line number Diff line number Diff line Loading @@ -560,11 +560,10 @@ static int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd, pipe->pp_cfg.hist_cfg.frame_cnt; hist.bit_mask = pipe->pp_cfg.hist_cfg.bit_mask; hist.num_bins = pipe->pp_cfg.hist_cfg.num_bins; mdss_mdp_histogram_start(pipe->mixer->ctl, &hist); mdss_mdp_histogram_start(&hist); } else if (pipe->pp_cfg.hist_cfg.ops & MDP_PP_OPS_DISABLE) { mdss_mdp_histogram_stop(pipe->mixer->ctl, mdss_mdp_histogram_stop( pipe->pp_cfg.hist_cfg.block); } } Loading Loading @@ -1847,7 +1846,6 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, struct msmfb_mdp_pp mdp_pp; u32 copyback = 0; u32 copy_from_kernel = 0; struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); ret = copy_from_user(&mdp_pp, argp, sizeof(mdp_pp)); if (ret) Loading @@ -1862,14 +1860,12 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, switch (mdp_pp.op) { case mdp_op_pa_cfg: ret = mdss_mdp_pa_config(mdp5_data->ctl, &mdp_pp.data.pa_cfg_data, ret = mdss_mdp_pa_config(&mdp_pp.data.pa_cfg_data, ©back); break; case mdp_op_pcc_cfg: ret = mdss_mdp_pcc_config(mdp5_data->ctl, &mdp_pp.data.pcc_cfg_data, ret = mdss_mdp_pcc_config(&mdp_pp.data.pcc_cfg_data, ©back); break; Loading @@ -1877,7 +1873,6 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, switch (mdp_pp.data.lut_cfg_data.lut_type) { case mdp_lut_igc: ret = mdss_mdp_igc_lut_config( mdp5_data->ctl, (struct mdp_igc_lut_data *) &mdp_pp.data.lut_cfg_data.data, ©back, copy_from_kernel); Loading @@ -1885,14 +1880,12 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, case mdp_lut_pgc: ret = mdss_mdp_argc_config( mdp5_data->ctl, &mdp_pp.data.lut_cfg_data.data.pgc_lut_data, ©back); break; case mdp_lut_hist: ret = mdss_mdp_hist_lut_config( mdp5_data->ctl, (struct mdp_hist_lut_data *) &mdp_pp.data.lut_cfg_data.data, ©back); break; Loading @@ -1904,13 +1897,11 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, break; case mdp_op_dither_cfg: ret = mdss_mdp_dither_config( mdp5_data->ctl, &mdp_pp.data.dither_cfg_data, ©back); break; case mdp_op_gamut_cfg: ret = mdss_mdp_gamut_config( mdp5_data->ctl, &mdp_pp.data.gamut_cfg_data, ©back); break; Loading Loading @@ -1961,7 +1952,6 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, struct mdp_histogram_data hist; struct mdp_histogram_start_req hist_req; u32 block; struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); u32 pp_bus_handle; static int req = -1; Loading @@ -1980,7 +1970,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_histogram_start(mdp5_data->ctl, &hist_req); ret = mdss_mdp_histogram_start(&hist_req); break; case MSMFB_HISTOGRAM_STOP: Loading @@ -1988,7 +1978,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_histogram_stop(mdp5_data->ctl, block); ret = mdss_mdp_histogram_stop(block); if (ret) return ret; Loading @@ -2010,7 +2000,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_hist_collect(mdp5_data->ctl, &hist); ret = mdss_mdp_hist_collect(&hist); if (!ret) ret = copy_to_user(argp, &hist, sizeof(hist)); break; Loading drivers/video/msm/mdss/mdss_mdp_pp.c +17 −102 Original line number Diff line number Diff line Loading @@ -1147,7 +1147,7 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_mixer *mixer) flush_exit: writel_relaxed(opmode, base + MDSS_MDP_REG_DSPP_OP_MODE); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, BIT(13 + dspp_num)); ctl->flush_bits |= BIT(13 + dspp_num); wmb(); dspp_exit: mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); Loading Loading @@ -1383,16 +1383,13 @@ static int pp_get_dspp_num(u32 disp_num, u32 *dspp_num) return 0; } int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback) { int ret = 0; u32 disp_num, dspp_num = 0; char __iomem *pa_addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1426,8 +1423,6 @@ int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, pa_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading Loading @@ -1557,17 +1552,13 @@ static void pp_update_pcc_regs(char __iomem *addr, writel_relaxed(cfg_ptr->b.rgb_1, addr + 8); } int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, struct mdp_pcc_cfg_data *config, int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *config, u32 *copyback) { int ret = 0; u32 disp_num, dspp_num = 0; char __iomem *addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1597,8 +1588,6 @@ int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, pcc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading Loading @@ -1672,13 +1661,12 @@ int mdss_mdp_limited_lut_igc_config(struct mdss_mdp_ctl *ctl) config.c0_c1_data = igc_limited; config.c2_data = igc_limited; ret = mdss_mdp_igc_lut_config(ctl, &config, ©back, ret = mdss_mdp_igc_lut_config(&config, ©back, copy_from_kernel); return ret; } int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_igc_lut_data *config, int mdss_mdp_igc_lut_config(struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel) { int ret = 0; Loading @@ -1687,9 +1675,6 @@ int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, char __iomem *igc_addr; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1767,8 +1752,6 @@ int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, igc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } static void pp_update_gc_one_lut(char __iomem *addr, Loading Loading @@ -1884,8 +1867,7 @@ static void pp_update_hist_lut(char __iomem *addr, writel_relaxed(1, addr + 16); } int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, struct mdp_pgc_lut_data *config, int mdss_mdp_argc_config(struct mdp_pgc_lut_data *config, u32 *copyback) { int ret = 0; Loading @@ -1895,9 +1877,6 @@ int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, u32 tbl_size, r_size, g_size, b_size; char __iomem *argc_addr = 0; if (!ctl) return -EINVAL; if ((PP_BLOCK(config->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(config->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2007,21 +1986,15 @@ int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, } argc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_hist_lut_data *config, int mdss_mdp_hist_lut_config(struct mdp_hist_lut_data *config, u32 *copyback) { int i, ret = 0; u32 disp_num, dspp_num = 0; char __iomem *hist_addr; if (!ctl) return -EINVAL; if ((PP_BLOCK(config->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(config->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2065,18 +2038,13 @@ int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, } enhist_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, struct mdp_dither_cfg_data *config, int mdss_mdp_dither_config(struct mdp_dither_cfg_data *config, u32 *copyback) { u32 disp_num; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) Loading @@ -2089,12 +2057,10 @@ int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, mdss_pp_res->dither_disp_cfg[disp_num] = *config; mdss_pp_res->pp_disp_flags[disp_num] |= PP_FLAGS_DIRTY_DITHER; mutex_unlock(&mdss_pp_mutex); mdss_mdp_pp_setup(ctl); return 0; } int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, struct mdp_gamut_cfg_data *config, int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config, u32 *copyback) { int i, j, size_total = 0, ret = 0; Loading @@ -2107,9 +2073,6 @@ int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, uint16_t *b_tbl[MDP_GAMUT_TABLE_NUM]; char __iomem *addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2232,8 +2195,6 @@ int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, } gamut_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } static void pp_hist_read(char __iomem *v_addr, Loading Loading @@ -2276,7 +2237,7 @@ static int pp_histogram_enable(struct pp_hist_col_info *hist_info, hist_info->col_state = HIST_RESET; hist_info->col_en = true; spin_unlock_irqrestore(&hist_info->hist_lock, flag); hist_info->is_kick_ready = false; hist_info->is_kick_ready = true; mdss_mdp_hist_irq_enable(3 << shift_bit); writel_relaxed(req->frame_cnt, ctl_base + 8); /* Kick out reset start */ Loading @@ -2286,8 +2247,7 @@ exit: return ret; } int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, struct mdp_histogram_start_req *req) int mdss_mdp_histogram_start(struct mdp_histogram_start_req *req) { u32 done_shift_bit; char __iomem *ctl_base; Loading @@ -2297,8 +2257,6 @@ int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, u32 mixer_cnt, mixer_id[MDSS_MDP_INTF_MAX_LAYERMIXER]; struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(req->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(req->block) >= MDP_BLOCK_MAX)) Loading Loading @@ -2365,31 +2323,6 @@ int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); hist_exit: if (!ret && (PP_LOCAT(req->block) == MDSS_PP_DSPP_CFG)) { mdss_mdp_pp_setup(ctl); /* wait for a frame to let histrogram enable itself */ /* TODO add hysteresis value to be able to remove this sleep */ usleep(41666); for (i = 0; i < mixer_cnt; i++) { dspp_num = mixer_id[i]; hist_info = &mdss_pp_res->dspp_hist[dspp_num]; mutex_lock(&hist_info->hist_mutex); hist_info->is_kick_ready = true; mutex_unlock(&hist_info->hist_mutex); } } else if (!ret) { for (i = 0; i < MDSS_PP_ARG_NUM; i++) { if (!PP_ARG(i, req->block)) continue; pr_info("PP_ARG(%d) = %d", i, PP_ARG(i, req->block)); pipe = mdss_mdp_pipe_get(mdata, BIT(i)); if (IS_ERR_OR_NULL(pipe)) continue; hist_info = &pipe->pp_res.hist; hist_info->is_kick_ready = true; mdss_mdp_pipe_unmap(pipe); } } return ret; } Loading Loading @@ -2418,7 +2351,7 @@ exit: return ret; } int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) int mdss_mdp_histogram_stop(u32 block) { int i, ret = 0; char __iomem *ctl_base; Loading @@ -2428,9 +2361,6 @@ int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2495,13 +2425,10 @@ int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) hist_stop_clk: mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); hist_stop_exit: if (!ret && (PP_LOCAT(block) == MDSS_PP_DSPP_CFG)) mdss_mdp_pp_setup(ctl); return ret; } static int pp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist, static int pp_hist_collect(struct mdp_histogram_data *hist, struct pp_hist_col_info *hist_info, char __iomem *ctl_base) { Loading @@ -2525,9 +2452,6 @@ static int pp_hist_collect(struct mdss_mdp_ctl *ctl, spin_unlock_irqrestore(&hist_info->hist_lock, flag); timeout = HIST_WAIT_TIMEOUT(hist_info->frame_cnt); mutex_unlock(&hist_info->hist_mutex); /* flush updates before wait*/ if (PP_LOCAT(hist->block) == MDSS_PP_DSPP_CFG) mdss_mdp_pp_setup(ctl); if (PP_LOCAT(hist->block) == MDSS_PP_SSPP_CFG) { res = container_of(hist_info, struct mdss_pipe_pp_res, hist); Loading Loading @@ -2588,8 +2512,7 @@ hist_collect_exit: return ret; } int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist) int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) { int i, j, off, ret = 0; struct pp_hist_col_info *hist_info; Loading @@ -2603,9 +2526,6 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(hist->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(hist->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading @@ -2632,7 +2552,7 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, hist_info = &mdss_pp_res->dspp_hist[dspp_num]; ctl_base = mdss_mdp_get_dspp_addr_off(dspp_num) + MDSS_MDP_REG_DSPP_HIST_CTL_BASE; ret = pp_hist_collect(ctl, hist, hist_info, ctl_base); ret = pp_hist_collect(hist, hist_info, ctl_base); if (ret) goto hist_collect_exit; } Loading Loading @@ -2701,7 +2621,7 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, hist_info = &pipe->pp_res.hist; ctl_base = pipe->base + MDSS_MDP_REG_VIG_HIST_CTL_BASE; ret = pp_hist_collect(ctl, hist, hist_info, ctl_base); ret = pp_hist_collect(hist, hist_info, ctl_base); mdss_mdp_pipe_unmap(pipe); if (ret) goto hist_collect_exit; Loading Loading @@ -2994,8 +2914,6 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, } mutex_unlock(&ad->lock); ctl = mfd_to_ctl(mfd); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading @@ -3003,7 +2921,6 @@ int mdss_mdp_ad_input(struct msm_fb_data_type *mfd, struct mdss_ad_input *input, int wait) { int ret = 0; struct mdss_ad_info *ad; struct mdss_mdp_ctl *ctl; u32 bl; ret = mdss_mdp_get_ad(mfd, &ad); Loading Loading @@ -3079,8 +2996,6 @@ error: init_completion(&ad->comp); mutex_unlock(&ad->lock); } ctl = mfd_to_ctl(mfd); mdss_mdp_pp_setup(ctl); if (wait) { ret = wait_for_completion_interruptible_timeout( &ad->comp, HIST_WAIT_TIMEOUT(1)); Loading Loading @@ -3438,7 +3353,7 @@ static void pp_ad_calc_worker(struct work_struct *work) } mutex_unlock(&ad->lock); mutex_lock(&mfd->lock); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, BIT(13 + ad->num)); ctl->flush_bits |= BIT(13 + ad->num); mutex_unlock(&mfd->lock); /* Trigger update notify to wake up those waiting for display updates */ Loading Loading
drivers/video/msm/mdss/mdss_mdp.h +12 −27 Original line number Diff line number Diff line Loading @@ -517,33 +517,18 @@ int mdss_mdp_smp_setup(struct mdss_data_type *mdata, u32 cnt, u32 size); int mdss_hw_init(struct mdss_data_type *mdata); int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, u32 *copyback); int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel); int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, struct mdp_pgc_lut_data *config, u32 *copyback); int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_hist_lut_data *config, u32 *copyback); int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, struct mdp_dither_cfg_data *config, u32 *copyback); int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, struct mdp_gamut_cfg_data *config, u32 *copyback); int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, struct mdp_histogram_start_req *req); int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block); int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist); int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback); int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); int mdss_mdp_igc_lut_config(struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel); int mdss_mdp_argc_config(struct mdp_pgc_lut_data *config, u32 *copyback); int mdss_mdp_hist_lut_config(struct mdp_hist_lut_data *config, u32 *copyback); int mdss_mdp_dither_config(struct mdp_dither_cfg_data *config, u32 *copyback); int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config, u32 *copyback); int mdss_mdp_histogram_start(struct mdp_histogram_start_req *req); int mdss_mdp_histogram_stop(u32 block); int mdss_mdp_hist_collect(struct mdp_histogram_data *hist); void mdss_mdp_hist_intr_done(u32 isr); int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, Loading
drivers/video/msm/mdss/mdss_mdp_ctl.c +1 −1 Original line number Diff line number Diff line Loading @@ -908,7 +908,7 @@ struct mdss_mdp_ctl *mdss_mdp_ctl_init(struct mdss_panel_data *pdata, ctl->dst_format = MDSS_MDP_PANEL_FORMAT_RGB888; break; } mdss_mdp_dither_config(ctl, &dither, NULL); mdss_mdp_dither_config(&dither, NULL); } return ctl; Loading
drivers/video/msm/mdss/mdss_mdp_overlay.c +8 −18 Original line number Diff line number Diff line Loading @@ -560,11 +560,10 @@ static int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd, pipe->pp_cfg.hist_cfg.frame_cnt; hist.bit_mask = pipe->pp_cfg.hist_cfg.bit_mask; hist.num_bins = pipe->pp_cfg.hist_cfg.num_bins; mdss_mdp_histogram_start(pipe->mixer->ctl, &hist); mdss_mdp_histogram_start(&hist); } else if (pipe->pp_cfg.hist_cfg.ops & MDP_PP_OPS_DISABLE) { mdss_mdp_histogram_stop(pipe->mixer->ctl, mdss_mdp_histogram_stop( pipe->pp_cfg.hist_cfg.block); } } Loading Loading @@ -1847,7 +1846,6 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, struct msmfb_mdp_pp mdp_pp; u32 copyback = 0; u32 copy_from_kernel = 0; struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); ret = copy_from_user(&mdp_pp, argp, sizeof(mdp_pp)); if (ret) Loading @@ -1862,14 +1860,12 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, switch (mdp_pp.op) { case mdp_op_pa_cfg: ret = mdss_mdp_pa_config(mdp5_data->ctl, &mdp_pp.data.pa_cfg_data, ret = mdss_mdp_pa_config(&mdp_pp.data.pa_cfg_data, ©back); break; case mdp_op_pcc_cfg: ret = mdss_mdp_pcc_config(mdp5_data->ctl, &mdp_pp.data.pcc_cfg_data, ret = mdss_mdp_pcc_config(&mdp_pp.data.pcc_cfg_data, ©back); break; Loading @@ -1877,7 +1873,6 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, switch (mdp_pp.data.lut_cfg_data.lut_type) { case mdp_lut_igc: ret = mdss_mdp_igc_lut_config( mdp5_data->ctl, (struct mdp_igc_lut_data *) &mdp_pp.data.lut_cfg_data.data, ©back, copy_from_kernel); Loading @@ -1885,14 +1880,12 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, case mdp_lut_pgc: ret = mdss_mdp_argc_config( mdp5_data->ctl, &mdp_pp.data.lut_cfg_data.data.pgc_lut_data, ©back); break; case mdp_lut_hist: ret = mdss_mdp_hist_lut_config( mdp5_data->ctl, (struct mdp_hist_lut_data *) &mdp_pp.data.lut_cfg_data.data, ©back); break; Loading @@ -1904,13 +1897,11 @@ static int mdss_mdp_pp_ioctl(struct msm_fb_data_type *mfd, break; case mdp_op_dither_cfg: ret = mdss_mdp_dither_config( mdp5_data->ctl, &mdp_pp.data.dither_cfg_data, ©back); break; case mdp_op_gamut_cfg: ret = mdss_mdp_gamut_config( mdp5_data->ctl, &mdp_pp.data.gamut_cfg_data, ©back); break; Loading Loading @@ -1961,7 +1952,6 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, struct mdp_histogram_data hist; struct mdp_histogram_start_req hist_req; u32 block; struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd); u32 pp_bus_handle; static int req = -1; Loading @@ -1980,7 +1970,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_histogram_start(mdp5_data->ctl, &hist_req); ret = mdss_mdp_histogram_start(&hist_req); break; case MSMFB_HISTOGRAM_STOP: Loading @@ -1988,7 +1978,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_histogram_stop(mdp5_data->ctl, block); ret = mdss_mdp_histogram_stop(block); if (ret) return ret; Loading @@ -2010,7 +2000,7 @@ static int mdss_mdp_histo_ioctl(struct msm_fb_data_type *mfd, u32 cmd, if (ret) return ret; ret = mdss_mdp_hist_collect(mdp5_data->ctl, &hist); ret = mdss_mdp_hist_collect(&hist); if (!ret) ret = copy_to_user(argp, &hist, sizeof(hist)); break; Loading
drivers/video/msm/mdss/mdss_mdp_pp.c +17 −102 Original line number Diff line number Diff line Loading @@ -1147,7 +1147,7 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_mixer *mixer) flush_exit: writel_relaxed(opmode, base + MDSS_MDP_REG_DSPP_OP_MODE); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, BIT(13 + dspp_num)); ctl->flush_bits |= BIT(13 + dspp_num); wmb(); dspp_exit: mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); Loading Loading @@ -1383,16 +1383,13 @@ static int pp_get_dspp_num(u32 disp_num, u32 *dspp_num) return 0; } int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback) { int ret = 0; u32 disp_num, dspp_num = 0; char __iomem *pa_addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1426,8 +1423,6 @@ int mdss_mdp_pa_config(struct mdss_mdp_ctl *ctl, struct mdp_pa_cfg_data *config, pa_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading Loading @@ -1557,17 +1552,13 @@ static void pp_update_pcc_regs(char __iomem *addr, writel_relaxed(cfg_ptr->b.rgb_1, addr + 8); } int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, struct mdp_pcc_cfg_data *config, int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *config, u32 *copyback) { int ret = 0; u32 disp_num, dspp_num = 0; char __iomem *addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1597,8 +1588,6 @@ int mdss_mdp_pcc_config(struct mdss_mdp_ctl *ctl, pcc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading Loading @@ -1672,13 +1661,12 @@ int mdss_mdp_limited_lut_igc_config(struct mdss_mdp_ctl *ctl) config.c0_c1_data = igc_limited; config.c2_data = igc_limited; ret = mdss_mdp_igc_lut_config(ctl, &config, ©back, ret = mdss_mdp_igc_lut_config(&config, ©back, copy_from_kernel); return ret; } int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_igc_lut_data *config, int mdss_mdp_igc_lut_config(struct mdp_igc_lut_data *config, u32 *copyback, u32 copy_from_kernel) { int ret = 0; Loading @@ -1687,9 +1675,6 @@ int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, char __iomem *igc_addr; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -1767,8 +1752,6 @@ int mdss_mdp_igc_lut_config(struct mdss_mdp_ctl *ctl, igc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } static void pp_update_gc_one_lut(char __iomem *addr, Loading Loading @@ -1884,8 +1867,7 @@ static void pp_update_hist_lut(char __iomem *addr, writel_relaxed(1, addr + 16); } int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, struct mdp_pgc_lut_data *config, int mdss_mdp_argc_config(struct mdp_pgc_lut_data *config, u32 *copyback) { int ret = 0; Loading @@ -1895,9 +1877,6 @@ int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, u32 tbl_size, r_size, g_size, b_size; char __iomem *argc_addr = 0; if (!ctl) return -EINVAL; if ((PP_BLOCK(config->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(config->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2007,21 +1986,15 @@ int mdss_mdp_argc_config(struct mdss_mdp_ctl *ctl, } argc_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, struct mdp_hist_lut_data *config, int mdss_mdp_hist_lut_config(struct mdp_hist_lut_data *config, u32 *copyback) { int i, ret = 0; u32 disp_num, dspp_num = 0; char __iomem *hist_addr; if (!ctl) return -EINVAL; if ((PP_BLOCK(config->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(config->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2065,18 +2038,13 @@ int mdss_mdp_hist_lut_config(struct mdss_mdp_ctl *ctl, } enhist_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, struct mdp_dither_cfg_data *config, int mdss_mdp_dither_config(struct mdp_dither_cfg_data *config, u32 *copyback) { u32 disp_num; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) Loading @@ -2089,12 +2057,10 @@ int mdss_mdp_dither_config(struct mdss_mdp_ctl *ctl, mdss_pp_res->dither_disp_cfg[disp_num] = *config; mdss_pp_res->pp_disp_flags[disp_num] |= PP_FLAGS_DIRTY_DITHER; mutex_unlock(&mdss_pp_mutex); mdss_mdp_pp_setup(ctl); return 0; } int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, struct mdp_gamut_cfg_data *config, int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config, u32 *copyback) { int i, j, size_total = 0, ret = 0; Loading @@ -2107,9 +2073,6 @@ int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, uint16_t *b_tbl[MDP_GAMUT_TABLE_NUM]; char __iomem *addr; if (!ctl) return -EINVAL; if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) || (config->block >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2232,8 +2195,6 @@ int mdss_mdp_gamut_config(struct mdss_mdp_ctl *ctl, } gamut_config_exit: mutex_unlock(&mdss_pp_mutex); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } static void pp_hist_read(char __iomem *v_addr, Loading Loading @@ -2276,7 +2237,7 @@ static int pp_histogram_enable(struct pp_hist_col_info *hist_info, hist_info->col_state = HIST_RESET; hist_info->col_en = true; spin_unlock_irqrestore(&hist_info->hist_lock, flag); hist_info->is_kick_ready = false; hist_info->is_kick_ready = true; mdss_mdp_hist_irq_enable(3 << shift_bit); writel_relaxed(req->frame_cnt, ctl_base + 8); /* Kick out reset start */ Loading @@ -2286,8 +2247,7 @@ exit: return ret; } int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, struct mdp_histogram_start_req *req) int mdss_mdp_histogram_start(struct mdp_histogram_start_req *req) { u32 done_shift_bit; char __iomem *ctl_base; Loading @@ -2297,8 +2257,6 @@ int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, u32 mixer_cnt, mixer_id[MDSS_MDP_INTF_MAX_LAYERMIXER]; struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(req->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(req->block) >= MDP_BLOCK_MAX)) Loading Loading @@ -2365,31 +2323,6 @@ int mdss_mdp_histogram_start(struct mdss_mdp_ctl *ctl, mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); hist_exit: if (!ret && (PP_LOCAT(req->block) == MDSS_PP_DSPP_CFG)) { mdss_mdp_pp_setup(ctl); /* wait for a frame to let histrogram enable itself */ /* TODO add hysteresis value to be able to remove this sleep */ usleep(41666); for (i = 0; i < mixer_cnt; i++) { dspp_num = mixer_id[i]; hist_info = &mdss_pp_res->dspp_hist[dspp_num]; mutex_lock(&hist_info->hist_mutex); hist_info->is_kick_ready = true; mutex_unlock(&hist_info->hist_mutex); } } else if (!ret) { for (i = 0; i < MDSS_PP_ARG_NUM; i++) { if (!PP_ARG(i, req->block)) continue; pr_info("PP_ARG(%d) = %d", i, PP_ARG(i, req->block)); pipe = mdss_mdp_pipe_get(mdata, BIT(i)); if (IS_ERR_OR_NULL(pipe)) continue; hist_info = &pipe->pp_res.hist; hist_info->is_kick_ready = true; mdss_mdp_pipe_unmap(pipe); } } return ret; } Loading Loading @@ -2418,7 +2351,7 @@ exit: return ret; } int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) int mdss_mdp_histogram_stop(u32 block) { int i, ret = 0; char __iomem *ctl_base; Loading @@ -2428,9 +2361,6 @@ int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading Loading @@ -2495,13 +2425,10 @@ int mdss_mdp_histogram_stop(struct mdss_mdp_ctl *ctl, u32 block) hist_stop_clk: mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF, false); hist_stop_exit: if (!ret && (PP_LOCAT(block) == MDSS_PP_DSPP_CFG)) mdss_mdp_pp_setup(ctl); return ret; } static int pp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist, static int pp_hist_collect(struct mdp_histogram_data *hist, struct pp_hist_col_info *hist_info, char __iomem *ctl_base) { Loading @@ -2525,9 +2452,6 @@ static int pp_hist_collect(struct mdss_mdp_ctl *ctl, spin_unlock_irqrestore(&hist_info->hist_lock, flag); timeout = HIST_WAIT_TIMEOUT(hist_info->frame_cnt); mutex_unlock(&hist_info->hist_mutex); /* flush updates before wait*/ if (PP_LOCAT(hist->block) == MDSS_PP_DSPP_CFG) mdss_mdp_pp_setup(ctl); if (PP_LOCAT(hist->block) == MDSS_PP_SSPP_CFG) { res = container_of(hist_info, struct mdss_pipe_pp_res, hist); Loading Loading @@ -2588,8 +2512,7 @@ hist_collect_exit: return ret; } int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdp_histogram_data *hist) int mdss_mdp_hist_collect(struct mdp_histogram_data *hist) { int i, j, off, ret = 0; struct pp_hist_col_info *hist_info; Loading @@ -2603,9 +2526,6 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, struct mdss_mdp_pipe *pipe; struct mdss_data_type *mdata = mdss_mdp_get_mdata(); if (!ctl) return -EINVAL; if ((PP_BLOCK(hist->block) < MDP_LOGICAL_BLOCK_DISP_0) || (PP_BLOCK(hist->block) >= MDP_BLOCK_MAX)) return -EINVAL; Loading @@ -2632,7 +2552,7 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, hist_info = &mdss_pp_res->dspp_hist[dspp_num]; ctl_base = mdss_mdp_get_dspp_addr_off(dspp_num) + MDSS_MDP_REG_DSPP_HIST_CTL_BASE; ret = pp_hist_collect(ctl, hist, hist_info, ctl_base); ret = pp_hist_collect(hist, hist_info, ctl_base); if (ret) goto hist_collect_exit; } Loading Loading @@ -2701,7 +2621,7 @@ int mdss_mdp_hist_collect(struct mdss_mdp_ctl *ctl, hist_info = &pipe->pp_res.hist; ctl_base = pipe->base + MDSS_MDP_REG_VIG_HIST_CTL_BASE; ret = pp_hist_collect(ctl, hist, hist_info, ctl_base); ret = pp_hist_collect(hist, hist_info, ctl_base); mdss_mdp_pipe_unmap(pipe); if (ret) goto hist_collect_exit; Loading Loading @@ -2994,8 +2914,6 @@ int mdss_mdp_ad_config(struct msm_fb_data_type *mfd, } mutex_unlock(&ad->lock); ctl = mfd_to_ctl(mfd); if (!ret) mdss_mdp_pp_setup(ctl); return ret; } Loading @@ -3003,7 +2921,6 @@ int mdss_mdp_ad_input(struct msm_fb_data_type *mfd, struct mdss_ad_input *input, int wait) { int ret = 0; struct mdss_ad_info *ad; struct mdss_mdp_ctl *ctl; u32 bl; ret = mdss_mdp_get_ad(mfd, &ad); Loading Loading @@ -3079,8 +2996,6 @@ error: init_completion(&ad->comp); mutex_unlock(&ad->lock); } ctl = mfd_to_ctl(mfd); mdss_mdp_pp_setup(ctl); if (wait) { ret = wait_for_completion_interruptible_timeout( &ad->comp, HIST_WAIT_TIMEOUT(1)); Loading Loading @@ -3438,7 +3353,7 @@ static void pp_ad_calc_worker(struct work_struct *work) } mutex_unlock(&ad->lock); mutex_lock(&mfd->lock); mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, BIT(13 + ad->num)); ctl->flush_bits |= BIT(13 + ad->num); mutex_unlock(&mfd->lock); /* Trigger update notify to wake up those waiting for display updates */ Loading