From 428e770673a661fc662004d86d505aa549a03e8d Mon Sep 17 00:00:00 2001 From: Brian Zhu Date: Thu, 29 Mar 2018 18:01:20 +0800 Subject: [PATCH] vpp: increase the vskip count to 8 for scale down PD#163431: vpp: increase the vskip count to 8 for scale down Change-Id: I2022a031a95c0598ad31276e7a2aebd5ba2a977c Signed-off-by: Brian Zhu --- drivers/amlogic/media/video_sink/video.c | 10 +++++---- drivers/amlogic/media/video_sink/vpp.c | 22 ++++++++++++-------- include/linux/amlogic/media/video_sink/vpp.h | 2 ++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index 03c2ff930c73..44bd0936e058 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -2579,7 +2579,8 @@ static void viu_set_dcu(struct vpp_frame_par_s *frame_par, struct vframe_s *vf) u32 r; u32 vphase, vini_phase, vformatter; u32 pat, loop; - static const u32 vpat[] = { 0, 0x8, 0x9, 0xa, 0xb, 0xc }; + static const u32 vpat[MAX_VSKIP_COUNT + 1] = { + 0, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; u32 u, v; u32 type = vf->type, bit_mode = 0; bool vf_with_el = false; @@ -3131,7 +3132,8 @@ static void vd2_set_dcu(struct vpp_frame_par_s *frame_par, struct vframe_s *vf) u32 r; u32 vphase, vini_phase; u32 pat, loop; - static const u32 vpat[] = { 0, 0x8, 0x9, 0xa, 0xb, 0xc }; + static const u32 vpat[MAX_VSKIP_COUNT + 1] = { + 0, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; u32 u, v; u32 type = vf->type, bit_mode = 0; @@ -3432,8 +3434,8 @@ static void vd2_set_dcu(struct vpp_frame_par_s *frame_par, struct vframe_s *vf) if (type & VIDTYPE_VIU_FIELD) { loop = 0; - if (type & VIDTYPE_INTERLACE) - pat = vpat[frame_par->vscale_skip_count >> 1]; + if (type & VIDTYPE_INTERLACE) + pat = vpat[frame_par->vscale_skip_count >> 1]; } else if (type & VIDTYPE_MVC) { loop = 0x11; pat = 0x80; diff --git a/drivers/amlogic/media/video_sink/vpp.c b/drivers/amlogic/media/video_sink/vpp.c index 1f1c754c8eb4..b45c16afffa4 100644 --- a/drivers/amlogic/media/video_sink/vpp.c +++ b/drivers/amlogic/media/video_sink/vpp.c @@ -841,6 +841,7 @@ vpp_set_filters2(u32 process_3d_type, u32 width_in, u32 orig_aspect = 0; u32 screen_aspect = 0; bool skip_policy_check = true; + int cur_skip_count = 0; if (get_cpu_type() >= MESON_CPU_MAJOR_ID_GXTVBB) { if (likely(w_in > @@ -1352,7 +1353,9 @@ RESTART: * if we need skip half resolution on source side for progressive * frames. */ - if ((next_frame_par->vscale_skip_count < 4) + /* one more time to check skip for trigger h skip */ + if ((next_frame_par->vscale_skip_count + < (MAX_VSKIP_COUNT + 1)) && (!(vpp_flags & VPP_FLAG_VSCALE_DISABLE))) { int skip = vpp_process_speed_check( (next_frame_par->VPP_hd_end_lines_ - @@ -1370,20 +1373,21 @@ RESTART: vf); if (skip == SPEED_CHECK_VSKIP) { - if (vpp_flags & VPP_FLAG_INTERLACE_IN) - next_frame_par->vscale_skip_count += 2; - else { + if (cur_skip_count < MAX_VSKIP_COUNT) { + if (vpp_flags & VPP_FLAG_INTERLACE_IN) + next_frame_par->vscale_skip_count += 2; #ifdef TV_3D_FUNCTION_OPEN - if ((next_frame_par->vpp_3d_mode == + else if ((next_frame_par->vpp_3d_mode == VPP_3D_MODE_LA) && (process_3d_type & MODE_3D_ENABLE)) next_frame_par->vscale_skip_count += 2; - else #endif + else next_frame_par->vscale_skip_count++; - } - goto RESTART; - + cur_skip_count++; + goto RESTART; + } else + next_frame_par->hscale_skip_count = 1; } else if (skip == SPEED_CHECK_HSKIP) next_frame_par->hscale_skip_count = 1; } diff --git a/include/linux/amlogic/media/video_sink/vpp.h b/include/linux/amlogic/media/video_sink/vpp.h index 19653df8461f..e162ee47f877 100644 --- a/include/linux/amlogic/media/video_sink/vpp.h +++ b/include/linux/amlogic/media/video_sink/vpp.h @@ -37,6 +37,8 @@ #define ASPECT_4_3 ((3<<8)/4) #define ASPECT_16_9 ((9<<8)/16) +#define MAX_VSKIP_COUNT 8 + #define SPEED_CHECK_DONE 0 #define SPEED_CHECK_HSKIP 1 #define SPEED_CHECK_VSKIP 2