aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0680-drm-amd-display-Roll-stream-into-dc_stream.patch
blob: f8ac8be9d1c71f3839a781dd1a69b26bd305f1b6 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 7af340ad7d55aec3c7b09521c51d09c46e90ec20 Mon Sep 17 00:00:00 2001
From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
Date: Wed, 26 Jul 2017 16:13:48 -0400
Subject: [PATCH 0680/4131] drm/amd/display: Roll stream into dc_stream

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@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 | 29 +++++++------------------
 1 file changed, 8 insertions(+), 21 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 46ad1bc..a77e1e8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -31,17 +31,6 @@
 #include "timing_generator.h"
 
 /*******************************************************************************
- * Private definitions
- ******************************************************************************/
-
-struct stream {
-	struct dc_stream protected;
-	int ref_count;
-};
-
-#define DC_STREAM_TO_STREAM(dc_stream) container_of(dc_stream, struct stream, protected)
-
-/*******************************************************************************
  * Private functions
  ******************************************************************************/
 
@@ -105,24 +94,22 @@ static void destruct(struct dc_stream *stream)
 	}
 }
 
-void dc_stream_retain(struct dc_stream *dc_stream)
+void dc_stream_retain(struct dc_stream *stream)
 {
-	struct stream *stream = DC_STREAM_TO_STREAM(dc_stream);
 
 	ASSERT(stream->ref_count > 0);
 	stream->ref_count++;
 }
 
-void dc_stream_release(struct dc_stream *public)
+void dc_stream_release(struct dc_stream *stream)
 {
-	struct stream *stream = DC_STREAM_TO_STREAM(public);
 
-	if (public != NULL) {
+	if (stream != NULL) {
 		ASSERT(stream->ref_count > 0);
 		stream->ref_count--;
 
 		if (stream->ref_count == 0) {
-			destruct(public);
+			destruct(stream);
 			dm_free(stream);
 		}
 	}
@@ -131,22 +118,22 @@ void dc_stream_release(struct dc_stream *public)
 struct dc_stream *dc_create_stream_for_sink(
 		struct dc_sink *sink)
 {
-	struct stream *stream;
+	struct dc_stream *stream;
 
 	if (sink == NULL)
 		goto alloc_fail;
 
-	stream = dm_alloc(sizeof(struct stream));
+	stream = dm_alloc(sizeof(struct dc_stream));
 
 	if (NULL == stream)
 		goto alloc_fail;
 
-	if (false == construct(&stream->protected, sink))
+	if (false == construct(stream, sink))
 			goto construct_fail;
 
 	stream->ref_count++;
 
-	return &stream->protected;
+	return stream;
 
 construct_fail:
 	dm_free(stream);
-- 
2.7.4