1 /* drivers/gpu/drm/exynos/regs-scaler.h
2  *
3  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4  *		http://www.samsung.com/
5  * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
6  *
7  * Register definition file for Samsung scaler driver
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13 
14 #ifndef EXYNOS_REGS_SCALER_H
15 #define EXYNOS_REGS_SCALER_H
16 
17 /* Register part */
18 
19 /* Global setting */
20 #define SCALER_STATUS			0x0	/* no shadow */
21 #define SCALER_CFG			0x4
22 
23 /* Interrupt */
24 #define SCALER_INT_EN			0x8	/* no shadow */
25 #define SCALER_INT_STATUS		0xc	/* no shadow */
26 
27 /* SRC */
28 #define SCALER_SRC_CFG			0x10
29 #define SCALER_SRC_Y_BASE		0x14
30 #define SCALER_SRC_CB_BASE		0x18
31 #define SCALER_SRC_CR_BASE		0x294
32 #define SCALER_SRC_SPAN			0x1c
33 #define SCALER_SRC_Y_POS		0x20
34 #define SCALER_SRC_WH			0x24
35 #define SCALER_SRC_C_POS		0x28
36 
37 /* DST */
38 #define SCALER_DST_CFG			0x30
39 #define SCALER_DST_Y_BASE		0x34
40 #define SCALER_DST_CB_BASE		0x38
41 #define SCALER_DST_CR_BASE		0x298
42 #define SCALER_DST_SPAN			0x3c
43 #define SCALER_DST_WH			0x40
44 #define SCALER_DST_POS			0x44
45 
46 /* Ratio */
47 #define SCALER_H_RATIO			0x50
48 #define SCALER_V_RATIO			0x54
49 
50 /* Rotation */
51 #define SCALER_ROT_CFG			0x58
52 
53 /* Coefficient */
54 /*
55  * YHCOEF_{x}{A|B|C|D}			CHCOEF_{x}{A|B|C|D}
56  *
57  *	A	B	C	D	A	B	C	D
58  * 0	60	64	68	6c	140	144	148	14c
59  * 1	70	74	78	7c	150	154	158	15c
60  * 2	80	84	88	8c	160	164	168	16c
61  * 3	90	94	98	9c	170	174	178	17c
62  * 4	a0	a4	a8	ac	180	184	188	18c
63  * 5	b0	b4	b8	bc	190	194	198	19c
64  * 6	c0	c4	c8	cc	1a0	1a4	1a8	1ac
65  * 7	d0	d4	d8	dc	1b0	1b4	1b8	1bc
66  * 8	e0	e4	e8	ec	1c0	1c4	1c8	1cc
67  *
68  *
69  * YVCOEF_{x}{A|B}			CVCOEF_{x}{A|B}
70  *
71  *	A	B			A	B
72  * 0	f0	f4			1d0	1d4
73  * 1	f8	fc			1d8	1dc
74  * 2	100	104			1e0	1e4
75  * 3	108	10c			1e8	1ec
76  * 4	110	114			1f0	1f4
77  * 5	118	11c			1f8	1fc
78  * 6	120	124			200	204
79  * 7	128	12c			208	20c
80  * 8	130	134			210	214
81  */
82 #define _SCALER_HCOEF_DELTA(r, c)	((r) * 0x10 + (c) * 0x4)
83 #define _SCALER_VCOEF_DELTA(r, c)	((r) * 0x8 + (c) * 0x4)
84 
85 #define SCALER_YHCOEF(r, c)		(0x60 + _SCALER_HCOEF_DELTA((r), (c)))
86 #define SCALER_YVCOEF(r, c)		(0xf0 + _SCALER_VCOEF_DELTA((r), (c)))
87 #define SCALER_CHCOEF(r, c)		(0x140 + _SCALER_HCOEF_DELTA((r), (c)))
88 #define SCALER_CVCOEF(r, c)		(0x1d0 + _SCALER_VCOEF_DELTA((r), (c)))
89 
90 
91 /* Color Space Conversion */
92 #define SCALER_CSC_COEF(x, y)		(0x220 + (y) * 0xc + (x) * 0x4)
93 
94 /* Dithering */
95 #define SCALER_DITH_CFG			0x250
96 
97 /* Version Number */
98 #define SCALER_VER			0x260	/* no shadow */
99 
100 /* Cycle count and Timeout */
101 #define SCALER_CYCLE_COUNT		0x278	/* no shadow */
102 #define SCALER_TIMEOUT_CTRL		0x2c0	/* no shadow */
103 #define SCALER_TIMEOUT_CNT		0x2c4	/* no shadow */
104 
105 /* Blending */
106 #define SCALER_SRC_BLEND_COLOR		0x280
107 #define SCALER_SRC_BLEND_ALPHA		0x284
108 #define SCALER_DST_BLEND_COLOR		0x288
109 #define SCALER_DST_BLEND_ALPHA		0x28c
110 
111 /* Color Fill */
112 #define SCALER_FILL_COLOR		0x290
113 
114 /* Multiple Command Queue */
115 #define SCALER_ADDR_Q_CONFIG		0x2a0	/* no shadow */
116 #define SCALER_SRC_ADDR_Q_STATUS	0x2a4	/* no shadow */
117 #define SCALER_SRC_ADDR_Q		0x2a8	/* no shadow */
118 
119 /* CRC */
120 #define SCALER_CRC_COLOR00_10		0x2b0	/* no shadow */
121 #define SCALER_CRC_COLOR20_30		0x2b4	/* no shadow */
122 #define SCALER_CRC_COLOR01_11		0x2b8	/* no shadow */
123 #define SCALER_CRC_COLOR21_31		0x2bc	/* no shadow */
124 
125 /* Shadow Registers */
126 #define SCALER_SHADOW_OFFSET		0x1000
127 
128 
129 /* Bit definition part */
130 #define SCALER_MASK(hi_b, lo_b)		((1 << ((hi_b) - (lo_b) + 1)) - 1)
131 #define SCALER_GET(reg, hi_b, lo_b)	\
132 	(((reg) >> (lo_b)) & SCALER_MASK(hi_b, lo_b))
133 #define SCALER_SET(val, hi_b, lo_b) \
134 	(((val) & SCALER_MASK(hi_b, lo_b)) << lo_b)
135 
136 /* SCALER_STATUS */
137 #define SCALER_STATUS_SCALER_RUNNING		(1 << 1)
138 #define SCALER_STATUS_SCALER_READY_CLK_DOWN	(1 << 0)
139 
140 /* SCALER_CFG */
141 #define SCALER_CFG_FILL_EN			(1 << 24)
142 #define SCALER_CFG_BLEND_COLOR_DIVIDE_ALPHA_EN	(1 << 17)
143 #define SCALER_CFG_BLEND_EN			(1 << 16)
144 #define SCALER_CFG_CSC_Y_OFFSET_SRC_EN		(1 << 10)
145 #define SCALER_CFG_CSC_Y_OFFSET_DST_EN		(1 << 9)
146 #define SCALER_CFG_16_BURST_MODE		(1 << 8)
147 #define SCALER_CFG_SOFT_RESET			(1 << 1)
148 #define SCALER_CFG_START_CMD			(1 << 0)
149 
150 /* SCALER_INT_EN */
151 #define SCALER_INT_EN_TIMEOUT			(1 << 31)
152 #define SCALER_INT_EN_ILLEGAL_BLEND		(1 << 24)
153 #define SCALER_INT_EN_ILLEGAL_RATIO		(1 << 23)
154 #define SCALER_INT_EN_ILLEGAL_DST_HEIGHT	(1 << 22)
155 #define SCALER_INT_EN_ILLEGAL_DST_WIDTH		(1 << 21)
156 #define SCALER_INT_EN_ILLEGAL_DST_V_POS		(1 << 20)
157 #define SCALER_INT_EN_ILLEGAL_DST_H_POS		(1 << 19)
158 #define SCALER_INT_EN_ILLEGAL_DST_C_SPAN	(1 << 18)
159 #define SCALER_INT_EN_ILLEGAL_DST_Y_SPAN	(1 << 17)
160 #define SCALER_INT_EN_ILLEGAL_DST_CR_BASE	(1 << 16)
161 #define SCALER_INT_EN_ILLEGAL_DST_CB_BASE	(1 << 15)
162 #define SCALER_INT_EN_ILLEGAL_DST_Y_BASE	(1 << 14)
163 #define SCALER_INT_EN_ILLEGAL_DST_COLOR		(1 << 13)
164 #define SCALER_INT_EN_ILLEGAL_SRC_HEIGHT	(1 << 12)
165 #define SCALER_INT_EN_ILLEGAL_SRC_WIDTH		(1 << 11)
166 #define SCALER_INT_EN_ILLEGAL_SRC_CV_POS	(1 << 10)
167 #define SCALER_INT_EN_ILLEGAL_SRC_CH_POS	(1 << 9)
168 #define SCALER_INT_EN_ILLEGAL_SRC_YV_POS	(1 << 8)
169 #define SCALER_INT_EN_ILLEGAL_SRC_YH_POS	(1 << 7)
170 #define SCALER_INT_EN_ILLEGAL_DST_SPAN		(1 << 6)
171 #define SCALER_INT_EN_ILLEGAL_SRC_Y_SPAN	(1 << 5)
172 #define SCALER_INT_EN_ILLEGAL_SRC_CR_BASE	(1 << 4)
173 #define SCALER_INT_EN_ILLEGAL_SRC_CB_BASE	(1 << 3)
174 #define SCALER_INT_EN_ILLEGAL_SRC_Y_BASE	(1 << 2)
175 #define SCALER_INT_EN_ILLEGAL_SRC_COLOR		(1 << 1)
176 #define SCALER_INT_EN_FRAME_END			(1 << 0)
177 
178 /* SCALER_INT_STATUS */
179 #define SCALER_INT_STATUS_TIMEOUT		(1 << 31)
180 #define SCALER_INT_STATUS_ILLEGAL_BLEND		(1 << 24)
181 #define SCALER_INT_STATUS_ILLEGAL_RATIO		(1 << 23)
182 #define SCALER_INT_STATUS_ILLEGAL_DST_HEIGHT	(1 << 22)
183 #define SCALER_INT_STATUS_ILLEGAL_DST_WIDTH	(1 << 21)
184 #define SCALER_INT_STATUS_ILLEGAL_DST_V_POS	(1 << 20)
185 #define SCALER_INT_STATUS_ILLEGAL_DST_H_POS	(1 << 19)
186 #define SCALER_INT_STATUS_ILLEGAL_DST_C_SPAN	(1 << 18)
187 #define SCALER_INT_STATUS_ILLEGAL_DST_Y_SPAN	(1 << 17)
188 #define SCALER_INT_STATUS_ILLEGAL_DST_CR_BASE	(1 << 16)
189 #define SCALER_INT_STATUS_ILLEGAL_DST_CB_BASE	(1 << 15)
190 #define SCALER_INT_STATUS_ILLEGAL_DST_Y_BASE	(1 << 14)
191 #define SCALER_INT_STATUS_ILLEGAL_DST_COLOR	(1 << 13)
192 #define SCALER_INT_STATUS_ILLEGAL_SRC_HEIGHT	(1 << 12)
193 #define SCALER_INT_STATUS_ILLEGAL_SRC_WIDTH	(1 << 11)
194 #define SCALER_INT_STATUS_ILLEGAL_SRC_CV_POS	(1 << 10)
195 #define SCALER_INT_STATUS_ILLEGAL_SRC_CH_POS	(1 << 9)
196 #define SCALER_INT_STATUS_ILLEGAL_SRC_YV_POS	(1 << 8)
197 #define SCALER_INT_STATUS_ILLEGAL_SRC_YH_POS	(1 << 7)
198 #define SCALER_INT_STATUS_ILLEGAL_DST_SPAN	(1 << 6)
199 #define SCALER_INT_STATUS_ILLEGAL_SRC_Y_SPAN	(1 << 5)
200 #define SCALER_INT_STATUS_ILLEGAL_SRC_CR_BASE	(1 << 4)
201 #define SCALER_INT_STATUS_ILLEGAL_SRC_CB_BASE	(1 << 3)
202 #define SCALER_INT_STATUS_ILLEGAL_SRC_Y_BASE	(1 << 2)
203 #define SCALER_INT_STATUS_ILLEGAL_SRC_COLOR	(1 << 1)
204 #define SCALER_INT_STATUS_FRAME_END		(1 << 0)
205 
206 /* SCALER_SRC_CFG */
207 #define SCALER_SRC_CFG_TILE_EN			(1 << 10)
208 #define SCALER_SRC_CFG_GET_BYTE_SWAP(r)		SCALER_GET(r, 6, 5)
209 #define SCALER_SRC_CFG_SET_BYTE_SWAP(v)		SCALER_SET(v, 6, 5)
210 #define SCALER_SRC_CFG_GET_COLOR_FORMAT(r)	SCALER_GET(r, 4, 0)
211 #define SCALER_SRC_CFG_SET_COLOR_FORMAT(v)	SCALER_SET(v, 4, 0)
212 #define SCALER_YUV420_2P_UV			0
213 #define SCALER_YUV422_2P_UV			2
214 #define SCALER_YUV444_2P_UV			3
215 #define SCALER_RGB_565				4
216 #define SCALER_ARGB1555				5
217 #define SCALER_ARGB8888				6
218 #define SCALER_ARGB8888_PRE			7
219 #define SCALER_YUV422_1P_YVYU			9
220 #define SCALER_YUV422_1P_YUYV			10
221 #define SCALER_YUV422_1P_UYVY			11
222 #define SCALER_ARGB4444				12
223 #define SCALER_L8A8				13
224 #define SCALER_RGBA8888				14
225 #define SCALER_L8				15
226 #define SCALER_YUV420_2P_VU			16
227 #define SCALER_YUV422_2P_VU			18
228 #define SCALER_YUV444_2P_VU			19
229 #define SCALER_YUV420_3P			20
230 #define SCALER_YUV422_3P			22
231 #define SCALER_YUV444_3P			23
232 
233 /* SCALER_SRC_SPAN */
234 #define SCALER_SRC_SPAN_GET_C_SPAN(r)		SCALER_GET(r, 29, 16)
235 #define SCALER_SRC_SPAN_SET_C_SPAN(v)		SCALER_SET(v, 29, 16)
236 #define SCALER_SRC_SPAN_GET_Y_SPAN(r)		SCALER_GET(r, 13, 0)
237 #define SCALER_SRC_SPAN_SET_Y_SPAN(v)		SCALER_SET(v, 13, 0)
238 
239 /* SCALER_SRC_Y_POS */
240 #define SCALER_SRC_Y_POS_GET_YH_POS(r)		SCALER_GET(r, 31, 16)
241 #define SCALER_SRC_Y_POS_SET_YH_POS(v)		SCALER_SET(v, 31, 16)
242 #define SCALER_SRC_Y_POS_GET_YV_POS(r)		SCALER_GET(r, 15, 0)
243 #define SCALER_SRC_Y_POS_SET_YV_POS(v)		SCALER_SET(v, 15, 0)
244 
245 /* SCALER_SRC_WH */
246 #define SCALER_SRC_WH_GET_WIDTH(r)		SCALER_GET(r, 29, 16)
247 #define SCALER_SRC_WH_SET_WIDTH(v)		SCALER_SET(v, 29, 16)
248 #define SCALER_SRC_WH_GET_HEIGHT(r)		SCALER_GET(r, 13, 0)
249 #define SCALER_SRC_WH_SET_HEIGHT(v)		SCALER_SET(v, 13, 0)
250 
251 /* SCALER_SRC_C_POS */
252 #define SCALER_SRC_C_POS_GET_CH_POS(r)		SCALER_GET(r, 31, 16)
253 #define SCALER_SRC_C_POS_SET_CH_POS(v)		SCALER_SET(v, 31, 16)
254 #define SCALER_SRC_C_POS_GET_CV_POS(r)		SCALER_GET(r, 15, 0)
255 #define SCALER_SRC_C_POS_SET_CV_POS(v)		SCALER_SET(v, 15, 0)
256 
257 /* SCALER_DST_CFG */
258 #define SCALER_DST_CFG_GET_BYTE_SWAP(r)		SCALER_GET(r, 6, 5)
259 #define SCALER_DST_CFG_SET_BYTE_SWAP(v)		SCALER_SET(v, 6, 5)
260 #define SCALER_DST_CFG_GET_COLOR_FORMAT(r)	SCALER_GET(r, 4, 0)
261 #define SCALER_DST_CFG_SET_COLOR_FORMAT(v)	SCALER_SET(v, 4, 0)
262 
263 /* SCALER_DST_SPAN */
264 #define SCALER_DST_SPAN_GET_C_SPAN(r)		SCALER_GET(r, 29, 16)
265 #define SCALER_DST_SPAN_SET_C_SPAN(v)		SCALER_SET(v, 29, 16)
266 #define SCALER_DST_SPAN_GET_Y_SPAN(r)		SCALER_GET(r, 13, 0)
267 #define SCALER_DST_SPAN_SET_Y_SPAN(v)		SCALER_SET(v, 13, 0)
268 
269 /* SCALER_DST_WH */
270 #define SCALER_DST_WH_GET_WIDTH(r)		SCALER_GET(r, 29, 16)
271 #define SCALER_DST_WH_SET_WIDTH(v)		SCALER_SET(v, 29, 16)
272 #define SCALER_DST_WH_GET_HEIGHT(r)		SCALER_GET(r, 13, 0)
273 #define SCALER_DST_WH_SET_HEIGHT(v)		SCALER_SET(v, 13, 0)
274 
275 /* SCALER_DST_POS */
276 #define SCALER_DST_POS_GET_H_POS(r)		SCALER_GET(r, 29, 16)
277 #define SCALER_DST_POS_SET_H_POS(v)		SCALER_SET(v, 29, 16)
278 #define SCALER_DST_POS_GET_V_POS(r)		SCALER_GET(r, 13, 0)
279 #define SCALER_DST_POS_SET_V_POS(v)		SCALER_SET(v, 13, 0)
280 
281 /* SCALER_H_RATIO */
282 #define SCALER_H_RATIO_GET(r)			SCALER_GET(r, 18, 0)
283 #define SCALER_H_RATIO_SET(v)			SCALER_SET(v, 18, 0)
284 
285 /* SCALER_V_RATIO */
286 #define SCALER_V_RATIO_GET(r)			SCALER_GET(r, 18, 0)
287 #define SCALER_V_RATIO_SET(v)			SCALER_SET(v, 18, 0)
288 
289 /* SCALER_ROT_CFG */
290 #define SCALER_ROT_CFG_FLIP_X_EN		(1 << 3)
291 #define SCALER_ROT_CFG_FLIP_Y_EN		(1 << 2)
292 #define SCALER_ROT_CFG_GET_ROTMODE(r)		SCALER_GET(r, 1, 0)
293 #define SCALER_ROT_CFG_SET_ROTMODE(v)		SCALER_SET(v, 1, 0)
294 #define SCALER_ROT_MODE_90			1
295 #define SCALER_ROT_MODE_180			2
296 #define SCALER_ROT_MODE_270			3
297 
298 /* SCALER_HCOEF, SCALER_VCOEF */
299 #define SCALER_COEF_SHIFT(i)			(16 * (1 - (i) % 2))
300 #define SCALER_COEF_GET(r, i)			\
301 				(((r) >> SCALER_COEF_SHIFT(i)) & 0x1ff)
302 #define SCALER_COEF_SET(v, i)			\
303 				(((v) & 0x1ff) << SCALER_COEF_SHIFT(i))
304 
305 /* SCALER_CSC_COEFxy */
306 #define SCALER_CSC_COEF_GET(r)			SCALER_GET(r, 11, 0)
307 #define SCALER_CSC_COEF_SET(v)			SCALER_SET(v, 11, 0)
308 
309 /* SCALER_DITH_CFG */
310 #define SCALER_DITH_CFG_GET_R_TYPE(r)		SCALER_GET(r, 8, 6)
311 #define SCALER_DITH_CFG_SET_R_TYPE(v)		SCALER_SET(v, 8, 6)
312 #define SCALER_DITH_CFG_GET_G_TYPE(r)		SCALER_GET(r, 5, 3)
313 #define SCALER_DITH_CFG_SET_G_TYPE(v)		SCALER_SET(v, 5, 3)
314 #define SCALER_DITH_CFG_GET_B_TYPE(r)		SCALER_GET(r, 2, 0)
315 #define SCALER_DITH_CFG_SET_B_TYPE(v)		SCALER_SET(v, 2, 0)
316 
317 /* SCALER_TIMEOUT_CTRL */
318 #define SCALER_TIMEOUT_CTRL_GET_TIMER_VALUE(r)	SCALER_GET(r, 31, 16)
319 #define SCALER_TIMEOUT_CTRL_SET_TIMER_VALUE(v)	SCALER_SET(v, 31, 16)
320 #define SCALER_TIMEOUT_CTRL_GET_TIMER_DIV(r)	SCALER_GET(r, 7, 4)
321 #define SCALER_TIMEOUT_CTRL_SET_TIMER_DIV(v)	SCALER_SET(v, 7, 4)
322 #define SCALER_TIMEOUT_CTRL_TIMER_ENABLE	(1 << 0)
323 
324 /* SCALER_TIMEOUT_CNT */
325 #define SCALER_TIMEOUT_CTRL_GET_TIMER_COUNT(r)	SCALER_GET(r, 31, 16)
326 
327 /* SCALER_SRC_BLEND_COLOR */
328 #define SCALER_SRC_BLEND_COLOR_SEL_INV		(1 << 31)
329 #define SCALER_SRC_BLEND_COLOR_GET_SEL(r)	SCALER_GET(r, 30, 29)
330 #define SCALER_SRC_BLEND_COLOR_SET_SEL(v)	SCALER_SET(v, 30, 29)
331 #define SCALER_SRC_BLEND_COLOR_OP_SEL_INV	(1 << 28)
332 #define SCALER_SRC_BLEND_COLOR_GET_OP_SEL(r)	SCALER_GET(r, 27, 24)
333 #define SCALER_SRC_BLEND_COLOR_SET_OP_SEL(v)	SCALER_SET(v, 27, 24)
334 #define SCALER_SRC_BLEND_COLOR_GET_COLOR0(r)	SCALER_GET(r, 23, 16)
335 #define SCALER_SRC_BLEND_COLOR_SET_COLOR0(v)	SCALER_SET(v, 23, 16)
336 #define SCALER_SRC_BLEND_COLOR_GET_COLOR1(r)	SCALER_GET(r, 15, 8)
337 #define SCALER_SRC_BLEND_COLOR_SET_COLOR1(v)	SCALER_SET(v, 15, 8)
338 #define SCALER_SRC_BLEND_COLOR_GET_COLOR2(r)	SCALER_GET(r, 7, 0)
339 #define SCALER_SRC_BLEND_COLOR_SET_COLOR2(v)	SCALER_SET(v, 7, 0)
340 
341 /* SCALER_SRC_BLEND_ALPHA */
342 #define SCALER_SRC_BLEND_ALPHA_SEL_INV		(1 << 31)
343 #define SCALER_SRC_BLEND_ALPHA_GET_SEL(r)	SCALER_GET(r, 30, 29)
344 #define SCALER_SRC_BLEND_ALPHA_SET_SEL(v)	SCALER_SET(v, 30, 29)
345 #define SCALER_SRC_BLEND_ALPHA_OP_SEL_INV	(1 << 28)
346 #define SCALER_SRC_BLEND_ALPHA_GET_OP_SEL(r)	SCALER_GET(r, 27, 24)
347 #define SCALER_SRC_BLEND_ALPHA_SET_OP_SEL(v)	SCALER_SET(v, 27, 24)
348 #define SCALER_SRC_BLEND_ALPHA_GET_ALPHA(r)	SCALER_GET(r, 7, 0)
349 #define SCALER_SRC_BLEND_ALPHA_SET_ALPHA(v)	SCALER_SET(v, 7, 0)
350 
351 /* SCALER_DST_BLEND_COLOR */
352 #define SCALER_DST_BLEND_COLOR_SEL_INV		(1 << 31)
353 #define SCALER_DST_BLEND_COLOR_GET_SEL(r)	SCALER_GET(r, 30, 29)
354 #define SCALER_DST_BLEND_COLOR_SET_SEL(v)	SCALER_SET(v, 30, 29)
355 #define SCALER_DST_BLEND_COLOR_OP_SEL_INV	(1 << 28)
356 #define SCALER_DST_BLEND_COLOR_GET_OP_SEL(r)	SCALER_GET(r, 27, 24)
357 #define SCALER_DST_BLEND_COLOR_SET_OP_SEL(v)	SCALER_SET(v, 27, 24)
358 #define SCALER_DST_BLEND_COLOR_GET_COLOR0(r)	SCALER_GET(r, 23, 16)
359 #define SCALER_DST_BLEND_COLOR_SET_COLOR0(v)	SCALER_SET(v, 23, 16)
360 #define SCALER_DST_BLEND_COLOR_GET_COLOR1(r)	SCALER_GET(r, 15, 8)
361 #define SCALER_DST_BLEND_COLOR_SET_COLOR1(v)	SCALER_SET(v, 15, 8)
362 #define SCALER_DST_BLEND_COLOR_GET_COLOR2(r)	SCALER_GET(r, 7, 0)
363 #define SCALER_DST_BLEND_COLOR_SET_COLOR2(v)	SCALER_SET(v, 7, 0)
364 
365 /* SCALER_DST_BLEND_ALPHA */
366 #define SCALER_DST_BLEND_ALPHA_SEL_INV		(1 << 31)
367 #define SCALER_DST_BLEND_ALPHA_GET_SEL(r)	SCALER_GET(r, 30, 29)
368 #define SCALER_DST_BLEND_ALPHA_SET_SEL(v)	SCALER_SET(v, 30, 29)
369 #define SCALER_DST_BLEND_ALPHA_OP_SEL_INV	(1 << 28)
370 #define SCALER_DST_BLEND_ALPHA_GET_OP_SEL(r)	SCALER_GET(r, 27, 24)
371 #define SCALER_DST_BLEND_ALPHA_SET_OP_SEL(v)	SCALER_SET(v, 27, 24)
372 #define SCALER_DST_BLEND_ALPHA_GET_ALPHA(r)	SCALER_GET(r, 7, 0)
373 #define SCALER_DST_BLEND_ALPHA_SET_ALPHA(v)	SCALER_SET(v, 7, 0)
374 
375 /* SCALER_FILL_COLOR */
376 #define SCALER_FILL_COLOR_GET_ALPHA(r)		SCALER_GET(r, 31, 24)
377 #define SCALER_FILL_COLOR_SET_ALPHA(v)		SCALER_SET(v, 31, 24)
378 #define SCALER_FILL_COLOR_GET_FILL_COLOR0(r)	SCALER_GET(r, 23, 16)
379 #define SCALER_FILL_COLOR_SET_FILL_COLOR0(v)	SCALER_SET(v, 23, 16)
380 #define SCALER_FILL_COLOR_GET_FILL_COLOR1(r)	SCALER_GET(r, 15, 8)
381 #define SCALER_FILL_COLOR_SET_FILL_COLOR1(v)	SCALER_SET(v, 15, 8)
382 #define SCALER_FILL_COLOR_GET_FILL_COLOR2(r)	SCALER_GET(r, 7, 0)
383 #define SCALER_FILL_COLOR_SET_FILL_COLOR2(v)	SCALER_SET(v, 7, 0)
384 
385 /* SCALER_ADDR_Q_CONFIG */
386 #define SCALER_ADDR_Q_CONFIG_RST		(1 << 0)
387 
388 /* SCALER_SRC_ADDR_Q_STATUS */
389 #define SCALER_SRC_ADDR_Q_STATUS_Y_FULL		(1 << 23)
390 #define SCALER_SRC_ADDR_Q_STATUS_Y_EMPTY	(1 << 22)
391 #define SCALER_SRC_ADDR_Q_STATUS_GET_Y_WR_IDX(r)	SCALER_GET(r, 21, 16)
392 #define SCALER_SRC_ADDR_Q_STATUS_CB_FULL	(1 << 15)
393 #define SCALER_SRC_ADDR_Q_STATUS_CB_EMPTY	(1 << 14)
394 #define SCALER_SRC_ADDR_Q_STATUS_GET_CB_WR_IDX(r)	SCALER_GET(r, 13, 8)
395 #define SCALER_SRC_ADDR_Q_STATUS_CR_FULL	(1 << 7)
396 #define SCALER_SRC_ADDR_Q_STATUS_CR_EMPTY	(1 << 6)
397 #define SCALER_SRC_ADDR_Q_STATUS_GET_CR_WR_IDX(r)	SCALER_GET(r, 5, 0)
398 
399 /* SCALER_DST_ADDR_Q_STATUS */
400 #define SCALER_DST_ADDR_Q_STATUS_Y_FULL		(1 << 23)
401 #define SCALER_DST_ADDR_Q_STATUS_Y_EMPTY	(1 << 22)
402 #define SCALER_DST_ADDR_Q_STATUS_GET_Y_WR_IDX(r)	SCALER_GET(r, 21, 16)
403 #define SCALER_DST_ADDR_Q_STATUS_CB_FULL	(1 << 15)
404 #define SCALER_DST_ADDR_Q_STATUS_CB_EMPTY	(1 << 14)
405 #define SCALER_DST_ADDR_Q_STATUS_GET_CB_WR_IDX(r)	SCALER_GET(r, 13, 8)
406 #define SCALER_DST_ADDR_Q_STATUS_CR_FULL	(1 << 7)
407 #define SCALER_DST_ADDR_Q_STATUS_CR_EMPTY	(1 << 6)
408 #define SCALER_DST_ADDR_Q_STATUS_GET_CR_WR_IDX(r)	SCALER_GET(r, 5, 0)
409 
410 /* SCALER_CRC_COLOR00_10 */
411 #define SCALER_CRC_COLOR00_10_GET_00(r)		SCALER_GET(r, 31, 16)
412 #define SCALER_CRC_COLOR00_10_GET_10(r)		SCALER_GET(r, 15, 0)
413 
414 /* SCALER_CRC_COLOR20_30 */
415 #define SCALER_CRC_COLOR20_30_GET_20(r)		SCALER_GET(r, 31, 16)
416 #define SCALER_CRC_COLOR20_30_GET_30(r)		SCALER_GET(r, 15, 0)
417 
418 /* SCALER_CRC_COLOR01_11 */
419 #define SCALER_CRC_COLOR01_11_GET_01(r)		SCALER_GET(r, 31, 16)
420 #define SCALER_CRC_COLOR01_11_GET_11(r)		SCALER_GET(r, 15, 0)
421 
422 /* SCALER_CRC_COLOR21_31 */
423 #define SCALER_CRC_COLOR21_31_GET_21(r)		SCALER_GET(r, 31, 16)
424 #define SCALER_CRC_COLOR21_31_GET_31(r)		SCALER_GET(r, 15, 0)
425 
426 #endif /* EXYNOS_REGS_SCALER_H */
427