From: Kaier Hsueh <[email protected]>

[Why & How]
Handle 90/270 degree rotation with YUV422 format by swapping the
subsampling axis since rotation swaps the orientation. For 4:2:2
subsampling, when the image is rotated 90/270 degrees, the subsampling
axis changes, so we need to update our tracking of which axis is
subsampled.

Reviewed-by: Samson Tam <[email protected]>
Signed-off-by: Kaier Hsueh <[email protected]>
Signed-off-by: Ray Wu <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c 
b/drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c
index 1b7ce1a8c59d..1eaf039e2023 100644
--- a/drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c
+++ b/drivers/gpu/drm/amd/display/dc/sspl/dc_spl.c
@@ -1018,6 +1018,13 @@ static bool spl_get_optimal_number_of_taps(
        bool is_horz_subsampled = 
(spl_is_subsampled_format(spl_in->basic_in.format) && !spl_in->upsp_mode);
        bool is_vert_subsampled = (spl_is_yuv420(spl_in->basic_in.format) && 
!spl_in->upsp_mode);
 
+       /* Only 4:2:2 subsamples a single axis; 90/270 rotates that axis from 
horizontal to vertical
+        * (like the ratio/cositing swaps above) so the now-full-res axis gets 
the 1-tap sharp bypass */
+       if ((spl_in->basic_in.rotation == SPL_ROTATION_ANGLE_90 ||
+               spl_in->basic_in.rotation == SPL_ROTATION_ANGLE_270) &&
+               spl_is_yuv422(spl_in->basic_in.format))
+               spl_swap(is_horz_subsampled, is_vert_subsampled);
+
        if (spl_scratch->scl_data.viewport.width > 
spl_scratch->scl_data.h_active &&
                max_downscale_src_width != 0 &&
                spl_scratch->scl_data.viewport.width > max_downscale_src_width) 
{
-- 
2.43.0

Reply via email to