drm/amd/display: Rework context change check
authorjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:25:37 +0000 (08:25 +0000)
committerjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:25:37 +0000 (08:25 +0000)
From Rodrigo Siqueira
bc2c7003888b4311e3bcc392326279fc97911602 in linux-6.1.y/6.1.43
10fdb0a11c555e0d6f7698d2874581d06e99ee71 in mainline linux

sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c

index beb2d7f..226c17e 100644 (file)
@@ -1505,19 +1505,19 @@ static void program_timing_sync(
        }
 }
 
-static bool context_changed(
-               struct dc *dc,
-               struct dc_state *context)
+static bool streams_changed(struct dc *dc,
+                           struct dc_stream_state *streams[],
+                           uint8_t stream_count)
 {
        uint8_t i;
 
-       if (context->stream_count != dc->current_state->stream_count)
+       if (stream_count != dc->current_state->stream_count)
                return true;
 
        for (i = 0; i < dc->current_state->stream_count; i++) {
-               if (dc->current_state->streams[i] != context->streams[i])
+               if (dc->current_state->streams[i] != streams[i])
                        return true;
-               if (!context->streams[i]->link->link_state_valid)
+               if (!streams[i]->link->link_state_valid)
                        return true;
        }
 
@@ -1918,7 +1918,7 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context)
        enum dc_status result = DC_ERROR_UNEXPECTED;
        int i;
 
-       if (!context_changed(dc, context))
+       if (!streams_changed(dc, context->streams, context->stream_count))
                return DC_OK;
 
        DC_LOG_DC("%s: %d streams\n",