drm/amd/display: Move resource_validate_ctx_destruct to dc.h
authorHarry Wentland <harry.wentland@amd.com>
Wed, 29 Mar 2017 15:15:14 +0000 (11:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:24:20 +0000 (17:24 -0400)
This will be needed to clean up context once we add it to private
atomic state.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/inc/resource.h

index 0d870e9c7c99a82c37ba5ab5a98c4333308ef272..5620fe3611735a4892ceb84cbf4c85049dc4d82a 100644 (file)
@@ -389,7 +389,7 @@ static void allocate_dc_stream_funcs(struct core_dc *core_dc)
 
 static void destruct(struct core_dc *dc)
 {
-       resource_validate_ctx_destruct(dc->current_context);
+       dc_resource_validate_ctx_destruct(dc->current_context);
 
        destroy_links(dc);
 
@@ -654,7 +654,7 @@ bool dc_validate_resources(
        result = core_dc->res_pool->funcs->validate_with_context(
                                                core_dc, set, set_count, context);
 
-       resource_validate_ctx_destruct(context);
+       dc_resource_validate_ctx_destruct(context);
        dm_free(context);
 
 context_alloc_fail:
@@ -684,7 +684,7 @@ bool dc_validate_guaranteed(
        result = core_dc->res_pool->funcs->validate_guaranteed(
                                        core_dc, stream, context);
 
-       resource_validate_ctx_destruct(context);
+       dc_resource_validate_ctx_destruct(context);
        dm_free(context);
 
 context_alloc_fail:
@@ -838,7 +838,7 @@ bool dc_commit_streams(
                                        __func__,
                                        result);
                BREAK_TO_DEBUGGER();
-               resource_validate_ctx_destruct(context);
+               dc_resource_validate_ctx_destruct(context);
                goto fail;
        }
 
@@ -870,7 +870,7 @@ bool dc_commit_streams(
                                context->streams[i]->public.timing.pix_clk_khz);
        }
 
-       resource_validate_ctx_destruct(core_dc->current_context);
+       dc_resource_validate_ctx_destruct(core_dc->current_context);
        dm_free(core_dc->current_context);
 
        core_dc->current_context = context;
@@ -903,7 +903,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
                dm_error("%s: failed to create validate ctx\n", __func__);
                return false;
        }
-       resource_validate_ctx_copy_construct(core_dc->current_context, context);
+       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++)
@@ -920,9 +920,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
 
        core_dc->hwss.set_bandwidth(core_dc, context, true);
 
-       resource_validate_ctx_copy_construct(context, core_dc->current_context);
+       dc_resource_validate_ctx_copy_construct(context, core_dc->current_context);
 
-       resource_validate_ctx_destruct(context);
+       dc_resource_validate_ctx_destruct(context);
        dm_free(context);
 
        return true;
@@ -1205,7 +1205,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,
 
                /* initialize scratch memory for building context */
                context = dm_alloc(sizeof(*context));
-               resource_validate_ctx_copy_construct(
+               dc_resource_validate_ctx_copy_construct(
                                core_dc->current_context, context);
 
                /* add surface to context */
@@ -1409,7 +1409,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,
        }
 
        if (core_dc->current_context != context) {
-               resource_validate_ctx_destruct(core_dc->current_context);
+               dc_resource_validate_ctx_destruct(core_dc->current_context);
                dm_free(core_dc->current_context);
 
                core_dc->current_context = context;
@@ -1418,7 +1418,7 @@ void dc_update_surfaces_and_stream(struct dc *dc,
 
 fail:
        if (core_dc->current_context != context) {
-               resource_validate_ctx_destruct(context);
+               dc_resource_validate_ctx_destruct(context);
                dm_free(context);
        }
 }
index 2d40864b7b48675184e6ac4d5eab37622c755590..2e12a0ba5ddfabf6364bdfd9b6770ff1c47f15e7 100644 (file)
@@ -2050,7 +2050,7 @@ static void set_vsc_info_packet(
        /*TODO: stereo 3D support and extend pixel encoding colorimetry*/
 }
 
-void resource_validate_ctx_destruct(struct validate_context *context)
+void dc_resource_validate_ctx_destruct(struct validate_context *context)
 {
        int i, j;
 
@@ -2069,7 +2069,7 @@ void resource_validate_ctx_destruct(struct validate_context *context)
  * Copy src_ctx into dst_ctx and retain all surfaces and streams referenced
  * by the src_ctx
  */
-void resource_validate_ctx_copy_construct(
+void dc_resource_validate_ctx_copy_construct(
                const struct validate_context *src_ctx,
                struct validate_context *dst_ctx)
 {
index 7d548b4d02994281365839952ccfa2bff5155793..7de2080e13edc438aad206195e02482901b15306 100644 (file)
@@ -522,6 +522,12 @@ bool dc_validate_guaranteed(
                const struct dc *dc,
                const struct dc_stream *stream);
 
+void dc_resource_validate_ctx_copy_construct(
+               const struct validate_context *src_ctx,
+               struct validate_context *dst_ctx);
+
+void dc_resource_validate_ctx_destruct(struct validate_context *context);
+
 /*
  * Set up streams and links associated to drive sinks
  * The streams parameter is an absolute set of all active streams.
index eb9c96634578ba3b22bb76080cc63d584af06876..b1987cab9751492ff39cb667aad8ebebd714dae2 100644 (file)
@@ -141,12 +141,6 @@ void resource_validate_ctx_update_pointer_after_copy(
                const struct validate_context *src_ctx,
                struct validate_context *dst_ctx);
 
-void resource_validate_ctx_copy_construct(
-               const struct validate_context *src_ctx,
-               struct validate_context *dst_ctx);
-
-void resource_validate_ctx_destruct(struct validate_context *context);
-
 enum dc_status resource_map_clock_resources(
                const struct core_dc *dc,
                struct validate_context *context);