From: Maxime Ripard <maxime@cerno.tech>
To: Sui Jingfeng <15330273260@189.cn>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Lucas Stach <l.stach@pengutronix.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Roland Scheidegger <sroland@vmware.com>,
Zack Rusin <zackr@vmware.com>,
Christian Gmeiner <christian.gmeiner@gmail.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Rob Herring <robh+dt@kernel.org>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Krzysztof Kozlowski <krzk@kernel.org>,
Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>,
Sam Ravnborg <sam@ravnborg.org>,
suijingfeng <suijingfeng@loongson.cn>,
linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org,
Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v6 1/3] drm/lsdc: add drm driver for loongson display controller
Date: Wed, 9 Feb 2022 09:52:15 +0100 [thread overview]
Message-ID: <20220209085215.65qbdsgwtnvujdng@houat> (raw)
In-Reply-To: <57805e19-285a-76d3-16e3-09a3eb7a9540@189.cn>
[-- Attachment #1: Type: text/plain, Size: 3836 bytes --]
On Thu, Feb 03, 2022 at 11:47:16PM +0800, Sui Jingfeng wrote:
> On 2022/2/3 16:58, Maxime Ripard wrote:
> > > diff --git a/drivers/gpu/drm/lsdc/Kconfig b/drivers/gpu/drm/lsdc/Kconfig
> > > new file mode 100644
> > > index 000000000000..7ed1b0fdbe1b
> > > --- /dev/null
> > > +++ b/drivers/gpu/drm/lsdc/Kconfig
> > > @@ -0,0 +1,38 @@
> > > +config DRM_LSDC
> > > + tristate "DRM Support for loongson's display controller"
> > > + depends on DRM && PCI
> > > + depends on MACH_LOONGSON64 || LOONGARCH || MIPS || COMPILE_TEST
> > > + select OF
> > > + select CMA if HAVE_DMA_CONTIGUOUS
> > > + select DMA_CMA if HAVE_DMA_CONTIGUOUS
> > > + select DRM_KMS_HELPER
> > > + select DRM_KMS_FB_HELPER
> > > + select DRM_GEM_CMA_HELPER
> > > + select VIDEOMODE_HELPERS
> > > + select BACKLIGHT_PWM if CPU_LOONGSON2K
> > > + select I2C_GPIO if CPU_LOONGSON2K
> > > + select I2C_LS2X if CPU_LOONGSON2K
> > > + default m
> > > + help
> > > + This is a KMS driver for the display controller in the LS7A1000
> > > + bridge chip and LS2K1000 SoC. The display controller has two
> > > + display pipes and it is a PCI device.
> > > + When using this driver on LS2K1000/LS2K0500 SoC, its framebuffer
> > > + is located at system memory.
> > > + If "M" is selected, the module will be called lsdc.
> > > +
> > > + If in doubt, say "Y".
> > > +
> > > +config DRM_LSDC_VRAM_DRIVER
> > > + bool "vram helper based device driver support"
> > > + depends on DRM_LSDC
> > > + select DRM_VRAM_HELPER
> > > + default y
> > > + help
> > > + When using this driver on LS7A1000 + LS3A3000/LS3A4000/LS3A5000
> > > + platform, the LS7A1000 bridge chip has dedicated video RAM. Using
> > > + "lsdc.use_vram_helper=1" in the kernel command line will enable
> > > + this driver mode and then the framebuffer will be located at the
> > > + VRAM at the price of losing PRIME support.
> > > +
> > > + If in doubt, say "Y".
> > This doesn't sound right. The driver should make the proper decision
> > depending on the platform, not the user or the distribution.
>
> The LS7A1000 north bridge chip has dedicated video RAM, but the DC in LS7A1000
> can also scanout from the system memory directly like a display controller in a
> SoC does. In fact, this display controller is envolved from early product of
> Loongson 2H SoC. This driver still works even if the downstream PC board
> manufacturer doesn't solder a video RAM on the mother board.
>
> The lsdc_should_vram_helper_based() function in lsdc_drv.c will examine
> if the DC device node contain a use_vram_helper property at driver loading time.
> If there is no use_vram_helper property, CMA helper based DRM driver will be used.
> Doing this way allow the user using "lsdc.use_vram_helper=0" override the default
> behavior even through there is a "use_vram_helper;" property in the DTS.
>
> In short, It is intend to let the command line passed from kernel has higher
> priority than the device tree. Otherwise the end user can not switch different
> driver mode through the kernel command line once the DC device node contain
> "use_vram_helper;" property.
>
> This driver's author already made the decision by the time when the patch is
> sent out, even through this**may not proper.
>
> The CMA helper based driver will be used by default, if the DC device node contain
> "use_vram_helper;" then VRAM based driver will be used. This is my initial intention.
DT isn't really a solution either. Let's take the distribution
perspective there. Suppose you're a Fedora or Debian developer, and want
to make a single kernel image, and ship a DT to the user for their board
without any modification. How is either the Kconfig solution or DT flags
solution any good there? It doesn't help them at all.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2022-02-09 9:58 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 8:25 [PATCH v6 0/3] drm/lsdc: add drm driver for loongson display controller Sui Jingfeng
2022-02-03 8:25 ` [PATCH v6 2/3] dt-bindings: ls2k1000: add the display controller device node Sui Jingfeng
2022-02-03 8:50 ` Krzysztof Kozlowski
2022-02-16 14:01 ` Sui Jingfeng
2022-02-17 8:38 ` Krzysztof Kozlowski
2022-02-03 8:25 ` [PATCH v6 3/3] dt-bindings: mips: loongson: introduce board specific dts Sui Jingfeng
2022-02-03 8:49 ` Krzysztof Kozlowski
[not found] ` <20220203082546.3099-2-15330273260@189.cn>
2022-02-03 8:53 ` [PATCH v6 1/3] drm/lsdc: add drm driver for loongson display controller Krzysztof Kozlowski
2022-02-03 11:07 ` Dan Carpenter
2022-02-03 11:29 ` Krzysztof Kozlowski
2022-02-03 13:34 ` Dan Carpenter
[not found] ` <20220203085851.yqstkfgt4dz7rcnw@houat>
2022-02-03 15:47 ` Sui Jingfeng
2022-02-09 8:52 ` Maxime Ripard [this message]
2022-02-09 11:56 ` Jiaxun Yang
2022-02-09 14:04 ` Maxime Ripard
2022-02-09 14:14 ` Jiaxun Yang
2023-02-03 3:25 ` suijingfeng
2022-02-03 16:04 ` Sui Jingfeng
2022-02-09 8:49 ` Maxime Ripard
2022-02-09 14:38 ` Sui Jingfeng
2022-02-09 16:16 ` Maxime Ripard
2022-02-12 18:11 ` Sui Jingfeng
2022-02-16 14:08 ` Maxime Ripard
2022-02-12 20:52 ` Ilia Mirkin
2022-02-16 13:34 ` Sui Jingfeng
2022-02-16 14:11 ` Maxime Ripard
2022-02-03 16:29 ` Sui Jingfeng
2022-02-09 8:43 ` Maxime Ripard
2022-02-09 15:41 ` Sui Jingfeng
2022-02-09 16:19 ` Maxime Ripard
2022-02-16 13:46 ` Daniel Stone
2022-02-16 14:13 ` Sui Jingfeng
2022-02-16 14:43 ` Daniel Stone
2022-02-03 16:41 ` Sui Jingfeng
2022-02-09 8:36 ` Maxime Ripard
2023-02-02 2:58 ` suijingfeng
2022-02-09 12:00 ` [PATCH v6 0/3] " Jiaxun Yang
2022-02-10 4:04 ` Sui Jingfeng
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=20220209085215.65qbdsgwtnvujdng@houat \
--to=maxime@cerno.tech \
--cc=15330273260@189.cn \
--cc=airlied@linux.ie \
--cc=andrey.zhizhikin@leica-geosystems.com \
--cc=christian.gmeiner@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=krzk@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--cc=sroland@vmware.com \
--cc=suijingfeng@loongson.cn \
--cc=tsbogend@alpha.franken.de \
--cc=zackr@vmware.com \
/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