From c15cfa53f73a5b75668d2376b8da55e8977b62a0 Mon Sep 17 00:00:00 2001 From: Anthony Koo Date: Tue, 26 Jan 2016 11:24:13 -0500 Subject: [PATCH 0736/1110] 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. 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++; -- 2.7.4