[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <df7472540cd546ed9ee0c2fb3e10c666b442a68e.camel@mediatek.com>
Date: Thu, 16 Jan 2025 01:45:33 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org"
<krzk+dt@...nel.org>, Paul-pl Chen (陳柏霖)
<Paul-pl.Chen@...iatek.com>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"treapking@...omium.org" <treapking@...omium.org>,
Singo Chang (張興國) <Singo.Chang@...iatek.com>,
Project_Global_Chrome_Upstream_Group
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>,
Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
Xiandong Wang (王先冬)
<Xiandong.Wang@...iatek.com>, "linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Sunny Shen (沈姍姍) <Sunny.Shen@...iatek.com>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
Sirius Wang (王皓昱) <Sirius.Wang@...iatek.com>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 08/12] drm/mediatek: add EXDMA support for MT8196
Hi, Paul:
On Fri, 2025-01-10 at 20:34 +0800,paul-pl.chen wrote:
>
> > From: "Nancy.Lin" <nancy.lin@...iatek.com>
>
> >
>
> > EXDMA is a DMA engine for reading data from DRAM with
>
> > various DRAM footprints and data formats. For input
>
> > sources in certain color formats and color domains,
>
> > EXDMA also includes a color transfer function to
>
> > process pixels into a consistent color domain.
>
> >
>
> > Signed-off-by: Nancy.Lin <nancy.lin@...iatek.com>
>
> > Signed-off-by: Paul-pl.Chen <paul-pl.chen@...iatek.com>
>
> > ---
>
>
>
> [snip]
>
>
>
> > +#define DISP_REG_OVL_L0_CLRFMT 0x050
>
> > +#define OVL_CON_FLD_CLRFMT GENMASK(3, 0)
>
> > +#define OVL_CON_CLRFMT_MAN BIT(4)
>
> > +#define OVL_CON_FLD_CLRFMT_NB GENMASK(9, 8)
>
> > +#define OVL_CON_CLRFMT_NB_10_BIT BIT(8)
>
> > +#define OVL_CON_BYTE_SWAP BIT(16)
>
> > +#define OVL_CON_RGB_SWAP BIT(17)
>
> > +#define OVL_CON_CLRFMT_RGB565 0x000
>
> > +#define OVL_CON_CLRFMT_BGR888 0x001
>
> > +#define OVL_CON_CLRFMT_BGRA8888 0x002
>
> > +#define OVL_CON_CLRFMT_ABGRB8888 0x003
>
> > +#define OVL_CON_CLRFMT_UYVY 0x004
>
> > +#define OVL_CON_CLRFMT_YUYV 0x005
>
> > +#define OVL_CON_CLRFMT_BGR565 (0x000 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_RGB888 (0x001 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_RGBA8888 (0x002 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_ARGB8888 (0x003 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_VYUY (0x004 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_YVYU (0x005 | OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_PBGRA8888 (0x003 | OVL_CON_CLRFMT_MAN)
>
> > +#define OVL_CON_CLRFMT_PARGB8888 (OVL_CON_CLRFMT_PBGRA8888 | \
>
> > + OVL_CON_BYTE_SWAP)
>
> > +#define OVL_CON_CLRFMT_PRGBA8888 (OVL_CON_CLRFMT_PBGRA8888 | \
>
> > + OVL_CON_RGB_SWAP)
>
> > +#define OVL_CON_CLRFMT_PABGR8888 (OVL_CON_CLRFMT_PBGRA8888 | \
>
> > + OVL_CON_RGB_SWAP | \
>
> > + OVL_CON_BYTE_SWAP)
>
>
>
> The color format definition is identical with ovl driver. Try to merge them.
>
>
>
> > +#define DISP_REG_OVL_RDMA0_CTRL 0x100
>
> > +#define DISP_RDMA0_EN BIT(0)
>
> > +#define DISP_REG_OVL_RDMA_BURST_CON1 0x1f4
>
> > +#define DISP_RDMA_BURST_CON1_BURST16_EN BIT(28)
>
> > +#define DISP_RDMA_BURST_CON1_DDR_EN BIT(30)
>
> > +#define DISP_RDMA_BURST_CON1_DDR_ACK_EN BIT(31)
>
> > +#define DISP_REG_OVL_DUMMY_REG 0x200
>
> > +#define DISP_OVL_EXT_DDR_EN_OPT BIT(2)
>
> > +#define DISP_OVL_FORCE_EXT_DDR_EN BIT(3)
>
> > +#define DISP_REG_OVL_GDRDY_PRD 0x208
>
>
>
> [snip]
>
>
>
> > +
>
> > +static const u32 formats[] = {
>
>
>
> This array is identical with mt8195_formats[], try to merge them.
>
>
>
> > + DRM_FORMAT_XRGB8888,
>
> > + DRM_FORMAT_ARGB8888,
>
> > + DRM_FORMAT_BGRX8888,
>
> > + DRM_FORMAT_BGRA8888,
>
> > + DRM_FORMAT_ABGR8888,
>
> > + DRM_FORMAT_XBGR8888,
>
> > + DRM_FORMAT_RGBX8888,
>
> > + DRM_FORMAT_RGBA8888,
>
> > + DRM_FORMAT_RGB888,
>
> > + DRM_FORMAT_BGR888,
>
> > + DRM_FORMAT_RGB565,
>
> > + DRM_FORMAT_UYVY,
>
> > + DRM_FORMAT_YUYV,
>
> > + DRM_FORMAT_XRGB2101010,
>
> > + DRM_FORMAT_ARGB2101010,
>
> > + DRM_FORMAT_RGBX1010102,
>
> > + DRM_FORMAT_RGBA1010102,
>
> > + DRM_FORMAT_XBGR2101010,
>
> > + DRM_FORMAT_ABGR2101010,
>
> > + DRM_FORMAT_BGRX1010102,
>
> > + DRM_FORMAT_BGRA1010102,
>
> > +};
>
> > +
>
>
>
> [snip]
>
>
>
> > +
>
> > +static unsigned int mtk_disp_exdma_fmt_convert(unsigned int fmt, unsigned int blend_mode)
>
>
>
> This function is almost the same as mtk_ovl_fmt_convert(), try to merge them.
>
>
>
> Regards,
>
> CK
>
>
>
> > +{
>
> > + /*
>
> > + * DRM_FORMAT: bit 32->0, OVL_FMT: bit 0->32,
>
> > + * so DRM_FORMAT_RGB888 = OVL_CON_CLRFMT_BGR888
>
> > + */
>
> > + switch (fmt) {
>
> > + default:
>
> > + case DRM_FORMAT_BGR565:
>
> > + return OVL_CON_CLRFMT_RGB565;
>
> > + case DRM_FORMAT_RGB565:
>
> > + return OVL_CON_CLRFMT_BGR565;
>
> > + case DRM_FORMAT_RGB888:
>
> > + return OVL_CON_CLRFMT_BGR888;
>
> > + case DRM_FORMAT_BGR888:
>
> > + return OVL_CON_CLRFMT_RGB888;
>
> > + case DRM_FORMAT_RGBX8888:
>
> > + case DRM_FORMAT_RGBA8888:
>
> > + case DRM_FORMAT_RGBA1010102:
>
> > + case DRM_FORMAT_RGBX1010102:
>
> > + return ((blend_mode == DRM_MODE_BLEND_PREMULTI) ?
>
> > + OVL_CON_CLRFMT_PABGR8888 : OVL_CON_CLRFMT_ABGRB8888) |
>
> > + (is_10bit_rgb(fmt) ? OVL_CON_CLRFMT_NB_10_BIT : 0);
>
> > + case DRM_FORMAT_BGRX8888:
>
> > + case DRM_FORMAT_BGRA8888:
>
> > + case DRM_FORMAT_BGRA1010102:
>
> > + case DRM_FORMAT_BGRX1010102:
>
> > + return ((blend_mode == DRM_MODE_BLEND_PREMULTI) ?
>
> > + OVL_CON_CLRFMT_PARGB8888 : OVL_CON_CLRFMT_ARGB8888) |
>
> > + (is_10bit_rgb(fmt) ? OVL_CON_CLRFMT_NB_10_BIT : 0);
>
> > + case DRM_FORMAT_XRGB8888:
>
> > + case DRM_FORMAT_ARGB8888:
>
> > + case DRM_FORMAT_ARGB2101010:
>
> > + case DRM_FORMAT_XRGB2101010:
>
> > + return ((blend_mode == DRM_MODE_BLEND_PREMULTI) ?
>
> > + OVL_CON_CLRFMT_PBGRA8888 : OVL_CON_CLRFMT_BGRA8888) |
>
> > + (is_10bit_rgb(fmt) ? OVL_CON_CLRFMT_NB_10_BIT : 0);
>
> > + case DRM_FORMAT_XBGR8888:
>
> > + case DRM_FORMAT_ABGR8888:
>
> > + case DRM_FORMAT_ABGR2101010:
>
> > + case DRM_FORMAT_XBGR2101010:
>
> > + return ((blend_mode == DRM_MODE_BLEND_PREMULTI) ?
>
> > + OVL_CON_CLRFMT_PRGBA8888 : OVL_CON_CLRFMT_RGBA8888) |
>
> > + (is_10bit_rgb(fmt) ? OVL_CON_CLRFMT_NB_10_BIT : 0);
>
> > + case DRM_FORMAT_UYVY:
>
> > + return OVL_CON_CLRFMT_UYVY;
>
> > + case DRM_FORMAT_YUYV:
>
> > + return OVL_CON_CLRFMT_YUYV;
>
> > + }
>
> > +}
>
> > +
>
Powered by blists - more mailing lists