On Tue, Jun 03, 2025 at 10:37:37PM +0800, Jun Nie wrote: > Dmitry Baryshkov <dmitry.barysh...@oss.qualcomm.com> 于2025年6月3日周二 18:21写道: > > > > On Tue, Jun 03, 2025 at 03:10:09PM +0800, 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....@linaro.org> > > > --- > > > drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 148 > > > +++++++++++++++++++----------- > > > 1 file changed, 94 insertions(+), 54 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > index > > > 0bb153a71353ca9eaca138ebbee4cd699414771d..501b6a1bad4a1fee832f15efa7caec136a669da5 > > > 100644 > > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c > > > @@ -961,6 +961,33 @@ static int > > > dpu_plane_is_multirect_parallel_capable(struct dpu_hw_sspp *sspp, > > > dpu_plane_is_parallel_capable(pipe_cfg, fmt, max_linewidth); > > > } > > > > > > +static bool dpu_plane_get_single_pipe(struct dpu_plane_state *pstate, > > > + struct dpu_sw_pipe **single_pipe, > > > + struct dpu_sw_pipe_cfg > > > **single_pipe_cfg, > > > + bool config_pipe) > > > > Could you please describe, what does this function do? Why is it > > returning the pipe or configuring a pipe? > > It search all pipes. If there is only one valid pipe, return it via > pointer and function returns true. > If the config_pipe flag is set, multirect_index and multirect_mode are > also initialized. See below.
This doesn't look like a description of a single action. Please don't try to mix different actions into a single function. > > > > > +{ > > > + int i, valid_pipe = 0; > > > + struct dpu_sw_pipe *pipe; > > > + > > > + for (i = 0; i < PIPES_PER_PLANE; i++) { > > > + if (drm_rect_width(&pstate->pipe_cfg[i].src_rect) != 0) { > > > + valid_pipe++; > > > + if (valid_pipe > 1) > > > + return false; > > > + *single_pipe = &pstate->pipe[i]; > > > + *single_pipe_cfg = &pstate->pipe_cfg[i]; > > > + } else { > > > + if (!config_pipe) > > > + continue; > > > + pipe = &pstate->pipe[i]; > > > + pipe->multirect_index = DPU_SSPP_RECT_SOLO; > > > + pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; > > > + pipe->sspp = NULL; > > > + } > > > + } > > > + > > > + return true; > > > +} > > > > > > static int dpu_plane_atomic_check_sspp(struct drm_plane *plane, > > > struct drm_atomic_state *state, -- With best wishes Dmitry