xref: /openbmc/linux/drivers/gpu/drm/exynos/regs-vp.h (revision d8408326)
1d8408326SSeung-Woo Kim /*
2d8408326SSeung-Woo Kim  *
3d8408326SSeung-Woo Kim  *  Cloned from drivers/media/video/s5p-tv/regs-vp.h
4d8408326SSeung-Woo Kim  *
5d8408326SSeung-Woo Kim  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
6d8408326SSeung-Woo Kim  *		http://www.samsung.com/
7d8408326SSeung-Woo Kim  *
8d8408326SSeung-Woo Kim  * Video processor register header file for Samsung Mixer driver
9d8408326SSeung-Woo Kim  *
10d8408326SSeung-Woo Kim  * This program is free software; you can redistribute it and/or modify
11d8408326SSeung-Woo Kim  * it under the terms of the GNU General Public License version 2 as
12d8408326SSeung-Woo Kim  * published by the Free Software Foundation.
13d8408326SSeung-Woo Kim  */
14d8408326SSeung-Woo Kim 
15d8408326SSeung-Woo Kim #ifndef SAMSUNG_REGS_VP_H
16d8408326SSeung-Woo Kim #define SAMSUNG_REGS_VP_H
17d8408326SSeung-Woo Kim 
18d8408326SSeung-Woo Kim /*
19d8408326SSeung-Woo Kim  * Register part
20d8408326SSeung-Woo Kim  */
21d8408326SSeung-Woo Kim 
22d8408326SSeung-Woo Kim #define VP_ENABLE			0x0000
23d8408326SSeung-Woo Kim #define VP_SRESET			0x0004
24d8408326SSeung-Woo Kim #define VP_SHADOW_UPDATE		0x0008
25d8408326SSeung-Woo Kim #define VP_FIELD_ID			0x000C
26d8408326SSeung-Woo Kim #define VP_MODE				0x0010
27d8408326SSeung-Woo Kim #define VP_IMG_SIZE_Y			0x0014
28d8408326SSeung-Woo Kim #define VP_IMG_SIZE_C			0x0018
29d8408326SSeung-Woo Kim #define VP_PER_RATE_CTRL		0x001C
30d8408326SSeung-Woo Kim #define VP_TOP_Y_PTR			0x0028
31d8408326SSeung-Woo Kim #define VP_BOT_Y_PTR			0x002C
32d8408326SSeung-Woo Kim #define VP_TOP_C_PTR			0x0030
33d8408326SSeung-Woo Kim #define VP_BOT_C_PTR			0x0034
34d8408326SSeung-Woo Kim #define VP_ENDIAN_MODE			0x03CC
35d8408326SSeung-Woo Kim #define VP_SRC_H_POSITION		0x0044
36d8408326SSeung-Woo Kim #define VP_SRC_V_POSITION		0x0048
37d8408326SSeung-Woo Kim #define VP_SRC_WIDTH			0x004C
38d8408326SSeung-Woo Kim #define VP_SRC_HEIGHT			0x0050
39d8408326SSeung-Woo Kim #define VP_DST_H_POSITION		0x0054
40d8408326SSeung-Woo Kim #define VP_DST_V_POSITION		0x0058
41d8408326SSeung-Woo Kim #define VP_DST_WIDTH			0x005C
42d8408326SSeung-Woo Kim #define VP_DST_HEIGHT			0x0060
43d8408326SSeung-Woo Kim #define VP_H_RATIO			0x0064
44d8408326SSeung-Woo Kim #define VP_V_RATIO			0x0068
45d8408326SSeung-Woo Kim #define VP_POLY8_Y0_LL			0x006C
46d8408326SSeung-Woo Kim #define VP_POLY4_Y0_LL			0x00EC
47d8408326SSeung-Woo Kim #define VP_POLY4_C0_LL			0x012C
48d8408326SSeung-Woo Kim 
49d8408326SSeung-Woo Kim /*
50d8408326SSeung-Woo Kim  * Bit definition part
51d8408326SSeung-Woo Kim  */
52d8408326SSeung-Woo Kim 
53d8408326SSeung-Woo Kim /* generates mask for range of bits */
54d8408326SSeung-Woo Kim 
55d8408326SSeung-Woo Kim #define VP_MASK(high_bit, low_bit) \
56d8408326SSeung-Woo Kim 	(((2 << ((high_bit) - (low_bit))) - 1) << (low_bit))
57d8408326SSeung-Woo Kim 
58d8408326SSeung-Woo Kim #define VP_MASK_VAL(val, high_bit, low_bit) \
59d8408326SSeung-Woo Kim 	(((val) << (low_bit)) & VP_MASK(high_bit, low_bit))
60d8408326SSeung-Woo Kim 
61d8408326SSeung-Woo Kim  /* VP_ENABLE */
62d8408326SSeung-Woo Kim #define VP_ENABLE_ON			(1 << 0)
63d8408326SSeung-Woo Kim 
64d8408326SSeung-Woo Kim /* VP_SRESET */
65d8408326SSeung-Woo Kim #define VP_SRESET_PROCESSING		(1 << 0)
66d8408326SSeung-Woo Kim 
67d8408326SSeung-Woo Kim /* VP_SHADOW_UPDATE */
68d8408326SSeung-Woo Kim #define VP_SHADOW_UPDATE_ENABLE		(1 << 0)
69d8408326SSeung-Woo Kim 
70d8408326SSeung-Woo Kim /* VP_MODE */
71d8408326SSeung-Woo Kim #define VP_MODE_NV12			(0 << 6)
72d8408326SSeung-Woo Kim #define VP_MODE_NV21			(1 << 6)
73d8408326SSeung-Woo Kim #define VP_MODE_LINE_SKIP		(1 << 5)
74d8408326SSeung-Woo Kim #define VP_MODE_MEM_LINEAR		(0 << 4)
75d8408326SSeung-Woo Kim #define VP_MODE_MEM_TILED		(1 << 4)
76d8408326SSeung-Woo Kim #define VP_MODE_FMT_MASK		(5 << 4)
77d8408326SSeung-Woo Kim #define VP_MODE_FIELD_ID_AUTO_TOGGLING	(1 << 2)
78d8408326SSeung-Woo Kim #define VP_MODE_2D_IPC			(1 << 1)
79d8408326SSeung-Woo Kim 
80d8408326SSeung-Woo Kim /* VP_IMG_SIZE_Y */
81d8408326SSeung-Woo Kim /* VP_IMG_SIZE_C */
82d8408326SSeung-Woo Kim #define VP_IMG_HSIZE(x)			VP_MASK_VAL(x, 29, 16)
83d8408326SSeung-Woo Kim #define VP_IMG_VSIZE(x)			VP_MASK_VAL(x, 13, 0)
84d8408326SSeung-Woo Kim 
85d8408326SSeung-Woo Kim /* VP_SRC_H_POSITION */
86d8408326SSeung-Woo Kim #define VP_SRC_H_POSITION_VAL(x)	VP_MASK_VAL(x, 14, 4)
87d8408326SSeung-Woo Kim 
88d8408326SSeung-Woo Kim /* VP_ENDIAN_MODE */
89d8408326SSeung-Woo Kim #define VP_ENDIAN_MODE_LITTLE		(1 << 0)
90d8408326SSeung-Woo Kim 
91d8408326SSeung-Woo Kim #endif /* SAMSUNG_REGS_VP_H */
92