From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
"magnus.damm" <magnus.damm@gmail.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH v4 4/5] drm: renesas: rz-du: Move mode_valid logic to per-SoC clock limits
Date: Wed, 20 May 2026 09:13:49 +0100 [thread overview]
Message-ID: <CA+V-a8uReGLazx5xPfCG+EfSeT_zDy-xfq8Et2pEkmgOKT+8QA@mail.gmail.com> (raw)
In-Reply-To: <TY3PR01MB11346AD5B7CDBB72EC8FEA16686012@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Hi Biju,
Thank you for the review.
On Wed, May 20, 2026 at 6:36 AM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Hi Prabhakar,
>
> Thanks for the patch.
>
> > -----Original Message-----
> > From: Prabhakar <prabhakar.csengg@gmail.com>
> > Sent: 19 May 2026 17:08
> > Subject: [PATCH v4 4/5] drm: renesas: rz-du: Move mode_valid logic to per-SoC clock limits
> >
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Move pixel clock validation from a fixed encoder check to per SoC constraints stored in
> > rzg2l_du_device_info.
> >
> > Pixel clock limits differ across SoCs in the RZ DU family and cannot be expressed by a single shared
> > rule. For example, RZ/G2UL and RZ/G2L limit the DPAD0 pixel clock to a narrow window, while other SoCs
> > such as RZ/T2H require a wider operating range.
> >
> > Add mode_clock_min and mode_clock_max fields to rzg2l_du_device_info to describe the supported pixel
> > clock range for each SoC. Update
> > rzg2l_du_encoder_mode_valid() to check these bounds when evaluating
> > DPAD0 outputs, returning MODE_CLOCK_LOW when the pixel clock falls below mode_clock_min and
> > MODE_CLOCK_HIGH when it exceeds mode_clock_max.
> >
> > Populate the pixel clock limits for both the RZ/G2UL (R9A07G043U) and RZ/G2L (R9A07G044) variants to a
> > minimum of 20875 kHz and a maximum of
> > 83500 kHz.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> > v3->v4:
> > - Dropped per pad limits
> > - Updated commit message to reflect the change in approach.
> >
> > v2->v3:
> > - Moved clock limits from device_info to output_routing to allow
> > per-output constraints.
> > - Updated commit message to reflect the change in approach.
> >
> > v1->v2:
> > - Dropped storing info pointer in struct rzg2l_du_encoder as it's not needed.
> > ---
> > drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 6 +++++-
> > drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 4 ++++
> > drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 9 ++++++++-
> > 3 files changed, 17 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_drv.c
> > index 0fef33a5a089..1e4b9f38c55b 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > @@ -35,6 +35,8 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g043u_info = {
> > .port = 0,
> > },
> > },
> > + .mode_clock_min = 20875,
> > + .mode_clock_max = 83500,
> > };
> >
> > static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = { @@ -48,7 +50,9 @@ static const
> > struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
> > .possible_outputs = BIT(0),
> > .port = 1,
> > }
> > - }
> > + },
> > + .mode_clock_min = 20875,
> > + .mode_clock_max = 83500,
> > };
> >
> > static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = { diff --git
> > a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > index 58806c2a8f2b..885558eb9547 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > @@ -44,10 +44,14 @@ struct rzg2l_du_output_routing {
> > * struct rzg2l_du_device_info - DU model-specific information
> > * @channels_mask: bit mask of available DU channels
> > * @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
> > + * @mode_clock_min: minimum pixel clock in kHz
> > + * @mode_clock_max: maximum pixel clock in kHz
> > */
> > struct rzg2l_du_device_info {
> > unsigned int channels_mask;
> > struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX];
> > + u32 mode_clock_min;
> > + u32 mode_clock_max;
> > };
> >
> > #define RZG2L_DU_MAX_CRTCS 1
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_encoder.c
> > index 0e567b57a408..56220139a149 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> > @@ -50,8 +50,15 @@ rzg2l_du_encoder_mode_valid(struct drm_encoder *encoder,
> > const struct drm_display_mode *mode) {
> > struct rzg2l_du_encoder *renc = to_rzg2l_encoder(encoder);
> > + struct rzg2l_du_device *rcdu = to_rzg2l_du_device(renc->base.dev);
> > + const struct rzg2l_du_device_info *info = rcdu->info;
> >
> > - if (renc->output == RZG2L_DU_OUTPUT_DPAD0 && mode->clock > 83500)
> > + if (renc->output != RZG2L_DU_OUTPUT_DPAD0)
> > + return MODE_OK;
> > +
> > + if (info->mode_clock_min && mode->clock < info->mode_clock_min)
>
> I will avoid checking the first part as it is mandatory for SoCs with DPI support
> and DPI check above make sure that this part of the code is reachable only for DPI
> output.
>
Will you fix up while applying or shall I send a new version?
Cheers,
Prabhakar
> > + return MODE_CLOCK_LOW;
> > + if (info->mode_clock_max && mode->clock > info->mode_clock_max)
>
> Same here.
>
> Cheers,
> Biju
>
> > return MODE_CLOCK_HIGH;
> >
> > return MODE_OK;
> > --
> > 2.54.0
>
next prev parent reply other threads:[~2026-05-20 8:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 16:08 [PATCH v4 0/5] Add DU support for RZ/T2H and RZ/N2H SoCs Prabhakar
2026-05-19 16:08 ` [PATCH v4 1/5] dt-bindings: display: renesas, rzg2l-du: Refuse port@1 for RZ/G2UL Prabhakar
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
2026-05-19 16:08 ` [PATCH v4 2/5] dt-bindings: display: renesas, rzg2l-du: Add RZ/T2H and RZ/N2H support Prabhakar
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
2026-05-19 16:08 ` [PATCH v4 3/5] drm: renesas: rz-du: Make DU reset control optional for RZ/T2H support Prabhakar
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
2026-05-19 16:08 ` [PATCH v4 4/5] drm: renesas: rz-du: Move mode_valid logic to per-SoC clock limits Prabhakar
2026-05-20 5:35 ` Biju Das
2026-05-20 8:13 ` Lad, Prabhakar [this message]
2026-05-20 8:15 ` Biju Das
2026-05-22 6:27 ` Biju Das
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
2026-05-19 16:08 ` [PATCH v4 5/5] drm: renesas: rz-du: Add support for RZ/T2H SoC Prabhakar
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
2026-05-22 7:43 ` [PATCH v4 0/5] Add DU support for RZ/T2H and RZ/N2H SoCs Biju Das
2026-05-25 12:39 ` Claude review: " Claude Code Review Bot
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=CA+V-a8uReGLazx5xPfCG+EfSeT_zDy-xfq8Et2pEkmgOKT+8QA@mail.gmail.com \
--to=prabhakar.csengg@gmail.com \
--cc=airlied@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=magnus.damm@gmail.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--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