]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Fix gpu reset in multidisplay config
authorRoman Li <Roman.Li@amd.com>
Tue, 1 Apr 2025 21:05:10 +0000 (17:05 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Apr 2025 20:45:10 +0000 (16:45 -0400)
[Why]
The indexing of stream_status in dm_gpureset_commit_state() is incorrect.
That leads to asserts in multi-display configuration after gpu reset.

[How]
Adjust the indexing logic to align stream_status with surface_updates.

Fixes: cdaae8371aa9 ("drm/amd/display: Handle GPU reset for DC block")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3808
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Mark Broadworth <mark.broadworth@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d91bc901398741d317d9b55c59ca949d4bc7394b)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index 9fed4471405f895d87655d1d9a38e85d9fbaf25c..8f3a778df64651d359743c75a7fdee7b2c1a6b4c 100644 (file)
@@ -3355,16 +3355,16 @@ static void dm_gpureset_commit_state(struct dc_state *dc_state,
        for (k = 0; k < dc_state->stream_count; k++) {
                bundle->stream_update.stream = dc_state->streams[k];
 
-               for (m = 0; m < dc_state->stream_status->plane_count; m++) {
+               for (m = 0; m < dc_state->stream_status[k].plane_count; m++) {
                        bundle->surface_updates[m].surface =
-                               dc_state->stream_status->plane_states[m];
+                               dc_state->stream_status[k].plane_states[m];
                        bundle->surface_updates[m].surface->force_full_update =
                                true;
                }
 
                update_planes_and_stream_adapter(dm->dc,
                                         UPDATE_TYPE_FULL,
-                                        dc_state->stream_status->plane_count,
+                                        dc_state->stream_status[k].plane_count,
                                         dc_state->streams[k],
                                         &bundle->stream_update,
                                         bundle->surface_updates);