aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0055-drm-amd-display-fix-up-construction-of-scratch_val_c.patch
blob: d346e7c2ff35e2723548932a5ef4df8f465258c8 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From 7d58bf5b7ae6ec03eebab9c9004a07bc37d861f4 Mon Sep 17 00:00:00 2001
From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Date: Mon, 5 Dec 2016 18:03:04 -0500
Subject: [PATCH 0055/4131] drm/amd/display: fix up construction of
 scratch_val_ctx

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c        | 12 ++++++------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 522ef70..8e1d695 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -450,11 +450,6 @@ static void destruct(struct core_dc *dc)
 {
 	resource_validate_ctx_destruct(dc->current_context);
 
-	dm_free(dc->temp_flip_context);
-	dc->temp_flip_context = NULL;
-	dm_free(dc->scratch_val_ctx);
-	dc->scratch_val_ctx = NULL;
-
 	destroy_links(dc);
 
 	dc_destroy_resource_pool(dc);
@@ -473,6 +468,10 @@ static void destruct(struct core_dc *dc)
 
 	dm_free(dc->current_context);
 	dc->current_context = NULL;
+	dm_free(dc->temp_flip_context);
+	dc->temp_flip_context = NULL;
+	dm_free(dc->scratch_val_ctx);
+	dc->scratch_val_ctx = NULL;
 
 	dm_free(dc->ctx);
 	dc->ctx = NULL;
@@ -492,7 +491,7 @@ static bool construct(struct core_dc *dc,
 
 	dc->current_context = dm_alloc(sizeof(*dc->current_context));
 	dc->temp_flip_context = dm_alloc(sizeof(*dc->temp_flip_context));
-	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->temp_flip_context));
+	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->scratch_val_ctx));
 
 	if (!dc->current_context || !dc->temp_flip_context) {
 		dm_error("%s: failed to create validate ctx\n", __func__);
@@ -1220,6 +1219,7 @@ bool dc_pre_update_surfaces_to_target(
 			goto unexpected_fail;
 		}
 		resource_validate_ctx_destruct(context);
+		ASSERT(core_dc->scratch_val_ctx == temp_context);
 		core_dc->scratch_val_ctx = context;
 		context = temp_context;
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 0418e3e..3cf9bfb 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -312,7 +312,7 @@ struct validate_context {
 
 	/* The output from BW and WM calculations. */
 	struct bw_calcs_output bw_results;
-	/* Note: this is a big structure, do *not* put on stack! */
+	/* Note: these are big structures, do *not* put on stack! */
 	struct dm_pp_display_configuration pp_display_cfg;
 };
 
-- 
2.7.4