From: Marek Vasut <marex@denx.de>
To: Liu Ying <victor.liu@oss.nxp.com>, dri-devel@lists.freedesktop.org
Cc: Peng Fan <peng.fan@nxp.com>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
robert.foss@linaro.org, Martyn Welch <martyn.welch@collabora.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Sam Ravnborg <sam@ravnborg.org>, Robby Cai <robby.cai@nxp.com>
Subject: Re: [PATCH v6 2/2] drm: lcdif: Add support for i.MX8MP LCDIF variant
Date: Thu, 30 Jun 2022 22:47:28 +0200 [thread overview]
Message-ID: <3ebb3f00-d17c-35b0-6214-66393221fa6f@denx.de> (raw)
In-Reply-To: <2179a7f82a45e5af836ca5bdf28f10cdbeecaf55.camel@oss.nxp.com>
On 6/30/22 10:30, Liu Ying wrote:
> Hi Marek,
Hi,
>> drivers/gpu/drm/Makefile | 2 +-
>> drivers/gpu/drm/mxsfb/Kconfig | 16 +
>> drivers/gpu/drm/mxsfb/Makefile | 2 +
>> drivers/gpu/drm/mxsfb/lcdif_drv.c | 341 ++++++++++++++++++++
>> drivers/gpu/drm/mxsfb/lcdif_drv.h | 44 +++
>> drivers/gpu/drm/mxsfb/lcdif_kms.c | 483 +++++++++++++++++++++++++++++
>> drivers/gpu/drm/mxsfb/lcdif_regs.h | 257 +++++++++++++++
>
> The mxsfb-drm driver is in the mxsfb directory as a successor of the
> legacy mxsfb fbdev driver. The fbdev driver is for i.MX23/28 lcdif.
That mxsfb-drm is also used on iMX8M{,M,N}
> So, in order to avoid confusion, maybe don't put the new lcdifv3 driver
> here. I would choose to create a new sub-directory in
> drivers/gpu/drm/imx and put it there. The full path can be
> drivers/gpu/drm/imx/lcdifv3, which matches the IP name(as called by
> design team).
It also matches the NXP downstream vendor kernel paths.
> If people don't like it because i.MX23 lcdif version
> register reads major version3, drivers/gpu/drm/imx/imx8mp-lcdif
It cannot, because this IP is also used in iMXRT.
> can be
> an alternative, though longer directory name. I tend to use lcdifv3
> since separate directory(imx vs mxsfb) hints totally different display
> controllers.
We've had this discussion about naming/placement before.
Placing the lcdif driver into mxsfb would allow code deduplication
between the two drivers, that's why it is in mxsfb directory.
>> 7 files changed, 1144 insertions(+), 1 deletion(-)
>> create mode 100644 drivers/gpu/drm/mxsfb/lcdif_drv.c
>> create mode 100644 drivers/gpu/drm/mxsfb/lcdif_drv.h
>> create mode 100644 drivers/gpu/drm/mxsfb/lcdif_kms.c
>> create mode 100644 drivers/gpu/drm/mxsfb/lcdif_regs.h
>>
>> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
>> index 13ef240b3d2b2..75b5ac7c2663c 100644
>> --- a/drivers/gpu/drm/Makefile
>> +++ b/drivers/gpu/drm/Makefile
>> @@ -130,7 +130,7 @@ obj-y += bridge/
>> obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
>> obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
>> obj-y += hisilicon/
>> -obj-$(CONFIG_DRM_MXSFB) += mxsfb/
>> +obj-y += mxsfb/
>> obj-y += tiny/
>> obj-$(CONFIG_DRM_PL111) += pl111/
>> obj-$(CONFIG_DRM_TVE200) += tve200/
>> diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
>> index 987170e16ebd6..873551b4552f5 100644
>> --- a/drivers/gpu/drm/mxsfb/Kconfig
>> +++ b/drivers/gpu/drm/mxsfb/Kconfig
>> @@ -19,3 +19,19 @@ config DRM_MXSFB
>> i.MX28, i.MX6SX, i.MX7 and i.MX8M).
>>
>> If M is selected the module will be called mxsfb.
>> +
>> +config DRM_IMX_LCDIF
>
> Perhaps, choose a less generic name here in case yet another new IP
> with similar name in future... Use DRM_IMX_LCDIFV3?
>
>> + tristate "i.MX LCDIFv3 LCD controller"
>> + depends on DRM && OF
>> + depends on COMMON_CLK
>> + select DRM_MXS
>> + select DRM_KMS_HELPER
>> + select DRM_GEM_CMA_HELPER
>> + select DRM_PANEL
>> + select DRM_PANEL_BRIDGE
>> + help
>> + Choose this option if you have an LCDIFv3 LCD controller.
>> + Those devices are found in various i.MX SoC (i.MX8MP,
>> + i.MXRT).
>> +
>> + If M is selected the module will be called imx-lcdif.
>
> Same here. Use imx-lcdifv3?
The mxsfb LCDIF also supports multiple versions of the LCDIF IP (v3, v4,
v6 at least). So calling a driver LCDIF v3 is about as confusing, since
you cannot tell whether it is the iMX23 LCDIF v3 or the iMXRT/iMX8MP
LCDIFv3 .
> Similar comment applies to the entire driver - less generic name.
[...]
>> +struct lcdif_drm_private {
>> + void __iomem *base; /* registers */
>> + struct clk *clk;
>> + struct clk *clk_axi;
>> + struct clk *clk_disp_axi;
>
> i.MX8mp RM mentions that clocks are pix_clk, apb_clk and b_clk.
> Why not use them?
That's only because the DT bindings are aligned between old and new LCDIF.
[...]
>> + switch (format) {
>> + case DRM_FORMAT_RGB565:
>> + writel(CTRLDESCL0_5_BPP_16_RGB565,
>> + lcdif->base + LCDC_V8_CTRLDESCL0_5);
>> + break;
>> + case DRM_FORMAT_RGB888:
>> + writel(CTRLDESCL0_5_BPP_24_RGB888,
>> + lcdif->base + LCDC_V8_CTRLDESCL0_5);
>> + break;
>> + case DRM_FORMAT_XRGB1555:
>
> DRM_FORMAT_ARGB1555?
Why would there be formats with Alpha channel here ?
Because of the (unsupported) overlay planes ?
>
>> + writel(CTRLDESCL0_5_BPP_32_ARGB8888,
>> + lcdif->base + LCDC_V8_CTRLDESCL0_5);
>> + break;
>> + default:
>> + dev_err(drm->dev, "Unknown pixel format 0x%x\n", format);
>> + break;
>> + }
>
> lcdif_set_formats() is called in lcdif_crtc_mode_set_nofb(), so no fb,
> which means the framebuffer pixel format should be set in plane
> callback.
Do you have iMXRT and are/or you able to test overlay planes with this
IP (the overlay planes which are currently not supported) ? Or is there
any other iMX which has overlay plane available ?
[...]
next prev parent reply other threads:[~2022-06-30 20:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 18:02 [PATCH v6 1/2] dt-bindings: lcdif: Add compatible for i.MX8MP Marek Vasut
2022-06-24 18:02 ` Marek Vasut
2022-06-24 18:02 ` [PATCH v6 2/2] drm: lcdif: Add support for i.MX8MP LCDIF variant Marek Vasut
2022-06-27 7:54 ` Peng Fan
2022-06-28 16:20 ` Lucas Stach
2022-06-30 8:30 ` Liu Ying
2022-06-30 20:47 ` Marek Vasut [this message]
2022-07-01 2:55 ` Liu Ying
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=3ebb3f00-d17c-35b0-6214-66393221fa6f@denx.de \
--to=marex@denx.de \
--cc=alexander.stein@ew.tq-group.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=martyn.welch@collabora.com \
--cc=peng.fan@nxp.com \
--cc=robby.cai@nxp.com \
--cc=robert.foss@linaro.org \
--cc=sam@ravnborg.org \
--cc=victor.liu@oss.nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.