From 2f55cf66e2c9162923978ee9db38ec9ab0903e0c Mon Sep 17 00:00:00 2001 From: Anthony Koo Date: Tue, 26 Jan 2016 11:24:13 -0500 Subject: [PATCH 1302/1565] drm/amd/dal: Block commit surfaces to targets that have not been committed [Description] If a target is not committed, it should be in powergated state. In which case we should program it. Change-Id: I2d086fd9993136f800e16d8e46fe8d55645bdf25 Signed-off-by: Anthony Koo Acked-by: Harry Wentland --- drivers/gpu/drm/amd/dal/dc/core/dc_target.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c index 7f4f2f3..8cb05b7 100644 --- a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c +++ b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c @@ -236,10 +236,19 @@ bool dc_commit_surfaces_to_target( int new_enabled_surface_count = 0; if (!dal_adapter_service_is_in_accelerated_mode( - dc->res_pool.adapter_srv)) { + dc->res_pool.adapter_srv) || + dc->current_context.target_count == 0) { return false; } + for (i = 0; i < dc->current_context.target_count; i++) + if (target == dc->current_context.targets[i]) + break; + + /* Cannot commit surface to a target that is not commited */ + if (i == dc->current_context.target_count) + return false; + for (i = 0; i < target->status.surface_count; i++) if (target->status.surfaces[i]->visible) current_enabled_surface_count++; -- 1.9.1