<pre>
Hi, Hsiao-chien:
On Mon, 2023-09-18 at 16:42 +0800, Hsiao Chien Sung wrote:
> Support alpha blending by adding correct blend mode and
> alpha property in plane initialization.
>
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_drm_plane.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index db2f70ae060d..f87cf56fb846 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -301,6 +301,9 @@ int mtk_plane_init(struct drm_device *dev, struct
> drm_plane *plane,
> size_t num_formats)
> {
> int err;
> +u32 blend_mode = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
> + BIT(DRM_MODE_BLEND_PREMULTI) |
> + BIT(DRM_MODE_BLEND_COVERAGE);
>
> if (!formats || !num_formats) {
> DRM_ERROR("no formats for plane\n");
> @@ -323,6 +326,14 @@ int mtk_plane_init(struct drm_device *dev,
> struct drm_plane *plane,
> DRM_INFO("Create rotation property failed\n");
> }
>
> +err = drm_plane_create_alpha_property(plane);
> +if (err)
> +DRM_ERROR("failed to create property: alpha\n");
> +
> +err = drm_plane_create_blend_mode_property(plane, blend_mode);
> +if (err)
> +DRM_ERROR("failed to create property: blend_mode\n");
Do not always enable alpha function. Enable it depend on hardware
capability.
Regards,
CK
> +
> drm_plane_helper_add(plane, &mtk_plane_helper_funcs);
>
> return 0;
</pre><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->