]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: check if dml21_add_phantom_plane() is successful
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 16 Feb 2026 14:32:53 +0000 (09:32 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Jul 2026 00:00:28 +0000 (20:00 -0400)
Verify that the phantom plane was allocated to avoid a later
segfault.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4970
Fixes: 70839da63605 ("drm/amd/display: Add new DCN401 sources")
Reviewed-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5adb54abe5a8e82cbff7f8806db30a5f4924329f)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_utils.c

index 835fece1d46a6ba374745834277e7ddbe1353b8e..50e445275b14c2daddbf69688a0e4116d82cd9b9 100644 (file)
@@ -359,14 +359,13 @@ void dml21_handle_phantom_streams_planes(const struct dc *dc, struct dc_state *c
                                        main_plane = main_stream_status->plane_states[dc_plane_index];
 
                                        /* create phantom planes for subvp enabled plane */
-                                       dml21_add_phantom_plane(dml_ctx,
-                                                       dc,
-                                                       context,
-                                                       phantom_stream,
-                                                       main_plane,
-                                                       &dml_ctx->v21.mode_programming.programming->plane_programming[dml_plane_index]);
-
-                                       phantoms_added = true;
+                                       if (dml21_add_phantom_plane(dml_ctx,
+                                                                   dc,
+                                                                   context,
+                                                                   phantom_stream,
+                                                                   main_plane,
+                                                                   &dml_ctx->v21.mode_programming.programming->plane_programming[dml_plane_index]))
+                                               phantoms_added = true;
                                }
                        }
                }