@@ -739,14 +739,13 @@ static enum scl_mode spl_get_dscl_mode(const struct spl_in *spl_in,
739
739
return SCL_MODE_SCALING_444_RGB_ENABLE ;
740
740
}
741
741
742
- /* Bypass YUV if at 1:1 with no ISHARP or if doing 2:1 YUV
743
- * downscale without EASF
742
+ /*
743
+ * Bypass YUV if Y is 1:1 with no ISHARP
744
+ * Do not bypass UV at 1:1 for cositing to be applied
744
745
*/
745
- if (( !enable_isharp ) && (! enable_easf ) ) {
746
+ if (!enable_isharp ) {
746
747
if (data -> ratios .horz .value == one && data -> ratios .vert .value == one )
747
748
return SCL_MODE_SCALING_420_LUMA_BYPASS ;
748
- if (data -> ratios .horz_c .value == one && data -> ratios .vert_c .value == one )
749
- return SCL_MODE_SCALING_420_CHROMA_BYPASS ;
750
749
}
751
750
752
751
return SCL_MODE_SCALING_420_YCBCR_ENABLE ;
@@ -933,6 +932,7 @@ static bool spl_get_optimal_number_of_taps(
933
932
int min_taps_y , min_taps_c ;
934
933
enum lb_memory_config lb_config ;
935
934
bool skip_easf = false;
935
+ bool is_ycbcr = spl_dscl_is_video_format (spl_in -> basic_in .format );
936
936
937
937
if (spl_scratch -> scl_data .viewport .width > spl_scratch -> scl_data .h_active &&
938
938
max_downscale_src_width != 0 &&
@@ -1074,10 +1074,9 @@ static bool spl_get_optimal_number_of_taps(
1074
1074
1075
1075
/* Sharpener requires scaler to be enabled, including for 1:1
1076
1076
* Check if ISHARP can be enabled
1077
- * If ISHARP is not enabled, for 1:1, set taps to 1 and disable
1078
- * EASF
1079
- * For case of 2:1 YUV where chroma is 1:1, set taps to 1 if
1080
- * EASF is not enabled
1077
+ * If ISHARP is not enabled, set taps to 1 if ratio is 1:1
1078
+ * except for chroma taps. Keep previous taps so it can
1079
+ * handle cositing
1081
1080
*/
1082
1081
1083
1082
* enable_isharp = spl_get_isharp_en (spl_in , spl_scratch );
@@ -1087,20 +1086,28 @@ static bool spl_get_optimal_number_of_taps(
1087
1086
spl_scratch -> scl_data .taps .h_taps = 1 ;
1088
1087
spl_scratch -> scl_data .taps .v_taps = 1 ;
1089
1088
1090
- if (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .horz_c ))
1089
+ if (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .horz_c ) && ! is_ycbcr )
1091
1090
spl_scratch -> scl_data .taps .h_taps_c = 1 ;
1092
1091
1093
- if (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .vert_c ))
1092
+ if (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .vert_c ) && ! is_ycbcr )
1094
1093
spl_scratch -> scl_data .taps .v_taps_c = 1 ;
1095
1094
1096
1095
* enable_easf_v = false;
1097
1096
* enable_easf_h = false;
1098
1097
} else {
1099
1098
if ((!* enable_easf_h ) &&
1099
+ (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .horz )))
1100
+ spl_scratch -> scl_data .taps .h_taps = 1 ;
1101
+
1102
+ if ((!* enable_easf_v ) &&
1103
+ (IDENTITY_RATIO (spl_scratch -> scl_data .ratios .vert )))
1104
+ spl_scratch -> scl_data .taps .v_taps = 1 ;
1105
+
1106
+ if ((!* enable_easf_h ) && !is_ycbcr &&
1100
1107
(IDENTITY_RATIO (spl_scratch -> scl_data .ratios .horz_c )))
1101
1108
spl_scratch -> scl_data .taps .h_taps_c = 1 ;
1102
1109
1103
- if ((!* enable_easf_v ) &&
1110
+ if ((!* enable_easf_v ) && ! is_ycbcr &&
1104
1111
(IDENTITY_RATIO (spl_scratch -> scl_data .ratios .vert_c )))
1105
1112
spl_scratch -> scl_data .taps .v_taps_c = 1 ;
1106
1113
}
@@ -1111,8 +1118,7 @@ static bool spl_get_optimal_number_of_taps(
1111
1118
static void spl_set_black_color_data (enum spl_pixel_format format ,
1112
1119
struct scl_black_color * scl_black_color )
1113
1120
{
1114
- bool ycbcr = format >= SPL_PIXEL_FORMAT_VIDEO_BEGIN
1115
- && format <= SPL_PIXEL_FORMAT_VIDEO_END ;
1121
+ bool ycbcr = spl_dscl_is_video_format (format );
1116
1122
if (ycbcr ) {
1117
1123
scl_black_color -> offset_rgb_y = BLACK_OFFSET_RGB_Y ;
1118
1124
scl_black_color -> offset_rgb_cbcr = BLACK_OFFSET_CBCR ;
0 commit comments