From: SivapiriyanKumarasamy <[email protected]>

Dithering needs to be enabled or disabled as requested. If
dc_stream_update->dither_option is non-null, program the FMT blocks.

Signed-off-by: SivapiriyanKumarasamy <[email protected]>
Reviewed-by: Anthony Koo <[email protected]>
Reviewed-by: Krunoslav Kovac <[email protected]>
Acked-by: Leo Li <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c   | 8 ++++++++
 drivers/gpu/drm/amd/display/dc/dc_stream.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index dffd083..ad67b98 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1483,6 +1483,14 @@ static void commit_planes_do_stream_update(struct dc *dc,
                        if (stream_update->output_csc_transform)
                                dc_stream_program_csc_matrix(dc, stream);
 
+                       if (stream_update->dither_option) {
+                               
resource_build_bit_depth_reduction_params(pipe_ctx->stream,
+                                                                       
&pipe_ctx->stream->bit_depth_params);
+                               
pipe_ctx->stream_res.opp->funcs->opp_program_fmt(pipe_ctx->stream_res.opp,
+                                               &stream->bit_depth_params,
+                                               &stream->clamping);
+                       }
+
                        /* Full fe update*/
                        if (update_type == UPDATE_TYPE_FAST)
                                continue;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h 
b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 0c42418..be34d63 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -136,6 +136,7 @@ struct dc_stream_update {
 
        struct colorspace_transform *gamut_remap;
        enum dc_color_space *output_color_space;
+       enum dc_dither_option *dither_option;
 
        struct dc_csc_transform *output_csc_transform;
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to