From: jsg Date: Fri, 4 Aug 2023 08:31:53 +0000 (+0000) Subject: drm/amd/display: Include surface of unaffected streams X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c5b64805e3ca19015d3d1be8be6dfe658f499f02;p=openbsd drm/amd/display: Include surface of unaffected streams From Rodrigo Siqueira a5397c85f0b89ac4138809ff5d537b9326730d43 in linux-6.1.y/6.1.43 f6ae69f49fcf697b6ffa93d58eb3746897f61cf8 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c index 31791c557c8..cbbad496cfc 100644 --- a/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c +++ b/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c @@ -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); diff --git a/sys/dev/pci/drm/amd/display/dc/dc.h b/sys/dev/pci/drm/amd/display/dc/dc.h index 7b7003f547a..b061ae6a387 100644 --- a/sys/dev/pci/drm/amd/display/dc/dc.h +++ b/sys/dev/pci/drm/amd/display/dc/dc.h @@ -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; }; diff --git a/sys/dev/pci/drm/amd/display/dc/dc_stream.h b/sys/dev/pci/drm/amd/display/dc/dc_stream.h index 45629d8437c..e2f4fe8c752 100644 --- a/sys/dev/pci/drm/amd/display/dc/dc_stream.h +++ b/sys/dev/pci/drm/amd/display/dc/dc_stream.h @@ -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;