From a2b8659db9b435853cb0dc78d225a492e7ee69d0 Mon Sep 17 00:00:00 2001 From: Tony Cheng Date: Sat, 22 Apr 2017 14:17:51 -0400 Subject: drm/amd/display: decouple resource_pool from resource_context to avoid null access in case res_ctx is used to access res_pool before it's fully constructed also make it clear which function has dependency on resource_pool Signed-off-by: Tony Cheng Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c') diff --git a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c index f65b785220e2..f0700706d7c9 100644 --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c @@ -804,8 +804,6 @@ enum dc_status dce100_validate_with_context( if (!dce100_validate_surface_sets(set, set_count)) return DC_FAIL_SURFACE_VALIDATE; - context->res_ctx.pool = dc->res_pool; - for (i = 0; i < set_count; i++) { context->streams[i] = DC_STREAM_TO_CORE(set[i].stream); dc_stream_retain(&context->streams[i]->public); @@ -817,8 +815,8 @@ enum dc_status dce100_validate_with_context( if (result == DC_OK) result = resource_map_clock_resources(dc, context); - if (!resource_validate_attach_surfaces( - set, set_count, dc->current_context, context)) { + if (!resource_validate_attach_surfaces(set, set_count, + dc->current_context, context, dc->res_pool)) { DC_ERROR("Failed to attach surface to stream!\n"); return DC_FAIL_ATTACH_SURFACES; } @@ -843,8 +841,6 @@ enum dc_status dce100_validate_guaranteed( { enum dc_status result = DC_ERROR_UNEXPECTED; - context->res_ctx.pool = dc->res_pool; - context->streams[0] = DC_STREAM_TO_CORE(dc_stream); dc_stream_retain(&context->streams[0]->public); context->stream_count++; -- cgit v1.2.3