Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 588758f4 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

msm: mdss: fix csc params config on source pipe



Commit 0717dcb8 ("uapi:
msm: mdp: Add color space in mdp_input_layer") adds
the csc params member on input layer but does not
pass the same configuration to sspp pipes. Post
Processing module will select the default CSC table
without this configuration.

The CSC configuration on MDSS hardware is not double
buffered. This needs additional input layer validation
check against CSC reconfiguration on staged pipes.

Change-Id: I3e6ea00fc426501cbbbeffa4545ed9cff711dcb4
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 2f2a03e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1510,7 +1510,7 @@ void mdss_hw_init(struct mdss_data_type *mdata)


	/* initialize csc matrix default value */
	/* initialize csc matrix default value */
	for (i = 0; i < mdata->nvig_pipes; i++)
	for (i = 0; i < mdata->nvig_pipes; i++)
		vig[i].csc_coeff_set = MDSS_MDP_CSC_YUV2RGB_709L;
		vig[i].csc_coeff_set = MDP_CSC_ITU_R_709;


	mdata->nmax_concurrent_ad_hw =
	mdata->nmax_concurrent_ad_hw =
		(mdata->mdp_rev < MDSS_MDP_HW_REV_103) ? 1 : 2;
		(mdata->mdp_rev < MDSS_MDP_HW_REV_103) ? 1 : 2;
+39 −0
Original line number Original line Diff line number Diff line
@@ -331,6 +331,28 @@ static int __layer_param_check(struct msm_fb_data_type *mfd,
	return 0;
	return 0;
}
}


/* compare all reconfiguration parameter validation in this API */
static int __validate_layer_reconfig(struct mdp_input_layer *layer,
	struct mdss_mdp_pipe *pipe)
{
	int status = 0;
	struct mdss_mdp_format_params *src_fmt;

	/*
	 * csc registers are not double buffered. It is not permitted
	 * to change them on staged pipe with YUV layer.
	 */
	if (pipe->csc_coeff_set != layer->color_space) {
		src_fmt = mdss_mdp_get_format_params(layer->buffer.format);
		if (pipe->src_fmt->is_yuv && src_fmt->is_yuv) {
			status = -EPERM;
			pr_err("csc change is not permitted on used pipe\n");
		}
	}

	return status;
}

static int __validate_single_layer(struct msm_fb_data_type *mfd,
static int __validate_single_layer(struct msm_fb_data_type *mfd,
	struct mdp_input_layer *layer, u32 mixer_mux)
	struct mdp_input_layer *layer, u32 mixer_mux)
{
{
@@ -499,6 +521,7 @@ static int __configure_pipe_params(struct msm_fb_data_type *mfd,
	pipe->blend_op = layer->blend_op;
	pipe->blend_op = layer->blend_op;
	pipe->is_handed_off = false;
	pipe->is_handed_off = false;
	pipe->async_update = (layer->flags & MDP_LAYER_ASYNC) ? true : false;
	pipe->async_update = (layer->flags & MDP_LAYER_ASYNC) ? true : false;
	pipe->csc_coeff_set = layer->color_space;


	if (mixer->ctl) {
	if (mixer->ctl) {
		pipe->dst.x += mixer->ctl->border_x_off;
		pipe->dst.x += mixer->ctl->border_x_off;
@@ -906,6 +929,7 @@ static inline bool __compare_layer_config(struct mdp_input_layer *validate,
		validate->horz_deci == layer->horz_deci &&
		validate->horz_deci == layer->horz_deci &&
		validate->vert_deci == layer->vert_deci &&
		validate->vert_deci == layer->vert_deci &&
		validate->alpha == layer->alpha &&
		validate->alpha == layer->alpha &&
		validate->color_space == layer->color_space &&
		validate->z_order == (layer->z_order - MDSS_MDP_STAGE_0) &&
		validate->z_order == (layer->z_order - MDSS_MDP_STAGE_0) &&
		validate->transp_mask == layer->transp_mask &&
		validate->transp_mask == layer->transp_mask &&
		validate->bg_color == layer->bg_color &&
		validate->bg_color == layer->bg_color &&
@@ -1290,6 +1314,21 @@ static int __validate_layers(struct msm_fb_data_type *mfd,
			goto validate_exit;
			goto validate_exit;
		}
		}


		if (pipe_q_type == LAYER_USES_USED_PIPE_Q) {
			/*
			 * reconfig is allowed on new/destroy pipes. Only used
			 * pipe needs this extra validation.
			 */
			ret = __validate_layer_reconfig(layer, pipe);
			if (ret) {
				pr_err("layer reconfig validation failed=%d\n",
					ret);
				mdss_mdp_pipe_unmap(pipe);
				layer->error_code = ret;
				goto validate_exit;
			}
		}

		ret = __configure_pipe_params(mfd, layer, pipe,
		ret = __configure_pipe_params(mfd, layer, pipe,
			left_blend_pipe, is_single_layer, mixer_mux);
			left_blend_pipe, is_single_layer, mixer_mux);
		if (ret) {
		if (ret) {