Commit 22498036 authored by Dmytro Laktyushkin's avatar Dmytro Laktyushkin Committed by Alex Deucher

drm/amd/display: fix odm stream release

Need to memset all odm pipes when calling dc_remove_stream_from_ctx
Signed-off-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 285e3004
...@@ -1114,13 +1114,12 @@ struct pipe_ctx *resource_get_head_pipe_for_stream( ...@@ -1114,13 +1114,12 @@ struct pipe_ctx *resource_get_head_pipe_for_stream(
struct dc_stream_state *stream) struct dc_stream_state *stream)
{ {
int i; int i;
for (i = 0; i < MAX_PIPES; i++) { for (i = 0; i < MAX_PIPES; i++) {
if (res_ctx->pipe_ctx[i].stream == stream if (res_ctx->pipe_ctx[i].stream == stream
&& !res_ctx->pipe_ctx[i].top_pipe && !res_ctx->pipe_ctx[i].top_pipe
&& !res_ctx->pipe_ctx[i].prev_odm_pipe) { && !res_ctx->pipe_ctx[i].prev_odm_pipe)
return &res_ctx->pipe_ctx[i]; return &res_ctx->pipe_ctx[i];
break;
}
} }
return NULL; return NULL;
} }
...@@ -1697,14 +1696,17 @@ enum dc_status dc_remove_stream_from_ctx( ...@@ -1697,14 +1696,17 @@ enum dc_status dc_remove_stream_from_ctx(
{ {
int i; int i;
struct dc_context *dc_ctx = dc->ctx; struct dc_context *dc_ctx = dc->ctx;
struct pipe_ctx *del_pipe = NULL; struct pipe_ctx *del_pipe = resource_get_head_pipe_for_stream(&new_ctx->res_ctx, stream);
struct pipe_ctx *odm_pipe;
/* Release primary pipe */ if (!del_pipe) {
for (i = 0; i < MAX_PIPES; i++) { DC_ERROR("Pipe not found for stream %p !\n", stream);
if (new_ctx->res_ctx.pipe_ctx[i].stream == stream && return DC_ERROR_UNEXPECTED;
!new_ctx->res_ctx.pipe_ctx[i].top_pipe) { }
del_pipe = &new_ctx->res_ctx.pipe_ctx[i];
odm_pipe = del_pipe->next_odm_pipe;
/* Release primary pipe */
ASSERT(del_pipe->stream_res.stream_enc); ASSERT(del_pipe->stream_res.stream_enc);
update_stream_engine_usage( update_stream_engine_usage(
&new_ctx->res_ctx, &new_ctx->res_ctx,
...@@ -1726,16 +1728,13 @@ enum dc_status dc_remove_stream_from_ctx( ...@@ -1726,16 +1728,13 @@ enum dc_status dc_remove_stream_from_ctx(
if (dc->res_pool->funcs->remove_stream_from_ctx) if (dc->res_pool->funcs->remove_stream_from_ctx)
dc->res_pool->funcs->remove_stream_from_ctx(dc, new_ctx, stream); dc->res_pool->funcs->remove_stream_from_ctx(dc, new_ctx, stream);
memset(del_pipe, 0, sizeof(*del_pipe)); while (odm_pipe) {
struct pipe_ctx *next_odm_pipe = odm_pipe->next_odm_pipe;
break;
}
}
if (!del_pipe) { memset(odm_pipe, 0, sizeof(*odm_pipe));
DC_ERROR("Pipe not found for stream %p !\n", stream); odm_pipe = next_odm_pipe;
return DC_ERROR_UNEXPECTED;
} }
memset(del_pipe, 0, sizeof(*del_pipe));
for (i = 0; i < new_ctx->stream_count; i++) for (i = 0; i < new_ctx->stream_count; i++)
if (new_ctx->streams[i] == stream) if (new_ctx->streams[i] == stream)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment