All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Melissa Wen <mwen@igalia.com>,
	airlied@gmail.com, alexander.deucher@amd.com,
	christian.koenig@amd.com, daniels@collabora.com,
	harry.wentland@amd.com, leandro.ribeiro@collabora.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	pekka.paalanen@collabora.com, simona@ffwll.ch,
	siqueira@igalia.com, sunpeng.li@amd.com, tzimmermann@suse.de
Cc: Daniel Wheeler <Daniel.Wheeler@amd.com>,
	kernel-dev@igalia.com, Lyude Paul <lyude@redhat.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 2/3] drm/amd/display: fix missing blend-mode-prop warning for DCN
Date: Thu, 13 Aug 2026 11:49:38 -0600	[thread overview]
Message-ID: <bcbd2ce2-d668-4992-8ba9-8d20a0065b18@amd.com> (raw)
In-Reply-To: <20260813143605.106104-3-mwen@igalia.com>

I can confirm IGT's "kms_plane_alpha_blend --run-subtest alpha-basic" no 
longer fails with v3.

On 8/13/26 08:30, Melissa Wen wrote:
> validate_blend_mode_for_alpha_formats() warns when a plane supports
> formats with alpha but doesn't expose the blend mode property. Fix this
> by adding the same overlay plane blend modes to primary plane, since
> they are all universal planes in DCN-generation. Cursor planes support
> ARGB8888 format and CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA is set by
> default (other color formats are not implemented), so only expose
> support to PREMULTI, which is the default blend mode on DRM.
> 
> Fixes: 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")
> Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> 
> ---
> v3:
> - keep primary planes w/o alpha property
> - re-order if-conditions for readability
> ---
>   .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 21 ++++++++++++++++---
>   1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> index 1b564cfe2120..ab9bbe8ca333 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> @@ -1923,16 +1923,31 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
>   	if (res)
>   		return res;
>   
> -	if (plane->type == DRM_PLANE_TYPE_OVERLAY &&
> -	    plane_cap && plane_cap->per_pixel_alpha) {
> +	/* TODO: Check which blend modes are supported in DCE-generation
> +	 * planes, i.e. DC_PLANE_TYPE_DCE_RGB/UNDERLAY and expose blend mode
> +	 * property accordingly.
> +	 */
> +	if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
> +	     plane->type == DRM_PLANE_TYPE_PRIMARY) &&
> +	    plane_cap && plane_cap->per_pixel_alpha &&
> +	    plane_cap->type == DC_PLANE_TYPE_DCN_UNIVERSAL) {
>   		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
>   					  BIT(DRM_MODE_BLEND_PREMULTI) |
>   					  BIT(DRM_MODE_BLEND_COVERAGE);
>   
> -		drm_plane_create_alpha_property(plane);
>   		drm_plane_create_blend_mode_property(plane, blend_caps);
> +
> +		if (plane->type == DRM_PLANE_TYPE_OVERLAY)
> +			drm_plane_create_alpha_property(plane);
>   	}
>   
> +	/* Cursor color format is set to CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA
> +	 * by default, so only advertise DRM_MODE_BLEND_PREMULTI blend mode for
> +	 * this type of plane.
> +	 */
> +	if (plane->type == DRM_PLANE_TYPE_CURSOR)
> +		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PREMULTI));
> +
>   	if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
>   		/*
>   		 * Allow OVERLAY planes to be used as underlays by assigning an


  reply	other threads:[~2026-08-13 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 14:30 [PATCH v3 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning Melissa Wen
2026-08-13 14:30 ` [PATCH v3 1/3] drm/atomic-state-helper: set pixel_blend_mode to prop default on reset Melissa Wen
2026-08-13 14:30 ` [PATCH v3 2/3] drm/amd/display: fix missing blend-mode-prop warning for DCN Melissa Wen
2026-08-13 17:49   ` Alex Hung [this message]
2026-08-13 14:30 ` [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations Melissa Wen
2026-08-13 14:44   ` sashiko-bot
2026-08-13 15:04     ` Melissa Wen
2026-08-13 17:58 ` [PATCH v3 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning Wheeler, Daniel

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=bcbd2ce2-d668-4992-8ba9-8d20a0065b18@amd.com \
    --to=alex.hung@amd.com \
    --cc=Daniel.Wheeler@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=kernel-dev@igalia.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.