[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96cbca68-052f-42dd-a410-da9061d54c06@collabora.com>
Date: Thu, 15 Feb 2024 11:46:21 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Hsiao Chien Sung <shawn.sung@...iatek.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, Matthias Brugger <matthias.bgg@...il.com>,
Bibby Hsieh <bibby.hsieh@...iatek.com>, CK Hu <ck.hu@...iatek.com>,
Sean Paul <seanpaul@...omium.org>, Fei Shao <fshao@...omium.org>,
Jason Chen <jason-ch.chen@...iatek.corp-partner.google.com>,
"Nancy . Lin" <nancy.lin@...iatek.com>, dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 07/13] drm/mediatek: Support alpha blending in display
driver
Il 15/02/24 11:11, Hsiao Chien Sung ha scritto:
> Support "Pre-multiplied" and "None" blend mode on MediaTek's chips by
> adding correct blend mode property when the planes init.
> Before this patch, only the "Coverage" mode (default) is supported.
>
> For more information, there are three pixel blend modes in DRM driver:
> "None", "Pre-multiplied", and "Coverage".
>
> To understand the difference between these modes, let's take a look at
> the following two approaches to do alpha blending:
>
> 1. Straight:
> dst.RGB = src.RGB * src.A + dst.RGB * (1 - src.A)
> This is straightforward and easy to understand, when the source layer is
> compositing with the destination layer, it's alpha will affect the
> result. This is also known as "post-multiplied", or "Coverage" mode.
>
> 2. Pre-multiplied:
> dst.RGB = src.RGB + dst.RGB * (1 - src.A)
> Since the source RGB have already multiplied its alpha, only destination
> RGB need to multiply it. This is the "Pre-multiplied" mode in DRM.
>
> For the "None" blend mode in DRM, it means the pixel alpha is ignored
> when compositing the layers, only the constant alpha for the composited
> layer will take effects.
>
> Signed-off-by: Hsiao Chien Sung <shawn.sung@...iatek.com>
> Reviewed-by: CK Hu <ck.hu@...iatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Powered by blists - more mailing lists