From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
"airlied@gmail.com" <airlied@gmail.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/5] drm/mediatek: Support "None" blending in Mixer
Date: Mon, 1 Jul 2024 03:10:11 +0000 [thread overview]
Message-ID: <2bcb715c19c8445746a00bcd4b633ceb42c286a1.camel@mediatek.com> (raw)
In-Reply-To: <20240620-blend-v1-2-72670072ca20@mediatek.com>
Hi, Shawn:
On Thu, 2024-06-20 at 01:27 +0800, Hsiao Chien Sung via B4 Relay wrote:
>
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> From: Hsiao Chien Sung <shawn.sung@mediatek.com>
>
> Support "None" alpha blending mode on MediaTek's chips.
>
> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_ethdr.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> index 36021cb8df62..48b714994492 100644
> --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c
> +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c
> @@ -3,6 +3,7 @@
> * Copyright (c) 2021 MediaTek Inc.
> */
>
> +#include <drm/drm_blend.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_framebuffer.h>
> #include <linux/clk.h>
> @@ -35,6 +36,7 @@
> #define MIX_SRC_L0_ENBIT(0)
> #define MIX_L_SRC_CON(n)(0x28 + 0x18 * (n))
> #define NON_PREMULTI_SOURCE(2 << 12)
> +#define PREMULTI_SOURCE(3 << 12)
> #define MIX_L_SRC_SIZE(n)(0x30 + 0x18 * (n))
> #define MIX_L_SRC_OFFSET(n)(0x34 + 0x18 * (n))
> #define MIX_FUNC_DCM00x120
> @@ -175,7 +177,13 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
> alpha_con |= state->base.alpha & MIXER_ALPHA;
> }
>
> -if (state->base.fb && !state->base.fb->format->has_alpha) {
> +if (state->base.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE)
> +alpha_con |= PREMULTI_SOURCE;
To support DRM_MODE_BLEND_PIXEL_NONE, I think ignore pixel alpha is enough. Why need this setting?
Regards,
CK
> +else
> +alpha_con |= NON_PREMULTI_SOURCE;
> +
> +if ((state->base.fb && !state->base.fb->format->has_alpha) ||
> + state->base.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> /*
> * Mixer doesn't support CONST_BLD mode,
> * use a trick to make the output equivalent
> @@ -191,8 +199,7 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx,
> mtk_ddp_write(cmdq_pkt, pending->height << 16 | align_width, &mixer->cmdq_base,
> mixer->regs, MIX_L_SRC_SIZE(idx));
> mtk_ddp_write(cmdq_pkt, offset, &mixer->cmdq_base, mixer->regs, MIX_L_SRC_OFFSET(idx));
> -mtk_ddp_write_mask(cmdq_pkt, alpha_con, &mixer->cmdq_base, mixer->regs, MIX_L_SRC_CON(idx),
> - 0x1ff);
> +mtk_ddp_write(cmdq_pkt, alpha_con, &mixer->cmdq_base, mixer->regs, MIX_L_SRC_CON(idx));
> mtk_ddp_write_mask(cmdq_pkt, BIT(idx), &mixer->cmdq_base, mixer->regs, MIX_SRC_CON,
> BIT(idx));
> }
>
> --
> Git-146)
>
>
>
next prev parent reply other threads:[~2024-07-01 3:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 17:27 [PATCH 0/5] Support alpha blending in MTK display driver Hsiao Chien Sung via B4 Relay
2024-06-19 17:27 ` [PATCH 1/5] drm/mediatek: Support "None" blending in OVL Hsiao Chien Sung via B4 Relay
2024-06-19 17:27 ` [PATCH 2/5] drm/mediatek: Support "None" blending in Mixer Hsiao Chien Sung via B4 Relay
2024-07-01 2:22 ` CK Hu (胡俊光)
2024-07-04 1:43 ` Shawn Sung (宋孝謙)
2024-07-05 9:36 ` CK Hu (胡俊光)
2024-07-01 3:10 ` CK Hu (胡俊光) [this message]
2024-07-04 1:35 ` Shawn Sung (宋孝謙)
2024-07-05 9:49 ` CK Hu (胡俊光)
2024-06-19 17:27 ` [PATCH 3/5] drm/mediatek: Support "Pre-multiplied" blending in OVL Hsiao Chien Sung via B4 Relay
2024-07-01 2:35 ` CK Hu (胡俊光)
2024-06-19 17:27 ` [PATCH 4/5] drm/mediatek: Support "Pre-multiplied" blending in Mixer Hsiao Chien Sung via B4 Relay
2024-06-19 17:27 ` [PATCH 5/5] drm/mediatek: Support alpha blending in display driver Hsiao Chien Sung via B4 Relay
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=2bcb715c19c8445746a00bcd4b633ceb42c286a1.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Shawn.Sung@mediatek.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--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 \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
/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
all inboxes | Powered by JetHome®