drm/amd/display: Include surface of unaffected streams
authorRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tue, 18 Oct 2022 12:28:19 +0000 (08:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 24 Oct 2022 18:34:46 +0000 (14:34 -0400)
The commit stream function does not include surfaces of unaffected
streams, which may lead to some blank screens during mode change in some
edge cases. This commit adds surfaces of unaffected streams followed by
kernel-doc for documenting some of the fields that participate in this
change.

v2: squash in kerneldoc warning fix (Alex)

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Co-developed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@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.h
drivers/gpu/drm/amd/display/dc/dc_stream.h

index af81c28357380f1a47c0a2b9189c21909984405c..b904b03cf94e4277a065340feb883c62c1c575d0 100644 (file)
@@ -1907,9 +1907,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;
@@ -1918,8 +1919,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 6adecb62e534e43165054a00b06b4146f8c538b0..836cdf5d41141d5d50938104819df4f607690d85 100644 (file)
@@ -1269,12 +1269,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 9e6025c98db91f8afe71c732e9c82d64ee3a95b1..73dccd485895d6caec808f58e1fb7311d21572e1 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;