[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6a7c50b3d2692b02b610a881cb70bf562861522.camel@icenowy.me>
Date: Fri, 15 Aug 2025 17:07:44 +0800
From: Icenowy Zheng <uwu@...nowy.me>
To: Philipp Zabel <p.zabel@...gutronix.de>, Maarten Lankhorst
<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Drew
Fustini <fustini@...nel.org>, Guo Ren <guoren@...nel.org>, Fu Wei
<wefu@...hat.com>, Heiko Stuebner <heiko@...ech.de>, Andrzej Hajda
<andrzej.hajda@...el.com>, Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>, Laurent Pinchart
<Laurent.pinchart@...asonboard.com>, Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>, Michal Wilczynski
<m.wilczynski@...sung.com>
Cc: Han Gao <rabenda.cn@...il.com>, Yao Zi <ziyao@...root.org>,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [RFC PATCH 3/8] drm: verisilicon: add a driver for Verisilicon
display controllers
在 2025-08-15星期五的 11:05 +0200,Philipp Zabel写道:
> On Fr, 2025-08-15 at 00:40 +0800, Icenowy Zheng wrote:
> > This is a from-scratch driver targeting Verisilicon DC-series
> > display
> > controllers, which feature self-identification functionality like
> > their
> > GC-series GPUs.
> >
> > Only DC8200 is being supported now, and only the main framebuffer
> > is set
> > up (as the DRM primary plane). Support for more DC models and more
> > features is my further targets.
> >
> > As the display controller is delivered to SoC vendors as a whole
> > part,
> > this driver does not use component framework and extra bridges
> > inside a
> > SoC is expected to be implemented as dedicated bridges (this driver
> > properly supports bridge chaining).
> >
> > Signed-off-by: Icenowy Zheng <uwu@...nowy.me>
> > ---
> > drivers/gpu/drm/Kconfig | 2 +
> > drivers/gpu/drm/Makefile | 1 +
> > drivers/gpu/drm/verisilicon/Kconfig | 15 +
> > drivers/gpu/drm/verisilicon/Makefile | 5 +
> > drivers/gpu/drm/verisilicon/vs_bridge.c | 330
> > ++++++++++++++++++
> > drivers/gpu/drm/verisilicon/vs_bridge.h | 40 +++
> > drivers/gpu/drm/verisilicon/vs_bridge_regs.h | 47 +++
> > drivers/gpu/drm/verisilicon/vs_crtc.c | 217 ++++++++++++
> > drivers/gpu/drm/verisilicon/vs_crtc.h | 29 ++
> > drivers/gpu/drm/verisilicon/vs_crtc_regs.h | 60 ++++
> > drivers/gpu/drm/verisilicon/vs_dc.c | 233 +++++++++++++
> > drivers/gpu/drm/verisilicon/vs_dc.h | 39 +++
> > drivers/gpu/drm/verisilicon/vs_dc_top_regs.h | 27 ++
> > drivers/gpu/drm/verisilicon/vs_drm.c | 177 ++++++++++
> > drivers/gpu/drm/verisilicon/vs_drm.h | 29 ++
> > drivers/gpu/drm/verisilicon/vs_hwdb.c | 150 ++++++++
> > drivers/gpu/drm/verisilicon/vs_hwdb.h | 29 ++
> > drivers/gpu/drm/verisilicon/vs_plane.c | 102 ++++++
> > drivers/gpu/drm/verisilicon/vs_plane.h | 68 ++++
> > .../gpu/drm/verisilicon/vs_primary_plane.c | 166 +++++++++
> > .../drm/verisilicon/vs_primary_plane_regs.h | 53 +++
> > 21 files changed, 1819 insertions(+)
> > create mode 100644 drivers/gpu/drm/verisilicon/Kconfig
> > create mode 100644 drivers/gpu/drm/verisilicon/Makefile
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_bridge.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_bridge.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_bridge_regs.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_crtc.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_crtc.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_crtc_regs.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_dc.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_dc.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_dc_top_regs.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_drm.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_drm.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_hwdb.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_hwdb.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_plane.c
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_plane.h
> > create mode 100644 drivers/gpu/drm/verisilicon/vs_primary_plane.c
> > create mode 100644
> > drivers/gpu/drm/verisilicon/vs_primary_plane_regs.h
> >
> [...]
> > diff --git a/drivers/gpu/drm/verisilicon/vs_dc.c
> > b/drivers/gpu/drm/verisilicon/vs_dc.c
> > new file mode 100644
> > index 0000000000000..98384559568c4
> > --- /dev/null
> > +++ b/drivers/gpu/drm/verisilicon/vs_dc.c
> > @@ -0,0 +1,233 @@
> [...]
> > +static int vs_dc_probe(struct platform_device *pdev)
> > +{
> > + struct device *dev = &pdev->dev;
> > + struct vs_dc *dc;
> > + void __iomem *regs;
> > + unsigned int outputs, i;
> > + /* pix0/pix1 */
> > + char pixclk_name[5];
> > + int irq, ret;
> > +
> > + if (!dev->of_node) {
> > + dev_err(dev, "can't find DC devices\n");
> > + return -ENODEV;
> > + }
> > +
> > + outputs = of_graph_get_port_count(dev->of_node);
> > + if (!outputs) {
> > + dev_err(dev, "can't find DC downstream ports\n");
> > + return -ENODEV;
> > + }
> > + if (outputs > VSDC_MAX_OUTPUTS) {
> > + dev_err(dev, "too many DC downstream ports than
> > possible\n");
> > + return -EINVAL;
> > + }
> > +
> > + ret = dma_set_mask_and_coherent(&pdev->dev,
> > DMA_BIT_MASK(32));
> > + if (ret) {
> > + dev_err(dev, "No suitable DMA available\n");
> > + return ret;
> > + }
> > +
> > + dc = devm_kzalloc(dev, sizeof(*dc), GFP_KERNEL);
> > + if (!dc)
> > + return -ENOMEM;
> > +
> > + dc->outputs = outputs;
> > +
> > + dc->rsts[0].id = "core";
> > + dc->rsts[1].id = "axi";
> > + dc->rsts[0].id = "ahb";
>
> I assume this should be:
>
> dc->rsts[2].id = "ahb";
Sure.
>
> > +
> > + ret = devm_reset_control_bulk_get_optional_shared(dev,
> > VSDC_RESET_COUNT,
> > + dc-
> > >rsts);
> > + if (ret) {
> > + dev_err(dev, "can't get reset lines\n");
>
> Consider using dev_err_probe().
Sounds reasonable.
Thanks,
Icenowy
>
> > + return ret;
> > + }
> [...]
>
> regards
> Philipp
Powered by blists - more mailing lists