OSDN Git Service

drm/amd/display: Program dithering if requested
authorSivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>
Wed, 7 Nov 2018 19:59:41 +0000 (14:59 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Nov 2018 17:03:13 +0000 (12:03 -0500)
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 <sivapiriyan.kumarasamy@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc_stream.h

index 8edd030..8a182cb 100644 (file)
@@ -1463,6 +1463,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;
index 0c42418..be34d63 100644 (file)
@@ -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;