diff options
| author | Ping Li <pingli@codeaurora.org> | 2016-09-22 12:54:42 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-11-28 18:54:41 -0800 |
| commit | cb2d7844a28eff4b546b9de8aa95d081fd61b775 (patch) | |
| tree | 59891a8ab4403dbaad8206329f12e1c9ea8eba9f | |
| parent | 9aa1df0cf5ffb58b52b55b4fe2ea6531f795e186 (diff) | |
msm: mdss: Optimize Gamut Mapping programming sequence
Gamut mapping feature has a huge size 3D LUT table, which consumes
a lot of time to program. This patch optimizes the programming of
the 3D LUT to reduce about half of the register writes.
Change-Id: I4a9fcee6c1cd70d9c04426c394e480c11a6f4648
Signed-off-by: Ping Li <pingli@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp_v1_7.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp_v1_7.c b/drivers/video/fbdev/msm/mdss_mdp_pp_v1_7.c index 1e4adc984802..71cab148e1c3 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp_v1_7.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp_v1_7.c @@ -833,6 +833,8 @@ static int pp_gamut_set_config(char __iomem *base_addr, struct mdp_gamut_cfg_data *gamut_cfg_data = NULL; struct mdp_gamut_data_v1_7 *gamut_data = NULL; char __iomem *base_addr_scale = base_addr; + uint64_t gamut_val; + if (!base_addr || !cfg_data || !pp_sts) { pr_err("invalid params base_addr %pK cfg_data %pK pp_sts_type %pK\n", base_addr, cfg_data, pp_sts); @@ -900,12 +902,18 @@ static int pp_gamut_set_config(char __iomem *base_addr, val = index_start; val |= GAMUT_TABLE_SELECT(i); writel_relaxed(val, (base_addr + GAMUT_TABLE_INDEX)); - for (j = 0; j < gamut_data->tbl_size[i]; j++) { - writel_relaxed(gamut_data->c1_c2_data[i][j], - base_addr + GAMUT_TABLE_LOWER_GB); - writel_relaxed(gamut_data->c0_data[i][j], - base_addr + GAMUT_TABLE_UPPER_R); + + writel_relaxed(gamut_data->c1_c2_data[i][0], + base_addr + GAMUT_TABLE_LOWER_GB); + for (j = 0; j < gamut_data->tbl_size[i] - 1 ; j++) { + gamut_val = gamut_data->c1_c2_data[i][j + 1]; + gamut_val = (gamut_val << 32) | + gamut_data->c0_data[i][j]; + writeq_relaxed(gamut_val, + base_addr + GAMUT_TABLE_UPPER_R); } + writel_relaxed(gamut_data->c0_data[i][j], + base_addr + GAMUT_TABLE_UPPER_R); if ((i >= MDP_GAMUT_SCALE_OFF_TABLE_NUM) || (!gamut_data->map_en)) continue; |
