msm: mdss: update csc table on cdm block based on configuration

Update csc type table on cdm block based on configuration
from kernel client. Add proper validation checks in wfd
interface before updating the csc table to valid selection.

Change-Id: Id3a0f68c30919029df01e003a1bcb39ff894574c
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Krishna Srinivas <krisrini@codeaurora.org>
This commit is contained in:
Krishna Srinivas 2016-05-25 14:29:39 -07:00 committed by Harsh Sahu
parent db37c5bdcc
commit 99b8438d0e
6 changed files with 35 additions and 8 deletions

View file

@ -476,6 +476,7 @@ struct mdss_mdp_ctl {
/* used for WFD */
u32 dst_format;
enum mdss_mdp_csc_type csc_type;
struct mult_factor dst_comp_ratio;
u32 clk_rate;

View file

@ -135,7 +135,9 @@ static int mdss_mdp_cdm_csc_setup(struct mdss_mdp_cdm *cdm,
mdss_mdp_csc_setup(MDSS_MDP_BLOCK_CDM, cdm->num, data->csc_type);
if (data->csc_type == MDSS_MDP_CSC_RGB2YUV_601L) {
if ((data->csc_type == MDSS_MDP_CSC_RGB2YUV_601L) ||
(data->csc_type == MDSS_MDP_CSC_RGB2YUV_601FR) ||
(data->csc_type == MDSS_MDP_CSC_RGB2YUV_709L)) {
op_mode |= BIT(2); /* DST_DATA_FORMAT = YUV */
op_mode &= ~BIT(1); /* SRC_DATA_FORMAT = RGB */
op_mode |= BIT(0); /* EN = 1 */

View file

@ -1798,7 +1798,7 @@ static int mdss_mdp_video_cdm_setup(struct mdss_mdp_cdm *cdm,
struct mdp_cdm_cfg setup;
if (fmt->is_yuv)
setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601FR;
else
setup.csc_type = MDSS_MDP_CSC_RGB2RGB;

View file

@ -57,6 +57,7 @@ struct mdss_mdp_writeback_ctx {
u16 width;
u16 height;
u16 frame_rate;
enum mdss_mdp_csc_type csc_type;
struct mdss_rect dst_rect;
u32 dnsc_factor_w;
@ -206,11 +207,6 @@ static int mdss_mdp_writeback_cdm_setup(struct mdss_mdp_writeback_ctx *ctx,
{
struct mdp_cdm_cfg setup;
if (fmt->is_yuv)
setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
else
setup.csc_type = MDSS_MDP_CSC_RGB2RGB;
if (fmt->is_yuv)
setup.csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
else
@ -239,6 +235,7 @@ static int mdss_mdp_writeback_cdm_setup(struct mdss_mdp_writeback_ctx *ctx,
setup.mdp_csc_bit_depth = MDP_CDM_CSC_8BIT;
setup.output_width = ctx->width;
setup.output_height = ctx->height;
setup.csc_type = ctx->csc_type;
return mdss_mdp_cdm_setup(cdm, &setup);
}
@ -541,6 +538,7 @@ static int mdss_mdp_writeback_prepare_wfd(struct mdss_mdp_ctl *ctl, void *arg)
ctx->width = ctl->width;
ctx->height = ctl->height;
ctx->frame_rate = ctl->frame_rate;
ctx->csc_type = ctl->csc_type;
ctx->dst_rect.x = 0;
ctx->dst_rect.y = 0;
ctx->dst_rect.w = ctx->width;

View file

@ -152,6 +152,7 @@ int mdss_mdp_wfd_setup(struct mdss_mdp_wfd *wfd,
u32 wb_idx = layer->writeback_ndx;
struct mdss_mdp_ctl *ctl = wfd->ctl;
struct mdss_mdp_writeback *wb = NULL;
struct mdss_mdp_format_params *fmt = NULL;
int ret = 0;
u32 width, height, max_mixer_width;
@ -192,6 +193,26 @@ int mdss_mdp_wfd_setup(struct mdss_mdp_wfd *wfd,
ctl->roi = (struct mdss_rect) {0, 0, width, height};
ctl->is_secure = (layer->flags & MDP_LAYER_SECURE_SESSION);
fmt = mdss_mdp_get_format_params(layer->buffer.format);
/* only 3 csc type supported */
if (fmt->is_yuv) {
switch (layer->color_space) {
case MDP_CSC_ITU_R_601:
ctl->csc_type = MDSS_MDP_CSC_RGB2YUV_601L;
break;
case MDP_CSC_ITU_R_709:
ctl->csc_type = MDSS_MDP_CSC_RGB2YUV_709L;
break;
case MDP_CSC_ITU_R_601_FR:
default:
ctl->csc_type = MDSS_MDP_CSC_RGB2YUV_601FR;
break;
}
} else {
ctl->csc_type = MDSS_MDP_CSC_RGB2RGB;
}
if (ctl->mdata->wfd_mode == MDSS_MDP_WFD_INTERFACE) {
ctl->mixer_left = mdss_mdp_mixer_alloc(ctl,
MDSS_MDP_MIXER_TYPE_INTF, (width > max_mixer_width), 0);

View file

@ -165,6 +165,8 @@ VALIDATE/COMMIT FLAG CONFIGURATION
#define MDP_COMMIT_VERSION_1_0 0x00010000
#define OUT_LAYER_COLOR_SPACE
/**********************************************************************
Configuration structures
All parameters are input to driver unless mentioned output parameter
@ -357,8 +359,11 @@ struct mdp_output_layer {
/* Buffer attached with output layer. Device uses it for commit call */
struct mdp_layer_buffer buffer;
/* color space of the destination */
enum mdp_color_space color_space;
/* 32bits reserved value for future usage. */
uint32_t reserved[6];
uint32_t reserved[5];
};
/*