xref: /linux/drivers/gpu/drm/rockchip/rockchip_drm_vop2.h (revision 79997eda0d31bc68203c95ecb978773ee6ce7a1f)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
4  * Author:Mark Yao <mark.yao@rock-chips.com>
5  */
6 
7 #ifndef _ROCKCHIP_DRM_VOP2_H
8 #define _ROCKCHIP_DRM_VOP2_H
9 
10 #include "rockchip_drm_vop.h"
11 
12 #include <linux/regmap.h>
13 #include <drm/drm_modes.h>
14 
15 #define VOP_FEATURE_OUTPUT_10BIT        BIT(0)
16 
17 #define WIN_FEATURE_AFBDC		BIT(0)
18 #define WIN_FEATURE_CLUSTER		BIT(1)
19 
20 /*
21  *  the delay number of a window in different mode.
22  */
23 enum win_dly_mode {
24 	VOP2_DLY_MODE_DEFAULT,   /**< default mode */
25 	VOP2_DLY_MODE_HISO_S,    /** HDR in SDR out mode, as a SDR window */
26 	VOP2_DLY_MODE_HIHO_H,    /** HDR in HDR out mode, as a HDR window */
27 	VOP2_DLY_MODE_MAX,
28 };
29 
30 enum vop2_scale_up_mode {
31 	VOP2_SCALE_UP_NRST_NBOR,
32 	VOP2_SCALE_UP_BIL,
33 	VOP2_SCALE_UP_BIC,
34 };
35 
36 enum vop2_scale_down_mode {
37 	VOP2_SCALE_DOWN_NRST_NBOR,
38 	VOP2_SCALE_DOWN_BIL,
39 	VOP2_SCALE_DOWN_AVG,
40 };
41 
42 enum vop2_win_regs {
43 	VOP2_WIN_ENABLE,
44 	VOP2_WIN_FORMAT,
45 	VOP2_WIN_CSC_MODE,
46 	VOP2_WIN_XMIRROR,
47 	VOP2_WIN_YMIRROR,
48 	VOP2_WIN_RB_SWAP,
49 	VOP2_WIN_UV_SWAP,
50 	VOP2_WIN_ACT_INFO,
51 	VOP2_WIN_DSP_INFO,
52 	VOP2_WIN_DSP_ST,
53 	VOP2_WIN_YRGB_MST,
54 	VOP2_WIN_UV_MST,
55 	VOP2_WIN_YRGB_VIR,
56 	VOP2_WIN_UV_VIR,
57 	VOP2_WIN_YUV_CLIP,
58 	VOP2_WIN_Y2R_EN,
59 	VOP2_WIN_R2Y_EN,
60 	VOP2_WIN_COLOR_KEY,
61 	VOP2_WIN_COLOR_KEY_EN,
62 	VOP2_WIN_DITHER_UP,
63 
64 	/* scale regs */
65 	VOP2_WIN_SCALE_YRGB_X,
66 	VOP2_WIN_SCALE_YRGB_Y,
67 	VOP2_WIN_SCALE_CBCR_X,
68 	VOP2_WIN_SCALE_CBCR_Y,
69 	VOP2_WIN_YRGB_HOR_SCL_MODE,
70 	VOP2_WIN_YRGB_HSCL_FILTER_MODE,
71 	VOP2_WIN_YRGB_VER_SCL_MODE,
72 	VOP2_WIN_YRGB_VSCL_FILTER_MODE,
73 	VOP2_WIN_CBCR_VER_SCL_MODE,
74 	VOP2_WIN_CBCR_HSCL_FILTER_MODE,
75 	VOP2_WIN_CBCR_HOR_SCL_MODE,
76 	VOP2_WIN_CBCR_VSCL_FILTER_MODE,
77 	VOP2_WIN_VSD_CBCR_GT2,
78 	VOP2_WIN_VSD_CBCR_GT4,
79 	VOP2_WIN_VSD_YRGB_GT2,
80 	VOP2_WIN_VSD_YRGB_GT4,
81 	VOP2_WIN_BIC_COE_SEL,
82 
83 	/* cluster regs */
84 	VOP2_WIN_CLUSTER_ENABLE,
85 	VOP2_WIN_AFBC_ENABLE,
86 	VOP2_WIN_CLUSTER_LB_MODE,
87 
88 	/* afbc regs */
89 	VOP2_WIN_AFBC_FORMAT,
90 	VOP2_WIN_AFBC_RB_SWAP,
91 	VOP2_WIN_AFBC_UV_SWAP,
92 	VOP2_WIN_AFBC_AUTO_GATING_EN,
93 	VOP2_WIN_AFBC_BLOCK_SPLIT_EN,
94 	VOP2_WIN_AFBC_PIC_VIR_WIDTH,
95 	VOP2_WIN_AFBC_TILE_NUM,
96 	VOP2_WIN_AFBC_PIC_OFFSET,
97 	VOP2_WIN_AFBC_PIC_SIZE,
98 	VOP2_WIN_AFBC_DSP_OFFSET,
99 	VOP2_WIN_AFBC_TRANSFORM_OFFSET,
100 	VOP2_WIN_AFBC_HDR_PTR,
101 	VOP2_WIN_AFBC_HALF_BLOCK_EN,
102 	VOP2_WIN_AFBC_ROTATE_270,
103 	VOP2_WIN_AFBC_ROTATE_90,
104 	VOP2_WIN_MAX_REG,
105 };
106 
107 struct vop2_win_data {
108 	const char *name;
109 	unsigned int phys_id;
110 
111 	u32 base;
112 	enum drm_plane_type type;
113 
114 	u32 nformats;
115 	const u32 *formats;
116 	const uint64_t *format_modifiers;
117 	const unsigned int supported_rotations;
118 
119 	/**
120 	 * @layer_sel_id: defined by register OVERLAY_LAYER_SEL of VOP2
121 	 */
122 	unsigned int layer_sel_id;
123 	uint64_t feature;
124 
125 	unsigned int max_upscale_factor;
126 	unsigned int max_downscale_factor;
127 	const u8 dly[VOP2_DLY_MODE_MAX];
128 };
129 
130 struct vop2_video_port_data {
131 	unsigned int id;
132 	u32 feature;
133 	u16 gamma_lut_len;
134 	u16 cubic_lut_len;
135 	struct vop_rect max_output;
136 	const u8 pre_scan_max_dly[4];
137 	unsigned int offset;
138 };
139 
140 struct vop2_data {
141 	u8 nr_vps;
142 	const struct vop2_win_data *win;
143 	const struct vop2_video_port_data *vp;
144 	struct vop_rect max_input;
145 	struct vop_rect max_output;
146 
147 	unsigned int win_size;
148 	unsigned int soc_id;
149 };
150 
151 /* interrupt define */
152 #define FS_NEW_INTR			BIT(4)
153 #define ADDR_SAME_INTR			BIT(5)
154 #define LINE_FLAG1_INTR			BIT(6)
155 #define WIN0_EMPTY_INTR			BIT(7)
156 #define WIN1_EMPTY_INTR			BIT(8)
157 #define WIN2_EMPTY_INTR			BIT(9)
158 #define WIN3_EMPTY_INTR			BIT(10)
159 #define HWC_EMPTY_INTR			BIT(11)
160 #define POST_BUF_EMPTY_INTR		BIT(12)
161 #define PWM_GEN_INTR			BIT(13)
162 #define DMA_FINISH_INTR			BIT(14)
163 #define FS_FIELD_INTR			BIT(15)
164 #define FE_INTR				BIT(16)
165 #define WB_UV_FIFO_FULL_INTR		BIT(17)
166 #define WB_YRGB_FIFO_FULL_INTR		BIT(18)
167 #define WB_COMPLETE_INTR		BIT(19)
168 
169 /*
170  * display output interface supported by rockchip lcdc
171  */
172 #define ROCKCHIP_OUT_MODE_P888		0
173 #define ROCKCHIP_OUT_MODE_BT1120	0
174 #define ROCKCHIP_OUT_MODE_P666		1
175 #define ROCKCHIP_OUT_MODE_P565		2
176 #define ROCKCHIP_OUT_MODE_BT656		5
177 #define ROCKCHIP_OUT_MODE_S888		8
178 #define ROCKCHIP_OUT_MODE_S888_DUMMY	12
179 #define ROCKCHIP_OUT_MODE_YUV420	14
180 /* for use special outface */
181 #define ROCKCHIP_OUT_MODE_AAAA		15
182 
183 enum vop_csc_format {
184 	CSC_BT601L,
185 	CSC_BT709L,
186 	CSC_BT601F,
187 	CSC_BT2020,
188 };
189 
190 enum src_factor_mode {
191 	SRC_FAC_ALPHA_ZERO,
192 	SRC_FAC_ALPHA_ONE,
193 	SRC_FAC_ALPHA_DST,
194 	SRC_FAC_ALPHA_DST_INVERSE,
195 	SRC_FAC_ALPHA_SRC,
196 	SRC_FAC_ALPHA_SRC_GLOBAL,
197 };
198 
199 enum dst_factor_mode {
200 	DST_FAC_ALPHA_ZERO,
201 	DST_FAC_ALPHA_ONE,
202 	DST_FAC_ALPHA_SRC,
203 	DST_FAC_ALPHA_SRC_INVERSE,
204 	DST_FAC_ALPHA_DST,
205 	DST_FAC_ALPHA_DST_GLOBAL,
206 };
207 
208 #define RK3568_GRF_VO_CON1			0x0364
209 /* System registers definition */
210 #define RK3568_REG_CFG_DONE			0x000
211 #define RK3568_VERSION_INFO			0x004
212 #define RK3568_SYS_AUTO_GATING_CTRL		0x008
213 #define RK3568_SYS_AXI_LUT_CTRL			0x024
214 #define RK3568_DSP_IF_EN			0x028
215 #define RK3568_DSP_IF_CTRL			0x02c
216 #define RK3568_DSP_IF_POL			0x030
217 #define RK3568_WB_CTRL				0x40
218 #define RK3568_WB_XSCAL_FACTOR			0x44
219 #define RK3568_WB_YRGB_MST			0x48
220 #define RK3568_WB_CBR_MST			0x4C
221 #define RK3568_OTP_WIN_EN			0x050
222 #define RK3568_LUT_PORT_SEL			0x058
223 #define RK3568_SYS_STATUS0			0x060
224 #define RK3568_VP_LINE_FLAG(vp)			(0x70 + (vp) * 0x4)
225 #define RK3568_SYS0_INT_EN			0x80
226 #define RK3568_SYS0_INT_CLR			0x84
227 #define RK3568_SYS0_INT_STATUS			0x88
228 #define RK3568_SYS1_INT_EN			0x90
229 #define RK3568_SYS1_INT_CLR			0x94
230 #define RK3568_SYS1_INT_STATUS			0x98
231 #define RK3568_VP_INT_EN(vp)			(0xA0 + (vp) * 0x10)
232 #define RK3568_VP_INT_CLR(vp)			(0xA4 + (vp) * 0x10)
233 #define RK3568_VP_INT_STATUS(vp)		(0xA8 + (vp) * 0x10)
234 #define RK3568_VP_INT_RAW_STATUS(vp)		(0xAC + (vp) * 0x10)
235 
236 /* Video Port registers definition */
237 #define RK3568_VP_DSP_CTRL			0x00
238 #define RK3568_VP_MIPI_CTRL			0x04
239 #define RK3568_VP_COLOR_BAR_CTRL		0x08
240 #define RK3568_VP_3D_LUT_CTRL			0x10
241 #define RK3568_VP_3D_LUT_MST			0x20
242 #define RK3568_VP_DSP_BG			0x2C
243 #define RK3568_VP_PRE_SCAN_HTIMING		0x30
244 #define RK3568_VP_POST_DSP_HACT_INFO		0x34
245 #define RK3568_VP_POST_DSP_VACT_INFO		0x38
246 #define RK3568_VP_POST_SCL_FACTOR_YRGB		0x3C
247 #define RK3568_VP_POST_SCL_CTRL			0x40
248 #define RK3568_VP_POST_DSP_VACT_INFO_F1		0x44
249 #define RK3568_VP_DSP_HTOTAL_HS_END		0x48
250 #define RK3568_VP_DSP_HACT_ST_END		0x4C
251 #define RK3568_VP_DSP_VTOTAL_VS_END		0x50
252 #define RK3568_VP_DSP_VACT_ST_END		0x54
253 #define RK3568_VP_DSP_VS_ST_END_F1		0x58
254 #define RK3568_VP_DSP_VACT_ST_END_F1		0x5C
255 #define RK3568_VP_BCSH_CTRL			0x60
256 #define RK3568_VP_BCSH_BCS			0x64
257 #define RK3568_VP_BCSH_H			0x68
258 #define RK3568_VP_BCSH_COLOR_BAR		0x6C
259 
260 /* Overlay registers definition    */
261 #define RK3568_OVL_CTRL				0x600
262 #define RK3568_OVL_LAYER_SEL			0x604
263 #define RK3568_OVL_PORT_SEL			0x608
264 #define RK3568_CLUSTER0_MIX_SRC_COLOR_CTRL	0x610
265 #define RK3568_CLUSTER0_MIX_DST_COLOR_CTRL	0x614
266 #define RK3568_CLUSTER0_MIX_SRC_ALPHA_CTRL	0x618
267 #define RK3568_CLUSTER0_MIX_DST_ALPHA_CTRL	0x61C
268 #define RK3568_MIX0_SRC_COLOR_CTRL		0x650
269 #define RK3568_MIX0_DST_COLOR_CTRL		0x654
270 #define RK3568_MIX0_SRC_ALPHA_CTRL		0x658
271 #define RK3568_MIX0_DST_ALPHA_CTRL		0x65C
272 #define RK3568_HDR0_SRC_COLOR_CTRL		0x6C0
273 #define RK3568_HDR0_DST_COLOR_CTRL		0x6C4
274 #define RK3568_HDR0_SRC_ALPHA_CTRL		0x6C8
275 #define RK3568_HDR0_DST_ALPHA_CTRL		0x6CC
276 #define RK3568_VP_BG_MIX_CTRL(vp)		(0x6E0 + (vp) * 4)
277 #define RK3568_CLUSTER_DLY_NUM			0x6F0
278 #define RK3568_SMART_DLY_NUM			0x6F8
279 
280 /* Cluster register definition, offset relative to window base */
281 #define RK3568_CLUSTER_WIN_CTRL0		0x00
282 #define RK3568_CLUSTER_WIN_CTRL1		0x04
283 #define RK3568_CLUSTER_WIN_YRGB_MST		0x10
284 #define RK3568_CLUSTER_WIN_CBR_MST		0x14
285 #define RK3568_CLUSTER_WIN_VIR			0x18
286 #define RK3568_CLUSTER_WIN_ACT_INFO		0x20
287 #define RK3568_CLUSTER_WIN_DSP_INFO		0x24
288 #define RK3568_CLUSTER_WIN_DSP_ST		0x28
289 #define RK3568_CLUSTER_WIN_SCL_FACTOR_YRGB	0x30
290 #define RK3568_CLUSTER_WIN_AFBCD_TRANSFORM_OFFSET	0x3C
291 #define RK3568_CLUSTER_WIN_AFBCD_OUTPUT_CTRL	0x50
292 #define RK3568_CLUSTER_WIN_AFBCD_ROTATE_MODE	0x54
293 #define RK3568_CLUSTER_WIN_AFBCD_HDR_PTR	0x58
294 #define RK3568_CLUSTER_WIN_AFBCD_VIR_WIDTH	0x5C
295 #define RK3568_CLUSTER_WIN_AFBCD_PIC_SIZE	0x60
296 #define RK3568_CLUSTER_WIN_AFBCD_PIC_OFFSET	0x64
297 #define RK3568_CLUSTER_WIN_AFBCD_DSP_OFFSET	0x68
298 #define RK3568_CLUSTER_WIN_AFBCD_CTRL		0x6C
299 
300 #define RK3568_CLUSTER_CTRL			0x100
301 
302 /* (E)smart register definition, offset relative to window base */
303 #define RK3568_SMART_CTRL0			0x00
304 #define RK3568_SMART_CTRL1			0x04
305 #define RK3568_SMART_REGION0_CTRL		0x10
306 #define RK3568_SMART_REGION0_YRGB_MST		0x14
307 #define RK3568_SMART_REGION0_CBR_MST		0x18
308 #define RK3568_SMART_REGION0_VIR		0x1C
309 #define RK3568_SMART_REGION0_ACT_INFO		0x20
310 #define RK3568_SMART_REGION0_DSP_INFO		0x24
311 #define RK3568_SMART_REGION0_DSP_ST		0x28
312 #define RK3568_SMART_REGION0_SCL_CTRL		0x30
313 #define RK3568_SMART_REGION0_SCL_FACTOR_YRGB	0x34
314 #define RK3568_SMART_REGION0_SCL_FACTOR_CBR	0x38
315 #define RK3568_SMART_REGION0_SCL_OFFSET		0x3C
316 #define RK3568_SMART_REGION1_CTRL		0x40
317 #define RK3568_SMART_REGION1_YRGB_MST		0x44
318 #define RK3568_SMART_REGION1_CBR_MST		0x48
319 #define RK3568_SMART_REGION1_VIR		0x4C
320 #define RK3568_SMART_REGION1_ACT_INFO		0x50
321 #define RK3568_SMART_REGION1_DSP_INFO		0x54
322 #define RK3568_SMART_REGION1_DSP_ST		0x58
323 #define RK3568_SMART_REGION1_SCL_CTRL		0x60
324 #define RK3568_SMART_REGION1_SCL_FACTOR_YRGB	0x64
325 #define RK3568_SMART_REGION1_SCL_FACTOR_CBR	0x68
326 #define RK3568_SMART_REGION1_SCL_OFFSET		0x6C
327 #define RK3568_SMART_REGION2_CTRL		0x70
328 #define RK3568_SMART_REGION2_YRGB_MST		0x74
329 #define RK3568_SMART_REGION2_CBR_MST		0x78
330 #define RK3568_SMART_REGION2_VIR		0x7C
331 #define RK3568_SMART_REGION2_ACT_INFO		0x80
332 #define RK3568_SMART_REGION2_DSP_INFO		0x84
333 #define RK3568_SMART_REGION2_DSP_ST		0x88
334 #define RK3568_SMART_REGION2_SCL_CTRL		0x90
335 #define RK3568_SMART_REGION2_SCL_FACTOR_YRGB	0x94
336 #define RK3568_SMART_REGION2_SCL_FACTOR_CBR	0x98
337 #define RK3568_SMART_REGION2_SCL_OFFSET		0x9C
338 #define RK3568_SMART_REGION3_CTRL		0xA0
339 #define RK3568_SMART_REGION3_YRGB_MST		0xA4
340 #define RK3568_SMART_REGION3_CBR_MST		0xA8
341 #define RK3568_SMART_REGION3_VIR		0xAC
342 #define RK3568_SMART_REGION3_ACT_INFO		0xB0
343 #define RK3568_SMART_REGION3_DSP_INFO		0xB4
344 #define RK3568_SMART_REGION3_DSP_ST		0xB8
345 #define RK3568_SMART_REGION3_SCL_CTRL		0xC0
346 #define RK3568_SMART_REGION3_SCL_FACTOR_YRGB	0xC4
347 #define RK3568_SMART_REGION3_SCL_FACTOR_CBR	0xC8
348 #define RK3568_SMART_REGION3_SCL_OFFSET		0xCC
349 #define RK3568_SMART_COLOR_KEY_CTRL		0xD0
350 
351 /* HDR register definition */
352 #define RK3568_HDR_LUT_CTRL			0x2000
353 #define RK3568_HDR_LUT_MST			0x2004
354 #define RK3568_SDR2HDR_CTRL			0x2010
355 #define RK3568_HDR2SDR_CTRL			0x2020
356 #define RK3568_HDR2SDR_SRC_RANGE		0x2024
357 #define RK3568_HDR2SDR_NORMFACEETF		0x2028
358 #define RK3568_HDR2SDR_DST_RANGE		0x202C
359 #define RK3568_HDR2SDR_NORMFACCGAMMA		0x2030
360 #define RK3568_HDR_EETF_OETF_Y0			0x203C
361 #define RK3568_HDR_SAT_Y0			0x20C0
362 #define RK3568_HDR_EOTF_OETF_Y0			0x20F0
363 #define RK3568_HDR_OETF_DX_POW1			0x2200
364 #define RK3568_HDR_OETF_XN1			0x2300
365 
366 #define RK3568_REG_CFG_DONE__GLB_CFG_DONE_EN		BIT(15)
367 
368 #define RK3568_VP_DSP_CTRL__STANDBY			BIT(31)
369 #define RK3568_VP_DSP_CTRL__DITHER_DOWN_MODE		BIT(20)
370 #define RK3568_VP_DSP_CTRL__DITHER_DOWN_SEL		GENMASK(19, 18)
371 #define RK3568_VP_DSP_CTRL__DITHER_DOWN_EN		BIT(17)
372 #define RK3568_VP_DSP_CTRL__PRE_DITHER_DOWN_EN		BIT(16)
373 #define RK3568_VP_DSP_CTRL__POST_DSP_OUT_R2Y		BIT(15)
374 #define RK3568_VP_DSP_CTRL__DSP_RB_SWAP			BIT(9)
375 #define RK3568_VP_DSP_CTRL__DSP_INTERLACE		BIT(7)
376 #define RK3568_VP_DSP_CTRL__DSP_FILED_POL		BIT(6)
377 #define RK3568_VP_DSP_CTRL__P2I_EN			BIT(5)
378 #define RK3568_VP_DSP_CTRL__CORE_DCLK_DIV		BIT(4)
379 #define RK3568_VP_DSP_CTRL__OUT_MODE			GENMASK(3, 0)
380 
381 #define RK3568_VP_POST_SCL_CTRL__VSCALEDOWN		BIT(1)
382 #define RK3568_VP_POST_SCL_CTRL__HSCALEDOWN		BIT(0)
383 
384 #define RK3568_SYS_DSP_INFACE_EN_LVDS1_MUX		GENMASK(26, 25)
385 #define RK3568_SYS_DSP_INFACE_EN_LVDS1			BIT(24)
386 #define RK3568_SYS_DSP_INFACE_EN_MIPI1_MUX		GENMASK(22, 21)
387 #define RK3568_SYS_DSP_INFACE_EN_MIPI1			BIT(20)
388 #define RK3568_SYS_DSP_INFACE_EN_LVDS0_MUX		GENMASK(19, 18)
389 #define RK3568_SYS_DSP_INFACE_EN_MIPI0_MUX		GENMASK(17, 16)
390 #define RK3568_SYS_DSP_INFACE_EN_EDP_MUX		GENMASK(15, 14)
391 #define RK3568_SYS_DSP_INFACE_EN_HDMI_MUX		GENMASK(11, 10)
392 #define RK3568_SYS_DSP_INFACE_EN_RGB_MUX		GENMASK(9, 8)
393 #define RK3568_SYS_DSP_INFACE_EN_LVDS0			BIT(5)
394 #define RK3568_SYS_DSP_INFACE_EN_MIPI0			BIT(4)
395 #define RK3568_SYS_DSP_INFACE_EN_EDP			BIT(3)
396 #define RK3568_SYS_DSP_INFACE_EN_HDMI			BIT(1)
397 #define RK3568_SYS_DSP_INFACE_EN_RGB			BIT(0)
398 
399 #define RK3568_DSP_IF_POL__MIPI_PIN_POL			GENMASK(19, 16)
400 #define RK3568_DSP_IF_POL__EDP_PIN_POL			GENMASK(15, 12)
401 #define RK3568_DSP_IF_POL__HDMI_PIN_POL			GENMASK(7, 4)
402 #define RK3568_DSP_IF_POL__RGB_LVDS_PIN_POL		GENMASK(3, 0)
403 
404 #define RK3568_VP0_MIPI_CTRL__DCLK_DIV2_PHASE_LOCK	BIT(5)
405 #define RK3568_VP0_MIPI_CTRL__DCLK_DIV2			BIT(4)
406 
407 #define RK3568_SYS_AUTO_GATING_CTRL__AUTO_GATING_EN	BIT(31)
408 
409 #define RK3568_DSP_IF_POL__CFG_DONE_IMD			BIT(28)
410 
411 #define VOP2_SYS_AXI_BUS_NUM				2
412 
413 #define VOP2_CLUSTER_YUV444_10				0x12
414 
415 #define VOP2_COLOR_KEY_MASK				BIT(31)
416 
417 #define RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD		BIT(28)
418 
419 #define RK3568_VP_BG_MIX_CTRL__BG_DLY			GENMASK(31, 24)
420 
421 #define RK3568_OVL_PORT_SEL__SEL_PORT			GENMASK(31, 16)
422 #define RK3568_OVL_PORT_SEL__SMART1			GENMASK(31, 30)
423 #define RK3568_OVL_PORT_SEL__SMART0			GENMASK(29, 28)
424 #define RK3568_OVL_PORT_SEL__ESMART1			GENMASK(27, 26)
425 #define RK3568_OVL_PORT_SEL__ESMART0			GENMASK(25, 24)
426 #define RK3568_OVL_PORT_SEL__CLUSTER1			GENMASK(19, 18)
427 #define RK3568_OVL_PORT_SEL__CLUSTER0			GENMASK(17, 16)
428 #define RK3568_OVL_PORT_SET__PORT2_MUX			GENMASK(11, 8)
429 #define RK3568_OVL_PORT_SET__PORT1_MUX			GENMASK(7, 4)
430 #define RK3568_OVL_PORT_SET__PORT0_MUX			GENMASK(3, 0)
431 #define RK3568_OVL_LAYER_SEL__LAYER(layer, x)		((x) << ((layer) * 4))
432 
433 #define RK3568_CLUSTER_DLY_NUM__CLUSTER1_1		GENMASK(31, 24)
434 #define RK3568_CLUSTER_DLY_NUM__CLUSTER1_0		GENMASK(23, 16)
435 #define RK3568_CLUSTER_DLY_NUM__CLUSTER0_1		GENMASK(15, 8)
436 #define RK3568_CLUSTER_DLY_NUM__CLUSTER0_0		GENMASK(7, 0)
437 
438 #define RK3568_SMART_DLY_NUM__SMART1			GENMASK(31, 24)
439 #define RK3568_SMART_DLY_NUM__SMART0			GENMASK(23, 16)
440 #define RK3568_SMART_DLY_NUM__ESMART1			GENMASK(15, 8)
441 #define RK3568_SMART_DLY_NUM__ESMART0			GENMASK(7, 0)
442 
443 #define VP_INT_DSP_HOLD_VALID	BIT(6)
444 #define VP_INT_FS_FIELD		BIT(5)
445 #define VP_INT_POST_BUF_EMPTY	BIT(4)
446 #define VP_INT_LINE_FLAG1	BIT(3)
447 #define VP_INT_LINE_FLAG0	BIT(2)
448 #define VOP2_INT_BUS_ERRPR	BIT(1)
449 #define VP_INT_FS		BIT(0)
450 
451 #define POLFLAG_DCLK_INV	BIT(3)
452 
453 enum vop2_layer_phy_id {
454 	ROCKCHIP_VOP2_CLUSTER0 = 0,
455 	ROCKCHIP_VOP2_CLUSTER1,
456 	ROCKCHIP_VOP2_ESMART0,
457 	ROCKCHIP_VOP2_ESMART1,
458 	ROCKCHIP_VOP2_SMART0,
459 	ROCKCHIP_VOP2_SMART1,
460 	ROCKCHIP_VOP2_CLUSTER2,
461 	ROCKCHIP_VOP2_CLUSTER3,
462 	ROCKCHIP_VOP2_ESMART2,
463 	ROCKCHIP_VOP2_ESMART3,
464 	ROCKCHIP_VOP2_PHY_ID_INVALID = -1,
465 };
466 
467 extern const struct component_ops vop2_component_ops;
468 
469 #endif /* _ROCKCHIP_DRM_VOP2_H */
470