]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Fix hang when skipping modeset
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Fri, 24 Mar 2023 14:42:37 +0000 (10:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:36:05 +0000 (11:36 +0200)
commit da5e14909776edea4462672fb4a3007802d262e7 upstream.

[Why&How]

When skipping full modeset since the only state change was a front porch
change, the DC commit sequence requires extra checks to handle non
existant plane states being asked to be removed from context.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c

index 1e7083bc8a527a164aa3ac03ca5aba5e63b34338..3f3242783e1c3579adbfe6cf29522c23d7da74d2 100644 (file)
@@ -5776,6 +5776,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
                        continue;
 
                dc_plane = dm_new_plane_state->dc_state;
+               if (!dc_plane)
+                       continue;
 
                bundle->surface_updates[planes_count].surface = dc_plane;
                if (new_pcrtc_state->color_mgmt_changed) {
@@ -7029,8 +7031,9 @@ static int dm_update_plane_state(struct dc *dc,
                        return -EINVAL;
                }
 
+               if (dm_old_plane_state->dc_state)
+                       dc_plane_state_release(dm_old_plane_state->dc_state);
 
-               dc_plane_state_release(dm_old_plane_state->dc_state);
                dm_new_plane_state->dc_state = NULL;
 
                *lock_and_validation_needed = true;
index de246e183d6bac0d1afd14e03169c9095ada4cb3..cdcd5051dd66617253e2d01e88370fe345e048ce 100644 (file)
@@ -1315,6 +1315,9 @@ bool dc_remove_plane_from_context(
        struct dc_stream_status *stream_status = NULL;
        struct resource_pool *pool = dc->res_pool;
 
+       if (!plane_state)
+               return true;
+
        for (i = 0; i < context->stream_count; i++)
                if (context->streams[i] == stream) {
                        stream_status = &context->stream_status[i];