<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello@amd.com><br>
<b>Sent:</b> Friday, February 2, 2024 7:30 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Limonciello, Mario <Mario.Limonciello@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/display: Clear phantom stream count and plane count</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">When dc_state_destruct() was refactored the new phantom_stream_count<br>
and phantom_plane_count members weren't cleared.<br>
<br>
Fixes: 012a04b1d6af ("drm/amd/display: Refactor phantom resource allocation")<br>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/dc/core/dc_state.c | 3 +++<br>
 1 file changed, 3 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_state.c b/drivers/gpu/drm/amd/display/dc/core/dc_state.c<br>
index 88c6436b28b6..180ac47868c2 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/core/dc_state.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_state.c<br>
@@ -291,11 +291,14 @@ void dc_state_destruct(struct dc_state *state)<br>
                 dc_stream_release(state->phantom_streams[i]);<br>
                 state->phantom_streams[i] = NULL;<br>
         }<br>
+       state->phantom_stream_count = 0;<br>
 <br>
         for (i = 0; i < state->phantom_plane_count; i++) {<br>
                 dc_plane_state_release(state->phantom_planes[i]);<br>
                 state->phantom_planes[i] = NULL;<br>
         }<br>
+       state->phantom_plane_count = 0;<br>
+<br>
         state->stream_mask = 0;<br>
         memset(&state->res_ctx, 0, sizeof(state->res_ctx));<br>
         memset(&state->pp_display_cfg, 0, sizeof(state->pp_display_cfg));<br>
-- <br>
2.34.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>