drm/amd/display: Program gamut remap as part of stream update
authorSivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>
Thu, 26 Jul 2018 18:58:35 +0000 (14:58 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:11:00 +0000 (11:11 -0500)
Add gamut remap to dc_stream_update struct, and program if set when updating
streams.

Signed-off-by: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@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 b5c7be1cdd81ae5ddc1d9788f82a5fde61dacecc..b906b6adc5a895461d97bf7a8dbb142a69a7e349 100644 (file)
@@ -359,6 +359,23 @@ void dc_stream_set_dither_option(struct dc_stream_state *stream,
                opp_program_bit_depth_reduction(pipes->stream_res.opp, &params);
 }
 
+bool dc_stream_set_gamut_remap(struct dc *dc, const struct dc_stream_state *stream)
+{
+       int i = 0;
+       bool ret = false;
+       struct pipe_ctx *pipes;
+
+       for (i = 0; i < MAX_PIPES; i++) {
+               if (dc->current_state->res_ctx.pipe_ctx[i].stream == stream) {
+                       pipes = &dc->current_state->res_ctx.pipe_ctx[i];
+                       dc->hwss.program_gamut_remap(pipes);
+                       ret = true;
+               }
+       }
+
+       return ret;
+}
+
 void dc_stream_set_static_screen_events(struct dc *dc,
                struct dc_stream_state **streams,
                int num_streams,
@@ -1364,6 +1381,9 @@ static void commit_planes_do_stream_update(struct dc *dc,
                                dc->hwss.update_info_frame(pipe_ctx);
                        }
 
+                       if (stream_update->gamut_remap)
+                               dc_stream_set_gamut_remap(dc, stream);
+
                        /* Full fe update*/
                        if (update_type == UPDATE_TYPE_FAST)
                                continue;
index 790beb5cb358551852ac246005413e8758358978..1479b41ec1777476bb885852232ae9bc575a33f6 100644 (file)
@@ -132,6 +132,11 @@ struct dc_stream_update {
        struct dc_info_packet *vsc_infopacket;
 
        bool *dpms_off;
+
+       struct colorspace_transform *gamut_remap;
+       enum dc_color_space *output_color_space;
+
+
 };
 
 bool dc_is_stream_unchanged(
@@ -298,6 +303,9 @@ void dc_stream_set_static_screen_events(struct dc *dc,
 void dc_stream_set_dither_option(struct dc_stream_state *stream,
                                 enum dc_dither_option option);
 
+bool dc_stream_set_gamut_remap(struct dc *dc,
+                              const struct dc_stream_state *stream);
+
 bool dc_stream_get_crtc_position(struct dc *dc,
                                 struct dc_stream_state **stream,
                                 int num_streams,