linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "alpernebiyasak@gmail.com" <alpernebiyasak@gmail.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] drm/mediatek: ovl: Add fmt_support_man for MT8192 and MT8195
Date: Sun, 15 Sep 2024 14:56:02 +0000	[thread overview]
Message-ID: <dfe83cde23f263f4d791da093c5655f10d56577a.camel@mediatek.com> (raw)
In-Reply-To: <c8f8d556-77bf-4b60-abd9-bfcf7ac40ac5@gmail.com>

Hi Alper,

On Sun, 2024-09-15 at 13:54 +0300, Alper Nebi Yasak wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  Hi,
> 
> On 2024-09-14 23:18 +03:00, Jason-JH.Lin wrote:
> > OVL_CON_CLRFMT_MAN is an configuration for extending color format
> > settings of DISP_REG_OVL_CON(n).
> > It will change some of the original color format settings.
> > 
> > Take the settings of (3 << 12) for example.
> > - If OVL_CON_CLRFMT_MAN = 0 means OVL_CON_CLRFMT_RGBA8888.
> > - If OVL_CON_CLRFMT_MAN = 1 means OVL_CON_CLRFMT_PARGB8888.
> > 
> > Since OVL_CON_CLRFMT_MAN is not supported on previous SoCs,
> > It breaks the OVL color format setting of MT8173.
> > So add fmt_support_man to the driver data of MT8192 and MT8195
> > to solve the downgrade problem.
> > 
> > Fixes: a3f7f7ef4bfe ("drm/mediatek: Support "Pre-multiplied"
> blending in OVL")
> > Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 28 ++++++++++++++++++---
> ----
> >  1 file changed, 20 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > index 89b439dcf3a6..aa575569f996 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > @@ -70,10 +70,18 @@
> >  #define OVL_CON_CLRFMT_UYVY(4 << 12)
> >  #define OVL_CON_CLRFMT_YUYV(5 << 12)
> >  #define OVL_CON_MTX_YUV_TO_RGB(6 << 16)
> > -#define OVL_CON_CLRFMT_PARGB8888 ((3 << 12) | OVL_CON_CLRFMT_MAN)
> > -#define OVL_CON_CLRFMT_PABGR8888 (OVL_CON_CLRFMT_PARGB8888 |
> OVL_CON_RGB_SWAP)
> > -#define OVL_CON_CLRFMT_PBGRA8888 (OVL_CON_CLRFMT_PARGB8888 |
> OVL_CON_BYTE_SWAP)
> > -#define OVL_CON_CLRFMT_PRGBA8888 (OVL_CON_CLRFMT_PABGR8888 |
> OVL_CON_BYTE_SWAP)
> > +#define OVL_CON_CLRFMT_PARGB8888(ovl)((ovl)->data->fmt_support_man 
> ? \
> > +((3 << 12) | OVL_CON_CLRFMT_MAN) : \
> > +OVL_CON_CLRFMT_ABGR8888)
> 
> Should be OVL_CON_CLRFMT_ARGB8888 (*RGB* vs *BGR*)?
> 
> Otherwise I still see broken colors, but in blue instead of red.
> 

Yes, that was a typo. It should be original settings (ARGB8888).

> > +#define OVL_CON_CLRFMT_PABGR8888(ovl)((ovl)->data->fmt_support_man 
> ? \
> > +(OVL_CON_CLRFMT_PARGB8888 | OVL_CON_RGB_SWAP) : \
> 
> Compile error, likely (OVL_CON_CLRFMT_PARGB8888(ovl) | ...)?
> 

Yes, my mistake...

> > +OVL_CON_CLRFMT_ABGR8888)
> > +#define OVL_CON_CLRFMT_PBGRA8888(ovl)((ovl)->data->fmt_support_man 
> ? \
> > +(OVL_CON_CLRFMT_PARGB8888 | OVL_CON_BYTE_SWAP) : \
> 
> Same as above, OVL_CON_CLRFMT_PARGB8888(ovl)
> 
> > +OVL_CON_CLRFMT_BGRA8888)
> > +#define OVL_CON_CLRFMT_PRGBA8888(ovl)((ovl)->data->fmt_support_man 
> ? \
> > +(OVL_CON_CLRFMT_PABGR8888 | OVL_CON_BYTE_SWAP) : \
> 
> Same as above, OVL_CON_CLRFMT_PABGR8888(ovl)
> 
> > +OVL_CON_CLRFMT_RGBA8888)
> >  #define OVL_CON_CLRFMT_RGB565(ovl)((ovl)->data->fmt_rgb565_is_0 ?
> \
> >  0 : OVL_CON_CLRFMT_RGB)
> >  #define OVL_CON_CLRFMT_RGB888(ovl)((ovl)->data->fmt_rgb565_is_0 ?
> \
> 
> With those changes, colors are fine on my MT8173, MT8183, MT8186 
> Chromebooks.

Thanks for your verification.
I'll fix them and send v2 soon.

Regards,
Jason-JH.Lin


      reply	other threads:[~2024-09-15 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-14 20:18 [PATCH] drm/mediatek: ovl: Add fmt_support_man for MT8192 and MT8195 Jason-JH.Lin
2024-09-15 10:54 ` Alper Nebi Yasak
2024-09-15 14:56   ` Jason-JH Lin (林睿祥) [this message]

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=dfe83cde23f263f4d791da093c5655f10d56577a.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Shawn.Sung@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=alpernebiyasak@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).