Commit f02b8f4d authored by Nicholas Kazlauskas's avatar Nicholas Kazlauskas Committed by Greg Kroah-Hartman

drm/amd/display: Use plane->color_space for dpp if specified

[ Upstream commit a1e07ba8 ]

[Why]
The input color space for the plane was previously ignored even if it
was set.

If a limited range YUV format was given to DC then the
wrong color transformation matrix was being used since DC assumed that
it was full range instead.

[How]
Respect the given color_space format for the plane if it isn't
COLOR_SPACE_UNKNOWN. Otherwise, use the implicit default since DM
didn't specify.
Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: default avatarSun peng Li <Sunpeng.Li@amd.com>
Acked-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent cac1f3c2
...@@ -392,6 +392,10 @@ void dpp1_cnv_setup ( ...@@ -392,6 +392,10 @@ void dpp1_cnv_setup (
default: default:
break; break;
} }
/* Set default color space based on format if none is given. */
color_space = input_color_space ? input_color_space : color_space;
REG_SET(CNVC_SURFACE_PIXEL_FORMAT, 0, REG_SET(CNVC_SURFACE_PIXEL_FORMAT, 0,
CNVC_SURFACE_PIXEL_FORMAT, pixel_format); CNVC_SURFACE_PIXEL_FORMAT, pixel_format);
REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en); REG_UPDATE(FORMAT_CONTROL, FORMAT_CONTROL__ALPHA_EN, alpha_en);
...@@ -403,7 +407,7 @@ void dpp1_cnv_setup ( ...@@ -403,7 +407,7 @@ void dpp1_cnv_setup (
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
tbl_entry.regval[i] = input_csc_color_matrix.matrix[i]; tbl_entry.regval[i] = input_csc_color_matrix.matrix[i];
tbl_entry.color_space = input_color_space; tbl_entry.color_space = color_space;
if (color_space >= COLOR_SPACE_YCBCR601) if (color_space >= COLOR_SPACE_YCBCR601)
select = INPUT_CSC_SELECT_ICSC; select = INPUT_CSC_SELECT_ICSC;
......
...@@ -1936,7 +1936,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state) ...@@ -1936,7 +1936,7 @@ static void update_dpp(struct dpp *dpp, struct dc_plane_state *plane_state)
plane_state->format, plane_state->format,
EXPANSION_MODE_ZERO, EXPANSION_MODE_ZERO,
plane_state->input_csc_color_matrix, plane_state->input_csc_color_matrix,
COLOR_SPACE_YCBCR601_LIMITED); plane_state->color_space);
//set scale and bias registers //set scale and bias registers
build_prescale_params(&bns_params, plane_state); build_prescale_params(&bns_params, plane_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment