msm: mdss: Fix scaler enable flag setting

Scaler enable flag should be validated after copying the
scaler structure from the user space driver. For qseed2
scaler the enable flag should be set to true if this structure
is populated from user space driver.

CRs-Fixed: 1094768
Change-Id: I21b23137dcb310793656d7104594803d1727bbaa
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This commit is contained in:
Abhijit Kulkarni 2016-11-22 20:32:06 -08:00
parent 368fecd7df
commit f3b323b0a2
2 changed files with 11 additions and 4 deletions

View file

@ -4242,6 +4242,7 @@ static void __mdss_fb_copy_pixel_ext(struct mdp_scale_data *src,
{
if (!src || !dest)
return;
dest->enable = true;
memcpy(dest->init_phase_x, src->init_phase_x,
sizeof(src->init_phase_x));
memcpy(dest->phase_step_x, src->phase_step_x,

View file

@ -1034,7 +1034,6 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd,
if (layer->flags & MDP_LAYER_SECURE_CAMERA_SESSION)
pipe->flags |= MDP_SECURE_CAMERA_OVERLAY_SESSION;
pipe->scaler.enable = (layer->flags & SCALER_ENABLED);
pipe->is_fg = layer->flags & MDP_LAYER_FORGROUND;
pipe->img_width = layer->buffer.width & 0x3fff;
pipe->img_height = layer->buffer.height & 0x3fff;
@ -1067,6 +1066,16 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd,
pipe->src.x, pipe->src.y, pipe->src.w, pipe->src.h,
pipe->dst.x, pipe->dst.y, pipe->dst.w, pipe->dst.h);
if (layer->flags & SCALER_ENABLED) {
memcpy(&pipe->scaler, layer->scale,
sizeof(struct mdp_scale_data_v2));
/* Sanitize enable flag */
pipe->scaler.enable &= (ENABLE_SCALE | ENABLE_DETAIL_ENHANCE |
ENABLE_DIRECTION_DETECTION);
} else {
pipe->scaler.enable = 0;
}
flags = pipe->flags;
if (is_single_layer)
flags |= PERF_CALC_PIPE_SINGLE_LAYER;
@ -1189,9 +1198,6 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd,
}
}
if (layer->flags & SCALER_ENABLED)
memcpy(&pipe->scaler, layer->scale,
sizeof(struct mdp_scale_data_v2));
ret = mdss_mdp_overlay_setup_scaling(pipe);
if (ret) {
pr_err("scaling setup failed %d\n", ret);