OSDN Git Service

drm/amd/display: Set Stream Update Flags in commit_state_no_check
authorAustin Zheng <austin.zheng@amd.com>
Wed, 26 Jul 2023 14:18:39 +0000 (10:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Aug 2023 21:14:08 +0000 (17:14 -0400)
[Why]
Front-end would be programmed using the stream update flags set
from the previous update and the full update should be triggered
whenever commit_state_no_check gets called.

[How]
Set all stream update flags before programming the front-end
Clear all flags that got set to avoid redundant programming

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Austin Zheng <austin.zheng@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index dfd31b1..4326daa 100644 (file)
@@ -1925,6 +1925,14 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
 
        dc_trigger_sync(dc, context);
 
+       /* Full update should unconditionally be triggered when dc_commit_state_no_check is called */
+       for (i = 0; i < context->stream_count; i++) {
+               uint32_t prev_dsc_changed = context->streams[i]->update_flags.bits.dsc_changed;
+
+               context->streams[i]->update_flags.raw = 0xFFFFFFFF;
+               context->streams[i]->update_flags.bits.dsc_changed = prev_dsc_changed;
+       }
+
        /* Program all planes within new context*/
        if (dc->hwss.program_front_end_for_ctx) {
                dc->hwss.interdependent_update_lock(dc, context, true);
@@ -2003,6 +2011,11 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
        for (i = 0; i < context->stream_count; i++)
                context->streams[i]->mode_changed = false;
 
+       /* Clear update flags that were set earlier to avoid redundant programming */
+       for (i = 0; i < context->stream_count; i++) {
+               context->streams[i]->update_flags.raw = 0x0;
+       }
+
        old_state = dc->current_state;
        dc->current_state = context;