dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jun Nie <jun.nie@linaro.org>
To: Rob Clark <robdclark@gmail.com>,
	 Abhinav Kumar <quic_abhinavk@quicinc.com>,
	 Dmitry Baryshkov <lumag@kernel.org>, Sean Paul <sean@poorly.run>,
	 Marijn Suijten <marijn.suijten@somainline.org>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Jessica Zhang <quic_jesszhan@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Jun Nie <jun.nie@linaro.org>,
	Dmitry Baryshkov <lumag@kernel.org>
Subject: [PATCH v12 02/12] drm/msm/dpu: decide right side per last bit
Date: Mon, 07 Jul 2025 14:17:57 +0800	[thread overview]
Message-ID: <20250707-v6-16-rc2-quad-pipe-upstream-v12-2-67e3721e7d83@linaro.org> (raw)
In-Reply-To: <20250707-v6-16-rc2-quad-pipe-upstream-v12-0-67e3721e7d83@linaro.org>

Currently, only one pair of mixers is supported, so a non-zero counter
value is sufficient to identify the correct mixer within that pair.
However, future implementations may involve multiple mixer pairs. With
the current implementation, all mixers within the second pair would be
incorrectly selected as right mixer. To correctly select the mixer
within a pair, test the least significant bit of the counter. If the
least significant bit is not set, select the mixer as left one;
otherwise, select the mixer as right one for all pairs.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index d4b545448d74657aafc96e9042c7756654b4f0e7..9a40492e5aa961f7180ba4ac6c86e06fcccef8c2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -377,11 +377,10 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
 static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc)
 {
 	struct dpu_crtc_state *crtc_state;
-	int lm_idx, lm_horiz_position;
+	int lm_idx;
 
 	crtc_state = to_dpu_crtc_state(crtc->state);
 
-	lm_horiz_position = 0;
 	for (lm_idx = 0; lm_idx < crtc_state->num_mixers; lm_idx++) {
 		const struct drm_rect *lm_roi = &crtc_state->lm_bounds[lm_idx];
 		struct dpu_hw_mixer *hw_lm = crtc_state->mixers[lm_idx].hw_lm;
@@ -392,7 +391,7 @@ static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc)
 
 		cfg.out_width = drm_rect_width(lm_roi);
 		cfg.out_height = drm_rect_height(lm_roi);
-		cfg.right_mixer = lm_horiz_position++;
+		cfg.right_mixer = lm_idx & 0x1;
 		cfg.flags = 0;
 		hw_lm->ops.setup_mixer_out(hw_lm, &cfg);
 	}

-- 
2.34.1


  parent reply	other threads:[~2025-07-07  6:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07  6:17 [PATCH v12 00/12] drm/msm/dpu: Support quad pipe with dual-interface Jun Nie
2025-07-07  6:17 ` [PATCH v12 01/12] drm/msm/dpu: polish log for resource allocation Jun Nie
2025-07-07  6:17 ` Jun Nie [this message]
2025-07-07  6:17 ` [PATCH v12 03/12] drm/msm/dpu: fix mixer number counter on allocation Jun Nie
2025-07-07  6:17 ` [PATCH v12 04/12] drm/msm/dpu: bind correct pingpong for quad pipe Jun Nie
2025-07-07  6:18 ` [PATCH v12 05/12] drm/msm/dpu: Add pipe as trace argument Jun Nie
2025-07-07  6:18 ` [PATCH v12 06/12] drm/msm/dpu: handle pipes as array Jun Nie
2025-07-07  6:18 ` [PATCH v12 07/12] drm/msm/dpu: split PIPES_PER_STAGE definition per plane and mixer Jun Nie
2025-07-07  6:18 ` [PATCH v12 08/12] drm/msm/dpu: Use dedicated WB number definition Jun Nie
2025-07-07  6:18 ` [PATCH v12 09/12] drm/msm/dpu: blend pipes per mixer pairs config Jun Nie
2025-07-07  6:18 ` [PATCH v12 10/12] drm/msm/dpu: support SSPP assignment for quad-pipe case Jun Nie
2025-07-19 10:09   ` Dmitry Baryshkov
2025-07-21  8:06     ` Jun Nie
2025-07-22 12:04       ` Dmitry Baryshkov
2025-07-24  1:56         ` Jun Nie
2025-07-25 13:45           ` Dmitry Baryshkov
2025-07-07  6:18 ` [PATCH v12 11/12] drm/msm/dpu: support plane splitting in " Jun Nie
2025-07-07  6:18 ` [PATCH v12 12/12] drm/msm/dpu: Enable quad-pipe for DSC and dual-DSI case Jun Nie

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=20250707-v6-16-rc2-quad-pipe-upstream-v12-2-67e3721e7d83@linaro.org \
    --to=jun.nie@linaro.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.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_abhinavk@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=robdclark@gmail.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).