aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0736-drm-amd-dal-Block-commit-surfaces-to-targets-that-ha.patch
blob: 85c6f2bc7bc647fcbdffa2056a1e3ca21b479f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From c15cfa53f73a5b75668d2376b8da55e8977b62a0 Mon Sep 17 00:00:00 2001
From: Anthony Koo <Anthony.Koo@amd.com>
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 <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 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