drm/amd/display: Include surface of unaffected streams
authorjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:31:53 +0000 (08:31 +0000)
committerjsg <jsg@openbsd.org>
Fri, 4 Aug 2023 08:31:53 +0000 (08:31 +0000)
From Rodrigo Siqueira
a5397c85f0b89ac4138809ff5d537b9326730d43 in linux-6.1.y/6.1.43
f6ae69f49fcf697b6ffa93d58eb3746897f61cf8 in mainline linux

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

index 31791c5..cbbad49 100644 (file)
@@ -1930,9 +1930,10 @@ enum dc_status dc_commit_streams(struct dc *dc,
                                 struct dc_stream_state *streams[],
                                 uint8_t stream_count)
 {
-       int i;
+       int i, j;
        struct dc_state *context;
        enum dc_status res = DC_OK;
+       struct dc_validation_set set[MAX_STREAMS] = {0};
 
        if (!streams_changed(dc, streams, stream_count))
                return res;
@@ -1941,8 +1942,17 @@ enum dc_status dc_commit_streams(struct dc *dc,
 
        for (i = 0; i < stream_count; i++) {
                struct dc_stream_state *stream = streams[i];
+               struct dc_stream_status *status = dc_stream_get_status(stream);
 
                dc_stream_log(dc, stream);
+
+               set[i].stream = stream;
+
+               if (status) {
+                       set[i].plane_count = status->plane_count;
+                       for (j = 0; j < status->plane_count; j++)
+                               set[i].plane_states[j] = status->plane_states[j];
+               }
        }
 
        context = dc_create_state(dc);
index 7b7003f..b061ae6 100644 (file)
@@ -1274,12 +1274,23 @@ void dc_post_update_surfaces_to_stream(
 
 #include "dc_stream.h"
 
-/*
- * Structure to store surface/stream associations for validation
+/**
+ * struct dc_validation_set - Struct to store surface/stream associations for validation
  */
 struct dc_validation_set {
+       /**
+        * @stream: Stream state properties
+        */
        struct dc_stream_state *stream;
+
+       /**
+        * @plane_state: Surface state
+        */
        struct dc_plane_state *plane_states[MAX_SURFACES];
+
+       /**
+        * @plane_count: Total of active planes
+        */
        uint8_t plane_count;
 };
 
index 45629d8..e2f4fe8 100644 (file)
@@ -41,6 +41,10 @@ struct timing_sync_info {
 struct dc_stream_status {
        int primary_otg_inst;
        int stream_enc_inst;
+
+       /**
+        * @plane_count: Total of planes attached to a single stream
+        */
        int plane_count;
        int audio_inst;
        struct timing_sync_info timing_sync_info;