From d6aa1270e0d4c04956a2d73eab5b96ab4f72ca16 Mon Sep 17 00:00:00 2001 From: "huaihao.guo" Date: Fri, 2 Nov 2018 19:10:19 +0800 Subject: [PATCH] deinterface: add afbc support on g12a and txlx [1/1] 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 --- drivers/amlogic/media/deinterlace/deinterlace.c | 7 +++++-- drivers/amlogic/media/deinterlace/deinterlace_hw.c | 13 +++++++------ drivers/amlogic/media/deinterlace/deinterlace_hw.h | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 3963e43..0a7a40d 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace.c +++ b/drivers/amlogic/media/deinterlace/deinterlace.c @@ -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; diff --git a/drivers/amlogic/media/deinterlace/deinterlace_hw.c b/drivers/amlogic/media/deinterlace/deinterlace_hw.c index 42724dc..3e2257f 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace_hw.c +++ b/drivers/amlogic/media/deinterlace/deinterlace_hw.c @@ -951,12 +951,12 @@ static const unsigned int *afbc_get_regbase(void) return ®_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); diff --git a/drivers/amlogic/media/deinterlace/deinterlace_hw.h b/drivers/amlogic/media/deinterlace/deinterlace_hw.h index 4a9582f..b173b93 100644 --- a/drivers/amlogic/media/deinterlace/deinterlace_hw.h +++ b/drivers/amlogic/media/deinterlace/deinterlace_hw.h @@ -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); -- 2.7.4