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

Commit 2c426659 authored by Vinu Deokaran's avatar Vinu Deokaran Committed by Ping Li
Browse files

msm: mdss: add csc tables for mdp5 for various color spaces



Add csc tables for 601 full, 601 limited and 709 limited
to support different csc matrices.

HAL provides color space request to driver, consider it
to choose appropriate matrix for conversion.

This will help in solving artifacts during GPU/MDP switches
so that both GPU and MDP choose same matrix for conversion.

Change-Id: Idd73e0695ea64d0c0bd778dba07199e209ca6f3d
Signed-off-by: default avatarVinu Deokaran <vinud@codeaurora.org>
Signed-off-by: default avatarKalyan Thota <kalyant@codeaurora.org>
Signed-off-by: default avatarPing Li <pingli@codeaurora.org>
parent c049a981
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,10 @@ void mdss_hw_init(struct mdss_data_type *mdata)
		writel_relaxed(1, offset + 16);
	}

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

	mdata->nmax_concurrent_ad_hw =
		(mdata->mdp_rev < MDSS_MDP_HW_REV_103) ? 1 : 2;

+21 −3
Original line number Diff line number Diff line
@@ -128,10 +128,14 @@ enum mdss_mdp_block_type {
};

enum mdss_mdp_csc_type {
	MDSS_MDP_CSC_RGB2RGB,
	MDSS_MDP_CSC_YUV2RGB,
	MDSS_MDP_CSC_RGB2YUV,
	MDSS_MDP_CSC_YUV2RGB_601L,
	MDSS_MDP_CSC_YUV2RGB_601FR,
	MDSS_MDP_CSC_YUV2RGB_709L,
	MDSS_MDP_CSC_RGB2YUV_601L,
	MDSS_MDP_CSC_RGB2YUV_601FR,
	MDSS_MDP_CSC_RGB2YUV_709L,
	MDSS_MDP_CSC_YUV2YUV,
	MDSS_MDP_CSC_RGB2RGB,
	MDSS_MDP_MAX_CSC
};

@@ -566,6 +570,7 @@ struct mdss_mdp_pipe {
	u8 chroma_sample_v;

	u32 frame_rate;
	u8 csc_coeff_set;
};

struct mdss_mdp_writeback_arg {
@@ -942,6 +947,19 @@ static inline u32 mdss_mdp_get_cursor_frame_size(struct mdss_data_type *mdata)
	return mdata->max_cursor_size *  mdata->max_cursor_size * 4;
}

static inline uint8_t pp_vig_csc_pipe_val(struct mdss_mdp_pipe *pipe)
{
	switch (pipe->csc_coeff_set) {
	case MDP_CSC_ITU_R_601:
		return MDSS_MDP_CSC_YUV2RGB_601L;
	case MDP_CSC_ITU_R_601_FR:
		return MDSS_MDP_CSC_YUV2RGB_601FR;
	case MDP_CSC_ITU_R_709:
	default:
		return  MDSS_MDP_CSC_YUV2RGB_709L;
	}
}

irqreturn_t mdss_mdp_isr(int irq, void *ptr);
void mdss_mdp_irq_clear(struct mdss_data_type *mdata,
		u32 intr_type, u32 intf_num);
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ static int mdss_mdp_cdm_csc_setup(struct mdss_mdp_cdm *cdm,
	int rc = 0;
	u32 op_mode = 0;

	if (data->csc_type == MDSS_MDP_CSC_RGB2YUV) {
	if (data->csc_type == MDSS_MDP_CSC_RGB2YUV_601L) {
		op_mode |= BIT(2);  /* DST_DATA_FORMAT = YUV */
		op_mode &= ~BIT(1); /* SRC_DATA_FORMAT = RGB */
		op_mode |= BIT(0);  /* EN = 1 */
+1 −1
Original line number Diff line number Diff line
@@ -1213,7 +1213,7 @@ static int mdss_mdp_video_cdm_setup(struct mdss_mdp_cdm *cdm,
	}
	setup.out_format = pinfo->out_format;
	if (fmt->is_yuv)
		setup.csc_type = MDSS_MDP_CSC_RGB2YUV;
		setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
	else
		setup.csc_type = MDSS_MDP_CSC_RGB2RGB;

+2 −2
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static int mdss_mdp_writeback_cdm_setup(struct mdss_mdp_writeback_ctx *ctx,
	}

	if (fmt->is_yuv)
		setup.csc_type = MDSS_MDP_CSC_RGB2YUV;
		setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
	else
		setup.csc_type = MDSS_MDP_CSC_RGB2RGB;

@@ -258,7 +258,7 @@ static int mdss_mdp_writeback_format_setup(struct mdss_mdp_writeback_ctx *ctx,
	if (ctx->type != MDSS_MDP_WRITEBACK_TYPE_ROTATOR &&
		fmt->is_yuv && !ctl->cdm) {
		mdss_mdp_csc_setup(MDSS_MDP_BLOCK_WB, ctx->wb_num,
				   MDSS_MDP_CSC_RGB2YUV);
				   MDSS_MDP_CSC_RGB2YUV_601L);
		opmode |= (1 << 8) |	/* CSC_EN */
			  (0 << 9) |	/* SRC_DATA=RGB */
			  (1 << 10);	/* DST_DATA=YCBCR */
Loading