aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
diff options
context:
space:
mode:
authorTony Cheng <tony.cheng@amd.com>2017-01-19 14:46:26 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:12:04 -0400
commite4e354b02fa8b6d53ec65bd5dbd27d014e4e752f (patch)
treeabac4a39e510a04f61a00e4c23766c7eb1e4b2b3 /drivers/gpu/drm/amd/display/dc/core/dc_surface.c
parentdrm/amd/display: refactor dc_update_surfaces_for_stream (diff)
downloadlinux-dev-e4e354b02fa8b6d53ec65bd5dbd27d014e4e752f.tar.xz
linux-dev-e4e354b02fa8b6d53ec65bd5dbd27d014e4e752f.zip
drm/amd/display: clean up redundant logic
Signed-off-by: Tony Cheng <tony.cheng@amd.com> Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com> Acked-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.c23
1 files changed, 8 insertions, 15 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 d607972b830b..21fedd447bd1 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -121,26 +121,20 @@ const struct dc_surface_status *dc_surface_get_status(
const struct dc_surface *dc_surface)
{
struct dc_surface_status *surface_status;
- struct core_surface *core_surface;
+ struct core_surface *core_surface = DC_SURFACE_TO_CORE(dc_surface);;
struct core_dc *core_dc;
int i;
- if (dc_surface == NULL)
- return NULL;
-
- core_surface = DC_SURFACE_TO_CORE(dc_surface);
-
- if (core_surface == NULL || core_surface->ctx == NULL)
- return NULL;
+ if (!dc_surface ||
+ !core_surface->ctx ||
+ !core_surface->ctx->dc) {
+ ASSERT(0);
+ return NULL; /* remove this if above assert never hit */
+ }
surface_status = &core_surface->status;
-
- if (core_surface->ctx == NULL || core_surface->ctx->dc == NULL)
- return NULL;
-
core_dc = DC_TO_CORE(core_surface->ctx->dc);
-
if (core_dc->current_context == NULL)
return NULL;
@@ -149,8 +143,7 @@ const struct dc_surface_status *dc_surface_get_status(
struct pipe_ctx *pipe_ctx =
&core_dc->current_context->res_ctx.pipe_ctx[i];
- if (pipe_ctx->surface !=
- DC_SURFACE_TO_CORE(dc_surface))
+ if (pipe_ctx->surface != core_surface)
continue;
core_dc->hwss.update_pending_status(pipe_ctx);