From aeaa1174bd25ee0a9a554d4987c435bb2ae9d9c4 Mon Sep 17 00:00:00 2001 From: Dezhi Kong Date: Fri, 27 Apr 2018 18:44:54 +0800 Subject: [PATCH] sr: fix calc issue PD#159391: sr: fix calc issue Change-Id: I4c52efe4fb09fd3b2516e8e46cef793a19a4003d Signed-off-by: Dezhi Kong --- drivers/amlogic/media/video_sink/vpp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/media/video_sink/vpp.c b/drivers/amlogic/media/video_sink/vpp.c index 0666235..8206a04 100644 --- a/drivers/amlogic/media/video_sink/vpp.c +++ b/drivers/amlogic/media/video_sink/vpp.c @@ -1863,10 +1863,12 @@ static void vpp_set_super_scaler(const struct vinfo_s *vinfo, /* step1: judge core0&core1 vertical enable or disable*/ if (ver_sc_multiple_num >= 2*SUPER_SCALER_V_FACTOR) { next_frame_par->supsc0_vert_ratio = - (src_width < SUPER_CORE0_WIDTH_MAX/2) ? 1 : 0; + ((src_width < SUPER_CORE0_WIDTH_MAX/2) && + (sr_support & SUPER_CORE0_SUPPORT)) ? 1 : 0; next_frame_par->supsc1_vert_ratio = ((width_out < SUPER_CORE1_WIDTH_MAX) && - (src_width < SUPER_CORE1_WIDTH_MAX/2)) ? 1 : 0; + (src_width < SUPER_CORE1_WIDTH_MAX/2) && + (sr_support & SUPER_CORE1_SUPPORT)) ? 1 : 0; if (next_frame_par->supsc0_vert_ratio && (ver_sc_multiple_num < 4*SUPER_SCALER_V_FACTOR)) next_frame_par->supsc1_vert_ratio = 0; @@ -1889,7 +1891,7 @@ static void vpp_set_super_scaler(const struct vinfo_s *vinfo, (((src_width << 1) > SUPER_CORE1_WIDTH_MAX/2) && next_frame_par->supsc1_vert_ratio)) next_frame_par->supsc0_hori_ratio = 0; - else + else if (sr_support & SUPER_CORE0_SUPPORT) next_frame_par->supsc0_hori_ratio = 1; if (((width_out >> 1) > SUPER_CORE1_WIDTH_MAX) || (((width_out >> 1) > SUPER_CORE1_WIDTH_MAX/2) && @@ -1897,7 +1899,7 @@ static void vpp_set_super_scaler(const struct vinfo_s *vinfo, (next_frame_par->supsc0_hori_ratio && (hor_sc_multiple_num < 4))) next_frame_par->supsc1_hori_ratio = 0; - else + else if (sr_support & SUPER_CORE1_SUPPORT) next_frame_par->supsc1_hori_ratio = 1; next_frame_par->supsc0_enable = (next_frame_par->supsc0_hori_ratio || -- 2.7.4