Commit 2f8bed91 authored by Vladimir Lypak's avatar Vladimir Lypak Committed by Dmitry Baryshkov
Browse files

drm/msm/dpu: Fix pixel extension sub-sampling



In _dpu_plane_setup_pixel_ext function instead of dividing just chroma
source resolution once (component 1 and 2), second component is divided
once more because src_w and src_h variable is reused between iterations.
Third component receives wrong source resolution too (from component 2).
To fix this introduce temporary variables for each iteration.

Fixes: dabfdd89 ("drm/msm/disp/dpu1: add inline rotation support for sc7280")
Signed-off-by: default avatarVladimir Lypak <vladimir.lypak@gmail.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/681921/
Link: https://lore.kernel.org/r/20251017-b4-dpu-fixes-v1-4-40ce5993eeb6@gmail.com


Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
parent 425da330
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -500,13 +500,15 @@ static void _dpu_plane_setup_pixel_ext(struct dpu_hw_scaler3_cfg *scale_cfg,
	int i;

	for (i = 0; i < DPU_MAX_PLANES; i++) {
		uint32_t w = src_w, h = src_h;

		if (i == DPU_SSPP_COMP_1_2 || i == DPU_SSPP_COMP_2) {
			src_w /= chroma_subsmpl_h;
			src_h /= chroma_subsmpl_v;
			w /= chroma_subsmpl_h;
			h /= chroma_subsmpl_v;
		}

		pixel_ext->num_ext_pxls_top[i] = src_h;
		pixel_ext->num_ext_pxls_left[i] = src_w;
		pixel_ext->num_ext_pxls_top[i] = h;
		pixel_ext->num_ext_pxls_left[i] = w;
	}
}