From: Tony Cheng Date: Fri, 1 Sep 2017 20:14:01 +0000 (-0400) Subject: drm/amd/display: fix default dithering X-Git-Tag: v5.15~9960^2~23^2~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=603767f903bf5bf301728b197dcde63cf880fe2e;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/display: fix default dithering bug: default is mapped to no dithering. default to spatial dithering based on color depth Signed-off-by: Tony Cheng Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index ab6ad94..d5320f7 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -341,23 +341,9 @@ void set_dither_option(struct dc_stream_state *stream, return; if (option > DITHER_OPTION_MAX) return; - if (option == DITHER_OPTION_DEFAULT) { - switch (stream->timing.display_color_depth) { - case COLOR_DEPTH_666: - stream->dither_option = DITHER_OPTION_SPATIAL6; - break; - case COLOR_DEPTH_888: - stream->dither_option = DITHER_OPTION_SPATIAL8; - break; - case COLOR_DEPTH_101010: - stream->dither_option = DITHER_OPTION_SPATIAL10; - break; - default: - option = DITHER_OPTION_DISABLE; - } - } else { - stream->dither_option = option; - } + + stream->dither_option = option; + resource_build_bit_depth_reduction_params(stream, ¶ms); stream->bit_depth_params = params; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index fbf7747..ce721b7 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2607,6 +2607,22 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream, memset(fmt_bit_depth, 0, sizeof(*fmt_bit_depth)); + if (option == DITHER_OPTION_DEFAULT) { + switch (stream->timing.display_color_depth) { + case COLOR_DEPTH_666: + option = DITHER_OPTION_SPATIAL6; + break; + case COLOR_DEPTH_888: + option = DITHER_OPTION_SPATIAL8; + break; + case COLOR_DEPTH_101010: + option = DITHER_OPTION_SPATIAL10; + break; + default: + option = DITHER_OPTION_DISABLE; + } + } + if (option == DITHER_OPTION_DISABLE) return; diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 47e8b58..b36220b 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -1104,15 +1104,11 @@ static enum dc_status apply_single_controller_ctx_to_hw( stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE); -/*vbios crtc_source_selection and encoder_setup will override fmt_C*/ - if (pipe_ctx->stream->signal != SIGNAL_TYPE_EDP && - pipe_ctx->stream->signal != SIGNAL_TYPE_LVDS) { - /*for embedded panel, don't override VBIOS's setting*/ - pipe_ctx->stream_res.opp->funcs->opp_program_fmt( - pipe_ctx->stream_res.opp, - &stream->bit_depth_params, - &stream->clamping); - } + pipe_ctx->stream_res.opp->funcs->opp_program_fmt( + pipe_ctx->stream_res.opp, + &stream->bit_depth_params, + &stream->clamping); + if (dc_is_dp_signal(pipe_ctx->stream->signal)) pipe_ctx->stream_res.stream_enc->funcs->dp_set_stream_attribute( pipe_ctx->stream_res.stream_enc,