From: huaihao.guo Date: Fri, 2 Nov 2018 11:10:19 +0000 (+0800) Subject: deinterface: add afbc support on g12a and txlx [1/1] X-Git-Tag: khadas-vims-v0.9.6-release~1142 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6aa1270e0d4c04956a2d73eab5b96ab4f72ca16;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- diff --git a/drivers/amlogic/media/deinterlace/deinterlace.c b/drivers/amlogic/media/deinterlace/deinterlace.c index 3963e43..0a7a40dd 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);