Commit 603767f9 authored by Tony Cheng's avatar Tony Cheng Committed by Alex Deucher

drm/amd/display: fix default dithering

bug: default is mapped to no dithering.

default to spatial dithering based on color depth
Signed-off-by: default avatarTony Cheng <tony.cheng@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 61a44fc6
...@@ -341,23 +341,9 @@ void set_dither_option(struct dc_stream_state *stream, ...@@ -341,23 +341,9 @@ void set_dither_option(struct dc_stream_state *stream,
return; return;
if (option > DITHER_OPTION_MAX) if (option > DITHER_OPTION_MAX)
return; return;
if (option == DITHER_OPTION_DEFAULT) {
switch (stream->timing.display_color_depth) { stream->dither_option = option;
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;
}
resource_build_bit_depth_reduction_params(stream, resource_build_bit_depth_reduction_params(stream,
&params); &params);
stream->bit_depth_params = params; stream->bit_depth_params = params;
......
...@@ -2607,6 +2607,22 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream, ...@@ -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)); 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) if (option == DITHER_OPTION_DISABLE)
return; return;
......
...@@ -1104,15 +1104,11 @@ static enum dc_status apply_single_controller_ctx_to_hw( ...@@ -1104,15 +1104,11 @@ static enum dc_status apply_single_controller_ctx_to_hw(
stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE); stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE);
/*vbios crtc_source_selection and encoder_setup will override fmt_C*/ pipe_ctx->stream_res.opp->funcs->opp_program_fmt(
if (pipe_ctx->stream->signal != SIGNAL_TYPE_EDP && pipe_ctx->stream_res.opp,
pipe_ctx->stream->signal != SIGNAL_TYPE_LVDS) { &stream->bit_depth_params,
/*for embedded panel, don't override VBIOS's setting*/ &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)) 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->funcs->dp_set_stream_attribute(
pipe_ctx->stream_res.stream_enc, pipe_ctx->stream_res.stream_enc,
......
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