提交 807fc072 编写于 作者: Y Yue Hin Lau 提交者: Alex Deucher

drm/amd/display: call set csc_default if enable adjustment is false

Fixes a greenish tint on RV displays.
Signed-off-by: NYue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: NEric Bernstein <Eric.Bernstein@amd.com>
Acked-by: NHarry Wentland <harry.wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
[drake@endlessm.com: backport to 4.15]
Signed-off-by: NDaniel Drake <drake@endlessm.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 03bfd4e1
...@@ -1360,7 +1360,7 @@ void dpp1_cm_set_output_csc_adjustment( ...@@ -1360,7 +1360,7 @@ void dpp1_cm_set_output_csc_adjustment(
void dpp1_cm_set_output_csc_default( void dpp1_cm_set_output_csc_default(
struct dpp *dpp_base, struct dpp *dpp_base,
const struct default_adjustment *default_adjust); enum dc_color_space colorspace);
void dpp1_cm_set_gamut_remap( void dpp1_cm_set_gamut_remap(
struct dpp *dpp, struct dpp *dpp,
......
...@@ -225,14 +225,13 @@ void dpp1_cm_set_gamut_remap( ...@@ -225,14 +225,13 @@ void dpp1_cm_set_gamut_remap(
void dpp1_cm_set_output_csc_default( void dpp1_cm_set_output_csc_default(
struct dpp *dpp_base, struct dpp *dpp_base,
const struct default_adjustment *default_adjust) enum dc_color_space colorspace)
{ {
struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base); struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);
uint32_t ocsc_mode = 0; uint32_t ocsc_mode = 0;
if (default_adjust != NULL) { switch (colorspace) {
switch (default_adjust->out_color_space) {
case COLOR_SPACE_SRGB: case COLOR_SPACE_SRGB:
case COLOR_SPACE_2020_RGB_FULLRANGE: case COLOR_SPACE_2020_RGB_FULLRANGE:
ocsc_mode = 0; ocsc_mode = 0;
...@@ -253,7 +252,6 @@ void dpp1_cm_set_output_csc_default( ...@@ -253,7 +252,6 @@ void dpp1_cm_set_output_csc_default(
case COLOR_SPACE_UNKNOWN: case COLOR_SPACE_UNKNOWN:
default: default:
break; break;
}
} }
REG_SET(CM_OCSC_CONTROL, 0, CM_OCSC_MODE, ocsc_mode); REG_SET(CM_OCSC_CONTROL, 0, CM_OCSC_MODE, ocsc_mode);
......
...@@ -2097,6 +2097,8 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx, ...@@ -2097,6 +2097,8 @@ static void program_csc_matrix(struct pipe_ctx *pipe_ctx,
tbl_entry.color_space = color_space; tbl_entry.color_space = color_space;
//tbl_entry.regval = matrix; //tbl_entry.regval = matrix;
pipe_ctx->plane_res.dpp->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.dpp, &tbl_entry); pipe_ctx->plane_res.dpp->funcs->opp_set_csc_adjustment(pipe_ctx->plane_res.dpp, &tbl_entry);
} else {
pipe_ctx->plane_res.dpp->funcs->opp_set_csc_default(pipe_ctx->plane_res.dpp, colorspace);
} }
} }
static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx) static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx)
......
...@@ -64,7 +64,7 @@ struct dpp_funcs { ...@@ -64,7 +64,7 @@ struct dpp_funcs {
void (*opp_set_csc_default)( void (*opp_set_csc_default)(
struct dpp *dpp, struct dpp *dpp,
const struct default_adjustment *default_adjust); enum dc_color_space colorspace);
void (*opp_set_csc_adjustment)( void (*opp_set_csc_adjustment)(
struct dpp *dpp, struct dpp *dpp,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册