summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dce80
diff options
context:
space:
mode:
authorTony Cheng <tony.cheng@amd.com>2017-04-22 14:17:51 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:06:41 -0400
commita2b8659db9b435853cb0dc78d225a492e7ee69d0 (patch)
tree90cbccc70e1be2712f2c2cf75a31f85ee236e45f /drivers/gpu/drm/amd/display/dc/dce80
parent72ada5f76939ed00c07c584be7691a29d3c2c3da (diff)
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 <tony.cheng@amd.com> Reviewed-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce80')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
index d49092986d54..0aa128e5ed84 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
@@ -821,8 +821,6 @@ enum dc_status dce80_validate_with_context(
if (!dce80_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);
@@ -834,8 +832,8 @@ enum dc_status dce80_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;
}
@@ -859,8 +857,6 @@ enum dc_status dce80_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++;