diff options
author | Tony Cheng <tony.cheng@amd.com> | 2017-04-22 21:17:51 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-27 01:06:41 +0300 |
commit | a2b8659db9b435853cb0dc78d225a492e7ee69d0 (patch) | |
tree | 90cbccc70e1be2712f2c2cf75a31f85ee236e45f /drivers/gpu/drm/amd/display/dc/core/dc_surface.c | |
parent | 72ada5f76939ed00c07c584be7691a29d3c2c3da (diff) | |
download | linux-a2b8659db9b435853cb0dc78d225a492e7ee69d0.tar.xz |
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/core/dc_surface.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c index 943895faee49..aa6ac9596235 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c @@ -138,8 +138,7 @@ const struct dc_surface_status *dc_surface_get_status( if (core_dc->current_context == NULL) return NULL; - for (i = 0; i < core_dc->current_context->res_ctx.pool->pipe_count; - i++) { + for (i = 0; i < core_dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx = &core_dc->current_context->res_ctx.pipe_ctx[i]; |