From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>, Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
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>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
LUU HOAI <hoai.luu.ub@renesas.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Sam Ravnborg <sam@ravnborg.org>,
Biju Das <biju.das.jz@bp.renesas.com>,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Subject: Re: [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc
Date: Thu, 5 Dec 2024 19:34:52 +0200 [thread overview]
Message-ID: <20241205173452.GA21014@pendragon.ideasonboard.com> (raw)
In-Reply-To: <98b43276-2a68-4ba9-999a-c738b8f7654f@ideasonboard.com>
On Thu, Dec 05, 2024 at 06:08:24PM +0200, Tomi Valkeinen wrote:
> On 05/12/2024 16:16, Geert Uytterhoeven wrote:
> > Hi Tomi,
> >
> > CC Jacopo
> >
> > On Thu, Dec 5, 2024 at 2:45 PM Tomi Valkeinen wrote:
> >> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> >>
> >> Currently the driver always writes DPTSR when setting up the hardware.
> >> However, the register is only meaningful when there are more than one
> >> crtc, and the only SoC with one crtc, V3M, does not have the register
> >> mentioned in its documentation.
> >
> > R-Car V3H/V3H_2, too.
>
> Right... I was looking at the number of outputs, not the number of crtcs
> when going through the SoCs.
>
> >> So move the write behind a condition.
> >>
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> >> ---
> >> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++-----
> >> 1 file changed, 7 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> index 2ccd2581f544..0fbf6abbde6e 100644
> >> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> @@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp)
> >> dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1;
> >> rcar_du_group_write(rgrp, DORCR, dorcr);
> >>
> >> - /* Apply planes to CRTCs association. */
> >> - mutex_lock(&rgrp->lock);
> >> - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> >> - rgrp->dptsr_planes);
> >> - mutex_unlock(&rgrp->lock);
> >> + if (rgrp->num_crtcs > 1) {
> >> + /* Apply planes to CRTCs association. */
> >> + mutex_lock(&rgrp->lock);
> >> + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> >> + rgrp->dptsr_planes);
> >> + mutex_unlock(&rgrp->lock);
> >> + }
> >
> > This is per group, not per DU, right?
> > The second group on R-Car M3-W/M3-W+ has a single channel, hence no
> > DPTSR2 register.
> > The second group on R-Car M3-N has a single channel, but it's actually
> > the second physical channel in the group, and thus does have DPTSR2.
>
> That logic does make sense. So that would be if (rgrp->channels_mask &
> BIT(1)) then write DPTSR? And probably add a comment in the code about this.
>
> > And apparently we had this discussion before...
> > https://lore.kernel.org/all/CAMuHMdXxf4oePnyLvp84OhSa+wdehCNJBXnhjYO7-1VxpBJ7eQ@mail.gmail.com
>
> Somehow I hadn't even realized Jacopo had sent these before...
Oops...
I'll let Jacopo and you decide who will send an updated patch.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-12-05 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc Tomi Valkeinen
2024-12-05 14:16 ` Geert Uytterhoeven
2024-12-05 16:08 ` Tomi Valkeinen
2024-12-05 17:34 ` Laurent Pinchart [this message]
2024-12-05 13:44 ` [PATCH v2 03/10] dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0 Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 04/10] dt-bindings: display: renesas,du: " Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 05/10] clk: renesas: r8a779h0: Add display clocks Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 06/10] drm/rcar-du: dsi: Add r8a779h0 support Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0 Tomi Valkeinen
2024-12-05 19:08 ` Laurent Pinchart
2024-12-05 13:45 ` [PATCH v2 08/10] arm64: dts: renesas: gray-hawk-single: Fix indentation Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 09/10] arm64: dts: renesas: r8a779h0: Add display support Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 10/10] arm64: dts: renesas: gray-hawk-single: Add DisplayPort support Tomi Valkeinen
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=20241205173452.GA21014@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.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=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=hoai.luu.ub@renesas.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--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=mturquette@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sam@ravnborg.org \
--cc=sboyd@kernel.org \
--cc=simona@ffwll.ch \
--cc=tomi.valkeinen+renesas@ideasonboard.com \
--cc=tomi.valkeinen@ideasonboard.com \
--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