diff mbox series

[07/21] drm/msm/dpu: Support dynamic DSC number

Message ID 20240829-sm8650-v6-11-hmd-pocf-mdss-quad-upstream-8-v1-7-bdb05b4b5a2e@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/msm: Support quad pipe with dual-DSI | expand

Commit Message

Jun Nie Aug. 29, 2024, 10:17 a.m. UTC
Do not assume DSC number as 2. Because there are 4 DSC in
quad pipe case.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dmitry Baryshkov Aug. 29, 2024, 11:10 a.m. UTC | #1
On Thu, 29 Aug 2024 at 13:20, Jun Nie <jun.nie@linaro.org> wrote:
>
> Do not assume DSC number as 2. Because there are 4 DSC in
> quad pipe case.

Please expand the commit message. You prefer brevity, but your
comments lack clarifications.

>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 6bdd9c21ff3ed..05b203be2a9bc 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -553,9 +553,9 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
>                 if (dpu_enc->phys_encs[i])
>                         intf_count++;
>
> -       /* See dpu_encoder_get_topology, we only support 2:2:1 topology */
> +       /* DSC and mixer are mapped 1:1, so reuse the mixer number */

Why? DSCmerge is a valid topology even if it is not supported yet.

>         if (dpu_enc->dsc)
> -               num_dsc = 2;
> +               num_dsc = dpu_crtc_get_lm_num(drm_enc->crtc->state);
>
>         return (num_dsc > 0) && (num_dsc > intf_count);
>  }
>
> --
> 2.34.1
>
Jun Nie Sept. 3, 2024, 7:48 a.m. UTC | #2
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> 于2024年8月29日周四 19:10写道:
>
> On Thu, 29 Aug 2024 at 13:20, Jun Nie <jun.nie@linaro.org> wrote:
> >
> > Do not assume DSC number as 2. Because there are 4 DSC in
> > quad pipe case.
>
> Please expand the commit message. You prefer brevity, but your
> comments lack clarifications.

Is below message OK?

Current DSC number is fixed to 2 for any DSC usage case. While there are
more usage case that involve different number of DSC engine, such 4 in
quad-pipe case with bonded-DSI scenario. So retrieve the real number with
this change.

>
> >
> > Signed-off-by: Jun Nie <jun.nie@linaro.org>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > index 6bdd9c21ff3ed..05b203be2a9bc 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > @@ -553,9 +553,9 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
> >                 if (dpu_enc->phys_encs[i])
> >                         intf_count++;
> >
> > -       /* See dpu_encoder_get_topology, we only support 2:2:1 topology */
> > +       /* DSC and mixer are mapped 1:1, so reuse the mixer number */
>
> Why? DSCmerge is a valid topology even if it is not supported yet.

DSC merge is already supported in 2:2:1 topology without this patch
set. This change
is to get real DSC number in 4:4:2 topology, so that DSC merge can be
enabled for the
case.

>
> >         if (dpu_enc->dsc)
> > -               num_dsc = 2;
> > +               num_dsc = dpu_crtc_get_lm_num(drm_enc->crtc->state);
> >
> >         return (num_dsc > 0) && (num_dsc > intf_count);
> >  }
> >
> > --
> > 2.34.1
> >
>
>
> --
> With best wishes
> Dmitry
Dmitry Baryshkov Sept. 3, 2024, 8:38 a.m. UTC | #3
On Tue, 3 Sept 2024 at 10:48, Jun Nie <jun.nie@linaro.org> wrote:
>
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org> 于2024年8月29日周四 19:10写道:
> >
> > On Thu, 29 Aug 2024 at 13:20, Jun Nie <jun.nie@linaro.org> wrote:
> > >
> > > Do not assume DSC number as 2. Because there are 4 DSC in
> > > quad pipe case.
> >
> > Please expand the commit message. You prefer brevity, but your
> > comments lack clarifications.
>
> Is below message OK?
>
> Current DSC number is fixed to 2 for any DSC usage case. While there are
> more usage case that involve different number of DSC engine, such 4 in
> quad-pipe case with bonded-DSI scenario. So retrieve the real number with
> this change.

Please rewrite the last sentence. See
Documentation/process/submitting-patches.rst "Describe your changes".

>
> >
> > >
> > > Signed-off-by: Jun Nie <jun.nie@linaro.org>
> > > ---
> > >  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > index 6bdd9c21ff3ed..05b203be2a9bc 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > @@ -553,9 +553,9 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
> > >                 if (dpu_enc->phys_encs[i])
> > >                         intf_count++;
> > >
> > > -       /* See dpu_encoder_get_topology, we only support 2:2:1 topology */
> > > +       /* DSC and mixer are mapped 1:1, so reuse the mixer number */
> >
> > Why? DSCmerge is a valid topology even if it is not supported yet.
>
> DSC merge is already supported in 2:2:1 topology without this patch
> set. This change
> is to get real DSC number in 4:4:2 topology, so that DSC merge can be
> enabled for the
> case.

Yep, 3DMerge, not DSC Merge. Basically the comment about 1:1 is
incorrect. See sde_rm.h

Also it's "number of mixers", not "mixer number" (two different things).

>
> >
> > >         if (dpu_enc->dsc)
> > > -               num_dsc = 2;
> > > +               num_dsc = dpu_crtc_get_lm_num(drm_enc->crtc->state);
> > >
> > >         return (num_dsc > 0) && (num_dsc > intf_count);
> > >  }
> > >
> > > --
> > > 2.34.1
> > >
> >
> >
> > --
> > With best wishes
> > Dmitry
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 6bdd9c21ff3ed..05b203be2a9bc 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -553,9 +553,9 @@  bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
 		if (dpu_enc->phys_encs[i])
 			intf_count++;
 
-	/* See dpu_encoder_get_topology, we only support 2:2:1 topology */
+	/* DSC and mixer are mapped 1:1, so reuse the mixer number */
 	if (dpu_enc->dsc)
-		num_dsc = 2;
+		num_dsc = dpu_crtc_get_lm_num(drm_enc->crtc->state);
 
 	return (num_dsc > 0) && (num_dsc > intf_count);
 }