summaryrefslogtreecommitdiff
authorJihong Sui <jihong.sui@amlogic.com>2018-07-27 03:00:14 (GMT)
committer Yixun Lan <yixun.lan@amlogic.com>2018-08-03 06:02:29 (GMT)
commit5fc3c8cbe9658f02f24ad5a1892adf3416dc7720 (patch)
treec162ac40dd8502bd2f880883e102ac539299cbae
parentd483a76307a3f75457ab408a5c290c8b99e6b699 (diff)
downloadcommon-5fc3c8cbe9658f02f24ad5a1892adf3416dc7720.zip
common-5fc3c8cbe9658f02f24ad5a1892adf3416dc7720.tar.gz
common-5fc3c8cbe9658f02f24ad5a1892adf3416dc7720.tar.bz2
deinterlace: txl: add patch for hdmi progressive input
PD#170301: deinterlace: txl: add patch for hdmi progressive input Change-Id: I12a534d8aa545cfc2c8d5cfb0b9ab763da58d015 Signed-off-by: Jihong Sui <jihong.sui@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/deinterlace/deinterlace.c2
-rw-r--r--drivers/amlogic/media/deinterlace/deinterlace_hw.c51
-rw-r--r--drivers/amlogic/media/deinterlace/deinterlace_hw.h1
3 files changed, 54 insertions, 0 deletions
diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c
index 3f0afa5..8720a12 100644
--- a/drivers/amlogic/media/deinterlace/deinterlace.c
+++ b/drivers/amlogic/media/deinterlace/deinterlace.c
@@ -3011,6 +3011,8 @@ static void pre_de_process(void)
}
di_pre_stru.field_count_for_cont++;
+ di_txl_patch_prog(di_pre_stru.cur_prog_flag,
+ di_pre_stru.field_count_for_cont, mcpre_en);
#ifdef SUPPORT_MPEG_TO_VDIN
if (mpeg2vdin_flag) {
diff --git a/drivers/amlogic/media/deinterlace/deinterlace_hw.c b/drivers/amlogic/media/deinterlace/deinterlace_hw.c
index 09033da..935bec9 100644
--- a/drivers/amlogic/media/deinterlace/deinterlace_hw.c
+++ b/drivers/amlogic/media/deinterlace/deinterlace_hw.c
@@ -3156,6 +3156,57 @@ void di_load_regs(struct di_pq_parm_s *di_pq_ptr)
value, Rd(addr) != value?"fail":"success");
}
}
+/*note:*/
+/* function: patch for txl for progressive source */
+/* 480p/576p/720p from hdmi will timeout */
+/* prog_flg: in: 1:progressive; */
+/* cnt: in: di_pre_stru.field_count_for_cont*/
+/* mc_en: in: mcpre_en*/
+void di_txl_patch_prog(int prog_flg, unsigned int cnt, bool mc_en)
+{
+ unsigned int di_mtn_1_ctrl1 = 0; /*ary add tmp*/
+
+ if (!prog_flg || !is_meson_txl_cpu())
+ return;
+
+ /*printk("prog patch\n");*/
+ if (cnt >= 3) {
+ di_mtn_1_ctrl1 |= 1 << 29;/* enable txt */
+
+ if (mc_en) {
+ RDMA_WR(DI_MTN_CTRL1,
+ (0xffffcfff & RDMA_RD(DI_MTN_CTRL1)));
+
+ /* enable me(mc di) */
+ if (cnt == 4) {
+ di_mtn_1_ctrl1 &= (~(1 << 30));
+ /* enable contp2rd and contprd */
+ RDMA_WR(MCDI_MOTINEN, 1 << 1 | 1);
+
+ }
+ if (cnt == 5)
+ RDMA_WR(MCDI_CTRL_MODE, 0x1bfff7ff);
+
+
+ }
+
+ } else {
+ if (mc_en) {
+ /* txtdet_en mode */
+ RDMA_WR_BITS(MCDI_CTRL_MODE, 0, 1, 1);
+ RDMA_WR_BITS(MCDI_CTRL_MODE, 1, 9, 1);
+ RDMA_WR_BITS(MCDI_CTRL_MODE, 1, 16, 1);
+ RDMA_WR_BITS(MCDI_CTRL_MODE, 0, 28, 1);
+ RDMA_WR(MCDI_MOTINEN, 0);
+ RDMA_WR(DI_MTN_CTRL1,
+ (0xffffcfff & RDMA_RD(DI_MTN_CTRL1)));
+ /* disable me(mc di) */
+ }
+ RDMA_WR(DNR_CTRL, 0);
+ }
+ RDMA_WR(DI_MTN_1_CTRL1, di_mtn_1_ctrl1);
+
+}
#ifdef DEBUG_SUPPORT
module_param_named(pre_mif_gate, pre_mif_gate, bool, 0644);
module_param_named(pre_urgent, pre_urgent, ushort, 0644);
diff --git a/drivers/amlogic/media/deinterlace/deinterlace_hw.h b/drivers/amlogic/media/deinterlace/deinterlace_hw.h
index 64301c3..5faa50b 100644
--- a/drivers/amlogic/media/deinterlace/deinterlace_hw.h
+++ b/drivers/amlogic/media/deinterlace/deinterlace_hw.h
@@ -174,4 +174,5 @@ void pre_frame_reset(void);
void di_interrupt_ctrl(unsigned char ma_en,
unsigned char det3d_en, unsigned char nrds_en,
unsigned char post_wr, unsigned char mc_en);
+void di_txl_patch_prog(int prog_flg, unsigned int cnt, bool mc_en);
#endif