Change-Id: Iebcdb340c6ff5938886dc69fd6f005c3ab43c6e2
Signed-off-by: Harry Wentland <harry.wentl...@amd.com>
Acked-by: Harry Wentland <harry.wentl...@amd.com>
Reviewed-by: Tony Cheng <tony.ch...@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index e8499e744595..0d870e9c7c99 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -906,13 +906,13 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
        resource_validate_ctx_copy_construct(core_dc->current_context, context);
 
        post_surface_trace(dc);
-
        for (i = 0; i < context->res_ctx.pool->pipe_count; i++)
                if (context->res_ctx.pipe_ctx[i].stream == NULL) {
                        context->res_ctx.pipe_ctx[i].pipe_idx = i;
                        core_dc->hwss.power_down_front_end(
                                        core_dc, &context->res_ctx.pipe_ctx[i]);
                }
+
        if (!core_dc->res_pool->funcs->validate_bandwidth(core_dc, context)) {
                BREAK_TO_DEBUGGER();
                return false;
@@ -920,11 +920,10 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
        core_dc->hwss.set_bandwidth(core_dc, context, true);
 
-       resource_validate_ctx_destruct(core_dc->current_context);
-       if (core_dc->current_context)
-               dm_free(core_dc->current_context);
+       resource_validate_ctx_copy_construct(context, core_dc->current_context);
 
-       core_dc->current_context = context;
+       resource_validate_ctx_destruct(context);
+       dm_free(context);
 
        return true;
 }
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to