From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Icenowy Zheng" <zhengxingda@iscas.ac.cn>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.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>,
"Drew Fustini" <fustini@kernel.org>,
"Guo Ren" <guoren@kernel.org>, "Fu Wei" <wefu@redhat.com>
Cc: "Philipp Zabel" <p.zabel@pengutronix.de>,
"Dmitry Baryshkov" <lumag@kernel.org>,
"Michal Wilczynski" <m.wilczynski@samsung.com>,
"Han Gao" <gaohan@iscas.ac.cn>, "Yao Zi" <ziyao@disroot.org>,
<linux-kernel@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
<devicetree@vger.kernel.org>, <linux-riscv@lists.infradead.org>
Subject: Re: [PATCH v7 3/8] drm: verisilicon: add a driver for Verisilicon display controllers
Date: Tue, 10 Mar 2026 11:25:37 +0100 [thread overview]
Message-ID: <DGZ12YVFEPVZ.26EZEGK5DF6D1@bootlin.com> (raw)
In-Reply-To: <57436150684e72049b62657caec544a2f18aab1c.camel@iscas.ac.cn>
Hello Icenowy,
On Mon Mar 9, 2026 at 5:51 PM CET, Icenowy Zheng wrote:
> 在 2026-03-10二的 00:35 +0800,Icenowy Zheng写道:
> ================ 8< ==================
>> > > + if (IS_ERR(bridge))
>> > > + return ERR_PTR(PTR_ERR(bridge));
>> > > +
>> > > + bridge->crtc = crtc;
>> > > + bridge->intf = intf;
>> > > + bridge->next_bridge = next;
>> >
>> > There is now a next_bridge field in struct drm_bridge, which
>> > handles
>> > the
>> > bridge lifetime in a safer way and more simply [0], so you could
>> > use
>> > it:
>>
>> Glad to hear such a field exists now. Will more code about
>> next_bridge
>> lifetime management being shared?
>
> Looks like now many drivers can just share the .attach function,
> because they're all doing the same thing:
>
> ```
> int drm_bridge_attach_next(struct drm_bridge *bridge,
> struct drm_encoder *encoder,
> enum drm_bridge_attach_flags flags)
> {
> return drm_bridge_attach(encoder, bridge->next_bridge,
> bridge, flags);
> }
> ```
>
> At least vs_bridge_attach here and meson_encoder_*_attach (named
> encoder but they're bridge drivers now) match this pattern (the latter
> does a cast from `struct drm_bridge *` to their subclasses, but then
> only accessing the `bridge` field of the subclasses and doing the same
> things here).
Indeed, several drivers are more and more similar in this respect so a
helper could deduplicate a bit of code in an easy way here.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-03-10 10:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 2:39 [PATCH v7 0/8] Verisilicon DC8200 driver (and adaption to TH1520) Icenowy Zheng
2026-01-29 2:39 ` [PATCH v7 1/8] dt-bindings: vendor-prefixes: add verisilicon Icenowy Zheng
2026-01-29 2:39 ` [PATCH v7 2/8] dt-bindings: display: add verisilicon,dc Icenowy Zheng
2026-01-29 2:39 ` [PATCH v7 3/8] drm: verisilicon: add a driver for Verisilicon display controllers Icenowy Zheng
2026-03-09 12:47 ` Luca Ceresoli
2026-03-09 16:35 ` Icenowy Zheng
2026-03-09 16:51 ` Icenowy Zheng
2026-03-10 10:25 ` Luca Ceresoli [this message]
2026-03-10 8:27 ` Thomas Zimmermann
2026-03-10 10:25 ` Luca Ceresoli
2026-01-29 2:39 ` [PATCH v7 4/8] dt-bindings: display/bridge: add binding for TH1520 HDMI controller Icenowy Zheng
2026-01-29 2:39 ` [PATCH v7 5/8] drm/bridge: add a driver for T-Head " Icenowy Zheng
2026-01-29 2:39 ` [PATCH v7 6/8] riscv: dts: thead: add DPU and HDMI device tree nodes Icenowy Zheng
2026-01-29 20:39 ` Drew Fustini
2026-03-09 14:40 ` Luca Ceresoli
2026-01-29 2:39 ` [PATCH v7 7/8] riscv: dts: thead: lichee-pi-4a: enable HDMI Icenowy Zheng
2026-01-29 20:40 ` Drew Fustini
2026-03-09 14:40 ` Luca Ceresoli
2026-01-29 2:39 ` [PATCH v7 8/8] mailmap: map all Icenowy Zheng's mail addresses Icenowy Zheng
2026-02-05 9:30 ` [PATCH v7 0/8] Verisilicon DC8200 driver (and adaption to TH1520) Thomas Zimmermann
2026-02-05 9:31 ` Icenowy Zheng
2026-02-08 1:02 ` Drew Fustini
2026-02-09 8:03 ` Thomas Zimmermann
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=DGZ12YVFEPVZ.26EZEGK5DF6D1@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fustini@kernel.org \
--cc=gaohan@iscas.ac.cn \
--cc=guoren@kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lumag@kernel.org \
--cc=m.wilczynski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=p.zabel@pengutronix.de \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=wefu@redhat.com \
--cc=zhengxingda@iscas.ac.cn \
--cc=ziyao@disroot.org \
/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