Re: [PATCH v4 06/11] drm: sti: add TVOut driver

2014-06-11 Thread Rob Clark
On Thu, May 29, 2014 at 2:37 AM, Benjamin Gaignard
 wrote:
> TVout hardware block is responsible to dispatch the data flow coming
> from compositor block to any of the output (HDMI or Analog TV).
> It control when output are start/stop and configure according the
> require flow path.
>
> TVout is the parent of HDMI and HDA drivers and bind them at runtime.
>
> Signed-off-by: Benjamin Gaignard 
> ---
>  drivers/gpu/drm/sti/Makefile|   3 +-
>  drivers/gpu/drm/sti/sti_tvout.c | 678 
> 
>  drivers/gpu/drm/sti/sti_tvout.h |  18 ++
>  3 files changed, 698 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/sti/sti_tvout.c
>  create mode 100644 drivers/gpu/drm/sti/sti_tvout.h
>
> diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile
> index df47171..dcc9568 100644
> --- a/drivers/gpu/drm/sti/Makefile
> +++ b/drivers/gpu/drm/sti/Makefile
> @@ -4,4 +4,5 @@ obj-$(CONFIG_DRM_STI) += \
> sti_hdmi.o \
> sti_hdmi_tx3g0c55phy.o \
> sti_hdmi_tx3g4c28phy.o \
> -   sti_hda.o
> +   sti_hda.o \
> +   sti_tvout.o
> \ No newline at end of file
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> new file mode 100644
> index 000..d778e35
> --- /dev/null
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -0,0 +1,678 @@
> +/*
> + * Copyright (C) STMicroelectronics SA 2014
> + * Authors: Benjamin Gaignard 
> + *  Vincent Abriou 
> + *  for STMicroelectronics.
> + * License terms:  GNU General Public License (GPL), version 2
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include "sti_drm_connector.h"
> +#include "sti_drm_encoder.h"
> +#include "sti_tvout.h"
> +
> +/* glue registers */
> +#define TVO_CSC_MAIN_M0  0x000
> +#define TVO_CSC_MAIN_M1  0x004
> +#define TVO_CSC_MAIN_M2  0x008
> +#define TVO_CSC_MAIN_M3  0x00c
> +#define TVO_CSC_MAIN_M4  0x010
> +#define TVO_CSC_MAIN_M5  0x014
> +#define TVO_CSC_MAIN_M6  0x018
> +#define TVO_CSC_MAIN_M7  0x01c
> +#define TVO_MAIN_IN_VID_FORMAT   0x030
> +#define TVO_CSC_AUX_M0   0x100
> +#define TVO_CSC_AUX_M1   0x104
> +#define TVO_CSC_AUX_M2   0x108
> +#define TVO_CSC_AUX_M3   0x10c
> +#define TVO_CSC_AUX_M4   0x110
> +#define TVO_CSC_AUX_M5   0x114
> +#define TVO_CSC_AUX_M6   0x118
> +#define TVO_CSC_AUX_M7   0x11c
> +#define TVO_AUX_IN_VID_FORMAT0x130
> +#define TVO_VIP_HDF  0x400
> +#define TVO_HD_SYNC_SEL  0x418
> +#define TVO_HD_DAC_CFG_OFF   0x420
> +#define TVO_VIP_HDMI 0x500
> +#define TVO_HDMI_FORCE_COLOR_0   0x504
> +#define TVO_HDMI_FORCE_COLOR_1   0x508
> +#define TVO_HDMI_CLIP_VALUE_B_CB 0x50c
> +#define TVO_HDMI_CLIP_VALUE_Y_G  0x510
> +#define TVO_HDMI_CLIP_VALUE_R_CR 0x514
> +#define TVO_HDMI_SYNC_SEL0x518
> +#define TVO_HDMI_DFV_OBS 0x540
> +
> +#define TVO_IN_FMT_SIGNEDBIT(0)
> +#define TVO_SYNC_EXT BIT(4)
> +
> +#define TVO_VIP_REORDER_R_SHIFT  24
> +#define TVO_VIP_REORDER_G_SHIFT  20
> +#define TVO_VIP_REORDER_B_SHIFT  16
> +#define TVO_VIP_REORDER_MASK 0x3
> +#define TVO_VIP_REORDER_Y_G_SEL  0
> +#define TVO_VIP_REORDER_CB_B_SEL 1
> +#define TVO_VIP_REORDER_CR_R_SEL 2
> +
> +#define TVO_VIP_CLIP_SHIFT   8
> +#define TVO_VIP_CLIP_MASK0x7
> +#define TVO_VIP_CLIP_DISABLED0
> +#define TVO_VIP_CLIP_EAV_SAV 1
> +#define TVO_VIP_CLIP_LIMITED_RANGE_RGB_Y 2
> +#define TVO_VIP_CLIP_LIMITED_RANGE_CB_CR 3
> +#define TVO_VIP_CLIP_PROG_RANGE  4
> +
> +#define TVO_VIP_RND_SHIFT4
> +#define TVO_VIP_RND_MASK 0x3
> +#define TVO_VIP_RND_8BIT_ROUNDED 0
> +#define TVO_VIP_RND_10BIT_ROUNDED1
> +#define TVO_VIP_RND_12BIT_ROUNDED2
> +
> +#define TVO_VIP_SEL_INPUT_MASK   0xf
> +#define TVO_VIP_SEL_INPUT_MAIN   0x0
> +#define TVO_VIP_SEL_INPUT_AUX0x8
> +#define TVO_VIP_SEL_INPUT_FORCE_COLOR0xf
> +#define TVO_VIP_SEL_INPUT_BYPASS_MASK0x1
> +#define TVO_VIP_SEL_INPUT_BYPASSED   1
> +
> +#define TVO_SYNC_MAIN_VTG_SET_REF0x00
> +#define TVO_SYNC_MAIN_VTG_SET_1  0x01
> +#define TVO_SYNC_MAIN_VTG_SET_2  0x02
> +#define TVO_SYNC_MAIN_VTG_SET_3  0x03
> +#define TVO_SYNC_MAIN_VTG_SET_4  0x04
> +#define TVO_SYNC_MAIN_VTG_SET_5  0x05
> +#define TVO_SYNC_MAIN_VTG_SET_6  0x06
> +#define TVO_SYNC_AUX_VTG_SET_REF 0x10
> +#define TVO_SYNC_AUX_VTG_SET_1  

Re: [PATCH v4 06/11] drm: sti: add TVOut driver

2014-06-11 Thread Rob Clark
On Thu, May 29, 2014 at 2:37 AM, Benjamin Gaignard
benjamin.gaign...@linaro.org wrote:
 TVout hardware block is responsible to dispatch the data flow coming
 from compositor block to any of the output (HDMI or Analog TV).
 It control when output are start/stop and configure according the
 require flow path.

 TVout is the parent of HDMI and HDA drivers and bind them at runtime.

 Signed-off-by: Benjamin Gaignard benjamin.gaign...@linaro.org
 ---
  drivers/gpu/drm/sti/Makefile|   3 +-
  drivers/gpu/drm/sti/sti_tvout.c | 678 
 
  drivers/gpu/drm/sti/sti_tvout.h |  18 ++
  3 files changed, 698 insertions(+), 1 deletion(-)
  create mode 100644 drivers/gpu/drm/sti/sti_tvout.c
  create mode 100644 drivers/gpu/drm/sti/sti_tvout.h

 diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile
 index df47171..dcc9568 100644
 --- a/drivers/gpu/drm/sti/Makefile
 +++ b/drivers/gpu/drm/sti/Makefile
 @@ -4,4 +4,5 @@ obj-$(CONFIG_DRM_STI) += \
 sti_hdmi.o \
 sti_hdmi_tx3g0c55phy.o \
 sti_hdmi_tx3g4c28phy.o \
 -   sti_hda.o
 +   sti_hda.o \
 +   sti_tvout.o
 \ No newline at end of file
 diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
 new file mode 100644
 index 000..d778e35
 --- /dev/null
 +++ b/drivers/gpu/drm/sti/sti_tvout.c
 @@ -0,0 +1,678 @@
 +/*
 + * Copyright (C) STMicroelectronics SA 2014
 + * Authors: Benjamin Gaignard benjamin.gaign...@st.com
 + *  Vincent Abriou vincent.abr...@st.com
 + *  for STMicroelectronics.
 + * License terms:  GNU General Public License (GPL), version 2
 + */
 +
 +#include linux/clk.h
 +#include linux/component.h
 +#include linux/module.h
 +#include linux/of_platform.h
 +#include linux/platform_device.h
 +#include linux/reset.h
 +
 +#include drm/drmP.h
 +#include drm/drm_crtc_helper.h
 +
 +#include sti_drm_connector.h
 +#include sti_drm_encoder.h
 +#include sti_tvout.h
 +
 +/* glue registers */
 +#define TVO_CSC_MAIN_M0  0x000
 +#define TVO_CSC_MAIN_M1  0x004
 +#define TVO_CSC_MAIN_M2  0x008
 +#define TVO_CSC_MAIN_M3  0x00c
 +#define TVO_CSC_MAIN_M4  0x010
 +#define TVO_CSC_MAIN_M5  0x014
 +#define TVO_CSC_MAIN_M6  0x018
 +#define TVO_CSC_MAIN_M7  0x01c
 +#define TVO_MAIN_IN_VID_FORMAT   0x030
 +#define TVO_CSC_AUX_M0   0x100
 +#define TVO_CSC_AUX_M1   0x104
 +#define TVO_CSC_AUX_M2   0x108
 +#define TVO_CSC_AUX_M3   0x10c
 +#define TVO_CSC_AUX_M4   0x110
 +#define TVO_CSC_AUX_M5   0x114
 +#define TVO_CSC_AUX_M6   0x118
 +#define TVO_CSC_AUX_M7   0x11c
 +#define TVO_AUX_IN_VID_FORMAT0x130
 +#define TVO_VIP_HDF  0x400
 +#define TVO_HD_SYNC_SEL  0x418
 +#define TVO_HD_DAC_CFG_OFF   0x420
 +#define TVO_VIP_HDMI 0x500
 +#define TVO_HDMI_FORCE_COLOR_0   0x504
 +#define TVO_HDMI_FORCE_COLOR_1   0x508
 +#define TVO_HDMI_CLIP_VALUE_B_CB 0x50c
 +#define TVO_HDMI_CLIP_VALUE_Y_G  0x510
 +#define TVO_HDMI_CLIP_VALUE_R_CR 0x514
 +#define TVO_HDMI_SYNC_SEL0x518
 +#define TVO_HDMI_DFV_OBS 0x540
 +
 +#define TVO_IN_FMT_SIGNEDBIT(0)
 +#define TVO_SYNC_EXT BIT(4)
 +
 +#define TVO_VIP_REORDER_R_SHIFT  24
 +#define TVO_VIP_REORDER_G_SHIFT  20
 +#define TVO_VIP_REORDER_B_SHIFT  16
 +#define TVO_VIP_REORDER_MASK 0x3
 +#define TVO_VIP_REORDER_Y_G_SEL  0
 +#define TVO_VIP_REORDER_CB_B_SEL 1
 +#define TVO_VIP_REORDER_CR_R_SEL 2
 +
 +#define TVO_VIP_CLIP_SHIFT   8
 +#define TVO_VIP_CLIP_MASK0x7
 +#define TVO_VIP_CLIP_DISABLED0
 +#define TVO_VIP_CLIP_EAV_SAV 1
 +#define TVO_VIP_CLIP_LIMITED_RANGE_RGB_Y 2
 +#define TVO_VIP_CLIP_LIMITED_RANGE_CB_CR 3
 +#define TVO_VIP_CLIP_PROG_RANGE  4
 +
 +#define TVO_VIP_RND_SHIFT4
 +#define TVO_VIP_RND_MASK 0x3
 +#define TVO_VIP_RND_8BIT_ROUNDED 0
 +#define TVO_VIP_RND_10BIT_ROUNDED1
 +#define TVO_VIP_RND_12BIT_ROUNDED2
 +
 +#define TVO_VIP_SEL_INPUT_MASK   0xf
 +#define TVO_VIP_SEL_INPUT_MAIN   0x0
 +#define TVO_VIP_SEL_INPUT_AUX0x8
 +#define TVO_VIP_SEL_INPUT_FORCE_COLOR0xf
 +#define TVO_VIP_SEL_INPUT_BYPASS_MASK0x1
 +#define TVO_VIP_SEL_INPUT_BYPASSED   1
 +
 +#define TVO_SYNC_MAIN_VTG_SET_REF0x00
 +#define TVO_SYNC_MAIN_VTG_SET_1  0x01
 +#define TVO_SYNC_MAIN_VTG_SET_2  0x02
 +#define TVO_SYNC_MAIN_VTG_SET_3  0x03
 +#define TVO_SYNC_MAIN_VTG_SET_4  0x04
 +#define TVO_SYNC_MAIN_VTG_SET_5  0x05
 +#define TVO_SYNC_MAIN_VTG_SET_6   

[PATCH v4 06/11] drm: sti: add TVOut driver

2014-05-29 Thread Benjamin Gaignard
TVout hardware block is responsible to dispatch the data flow coming
from compositor block to any of the output (HDMI or Analog TV).
It control when output are start/stop and configure according the
require flow path.

TVout is the parent of HDMI and HDA drivers and bind them at runtime.

Signed-off-by: Benjamin Gaignard 
---
 drivers/gpu/drm/sti/Makefile|   3 +-
 drivers/gpu/drm/sti/sti_tvout.c | 678 
 drivers/gpu/drm/sti/sti_tvout.h |  18 ++
 3 files changed, 698 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/sti/sti_tvout.c
 create mode 100644 drivers/gpu/drm/sti/sti_tvout.h

diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile
index df47171..dcc9568 100644
--- a/drivers/gpu/drm/sti/Makefile
+++ b/drivers/gpu/drm/sti/Makefile
@@ -4,4 +4,5 @@ obj-$(CONFIG_DRM_STI) += \
sti_hdmi.o \
sti_hdmi_tx3g0c55phy.o \
sti_hdmi_tx3g4c28phy.o \
-   sti_hda.o
+   sti_hda.o \
+   sti_tvout.o
\ No newline at end of file
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
new file mode 100644
index 000..d778e35
--- /dev/null
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -0,0 +1,678 @@
+/*
+ * Copyright (C) STMicroelectronics SA 2014
+ * Authors: Benjamin Gaignard 
+ *  Vincent Abriou 
+ *  for STMicroelectronics.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "sti_drm_connector.h"
+#include "sti_drm_encoder.h"
+#include "sti_tvout.h"
+
+/* glue registers */
+#define TVO_CSC_MAIN_M0  0x000
+#define TVO_CSC_MAIN_M1  0x004
+#define TVO_CSC_MAIN_M2  0x008
+#define TVO_CSC_MAIN_M3  0x00c
+#define TVO_CSC_MAIN_M4  0x010
+#define TVO_CSC_MAIN_M5  0x014
+#define TVO_CSC_MAIN_M6  0x018
+#define TVO_CSC_MAIN_M7  0x01c
+#define TVO_MAIN_IN_VID_FORMAT   0x030
+#define TVO_CSC_AUX_M0   0x100
+#define TVO_CSC_AUX_M1   0x104
+#define TVO_CSC_AUX_M2   0x108
+#define TVO_CSC_AUX_M3   0x10c
+#define TVO_CSC_AUX_M4   0x110
+#define TVO_CSC_AUX_M5   0x114
+#define TVO_CSC_AUX_M6   0x118
+#define TVO_CSC_AUX_M7   0x11c
+#define TVO_AUX_IN_VID_FORMAT0x130
+#define TVO_VIP_HDF  0x400
+#define TVO_HD_SYNC_SEL  0x418
+#define TVO_HD_DAC_CFG_OFF   0x420
+#define TVO_VIP_HDMI 0x500
+#define TVO_HDMI_FORCE_COLOR_0   0x504
+#define TVO_HDMI_FORCE_COLOR_1   0x508
+#define TVO_HDMI_CLIP_VALUE_B_CB 0x50c
+#define TVO_HDMI_CLIP_VALUE_Y_G  0x510
+#define TVO_HDMI_CLIP_VALUE_R_CR 0x514
+#define TVO_HDMI_SYNC_SEL0x518
+#define TVO_HDMI_DFV_OBS 0x540
+
+#define TVO_IN_FMT_SIGNEDBIT(0)
+#define TVO_SYNC_EXT BIT(4)
+
+#define TVO_VIP_REORDER_R_SHIFT  24
+#define TVO_VIP_REORDER_G_SHIFT  20
+#define TVO_VIP_REORDER_B_SHIFT  16
+#define TVO_VIP_REORDER_MASK 0x3
+#define TVO_VIP_REORDER_Y_G_SEL  0
+#define TVO_VIP_REORDER_CB_B_SEL 1
+#define TVO_VIP_REORDER_CR_R_SEL 2
+
+#define TVO_VIP_CLIP_SHIFT   8
+#define TVO_VIP_CLIP_MASK0x7
+#define TVO_VIP_CLIP_DISABLED0
+#define TVO_VIP_CLIP_EAV_SAV 1
+#define TVO_VIP_CLIP_LIMITED_RANGE_RGB_Y 2
+#define TVO_VIP_CLIP_LIMITED_RANGE_CB_CR 3
+#define TVO_VIP_CLIP_PROG_RANGE  4
+
+#define TVO_VIP_RND_SHIFT4
+#define TVO_VIP_RND_MASK 0x3
+#define TVO_VIP_RND_8BIT_ROUNDED 0
+#define TVO_VIP_RND_10BIT_ROUNDED1
+#define TVO_VIP_RND_12BIT_ROUNDED2
+
+#define TVO_VIP_SEL_INPUT_MASK   0xf
+#define TVO_VIP_SEL_INPUT_MAIN   0x0
+#define TVO_VIP_SEL_INPUT_AUX0x8
+#define TVO_VIP_SEL_INPUT_FORCE_COLOR0xf
+#define TVO_VIP_SEL_INPUT_BYPASS_MASK0x1
+#define TVO_VIP_SEL_INPUT_BYPASSED   1
+
+#define TVO_SYNC_MAIN_VTG_SET_REF0x00
+#define TVO_SYNC_MAIN_VTG_SET_1  0x01
+#define TVO_SYNC_MAIN_VTG_SET_2  0x02
+#define TVO_SYNC_MAIN_VTG_SET_3  0x03
+#define TVO_SYNC_MAIN_VTG_SET_4  0x04
+#define TVO_SYNC_MAIN_VTG_SET_5  0x05
+#define TVO_SYNC_MAIN_VTG_SET_6  0x06
+#define TVO_SYNC_AUX_VTG_SET_REF 0x10
+#define TVO_SYNC_AUX_VTG_SET_1   0x11
+#define TVO_SYNC_AUX_VTG_SET_2   0x12
+#define TVO_SYNC_AUX_VTG_SET_3   0x13
+#define TVO_SYNC_AUX_VTG_SET_4   0x14
+#define TVO_SYNC_AUX_VTG_SET_5   0x15
+#define TVO_SYNC_AUX_VTG_SET_6   0x16
+
+#define TVO_SYNC_HD_DCS_SHIFT8
+
+/* enum listing the 

[PATCH v4 06/11] drm: sti: add TVOut driver

2014-05-29 Thread Benjamin Gaignard
TVout hardware block is responsible to dispatch the data flow coming
from compositor block to any of the output (HDMI or Analog TV).
It control when output are start/stop and configure according the
require flow path.

TVout is the parent of HDMI and HDA drivers and bind them at runtime.

Signed-off-by: Benjamin Gaignard benjamin.gaign...@linaro.org
---
 drivers/gpu/drm/sti/Makefile|   3 +-
 drivers/gpu/drm/sti/sti_tvout.c | 678 
 drivers/gpu/drm/sti/sti_tvout.h |  18 ++
 3 files changed, 698 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/sti/sti_tvout.c
 create mode 100644 drivers/gpu/drm/sti/sti_tvout.h

diff --git a/drivers/gpu/drm/sti/Makefile b/drivers/gpu/drm/sti/Makefile
index df47171..dcc9568 100644
--- a/drivers/gpu/drm/sti/Makefile
+++ b/drivers/gpu/drm/sti/Makefile
@@ -4,4 +4,5 @@ obj-$(CONFIG_DRM_STI) += \
sti_hdmi.o \
sti_hdmi_tx3g0c55phy.o \
sti_hdmi_tx3g4c28phy.o \
-   sti_hda.o
+   sti_hda.o \
+   sti_tvout.o
\ No newline at end of file
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
new file mode 100644
index 000..d778e35
--- /dev/null
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -0,0 +1,678 @@
+/*
+ * Copyright (C) STMicroelectronics SA 2014
+ * Authors: Benjamin Gaignard benjamin.gaign...@st.com
+ *  Vincent Abriou vincent.abr...@st.com
+ *  for STMicroelectronics.
+ * License terms:  GNU General Public License (GPL), version 2
+ */
+
+#include linux/clk.h
+#include linux/component.h
+#include linux/module.h
+#include linux/of_platform.h
+#include linux/platform_device.h
+#include linux/reset.h
+
+#include drm/drmP.h
+#include drm/drm_crtc_helper.h
+
+#include sti_drm_connector.h
+#include sti_drm_encoder.h
+#include sti_tvout.h
+
+/* glue registers */
+#define TVO_CSC_MAIN_M0  0x000
+#define TVO_CSC_MAIN_M1  0x004
+#define TVO_CSC_MAIN_M2  0x008
+#define TVO_CSC_MAIN_M3  0x00c
+#define TVO_CSC_MAIN_M4  0x010
+#define TVO_CSC_MAIN_M5  0x014
+#define TVO_CSC_MAIN_M6  0x018
+#define TVO_CSC_MAIN_M7  0x01c
+#define TVO_MAIN_IN_VID_FORMAT   0x030
+#define TVO_CSC_AUX_M0   0x100
+#define TVO_CSC_AUX_M1   0x104
+#define TVO_CSC_AUX_M2   0x108
+#define TVO_CSC_AUX_M3   0x10c
+#define TVO_CSC_AUX_M4   0x110
+#define TVO_CSC_AUX_M5   0x114
+#define TVO_CSC_AUX_M6   0x118
+#define TVO_CSC_AUX_M7   0x11c
+#define TVO_AUX_IN_VID_FORMAT0x130
+#define TVO_VIP_HDF  0x400
+#define TVO_HD_SYNC_SEL  0x418
+#define TVO_HD_DAC_CFG_OFF   0x420
+#define TVO_VIP_HDMI 0x500
+#define TVO_HDMI_FORCE_COLOR_0   0x504
+#define TVO_HDMI_FORCE_COLOR_1   0x508
+#define TVO_HDMI_CLIP_VALUE_B_CB 0x50c
+#define TVO_HDMI_CLIP_VALUE_Y_G  0x510
+#define TVO_HDMI_CLIP_VALUE_R_CR 0x514
+#define TVO_HDMI_SYNC_SEL0x518
+#define TVO_HDMI_DFV_OBS 0x540
+
+#define TVO_IN_FMT_SIGNEDBIT(0)
+#define TVO_SYNC_EXT BIT(4)
+
+#define TVO_VIP_REORDER_R_SHIFT  24
+#define TVO_VIP_REORDER_G_SHIFT  20
+#define TVO_VIP_REORDER_B_SHIFT  16
+#define TVO_VIP_REORDER_MASK 0x3
+#define TVO_VIP_REORDER_Y_G_SEL  0
+#define TVO_VIP_REORDER_CB_B_SEL 1
+#define TVO_VIP_REORDER_CR_R_SEL 2
+
+#define TVO_VIP_CLIP_SHIFT   8
+#define TVO_VIP_CLIP_MASK0x7
+#define TVO_VIP_CLIP_DISABLED0
+#define TVO_VIP_CLIP_EAV_SAV 1
+#define TVO_VIP_CLIP_LIMITED_RANGE_RGB_Y 2
+#define TVO_VIP_CLIP_LIMITED_RANGE_CB_CR 3
+#define TVO_VIP_CLIP_PROG_RANGE  4
+
+#define TVO_VIP_RND_SHIFT4
+#define TVO_VIP_RND_MASK 0x3
+#define TVO_VIP_RND_8BIT_ROUNDED 0
+#define TVO_VIP_RND_10BIT_ROUNDED1
+#define TVO_VIP_RND_12BIT_ROUNDED2
+
+#define TVO_VIP_SEL_INPUT_MASK   0xf
+#define TVO_VIP_SEL_INPUT_MAIN   0x0
+#define TVO_VIP_SEL_INPUT_AUX0x8
+#define TVO_VIP_SEL_INPUT_FORCE_COLOR0xf
+#define TVO_VIP_SEL_INPUT_BYPASS_MASK0x1
+#define TVO_VIP_SEL_INPUT_BYPASSED   1
+
+#define TVO_SYNC_MAIN_VTG_SET_REF0x00
+#define TVO_SYNC_MAIN_VTG_SET_1  0x01
+#define TVO_SYNC_MAIN_VTG_SET_2  0x02
+#define TVO_SYNC_MAIN_VTG_SET_3  0x03
+#define TVO_SYNC_MAIN_VTG_SET_4  0x04
+#define TVO_SYNC_MAIN_VTG_SET_5  0x05
+#define TVO_SYNC_MAIN_VTG_SET_6  0x06
+#define TVO_SYNC_AUX_VTG_SET_REF 0x10
+#define TVO_SYNC_AUX_VTG_SET_1   0x11
+#define TVO_SYNC_AUX_VTG_SET_2   0x12
+#define TVO_SYNC_AUX_VTG_SET_3   0x13
+#define