deinterface: add afbc support on g12a and txlx [1/1]
authorhuaihao.guo <huaihao.guo@amlogic.com>
Fri, 2 Nov 2018 11:10:19 +0000 (19:10 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 15 Nov 2018 15:36:16 +0000 (08:36 -0700)
PD#SWPL-1618

Problem:
Add afbc support on g12a and txlx

Solution:
add afbc support on g12a and txlx

Verify:
T962X-R311, U200(G12A)

Change-Id: Ia0cce8516a98653b01c3bc628e812c3a81b1df59
Signed-off-by: huaihao.guo <huaihao.guo@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c
drivers/amlogic/media/deinterlace/deinterlace_hw.c
drivers/amlogic/media/deinterlace/deinterlace_hw.h

index 3963e436f05c2ae23b901e2f8b02b6d5dbbb75d5..0a7a40ddd41858288257fd66cb1599be592ba9f8 100644 (file)
@@ -123,7 +123,7 @@ static di_dev_t *de_devp;
 static dev_t di_devno;
 static struct class *di_clsp;
 
-static const char version_s[] = "2018-09-28a";
+static const char version_s[] = "2018-11-06a";
 
 static int bypass_state = 1;
 static int bypass_all;
@@ -5973,11 +5973,14 @@ static bool need_bypass(struct vframe_s *vf)
 
        if (vf->type & VIDTYPE_PIC)
                return true;
-#if 1
+#if 0
        if (vf->type & VIDTYPE_COMPRESS)
                return true;
 #else
+       /*support G12A and TXLX platform*/
        if (vf->type & VIDTYPE_COMPRESS) {
+               if (!afbc_is_supported())
+                       return true;
                if ((vf->compHeight > (default_height + 8))
                        || (vf->compWidth > default_width))
                        return true;
index 42724dc360388764f3cc3cd1a16a851b05dd35e6..3e2257fc2875159b7788793d47afdfc5d0b413fc 100644 (file)
@@ -951,12 +951,12 @@ static const unsigned int *afbc_get_regbase(void)
        return &reg_AFBC[afbc_get_decnub()][0];
 }
 
-static bool afbc_is_supported(void)
+bool afbc_is_supported(void)
 {
        bool ret = false;
 
-       if (is_meson_gxl_cpu()
-               || is_meson_txlx_cpu()
+       /*currently support txlx and g12a*/
+       if (is_meson_txlx_cpu()
                || cpu_after_eq(MESON_CPU_MAJOR_ID_G12A))
                ret = true;
 
@@ -2466,10 +2466,11 @@ void initial_di_post_2(int hsize_post, int vsize_post,
                if (post_write_en) {
                        DI_VSYNC_WR_MPEG_REG(DI_POST_GL_CTRL,
                                0x80000000|line_num_post_frst);
+                       /*di if0 mif to di post*/
+                       DI_VSYNC_WR_MPEG_REG_BITS(VIUB_MISC_CTRL0, 0, 4, 1);
+                       /*di_mif0_en:select mif to di*/
                        DI_VSYNC_WR_MPEG_REG_BITS(VD1_AFBCD0_MISC_CTRL,
-                               0, 20, 1);
-                       DI_VSYNC_WR_MPEG_REG_BITS(VD1_AFBCD0_MISC_CTRL,
-                               0, 8, 9);
+                               1, 8, 1);
                } else {
                        DI_VSYNC_WR_MPEG_REG_BITS(VD1_AFBCD0_MISC_CTRL,
                                1, 8, 1);
index 4a9582f3e7572ec402d6923b277a625b0dac23bb..b173b93606ce8a27d77021803934017b724a1931 100644 (file)
@@ -176,6 +176,7 @@ 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);
+bool afbc_is_supported(void);
 //extern void afbc_power_sw(bool on);
 extern void afbc_reg_sw(bool on);
 extern void afbc_sw_trig(bool  on);