aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0811-drm-amd-dal-refactor-ipp-header-for-HW-pseudo-code.patch
blob: 6c24383db470087d48c9c2bce2ecf82a55d41d10 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
From 0fbec3793881bf34bebbb67ab2f71bbaaa630b92 Mon Sep 17 00:00:00 2001
From: Eric Yang <eric.yang2@amd.com>
Date: Thu, 18 Feb 2016 12:37:30 -0500
Subject: [PATCH 0811/1110] drm/amd/dal: refactor ipp header for HW pseudo code

Make sure all types used in ipp.h are either in the file
itself or in dc_hw_types.h so that they are visible for
HW diag team when then write their pseudo code

Signed-off-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/dc_hw_types.h          | 87 +++++++++++++++++++++++
 drivers/gpu/drm/amd/dal/dc/dc_types.h             | 71 ------------------
 drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h      |  5 --
 drivers/gpu/drm/amd/dal/include/video_csc_types.h |  7 --
 4 files changed, 87 insertions(+), 83 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h b/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
index 71d6301..2a9ec19 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
@@ -278,5 +278,92 @@ struct dc_cursor_position {
 	bool hot_spot_enable;
 };
 
+/* IPP related types */
+
+/* Used by both ipp amd opp functions*/
+/* TODO: to be consolidated with enum color_space */
+enum ovl_color_space {
+	OVL_COLOR_SPACE_UNKNOWN = 0,
+	OVL_COLOR_SPACE_RGB,
+	OVL_COLOR_SPACE_YUV601,
+	OVL_COLOR_SPACE_YUV709
+};
+
+/*
+ * This enum is for programming CURSOR_MODE register field. What this register
+ * should be programmed to depends on OS requested cursor shape flags and what
+ * we stored in the cursor surface.
+ */
+enum dc_cursor_color_format {
+	CURSOR_MODE_MONO,
+	CURSOR_MODE_COLOR_1BIT_AND,
+	CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA,
+	CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA
+};
+
+/*
+ * This is all the parameters required by DAL in order to update the cursor
+ * attributes, including the new cursor image surface address, size, hotspot
+ * location, color format, etc.
+ */
+
+union dc_cursor_attribute_flags {
+	struct {
+		uint32_t ENABLE_MAGNIFICATION:1;
+		uint32_t INVERSE_TRANSPARENT_CLAMPING:1;
+		uint32_t HORIZONTAL_MIRROR:1;
+		uint32_t VERTICAL_MIRROR:1;
+		uint32_t RESERVED:28;
+	} bits;
+	uint32_t value;
+};
+
+struct dc_cursor_attributes {
+	PHYSICAL_ADDRESS_LOC address;
+
+	/* Width and height should correspond to cursor surface width x heigh */
+	uint32_t width;
+	uint32_t height;
+	uint32_t x_hot;
+	uint32_t y_hot;
+
+	enum dc_cursor_color_format color_format;
+
+	/* In case we support HW Cursor rotation in the future */
+	enum dc_rotation_angle rotation_angle;
+
+	union dc_cursor_attribute_flags attribute_flags;
+};
+
+/* Pixel format */
+enum pixel_format {
+	/*graph*/
+	PIXEL_FORMAT_UNINITIALIZED,
+	PIXEL_FORMAT_INDEX8,
+	PIXEL_FORMAT_RGB565,
+	PIXEL_FORMAT_ARGB8888,
+	PIXEL_FORMAT_ARGB2101010,
+	PIXEL_FORMAT_ARGB2101010_XRBIAS,
+	PIXEL_FORMAT_FP16,
+	/*video*/
+	PIXEL_FORMAT_420BPP12,
+	PIXEL_FORMAT_422BPP16,
+	PIXEL_FORMAT_444BPP16,
+	PIXEL_FORMAT_444BPP32,
+	/*end of pixel format definition*/
+	PIXEL_FORMAT_INVALID,
+
+	PIXEL_FORMAT_GRPH_BEGIN = PIXEL_FORMAT_INDEX8,
+	PIXEL_FORMAT_GRPH_END = PIXEL_FORMAT_FP16,
+	PIXEL_FORMAT_VIDEO_BEGIN = PIXEL_FORMAT_420BPP12,
+	PIXEL_FORMAT_VIDEO_END = PIXEL_FORMAT_444BPP32,
+	PIXEL_FORMAT_UNKNOWN
+};
+
+struct dev_c_lut {
+	uint8_t red;
+	uint8_t green;
+	uint8_t blue;
+};
 #endif /* DC_HW_TYPES_H */
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 863443b..4e36b85 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -80,33 +80,6 @@ enum color_space {
 	COLOR_SPACE_N_MVPU_SUPER_AA,
 };
 
-
-
-/* Pixel format */
-enum pixel_format {
-	/*graph*/
-	PIXEL_FORMAT_UNINITIALIZED,
-	PIXEL_FORMAT_INDEX8,
-	PIXEL_FORMAT_RGB565,
-	PIXEL_FORMAT_ARGB8888,
-	PIXEL_FORMAT_ARGB2101010,
-	PIXEL_FORMAT_ARGB2101010_XRBIAS,
-	PIXEL_FORMAT_FP16,
-	/*video*/
-	PIXEL_FORMAT_420BPP12,
-	PIXEL_FORMAT_422BPP16,
-	PIXEL_FORMAT_444BPP16,
-	PIXEL_FORMAT_444BPP32,
-	/*end of pixel format definition*/
-	PIXEL_FORMAT_INVALID,
-
-	PIXEL_FORMAT_GRPH_BEGIN = PIXEL_FORMAT_INDEX8,
-	PIXEL_FORMAT_GRPH_END = PIXEL_FORMAT_FP16,
-	PIXEL_FORMAT_VIDEO_BEGIN = PIXEL_FORMAT_420BPP12,
-	PIXEL_FORMAT_VIDEO_END = PIXEL_FORMAT_444BPP32,
-	PIXEL_FORMAT_UNKNOWN
-};
-
 enum tiling_mode {
 	TILING_MODE_INVALID,
 	TILING_MODE_LINEAR,
@@ -472,50 +445,6 @@ struct dc_mode_timing {
 	struct dc_crtc_timing crtc_timing;
 };
 
-/* This enum is for programming CURSOR_MODE register field. */
-/* What this register should be programmed to depends on */
-/* OS requested cursor shape flags */
-/* and what we stored in the cursor surface. */
-enum dc_cursor_color_format {
-	CURSOR_MODE_MONO,
-	CURSOR_MODE_COLOR_1BIT_AND,
-	CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA,
-	CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA
-};
-
-union dc_cursor_attribute_flags {
-	struct {
-		uint32_t ENABLE_MAGNIFICATION:1;
-		uint32_t INVERSE_TRANSPARENT_CLAMPING:1;
-		uint32_t HORIZONTAL_MIRROR:1;
-		uint32_t VERTICAL_MIRROR:1;
-		uint32_t RESERVED:28;
-	} bits;
-	uint32_t value;
-};
-
-/* This is all the parameters required by DAL in order to */
-/* update the cursor attributes, */
-/* including the new cursor image surface address, size, */
-/* hotspot location, color format, etc. */
-struct dc_cursor_attributes {
-	PHYSICAL_ADDRESS_LOC address;
-
-	/* Width and height should correspond to cursor surface width x heigh */
-	uint32_t width;
-	uint32_t height;
-	uint32_t x_hot;
-	uint32_t y_hot;
-
-	enum dc_cursor_color_format color_format;
-
-	/* In case we support HW Cursor rotation in the future */
-	enum dc_rotation_angle rotation_angle;
-
-	union dc_cursor_attribute_flags attribute_flags;
-
-};
-
 enum dc_power_state {
 	DC_POWER_STATE_ON = 1,
 	DC_POWER_STATE_STANDBY,
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h b/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h
index ca23e1b..f1cdce8 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h
@@ -29,11 +29,6 @@
 #include "dc_types.h"
 
 /* TODO: Used in IPP and OPP */
-struct dev_c_lut {
-	uint8_t red;
-	uint8_t green;
-	uint8_t blue;
-};
 
 struct dev_c_lut16 {
 	uint16_t red;
diff --git a/drivers/gpu/drm/amd/dal/include/video_csc_types.h b/drivers/gpu/drm/amd/dal/include/video_csc_types.h
index e2a9343..354a01b 100644
--- a/drivers/gpu/drm/amd/dal/include/video_csc_types.h
+++ b/drivers/gpu/drm/amd/dal/include/video_csc_types.h
@@ -33,13 +33,6 @@ enum ovl_alpha_blending_mode {
 	OVL_ALPHA_PER_PIXEL_OVL_ALPHA_MODE
 };
 
-enum ovl_color_space {
-	OVL_COLOR_SPACE_UNKNOWN = 0,
-	OVL_COLOR_SPACE_RGB,
-	OVL_COLOR_SPACE_YUV601,
-	OVL_COLOR_SPACE_YUV709
-};
-
 enum ovl_surface_format {
 	OVL_SURFACE_FORMAT_UNKNOWN = 0,
 	OVL_SURFACE_FORMAT_YUY2,
-- 
2.7.4