else
VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL5, 0, 4, 1);
- VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL6, 1, 20, 1);
- /* bypass dither */
- VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL6, 1, 25, 1);
+ /*set diag reg to 0xb can bypass dither, not need set swap ctrl6 */
+ if (!is_meson_tm2_tvmode()) {
+ VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL6, 1, 20, 1);
+ /* bypass dither */
+ VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL6, 1, 25, 1);
+ }
if (src_chroma_format == 2)
VSYNC_WR_DV_REG_BITS(DOLBY_TV_SWAP_CTRL6, 1, 29, 1);
else if (src_chroma_format == 1)
/* vd2 to vpp */
1, 17, 1);
- if (dolby_vision_core1_on
- && !bypass_core1)
+ if (dolby_vision_core1_on &&
+ !bypass_core1) {
+ if (is_meson_tm2_tvmode()) {
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 8, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 10, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 0, 16, 1);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 0, 20, 1);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 24, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 0, 0, 2);
+ } else
VSYNC_WR_DV_REG_BITS(
VIU_MISC_CTRL1,
/* enable core 1 */
0, 16, 1);
- else if (dolby_vision_core1_on
- && bypass_core1)
- VSYNC_WR_DV_REG_BITS(
- VIU_MISC_CTRL1,
- /* bypass core 1 */
- 1, 16, 1);
+ } else if (dolby_vision_core1_on &&
+ bypass_core1) {
+ if (is_meson_tm2_tvmode()) {
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 3, 0, 2);
+ } else
+ VSYNC_WR_DV_REG_BITS(
+ VIU_MISC_CTRL1,
+ /* bypass core 1 */
+ 1, 16, 1);
+ }
if (dolby_vision_run_mode != 0xff)
run_mode = dolby_vision_run_mode;
/* 10->12 after gainoff */
VSYNC_WR_DV_REG(
VPP_DAT_CONV_PARA1, 0x20002000);
- WRITE_VPP_DV_REG(0x33e7, 0xb);
+ WRITE_VPP_DV_REG(DOLBY_TV_DIAG_CTRL,
+ 0xb);
} else {
/* bypass all video effect */
if (dolby_vision_flags
DOLBY_PATH_CTRL,
/* enable core1 */
0, 0, 1);
- else
+ else if (is_meson_tm2_tvmode()) {
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 8, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 10, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 0, 16, 1);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 0, 20, 1);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ 1, 24, 2);
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ /* enable core1 */
+ 0, 0, 2);
+ } else
VSYNC_WR_DV_REG_BITS(
VIU_MISC_CTRL1,
0,
DOLBY_PATH_CTRL,
/* disable core1 */
1, 0, 1);
+ else if (is_meson_tm2_tvmode())
+ VSYNC_WR_DV_REG_BITS(
+ DOLBY_PATH_CTRL,
+ /* disable core1 */
+ 3, 0, 2);
else
VSYNC_WR_DV_REG_BITS(
VIU_MISC_CTRL1,
}
if (is_meson_tvmode()
&& !force_stb_mode) {
- crc_enable = (READ_VPP_DV_REG(0x33e7) == 0xb);
- crc = READ_VPP_DV_REG(0x33ef);
+ crc_enable = (READ_VPP_DV_REG(DOLBY_TV_DIAG_CTRL) == 0xb);
+ crc = READ_VPP_DV_REG(DOLBY_TV_OUTPUT_DM_CRC);
} else {
crc_enable = true; /* (READ_VPP_DV_REG(0x36fb) & 1); */
crc = READ_VPP_DV_REG(0x36fd);
r = 0;
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
r = HFORMATTER_REPEAT |
HFORMATTER_YC_RATIO_2_1 |
HFORMATTER_EN |
vformatter = VFORMATTER_EN;
else
vformatter = 0;
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
VSYNC_WR_MPEG_REG(
VIU_VD1_FMT_CTRL + cur_dev->viu_off,
HFORMATTER_REPEAT |
<< VFORMATTER_PHASE_BIT) | VFORMATTER_EN |
hphase);
} else {
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
VSYNC_WR_MPEG_REG(
VIU_VD1_FMT_CTRL + cur_dev->viu_off,
HFORMATTER_REPEAT |
(0x8 << VFORMATTER_PHASE_BIT) |
VFORMATTER_EN;
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
r |= HFORMATTER_REPEAT |
HFORMATTER_YC_RATIO_2_1 |
HFORMATTER_EN |
vphase =
((type & VIDTYPE_VIU_422) ? 0x10 : 0x08) <<
VFORMATTER_PHASE_BIT;
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
VSYNC_WR_MPEG_REG(
VIU_VD2_FMT_CTRL + cur_dev->viu_off,
HFORMATTER_REPEAT |
<< VFORMATTER_PHASE_BIT) |
VFORMATTER_EN | hphase);
} else {
- if (is_meson_txlx_package_962X()
- && !is_dolby_vision_stb_mode()
- && is_dolby_vision_on()) {
+ if ((is_meson_txlx_package_962X() ||
+ is_meson_tm2_cpu()) &&
+ !is_dolby_vision_stb_mode() &&
+ is_dolby_vision_on()) {
VSYNC_WR_MPEG_REG(
VIU_VD2_FMT_CTRL + cur_dev->viu_off,
HFORMATTER_REPEAT |