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