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

Commit 3f5958b2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: Add VIG double buffered CSC capability"

parents 32504b6a f1b8a000
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2780,6 +2780,8 @@ ssize_t mdss_mdp_show_capabilities(struct device *dev,
		SPRINT(" avr");
	if (mdss_has_quirk(mdata, MDSS_QUIRK_HDR_SUPPORT_ENABLED))
		SPRINT(" hdr");
	if (mdata->nvig_pipes && mdata->mdp_rev >= MDSS_MDP_HW_REV_300)
		SPRINT(" vig_csc_db"); /* double buffered VIG CSC block */
	SPRINT("\n");
#undef SPRINT

+21 −16
Original line number Diff line number Diff line
@@ -975,26 +975,31 @@ 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;
	struct mdss_mdp_format_params *layer_src_fmt;
	struct mdss_data_type *mdata = mfd_to_mdata(pipe->mfd);
	bool is_csc_db = (mdata->mdp_rev < MDSS_MDP_HW_REV_300) ? false : true;

	layer_src_fmt = mdss_mdp_get_format_params(layer->buffer.format);
	if (!layer_src_fmt) {
		pr_err("Invalid layer format %d\n", layer->buffer.format);
		status = -EINVAL;
		goto err_exit;
	}

	/*
	 * csc registers are not double buffered. It is not permitted
	 * to change them on staged pipe with YUV layer.
	 * HW earlier to sdm 3.x.x does not support double buffer CSC.
	 * Invalidate any reconfig of CSC block on staged pipe.
	 */
	if (pipe->csc_coeff_set != layer->color_space) {
		src_fmt = mdss_mdp_get_format_params(layer->buffer.format);
		if (!src_fmt) {
			pr_err("Invalid layer format %d\n",
						layer->buffer.format);
	if (!is_csc_db &&
		((!!pipe->src_fmt->is_yuv != !!layer_src_fmt->is_yuv) ||
		(pipe->src_fmt->is_yuv && layer_src_fmt->is_yuv &&
		pipe->csc_coeff_set != layer->color_space))) {
		pr_err("CSC reconfig not allowed on staged pipe\n");
		status = -EINVAL;
		} else {
			if (pipe->src_fmt->is_yuv && src_fmt &&
							src_fmt->is_yuv) {
				status = -EPERM;
				pr_err("csc change is not permitted on used pipe\n");
			}
		}
		goto err_exit;
	}

err_exit:
	return status;
}