Skip to content

Commit

Permalink
Merge "msm: mdss: Replace the size check for gamut LUTs"
Browse files Browse the repository at this point in the history
  • Loading branch information
Linux Build Service Account authored and Gerrit - the friendly Code Review server committed Oct 15, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 7bf2b14 + d8417e7 commit ce64606
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions drivers/video/msm/mdss/mdss_mdp_pp.c
Original file line number Diff line number Diff line change
@@ -295,6 +295,9 @@ static void pp_update_argc_lut(u32 offset,
struct mdp_pgc_lut_data *config);
static void pp_update_hist_lut(char __iomem *base,
struct mdp_hist_lut_data *cfg);
static int pp_gm_has_invalid_lut_size(struct mdp_gamut_cfg_data *config);
static void pp_gamut_config(struct mdp_gamut_cfg_data *gamut_cfg,
u32 base, struct pp_sts_type *pp_sts);
static void pp_pa_config(unsigned long flags, u32 base,
struct pp_sts_type *pp_sts,
struct mdp_pa_cfg *pa_config);
@@ -2038,10 +2041,32 @@ int mdss_mdp_dither_config(struct mdp_dither_cfg_data *config,
return 0;
}

static int pp_gm_has_invalid_lut_size(struct mdp_gamut_cfg_data *config)
{
if (config->tbl_size[0] != GAMUT_T0_SIZE)
return -EINVAL;
if (config->tbl_size[1] != GAMUT_T1_SIZE)
return -EINVAL;
if (config->tbl_size[2] != GAMUT_T2_SIZE)
return -EINVAL;
if (config->tbl_size[3] != GAMUT_T3_SIZE)
return -EINVAL;
if (config->tbl_size[4] != GAMUT_T4_SIZE)
return -EINVAL;
if (config->tbl_size[5] != GAMUT_T5_SIZE)
return -EINVAL;
if (config->tbl_size[6] != GAMUT_T6_SIZE)
return -EINVAL;
if (config->tbl_size[7] != GAMUT_T7_SIZE)
return -EINVAL;

return 0;
}

int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config,
u32 *copyback)
{
int i, j, size_total = 0, ret = 0;
int i, j, ret = 0;
u32 offset, disp_num, dspp_num = 0;
uint16_t *tbl_off;
struct mdp_gamut_cfg_data local_cfg;
@@ -2053,9 +2078,8 @@ int mdss_mdp_gamut_config(struct mdp_gamut_cfg_data *config,
if ((config->block < MDP_LOGICAL_BLOCK_DISP_0) ||
(config->block >= MDP_BLOCK_MAX))
return -EINVAL;
for (i = 0; i < MDP_GAMUT_TABLE_NUM; i++)
size_total += config->tbl_size[i];
if (size_total != GAMUT_TOTAL_TABLE_SIZE)

if (pp_gm_has_invalid_lut_size(config))
return -EINVAL;

mutex_lock(&mdss_pp_mutex);

0 comments on commit ce64606

Please sign in to comment.