return -EINVAL;
}
+ /* When enabling CRC, we should also disable dithering. */
if (source == AMDGPU_DM_PIPE_CRC_SOURCE_AUTO) {
if (dc_stream_configure_crc(stream_state->ctx->dc,
stream_state,
- true, true))
+ true, true)) {
crtc_state->crc_enabled = true;
+ dc_stream_set_dither_option(stream_state,
+ DITHER_OPTION_TRUN8);
+ }
else
return -EINVAL;
} else {
if (dc_stream_configure_crc(stream_state->ctx->dc,
stream_state,
- false, false))
+ false, false)) {
crtc_state->crc_enabled = false;
+ dc_stream_set_dither_option(stream_state,
+ DITHER_OPTION_DEFAULT);
+ }
else
return -EINVAL;
}
}
}
- memset(¶ms, 0, sizeof(params));
if (!pipes)
return;
if (option > DITHER_OPTION_MAX)
stream->dither_option = option;
- resource_build_bit_depth_reduction_params(stream,
- ¶ms);
+ memset(¶ms, 0, sizeof(params));
+ resource_build_bit_depth_reduction_params(stream, ¶ms);
stream->bit_depth_params = params;
+
+ if (pipes->plane_res.xfm &&
+ pipes->plane_res.xfm->funcs->transform_set_pixel_storage_depth) {
+ pipes->plane_res.xfm->funcs->transform_set_pixel_storage_depth(
+ pipes->plane_res.xfm,
+ pipes->plane_res.scl_data.lb_params.depth,
+ &stream->bit_depth_params);
+ }
+
pipes->stream_res.opp->funcs->
opp_program_bit_depth_reduction(pipes->stream_res.opp, ¶ms);
}