Skip to contentSkip to conversation

drm/amd/display: Clear phantom stream count and plane count

PATCH In review Mario Limonciello 3 participants 3 messages Feb 3, 2024 – Feb 6, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Clear phantom stream count and plane count

When dc_state_destruct() was refactored the new phantom_stream_count and phantom_plane_count members weren't cleared.

Fixes 012a04b1d6af ("drm/amd/display: Refactor phantom resource allocation")
---
 drivers/gpu/drm/amd/display/dc/core/dc_state.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_state.c +3 -0
index 88c6436b28b6..180ac47868c2 100644
@@ -291,11 +291,14 @@ void dc_state_destruct(struct dc_state *state)
 		dc_stream_release(state->phantom_streams[i]);
 		state->phantom_streams[i] = NULL;
 	}
+	state->phantom_stream_count = 0;
 
 	for (i = 0; i < state->phantom_plane_count; i++) {
 		dc_plane_state_release(state->phantom_planes[i]);
 		state->phantom_planes[i] = NULL;
 	}
+	state->phantom_plane_count = 0;
+
 	state->stream_mask = 0;
 	memset(&state->res_ctx, 0, sizeof(state->res_ctx));
 	memset(&state->pp_display_cfg, 0, sizeof(state->pp_display_cfg));
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw

[Public]

________________________________
From: amd-gfx <[email protected]> on behalf of Mario Limonciello <[email protected]>
Sent: Friday, February 2, 2024 7:30 PM
To: [email protected] <[email protected]>
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd/display: Clear phantom stream count and plane count

When dc_state_destruct() was refactored the new phantom_stream_count and phantom_plane_count members weren't cleared.

Fixes 012a04b1d6af ("drm/amd/display: Refactor phantom resource allocation")
---
 drivers/gpu/drm/amd/display/dc/core/dc_state.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_state.c +3 -0
index 88c6436b28b6..180ac47868c2 100644
@@ -291,11 +291,14 @@ void dc_state_destruct(struct dc_state *state)
                 dc_stream_release(state->phantom_streams[i]);
                 state->phantom_streams[i] = NULL;
         }
+       state->phantom_stream_count = 0;
 
         for (i = 0; i < state->phantom_plane_count; i++) {
                 dc_plane_state_release(state->phantom_planes[i]);
                 state->phantom_planes[i] = NULL;
         }
+       state->phantom_plane_count = 0;
+
         state->stream_mask = 0;
         memset(&state->res_ctx, 0, sizeof(state->res_ctx));
         memset(&state->pp_display_cfg, 0, sizeof(state->pp_display_cfg));

--
2.34.1

maintainer Reviewed-by
#2 lore raw
Quoted 8 lines · Alexander

[Public]

[Public]

Harry

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Quoted 37 lines

*From:* amd-gfx <[email protected]> on behalf of Mario Limonciello <[email protected]> *Sent:* Friday, February 2, 2024 7:30 PM
*To:* [email protected] <[email protected]>
*Cc:* Limonciello, Mario <[email protected]>
*Subject:* [PATCH] drm/amd/display: Clear phantom stream count and plane count

When dc_state_destruct() was refactored the new phantom_stream_count
and phantom_plane_count members weren't cleared.

Fixes 012a04b1d6af ("drm/amd/display: Refactor phantom resource allocation")

---
 drivers/gpu/drm/amd/display/dc/core/dc_state.c | 3 +++

 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_state.c +1 -0
index 88c6436b28b6..180ac47868c2 100644
@@ -291,11 +291,14 @@ void dc_state_destruct(struct dc_state *state)
                  dc_stream_release(state->phantom_streams[i]);
                  state->phantom_streams[i] = NULL;
          }
+       state->phantom_stream_count = 0;


         for (i = 0; i < state->phantom_plane_count; i++) { dc_plane_state_release(state->phantom_planes[i]); state->phantom_planes[i] = NULL;
         }
+       state->phantom_plane_count = 0;
+
         state->stream_mask = 0;
         memset(&state->res_ctx, 0, sizeof(state->res_ctx)); memset(&state->pp_display_cfg, 0, sizeof(state->pp_display_cfg));

Signature · 1 line
2.34.1