]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Update SPL Taps Required For Integer Scaling
authorAustin Zheng <Austin.Zheng@amd.com>
Thu, 31 Oct 2024 18:10:39 +0000 (14:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 Nov 2024 16:45:30 +0000 (11:45 -0500)
Number of taps is incorrectly being set when integer scaling is enabled.
Taps required when src_rect != dst_rect previously not considered.
Perform the calculations when integer scaling is enabled.
Set taps to 1 if the scaling ratio is 1:1.

Reviewed-by: Samson Tam <samson.tam@amd.com>
Signed-off-by: Austin Zheng <Austin.Zheng@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c

index a29a9f131e046df3f563197b378e5836a850bd40..614276200aa08324fd4bdb2e6388001a28526cb1 100644 (file)
@@ -910,6 +910,16 @@ static void spl_get_taps_non_adaptive_scaler(
                spl_scratch->scl_data.taps.h_taps_c = in_taps->h_taps_c - 1;
        else
                spl_scratch->scl_data.taps.h_taps_c = in_taps->h_taps_c;
+
+       if (IDENTITY_RATIO(spl_scratch->scl_data.ratios.horz))
+               spl_scratch->scl_data.taps.h_taps = 1;
+       if (IDENTITY_RATIO(spl_scratch->scl_data.ratios.vert))
+               spl_scratch->scl_data.taps.v_taps = 1;
+       if (IDENTITY_RATIO(spl_scratch->scl_data.ratios.horz_c))
+               spl_scratch->scl_data.taps.h_taps_c = 1;
+       if (IDENTITY_RATIO(spl_scratch->scl_data.ratios.vert_c))
+               spl_scratch->scl_data.taps.v_taps_c = 1;
+
 }
 
 /* Calculate optimal number of taps */
@@ -936,10 +946,7 @@ static bool spl_get_optimal_number_of_taps(
 
        /* Disable adaptive scaler and sharpener when integer scaling is enabled */
        if (spl_in->scaling_quality.integer_scaling) {
-               spl_scratch->scl_data.taps.h_taps = 1;
-               spl_scratch->scl_data.taps.v_taps = 1;
-               spl_scratch->scl_data.taps.v_taps_c = 1;
-               spl_scratch->scl_data.taps.h_taps_c = 1;
+               spl_get_taps_non_adaptive_scaler(spl_scratch, in_taps);
                *enable_easf_v = false;
                *enable_easf_h = false;
                *enable_isharp = false;