From: Pengcheng Chen Date: Wed, 6 Nov 2019 06:50:01 +0000 (+0800) Subject: vpp: vpp video path vframe support RGB mode [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=312fe1245ed1f1b54fdba2529d2115e2d7617d82;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git vpp: vpp video path vframe support RGB mode [1/1] PD#SWPL-15879 Problem: video patch not support RGB mode Solution: vpp video path vframe support RGB mode Verify: TL1 Change-Id: Ic86be3eb9163e7e34a3f18886a5e87e8e1bab6fe Signed-off-by: Pengcheng Chen (cherry picked from commit 8e7b325aee3ea07c68ee350287eb26f4fc19d41f) --- diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index be7c5bb27cef..597912ef6c61 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -3581,7 +3581,9 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) chk_vf = (vf != NULL) ? vf : cur_dispbuf; if (chk_vf) force_adjust = - (chk_vf->type & VIDTYPE_VIU_444) ? true : false; + ((chk_vf->type & VIDTYPE_VIU_444) || + (chk_vf->type & VIDTYPE_RGB_444)) + ? true : false; if (chk_vf) { if (cur_frame_par && cur_frame_par->nocomp) { diff --git a/drivers/amlogic/media/video_sink/video_hw.c b/drivers/amlogic/media/video_sink/video_hw.c index b3d09a684ad0..b0777290ec65 100644 --- a/drivers/amlogic/media/video_sink/video_hw.c +++ b/drivers/amlogic/media/video_sink/video_hw.c @@ -683,7 +683,8 @@ static void vd1_set_dcu( r = 0x100; if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (type & VIDTYPE_VIU_444) + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) r |= 0; else if (type & VIDTYPE_VIU_422) r |= (1 << 12); @@ -712,7 +713,8 @@ static void vd1_set_dcu( r |= VFORMATTER_RPTLINE0_EN | (0xc << VFORMATTER_INIPHASE_BIT); if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (type & VIDTYPE_VIU_444) { + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) { r &= ~HFORMATTER_EN; r &= ~VFORMATTER_EN; r &= ~HFORMATTER_YC_RATIO_2_1; @@ -757,7 +759,8 @@ static void vd1_set_dcu( if ((vf->bitdepth & BITDEPTH_Y10) && !frame_par->nocomp) { - if (vf->type & VIDTYPE_VIU_444) { + if ((vf->type & VIDTYPE_VIU_444) || + (vf->type & VIDTYPE_RGB_444)) { bit_mode = 2; } else { if (vf->bitdepth & FULL_PACK_422_MODE) @@ -892,7 +895,8 @@ static void vd1_set_dcu( } /* chroma formatter */ - if (type & VIDTYPE_VIU_444) { + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) { r = HFORMATTER_YC_RATIO_1_1; if (frame_par->hscale_skip_count) r |= HFORMATTER_EN; @@ -1125,7 +1129,8 @@ static void vd2_set_dcu( r = 0x100; if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (type & VIDTYPE_VIU_444) + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) r |= 0; else if (type & VIDTYPE_VIU_422) r |= (1 << 12); @@ -1160,7 +1165,8 @@ static void vd2_set_dcu( VFORMATTER_RPTLINE0_EN | (0 << VFORMATTER_INIPHASE_BIT); if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (type & VIDTYPE_VIU_444) { + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) { r &= ~HFORMATTER_EN; r &= ~VFORMATTER_EN; r &= ~HFORMATTER_YC_RATIO_2_1; @@ -1206,7 +1212,8 @@ static void vd2_set_dcu( if ((vf->bitdepth & BITDEPTH_Y10) && !frame_par->nocomp) { - if (vf->type & VIDTYPE_VIU_444) { + if ((vf->type & VIDTYPE_VIU_444) || + (vf->type & VIDTYPE_RGB_444)) { bit_mode = 2; } else { if (vf->bitdepth & FULL_PACK_422_MODE) @@ -1289,7 +1296,8 @@ static void vd2_set_dcu( vd_off, 0, 2, 4); /* chroma formatter */ - if (type & VIDTYPE_VIU_444) { + if ((type & VIDTYPE_VIU_444) || + (type & VIDTYPE_RGB_444)) { r = HFORMATTER_YC_RATIO_1_1; if (frame_par->hscale_skip_count) r |= HFORMATTER_EN; @@ -2620,8 +2628,10 @@ void config_dvel_position( setting->vc_skip = 2; if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (layer->dispbuf->type - & VIDTYPE_VIU_444) { + if ((layer->dispbuf->type + & VIDTYPE_VIU_444) || + (layer->dispbuf->type + & VIDTYPE_RGB_444)) { setting->hc_skip = 1; setting->vc_skip = 1; } else if (layer->dispbuf->type @@ -3199,8 +3209,10 @@ s32 config_vd_position( setting->vc_skip = 2; if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) { - if (layer->dispbuf->type - & VIDTYPE_VIU_444) { + if ((layer->dispbuf->type + & VIDTYPE_VIU_444) || + (layer->dispbuf->type + & VIDTYPE_RGB_444)) { setting->hc_skip = 1; setting->vc_skip = 1; } else if (layer->dispbuf->type diff --git a/drivers/amlogic/media/video_sink/vpp.c b/drivers/amlogic/media/video_sink/vpp.c index ea3b17322f10..5eeba878e61e 100644 --- a/drivers/amlogic/media/video_sink/vpp.c +++ b/drivers/amlogic/media/video_sink/vpp.c @@ -728,8 +728,9 @@ static int vpp_process_speed_check( || (height_screen <= 0)) return SPEED_CHECK_DONE; - if ((next_frame_par->vscale_skip_count > 0) - && (vf->type & VIDTYPE_VIU_444)) + if ((next_frame_par->vscale_skip_count > 0) && + ((vf->type & VIDTYPE_VIU_444) || + (vf->type & VIDTYPE_RGB_444))) bpp = 2; if (height_in * bpp > height_out) { /* @@ -749,8 +750,9 @@ static int vpp_process_speed_check( /* di process first, need more a bit of ratio */ if (vf->type & VIDTYPE_PRE_INTERLACE) cur_ratio = (cur_ratio * 105) / 100; - if ((next_frame_par->vscale_skip_count > 0) - && (vf->type & VIDTYPE_VIU_444)) + if ((next_frame_par->vscale_skip_count > 0) && + ((vf->type & VIDTYPE_VIU_444) || + (vf->type & VIDTYPE_RGB_444))) cur_ratio = cur_ratio * 2; /* store the debug info for legacy */