From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Maíra Canal" <mcanal@igalia.com>,
"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: "Paul Cercueil" <paul.cercueil@bootlin.com>,
"Hui Pu" <Hui.Pu@gehealthcare.com>,
"Ian Ray" <ian.ray@gehealthcare.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 3/3] drm/vc4: dsi: remove unnecessary intermediate pointer computation
Date: Fri, 06 Nov 2026 15:01:12 +0100 [thread overview]
Message-ID: <DMO6LBTEZZ15.3T8QULAA5SSU@bootlin.com> (raw)
In-Reply-To: <05396e07-1c4a-4942-82dd-a0154fd6316d@igalia.com>
Hello Maíra,
On Fri Nov 6, 2026 at 12:27 AM CET, Maíra Canal wrote:
> Hi Luca,
>
> On 05/11/26 07:32, Luca Ceresoli wrote:
>> This function computes the 'dsi' pointer from the passed 'bridge' pointer,
>> but uses 'dsi' just to obtain the same 'bridge' pointer. Remove the
>> unnecessary pointer dance, just use the passed 'bridge' pointer.
>>
>> Suggested-by: Maíra Canal <mcanal@igalia.com>
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>>
>> ---
>>
>> New patch in v4
>> ---
>> drivers/gpu/drm/vc4/vc4_dsi.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
>> index 581b54e04ce4..ec008f766dd5 100644
>> --- a/drivers/gpu/drm/vc4/vc4_dsi.c
>> +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
>> @@ -1159,10 +1159,7 @@ static int vc4_dsi_bridge_attach(struct drm_bridge *bridge,
>> struct drm_encoder *encoder,
>> enum drm_bridge_attach_flags flags)
>> {
>> - struct vc4_dsi *dsi = bridge_to_vc4_dsi(bridge);
>> -
>> - return drm_bridge_attach(encoder, dsi->bridge.next_bridge,
>> - &dsi->bridge, flags);
>> + return drm_bridge_attach(encoder, bridge->next_bridge, bridge, flags);
>
> I wonder if we should turn this into a DRM helper... I noticed that
> other drivers follow this exact same pattern. The following files have
> such pattern: vs_bridge.c, meson_encoder_hdmi.c, rzg2l_mipi_dsi.c, etc.
Good point. I also think this could be factored out to a common
function. However for the time being I haven't done any steps in that
direction because I'm soon going to propose a .get_next_bridge bridge func
in [0], and I suspect that addition could further improve bridge attach
management. So I'm waiting until the get_next_bridge work is settled before
doing further steps.
> Anyway, just a suggestion. I already pushed the series to drm-misc-next.
Thanks!
[0] https://lore.kernel.org/lkml/20261001-drm-bridge-hotplug-v2-17-8e34986dcb68@bootlin.com/
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-11-06 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 10:32 [PATCH v4 0/3] drm: remove deprecated *_of_get_bridge() from non-OF drivers Luca Ceresoli
2026-11-05 10:32 ` [PATCH v4 1/3] drm/vc4: dpi: stop using deprecated drmm_of_get_bridge() Luca Ceresoli
2026-11-05 10:32 ` [PATCH v4 2/3] drm/vc4: dsi: " Luca Ceresoli
2026-11-05 10:32 ` [PATCH v4 3/3] drm/vc4: dsi: remove unnecessary intermediate pointer computation Luca Ceresoli
2026-11-05 23:27 ` Maíra Canal
2026-11-06 14:01 ` Luca Ceresoli [this message]
2026-11-05 23:20 ` [PATCH v4 0/3] drm: remove deprecated *_of_get_bridge() from non-OF drivers Maíra Canal
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=DMO6LBTEZZ15.3T8QULAA5SSU@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=Hui.Pu@gehealthcare.com \
--cc=airlied@gmail.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.ray@gehealthcare.com \
--cc=kernel-list@raspberrypi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=paul.cercueil@bootlin.com \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®