Skip to contentSkip to conversation

drm/amd/display: check if dml21_add_phantom_plane() is successful

PATCH New Alex Deucher 1 participant 1 message May 13

Subsystems (4)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: check if dml21_add_phantom_plane() is successful

Verify that the phantom plane was allocated to avoid a later segfault.

Fixes 70839da63605 ("drm/amd/display: Add new DCN401 sources")
---
 .../drm/amd/display/dc/dml2_0/dml21/dml21_utils.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2_0/dml21/dml21_utils.c +7 -8
index 835fece1d46a6..50e445275b14c 100644
@@ -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;
 				}
 			}
 		}
Signature · 1 line
2.54.0