Skip to contentSkip to conversation

drm/amd/display: Call dc_stream_release for remove link enc assignment

PATCH In review Nicholas Kazlauskas 3 participants 3 messages Jan 24, 2022

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

PATCH 1/1 drm/amd/display: Call dc_stream_release for remove link enc assignment

[Why]
A porting error resulted in the stream assignment for the link being retained without being released - a memory leak.

[How]
Fix the porting error by adding back the dc_stream_release() intended as part of the original patch.

Fixes 2e45b19dd882 ("drm/amd/display: retain/release at proper places in link_enc assignment")
Cc Qingqing Zhuo <[email protected]>
Cc Aurabindo Pillai <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +1 -0
index a55944da8d53..00f72f66a7ef 100644
@@ -122,6 +122,7 @@ static void remove_link_enc_assignment(
 				stream->link_enc = NULL;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].eng_id = ENGINE_ID_UNKNOWN;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].stream = NULL;
+				dc_stream_release(stream);
 				break;
 			}
 		}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Nicholas Kazlauskas

[Why]
A porting error resulted in the stream assignment for the link being retained without being released - a memory leak.

[How]
Fix the porting error by adding back the dc_stream_release() intended as part of the original patch.

Fixes 2e45b19dd882 ("drm/amd/display: retain/release at proper places in link_enc assignment")

This commit sha is wrong, it should be 0bb24555858403671657f6dc025d2931e3e857bb

Quoted 21 lines
Cc Qingqing Zhuo <[email protected]>
Cc Aurabindo Pillai <[email protected]>
Cc Rodrigo Siqueira <[email protected]>
---
  drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +1 -0
index a55944da8d53..00f72f66a7ef 100644
@@ -122,6 +122,7 @@ static void remove_link_enc_assignment(
  				stream->link_enc = NULL;
  				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].eng_id = ENGINE_ID_UNKNOWN;
  				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].stream = NULL;
+				dc_stream_release(stream);
  				break;
  			}
  		}
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Nicholas Kazlauskas
Quoted 8 lines · Nicholas Kazlauskas

[Why]
A porting error resulted in the stream assignment for the link being retained without being released - a memory leak.

[How]
Fix the porting error by adding back the dc_stream_release() intended as part of the original patch.

Quoted 6 lines
Fixes 2e45b19dd882 ("drm/amd/display: retain/release at proper places in link_enc assignment")
Cc Qingqing Zhuo <[email protected]>
Cc Aurabindo Pillai <[email protected]>
Cc Rodrigo Siqueira <[email protected]>

Harry

Quoted 16 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c +1 -0
index a55944da8d53..00f72f66a7ef 100644
@@ -122,6 +122,7 @@ static void remove_link_enc_assignment(
 				stream->link_enc = NULL;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].eng_id = ENGINE_ID_UNKNOWN;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].stream = NULL;
+				dc_stream_release(stream);
 				break;
 			}
 		}