summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
diff options
context:
space:
mode:
authorCharlene Liu <charlene.liu@amd.com>2017-02-01 20:35:53 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:13:37 -0400
commitcc4d99b8a888e16093b985d6a11fbd37ab92697c (patch)
tree82fe0d1328638f8252068ad2853b618594137921 /drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
parent8fde5884f4a18dec81ab5d498bf7bf3c156f8dfb (diff)
drm/amd/display: HDMI YCbCr422 12bpc pixel format issue
Signed-off-by: Charlene Liu <charlene.liu@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce/dce_opp.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_opp.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
index 9247afd4d42f..a2f57cf603aa 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
@@ -366,19 +366,37 @@ static void set_truncation(
FMT_TRUNCATE_EN, 0,
FMT_TRUNCATE_DEPTH, 0,
FMT_TRUNCATE_MODE, 0);
- /* no 10bpc trunc on DCE11*/
+
+
+ if (params->pixel_encoding == PIXEL_ENCODING_YCBCR422) {
+ /* 8bpc trunc on YCbCr422*/
+ if (params->flags.TRUNCATE_DEPTH == 1)
+ REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
+ FMT_TRUNCATE_EN, 1,
+ FMT_TRUNCATE_DEPTH, 1,
+ FMT_TRUNCATE_MODE, 0);
+ else if (params->flags.TRUNCATE_DEPTH == 2)
+ /* 10bpc trunc on YCbCr422*/
+ REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
+ FMT_TRUNCATE_EN, 1,
+ FMT_TRUNCATE_DEPTH, 2,
+ FMT_TRUNCATE_MODE, 0);
+ return;
+ }
+ /* on other format-to do */
if (params->flags.TRUNCATE_ENABLED == 0 ||
- params->flags.TRUNCATE_DEPTH == 2)
+ params->flags.TRUNCATE_DEPTH == 2)
return;
-
/*Set truncation depth and Enable truncation*/
REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
- FMT_TRUNCATE_EN, 1,
- FMT_TRUNCATE_DEPTH, params->flags.TRUNCATE_MODE,
- FMT_TRUNCATE_MODE, params->flags.TRUNCATE_DEPTH);
-
+ FMT_TRUNCATE_EN, 1,
+ FMT_TRUNCATE_DEPTH,
+ params->flags.TRUNCATE_MODE,
+ FMT_TRUNCATE_MODE,
+ params->flags.TRUNCATE_DEPTH);
}
+
/**
* set_spatial_dither
* 1) set spatial dithering mode: pattern of seed