Commit 896b3cb3 authored by Charlene Liu's avatar Charlene Liu Committed by Alex Deucher

drm/amd/display: fix 12bpc truncate to 10bpc

Signed-off-by: default avatarCharlene Liu <charlene.liu@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 87b58768
...@@ -710,32 +710,32 @@ void dce110_opp_set_dyn_expansion( ...@@ -710,32 +710,32 @@ void dce110_opp_set_dyn_expansion(
enum signal_type signal) enum signal_type signal)
{ {
struct dce110_opp *opp110 = TO_DCE110_OPP(opp); struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
bool enable_dyn_exp = false;
REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL, REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
FMT_DYNAMIC_EXP_EN, 0, FMT_DYNAMIC_EXP_EN, 0,
FMT_DYNAMIC_EXP_MODE, 0); FMT_DYNAMIC_EXP_MODE, 0);
/* From HW programming guide:
FMT_DYNAMIC_EXP_EN = 0 for limited RGB or YCbCr output
FMT_DYNAMIC_EXP_EN = 1 for RGB full range only*/
if (color_sp == COLOR_SPACE_SRGB)
enable_dyn_exp = true;
/*00 - 10-bit -> 12-bit dynamic expansion*/ /*00 - 10-bit -> 12-bit dynamic expansion*/
/*01 - 8-bit -> 12-bit dynamic expansion*/ /*01 - 8-bit -> 12-bit dynamic expansion*/
if (signal == SIGNAL_TYPE_HDMI_TYPE_A) { if (signal == SIGNAL_TYPE_HDMI_TYPE_A ||
signal == SIGNAL_TYPE_DISPLAY_PORT ||
signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
switch (color_dpth) { switch (color_dpth) {
case COLOR_DEPTH_888: case COLOR_DEPTH_888:
REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL, REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
FMT_DYNAMIC_EXP_EN, enable_dyn_exp ? 1:0, FMT_DYNAMIC_EXP_EN, 1,
FMT_DYNAMIC_EXP_MODE, 1); FMT_DYNAMIC_EXP_MODE, 1);
break; break;
case COLOR_DEPTH_101010: case COLOR_DEPTH_101010:
REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL, REG_UPDATE_2(FMT_DYNAMIC_EXP_CNTL,
FMT_DYNAMIC_EXP_EN, enable_dyn_exp ? 1:0, FMT_DYNAMIC_EXP_EN, 1,
FMT_DYNAMIC_EXP_MODE, 0); FMT_DYNAMIC_EXP_MODE, 0);
break; break;
case COLOR_DEPTH_121212: case COLOR_DEPTH_121212:
REG_UPDATE_2(
FMT_DYNAMIC_EXP_CNTL,
FMT_DYNAMIC_EXP_EN, 1,/*otherwise last two bits are zero*/
FMT_DYNAMIC_EXP_MODE, 0);
break; break;
default: default:
break; break;
......
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