aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0095-drm-amd-display-reset-transfer_func-to-NULL-on-relea.patch
blob: a47d69fe7bcaad7ea8ffb858b7e34f634d9e1410 (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
From e43d76189f92686aa8b2ce92f35aee8665c4d075 Mon Sep 17 00:00:00 2001
From: Yongqiang Sun <yongqiang.sun@amd.com>
Date: Wed, 21 Dec 2016 11:13:48 -0500
Subject: [PATCH 0095/4131] drm/amd/display: reset transfer_func to NULL on
 release

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c  | 4 +++-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 237436e..84e3fbb 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -89,9 +89,11 @@ static bool construct(struct core_stream *stream,
 static void destruct(struct core_stream *stream)
 {
 	dc_sink_release(&stream->sink->public);
-	if (stream->public.out_transfer_func != NULL)
+	if (stream->public.out_transfer_func != NULL) {
 		dc_transfer_func_release(
 				stream->public.out_transfer_func);
+		stream->public.out_transfer_func = NULL;
+	}
 }
 
 void dc_stream_retain(const struct dc_stream *dc_stream)
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 3ec1f36..cf8fb9a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -71,11 +71,15 @@ static bool construct(struct dc_context *ctx, struct surface *surface)
 
 static void destruct(struct surface *surface)
 {
-	if (surface->protected.public.gamma_correction != NULL)
+	if (surface->protected.public.gamma_correction != NULL) {
 		dc_gamma_release(surface->protected.public.gamma_correction);
-	if (surface->protected.public.in_transfer_func != NULL)
+		surface->protected.public.gamma_correction = NULL;
+	}
+	if (surface->protected.public.in_transfer_func != NULL) {
 		dc_transfer_func_release(
 				surface->protected.public.in_transfer_func);
+		surface->protected.public.in_transfer_func = NULL;
+	}
 }
 
 /*******************************************************************************
-- 
2.7.4