From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Jun Nie <jun.nie@linaro.org>, Rob Clark <robdclark@gmail.com>,
"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
Sean Paul <sean@poorly.run>,
"Marijn Suijten" <marijn.suijten@somainline.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Dmitry Baryshkov <lumag@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9 12/14] drm/msm/dpu: support SSPP assignment for quad-pipe case
Date: Thu, 8 May 2025 11:51:35 -0700 [thread overview]
Message-ID: <e2a326b1-4a14-4a2a-b72a-988854351f6a@quicinc.com> (raw)
In-Reply-To: <20250506-quad-pipe-upstream-v9-12-f7b273a8cc80@linaro.org>
On 5/6/2025 8:47 AM, Jun Nie wrote:
> Currently, SSPPs are assigned to a maximum of two pipes. However,
> quad-pipe usage scenarios require four pipes and involve configuring
> two stages. In quad-pipe case, the first two pipes share a set of
> mixer configurations and enable multi-rect mode when certain
> conditions are met. The same applies to the subsequent two pipes.
>
> Assign SSPPs to the pipes in each stage using a unified method and
> to loop the stages accordingly.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 68 +++++++++++++++++++------------
> 1 file changed, 42 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index ea7e3fdf52f726737941ad33218a843dca17280b..de3f52d743e1d1f11ae8721a316b9872d4139069 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -1112,11 +1112,10 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
> struct dpu_rm_sspp_requirements reqs;
> struct dpu_plane_state *pstate;
> struct dpu_sw_pipe *pipe;
> - struct dpu_sw_pipe *r_pipe;
> struct dpu_sw_pipe_cfg *pipe_cfg;
> - struct dpu_sw_pipe_cfg *r_pipe_cfg;
> + struct dpu_plane *pdpu = to_dpu_plane(plane);
> const struct msm_format *fmt;
> - int i;
> + int i, num_lm, stage_id, num_stages;
>
> if (plane_state->crtc)
> crtc_state = drm_atomic_get_new_crtc_state(state,
> @@ -1124,11 +1123,6 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
>
> pstate = to_dpu_plane_state(plane_state);
>
> - pipe = &pstate->pipe[0];
> - r_pipe = &pstate->pipe[1];
> - pipe_cfg = &pstate->pipe_cfg[0];
> - r_pipe_cfg = &pstate->pipe_cfg[1];
> -
> for (i = 0; i < PIPES_PER_PLANE; i++)
> pstate->pipe[i].sspp = NULL;
>
> @@ -1142,24 +1136,46 @@ static int dpu_plane_virtual_assign_resources(struct drm_crtc *crtc,
>
> reqs.rot90 = drm_rotation_90_or_270(plane_state->rotation);
>
> - pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
> - if (!pipe->sspp)
> - return -ENODEV;
> -
> - if (!dpu_plane_try_multirect_parallel(pipe, pipe_cfg, r_pipe, r_pipe_cfg,
> - pipe->sspp,
> - msm_framebuffer_format(plane_state->fb),
> - dpu_kms->catalog->caps->max_linewidth)) {
> - /* multirect is not possible, use two SSPP blocks */
> - r_pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
> - if (!r_pipe->sspp)
> - return -ENODEV;
> -
> - pipe->multirect_index = DPU_SSPP_RECT_SOLO;
> - pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
> -
> - r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
> - r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
> + num_lm = dpu_crtc_get_num_lm(crtc_state);
Hi Jun,
I think there might be some patch ordering issue here since
`dpu_crtc_get_num_lm()` is only declared/defined in the next patch. This
will break compilation upon partial application of the series.
Also, can you rebase this on top of the latest msm-next? The changes
here will conflict with commit 3ed12a36 ("drm/msm/dpu: allow sharing
SSPP between planes").
Thanks,
Jessica Zhang
> + num_stages = (num_lm + 1) / 2;
> + for (stage_id = 0; stage_id < num_stages; stage_id++) {
> + for (i = stage_id * PIPES_PER_STAGE; i < (stage_id + 1) * PIPES_PER_STAGE; i++) {
> + struct dpu_sw_pipe *r_pipe;
> + struct dpu_sw_pipe_cfg *r_pipe_cfg;
> +
> + pipe = &pstate->pipe[i];
> + pipe_cfg = &pstate->pipe_cfg[i];
> +
> + if (drm_rect_width(&pipe_cfg->src_rect) == 0)
> + break;
> +
> + pipe->sspp = dpu_rm_reserve_sspp(&dpu_kms->rm, global_state, crtc, &reqs);
> + if (!pipe->sspp)
> + return -ENODEV;
> +
> + r_pipe = &pstate->pipe[i + 1];
> + r_pipe_cfg = &pstate->pipe_cfg[i + 1];
> +
> + /*
> + * If current pipe is the first pipe in pipe pair, check
> + * multi-rect opportunity for the 2nd pipe in the pair.
> + * SSPP multi-rect mode cross mixer pairs is not supported.
> + */
> + if ((i % PIPES_PER_STAGE == 0) &&
> + drm_rect_width(&r_pipe_cfg->src_rect) != 0 &&
> + dpu_plane_try_multirect_parallel(pipe, pipe_cfg, r_pipe, r_pipe_cfg,
> + pipe->sspp,
> + msm_framebuffer_format(plane_state->fb),
> + dpu_kms->catalog->caps->max_linewidth)) {
> + i++;
> + } else {
> + /* multirect is not possible, use two SSPP blocks */
> + pipe->multirect_index = DPU_SSPP_RECT_SOLO;
> + pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
> + DPU_DEBUG_PLANE(pdpu, "allocating sspp_%d for pipe %d.\n",
> + pipe->sspp->idx - SSPP_NONE, i);
> + }
> + }
> }
>
> return dpu_plane_atomic_check_sspp(plane, state, crtc_state);
>
next prev parent reply other threads:[~2025-05-08 18:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 15:47 [PATCH v9 00/14] drm/msm/dpu: Support quad pipe with dual-DSI Jun Nie
2025-05-06 15:47 ` [PATCH v9 01/14] drm/atomic-helper: Add crtc check before checking plane Jun Nie
2025-05-08 10:47 ` Dmitry Baryshkov
2025-05-09 3:08 ` Jun Nie
2025-05-09 15:18 ` Dmitry Baryshkov
2025-05-06 15:47 ` [PATCH v9 02/14] drm/msm/dpu: check every pipe per capability Jun Nie
2025-05-08 18:38 ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 03/14] drm/msm/dpu: polish log for resource allocation Jun Nie
2025-05-06 15:47 ` [PATCH v9 04/14] drm/msm/dpu: decide right side per last bit Jun Nie
2025-05-06 15:47 ` [PATCH v9 05/14] drm/msm/dpu: fix mixer number counter on allocation Jun Nie
2025-05-06 15:47 ` [PATCH v9 06/14] drm/msm/dpu: bind correct pingpong for quad pipe Jun Nie
2025-05-06 15:47 ` [PATCH v9 07/14] drm/msm/dpu: Add pipe as trace argument Jun Nie
2025-05-06 15:47 ` [PATCH v9 08/14] drm/msm/dpu: handle pipes as array Jun Nie
2025-05-08 18:00 ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 09/14] drm/msm/dpu: split PIPES_PER_STAGE definition per plane and mixer Jun Nie
2025-05-08 20:42 ` Jessica Zhang
2025-05-08 20:55 ` Jessica Zhang
2025-05-23 10:03 ` Jun Nie
2025-05-06 15:47 ` [PATCH v9 10/14] drm/msm/dpu: Use dedicated WB number definition Jun Nie
2025-05-08 13:10 ` Dmitry Baryshkov
2025-05-08 18:03 ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 11/14] drm/msm/dpu: blend pipes per mixer pairs config Jun Nie
2025-05-08 20:53 ` Jessica Zhang
2025-05-06 15:47 ` [PATCH v9 12/14] drm/msm/dpu: support SSPP assignment for quad-pipe case Jun Nie
2025-05-08 18:51 ` Jessica Zhang [this message]
2025-05-06 15:47 ` [PATCH v9 13/14] drm/msm/dpu: support plane splitting in " Jun Nie
2025-05-08 21:24 ` Jessica Zhang
2025-05-23 10:21 ` Jun Nie
2025-05-06 15:47 ` [PATCH v9 14/14] drm/msm/dpu: Enable quad-pipe for DSC and dual-DSI case Jun Nie
2025-05-08 21:30 ` Jessica Zhang
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=e2a326b1-4a14-4a2a-b72a-988854351f6a@quicinc.com \
--to=quic_jesszhan@quicinc.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jun.nie@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=mripard@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®