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#ifndef __DAL_HW_SHARED_H__
27#define __DAL_HW_SHARED_H__
28
29#include "os_types.h"
30#include "fixed31_32.h"
31#include "dc_hw_types.h"
32
33
34
35
36
37#define MAX_AUDIOS 7
38#define MAX_PIPES 6
39#define MAX_DIG_LINK_ENCODERS 7
40#define MAX_DWB_PIPES 1
41
42struct gamma_curve {
43 uint32_t offset;
44 uint32_t segments_num;
45};
46
47struct curve_points {
48 struct fixed31_32 x;
49 struct fixed31_32 y;
50 struct fixed31_32 offset;
51 struct fixed31_32 slope;
52
53 uint32_t custom_float_x;
54 uint32_t custom_float_y;
55 uint32_t custom_float_offset;
56 uint32_t custom_float_slope;
57};
58
59struct curve_points3 {
60 struct curve_points red;
61 struct curve_points green;
62 struct curve_points blue;
63};
64
65struct pwl_result_data {
66 struct fixed31_32 red;
67 struct fixed31_32 green;
68 struct fixed31_32 blue;
69
70 struct fixed31_32 delta_red;
71 struct fixed31_32 delta_green;
72 struct fixed31_32 delta_blue;
73
74 uint32_t red_reg;
75 uint32_t green_reg;
76 uint32_t blue_reg;
77
78 uint32_t delta_red_reg;
79 uint32_t delta_green_reg;
80 uint32_t delta_blue_reg;
81};
82
83struct dc_rgb {
84 uint32_t red;
85 uint32_t green;
86 uint32_t blue;
87};
88
89struct tetrahedral_17x17x17 {
90 struct dc_rgb lut0[1229];
91 struct dc_rgb lut1[1228];
92 struct dc_rgb lut2[1228];
93 struct dc_rgb lut3[1228];
94};
95struct tetrahedral_9x9x9 {
96 struct dc_rgb lut0[183];
97 struct dc_rgb lut1[182];
98 struct dc_rgb lut2[182];
99 struct dc_rgb lut3[182];
100};
101
102struct tetrahedral_params {
103 union {
104 struct tetrahedral_17x17x17 tetrahedral_17;
105 struct tetrahedral_9x9x9 tetrahedral_9;
106 };
107 bool use_tetrahedral_9;
108 bool use_12bits;
109
110};
111
112
113
114
115
116
117struct pwl_params {
118 struct gamma_curve arr_curve_points[34];
119 union {
120 struct curve_points arr_points[2];
121 struct curve_points3 corner_points[2];
122 };
123 struct pwl_result_data rgb_resulted[256 + 3];
124 uint32_t hw_points_num;
125};
126
127
128
129
130
131
132
133enum lb_pixel_depth {
134
135 LB_PIXEL_DEPTH_18BPP = 1,
136 LB_PIXEL_DEPTH_24BPP = 2,
137 LB_PIXEL_DEPTH_30BPP = 4,
138 LB_PIXEL_DEPTH_36BPP = 8
139};
140
141enum graphics_csc_adjust_type {
142 GRAPHICS_CSC_ADJUST_TYPE_BYPASS = 0,
143 GRAPHICS_CSC_ADJUST_TYPE_HW,
144 GRAPHICS_CSC_ADJUST_TYPE_SW
145};
146
147enum ipp_degamma_mode {
148 IPP_DEGAMMA_MODE_BYPASS,
149 IPP_DEGAMMA_MODE_HW_sRGB,
150 IPP_DEGAMMA_MODE_HW_xvYCC,
151 IPP_DEGAMMA_MODE_USER_PWL
152};
153
154enum gamcor_mode {
155 GAMCOR_MODE_BYPASS,
156 GAMCOR_MODE_RESERVED_1,
157 GAMCOR_MODE_USER_PWL,
158 GAMCOR_MODE_RESERVED_3
159};
160
161enum ipp_output_format {
162 IPP_OUTPUT_FORMAT_12_BIT_FIX,
163 IPP_OUTPUT_FORMAT_16_BIT_BYPASS,
164 IPP_OUTPUT_FORMAT_FLOAT
165};
166
167enum expansion_mode {
168 EXPANSION_MODE_DYNAMIC,
169 EXPANSION_MODE_ZERO
170};
171
172struct default_adjustment {
173 enum lb_pixel_depth lb_color_depth;
174 enum dc_color_space out_color_space;
175 enum dc_color_space in_color_space;
176 enum dc_color_depth color_depth;
177 enum pixel_format surface_pixel_format;
178 enum graphics_csc_adjust_type csc_adjust_type;
179 bool force_hw_default;
180};
181
182
183struct out_csc_color_matrix {
184 enum dc_color_space color_space;
185 uint16_t regval[12];
186};
187
188enum gamut_remap_select {
189 GAMUT_REMAP_BYPASS = 0,
190 GAMUT_REMAP_COEFF,
191 GAMUT_REMAP_COMA_COEFF,
192 GAMUT_REMAP_COMB_COEFF
193};
194
195enum opp_regamma {
196 OPP_REGAMMA_BYPASS = 0,
197 OPP_REGAMMA_SRGB,
198 OPP_REGAMMA_XVYCC,
199 OPP_REGAMMA_USER
200};
201
202enum optc_dsc_mode {
203 OPTC_DSC_DISABLED = 0,
204 OPTC_DSC_ENABLED_444 = 1,
205 OPTC_DSC_ENABLED_NATIVE_SUBSAMPLED = 2
206};
207
208struct dc_bias_and_scale {
209 uint16_t scale_red;
210 uint16_t bias_red;
211 uint16_t scale_green;
212 uint16_t bias_green;
213 uint16_t scale_blue;
214 uint16_t bias_blue;
215};
216
217enum test_pattern_dyn_range {
218 TEST_PATTERN_DYN_RANGE_VESA = 0,
219 TEST_PATTERN_DYN_RANGE_CEA
220};
221
222enum test_pattern_mode {
223 TEST_PATTERN_MODE_COLORSQUARES_RGB = 0,
224 TEST_PATTERN_MODE_COLORSQUARES_YCBCR601,
225 TEST_PATTERN_MODE_COLORSQUARES_YCBCR709,
226 TEST_PATTERN_MODE_VERTICALBARS,
227 TEST_PATTERN_MODE_HORIZONTALBARS,
228 TEST_PATTERN_MODE_SINGLERAMP_RGB,
229 TEST_PATTERN_MODE_DUALRAMP_RGB,
230 TEST_PATTERN_MODE_XR_BIAS_RGB
231};
232
233enum test_pattern_color_format {
234 TEST_PATTERN_COLOR_FORMAT_BPC_6 = 0,
235 TEST_PATTERN_COLOR_FORMAT_BPC_8,
236 TEST_PATTERN_COLOR_FORMAT_BPC_10,
237 TEST_PATTERN_COLOR_FORMAT_BPC_12
238};
239
240enum controller_dp_test_pattern {
241 CONTROLLER_DP_TEST_PATTERN_D102 = 0,
242 CONTROLLER_DP_TEST_PATTERN_SYMBOLERROR,
243 CONTROLLER_DP_TEST_PATTERN_PRBS7,
244 CONTROLLER_DP_TEST_PATTERN_COLORSQUARES,
245 CONTROLLER_DP_TEST_PATTERN_VERTICALBARS,
246 CONTROLLER_DP_TEST_PATTERN_HORIZONTALBARS,
247 CONTROLLER_DP_TEST_PATTERN_COLORRAMP,
248 CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
249 CONTROLLER_DP_TEST_PATTERN_RESERVED_8,
250 CONTROLLER_DP_TEST_PATTERN_RESERVED_9,
251 CONTROLLER_DP_TEST_PATTERN_RESERVED_A,
252 CONTROLLER_DP_TEST_PATTERN_COLORSQUARES_CEA,
253 CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR
254};
255
256enum controller_dp_color_space {
257 CONTROLLER_DP_COLOR_SPACE_RGB,
258 CONTROLLER_DP_COLOR_SPACE_YCBCR601,
259 CONTROLLER_DP_COLOR_SPACE_YCBCR709,
260 CONTROLLER_DP_COLOR_SPACE_UDEFINED
261};
262
263enum dc_lut_mode {
264 LUT_BYPASS,
265 LUT_RAM_A,
266 LUT_RAM_B
267};
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338union audio_cea_channels {
339 uint8_t all;
340 struct audio_cea_channels_bits {
341 uint32_t FL:1;
342 uint32_t FR:1;
343 uint32_t LFE:1;
344 uint32_t FC:1;
345 uint32_t RL_RC:1;
346 uint32_t RR:1;
347 uint32_t RC_RLC_FLC:1;
348 uint32_t RRC_FRC:1;
349 } channels;
350};
351
352#endif
353