diff options
author | Hsiao Chien Sung <[email protected]> | 2024-07-17 13:24:45 +0800 |
---|---|---|
committer | Chun-Kuang Hu <[email protected]> | 2024-07-31 13:28:57 +0000 |
commit | 4225d5d5e779b859a6661130a3444eb4c5db77e5 (patch) | |
tree | 9ae6892de718b8d4d95199650110d0846ce7fdd8 /drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | |
parent | 59e9d9de25f046b48ae7c2756e1a3f32166d6635 (diff) |
drm/mediatek: Support alpha blending in display driver
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.
Reviewed-by: CK Hu <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Hsiao Chien Sung <[email protected]>
Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/
Signed-off-by: Chun-Kuang Hu <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c')
0 files changed, 0 insertions, 0 deletions