From: Vladimir Lypak <vladimir.lypak@gmail.com>
To: "Rob Clark" <robin.clark@oss.qualcomm.com>,
	"Dmitry Baryshkov" <lumag@kernel.org>,
	"Abhinav Kumar" <abhinav.kumar@linux.dev>,
	"Jessica Zhang" <jessica.zhang@oss.qualcomm.com>,
	"Sean Paul" <sean@poorly.run>,
	"Marijn Suijten" <marijn.suijten@somainline.org>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Kalyan Thota" <quic_kalyant@quicinc.com>,
	"Vinod Polimera" <quic_vpolimer@quicinc.com>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Barnabás Czémán" <barnabas.czeman@mainlining.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Vladimir Lypak <vladimir.lypak@gmail.com>
Subject: [PATCH 4/6] drm/msm/dpu: Fix pixel extension sub-sampling
Date: Fri, 17 Oct 2025 19:58:38 +0000	[thread overview]
Message-ID: <20251017-b4-dpu-fixes-v1-4-40ce5993eeb6@gmail.com> (raw)
In-Reply-To: <20251017-b4-dpu-fixes-v1-0-40ce5993eeb6@gmail.com>
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: dabfdd89eaa9 ("drm/msm/disp/dpu1: add inline rotation support for sc7280")
Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 6effe0fa4837284a1f038e4907c4c91d239aeb8b..905524ceeb1f192c093f1be7f571b29eb4b53379 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -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;
 	}
 }
 
-- 
2.51.0
next prev parent reply	other threads:[~2025-10-17 20:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 19:58 [PATCH 0/6] drm/msm/dpu: Fixes for virtual planes and 1.x features Vladimir Lypak
2025-10-17 19:58 ` [PATCH 1/6] drm/msm/dpu: Fix allocation of RGB SSPPs without scaling Vladimir Lypak
2025-10-28 21:24   ` Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 2/6] drm/msm/dpu: Propagate error from dpu_assign_plane_resources Vladimir Lypak
2025-10-28 21:24   ` Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 3/6] drm/msm/dpu: Disable scaling for unsupported scaler types Vladimir Lypak
2025-10-28 21:25   ` Dmitry Baryshkov
2025-10-17 19:58 ` Vladimir Lypak [this message]
2025-10-28 21:26   ` [PATCH 4/6] drm/msm/dpu: Fix pixel extension sub-sampling Dmitry Baryshkov
2025-10-17 19:58 ` [PATCH 5/6] drm/msm/dpu: Require linear modifier for writeback framebuffers Vladimir Lypak
2025-10-28 21:26   ` Dmitry Baryshkov
2025-10-18 14:33 ` [PATCH 6/6] drm/msm/dpu: Disable broken YUV on QSEED2 hardware Vladimir Lypak
2025-10-28 21:27   ` Dmitry Baryshkov
2025-10-28 22:14   ` Dmitry Baryshkov
2025-10-29  0:30 ` [PATCH 0/6] drm/msm/dpu: Fixes for virtual planes and 1.x features Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20251017-b4-dpu-fixes-v1-4-40ce5993eeb6@gmail.com \
    --to=vladimir.lypak@gmail.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=barnabas.czeman@mainlining.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_kalyant@quicinc.com \
    --cc=quic_vpolimer@quicinc.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).