AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Melissa Wen <mwen@igalia.com>
To: 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: "Alex Hung" <alex.hung@amd.com>,
	"Daniel Wheeler" <Daniel.Wheeler@amd.com>,
	kernel-dev@igalia.com, "Lyude Paul" <lyude@redhat.com>,
	"Viktor Jägersküpper" <viktor_jaegerskuepper@freenet.de>,
	"Timur Kristóf" <timur.kristof@gmail.com>,
	"Mikhail Gavrilov" <mikhail.v.gavrilov@gmail.com>,
	"Xaver Hugl" <xaver.hugl@gmail.com>,
	"Dan Wheeler" <daniel.wheeler@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH v4 1/3] drm/atomic-state-helper: set pixel_blend_mode to prop default on reset
Date: Wed, 26 Aug 2026 12:37:05 +0200	[thread overview]
Message-ID: <20260826104143.39077-2-mwen@igalia.com> (raw)
In-Reply-To: <20260826104143.39077-1-mwen@igalia.com>

In __drm_atomic_helper_plane_state_init(), pixel_blend_mode is always
reset to DRM_MODE_BLEND_PREMULTI. That was consistent while
drm_plane_create_blend_mode_property() required PREMULTI in the
supported modes, but it now falls back to COVERAGE or PIXEL_NONE when
the driver doesn't support PREMULTI. The hardcoded default may therefore
not be a blend mode the hardware can do, nor one the property
advertises.

Initialize pixel_blend_mode from the blend mode property default
instead, keeping DRM_MODE_BLEND_PREMULTI for planes without the
property.

Fixes: 9813e158d13d ("drm/drm_blend: allow blend mode property without PREMULTI")
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
---
 drivers/gpu/drm/drm_atomic_state_helper.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
index d90d1d7c9cf9..a2ef272e9f27 100644
--- a/drivers/gpu/drm/drm_atomic_state_helper.c
+++ b/drivers/gpu/drm/drm_atomic_state_helper.c
@@ -278,7 +278,14 @@ void __drm_atomic_helper_plane_state_init(struct drm_plane_state *plane_state,
 	plane_state->rotation = DRM_MODE_ROTATE_0;
 
 	plane_state->alpha = DRM_BLEND_ALPHA_OPAQUE;
+
 	plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI;
+	if (plane->blend_mode_property) {
+		if (!drm_object_property_get_default_value(&plane->base,
+							   plane->blend_mode_property,
+							   &val))
+			plane_state->pixel_blend_mode = val;
+	}
 
 	if (plane->color_encoding_property) {
 		if (!drm_object_property_get_default_value(&plane->base,
-- 
2.53.0


  reply	other threads:[~2026-08-26 10:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26 10:37 [PATCH v4 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning Melissa Wen
2026-08-26 10:37 ` Melissa Wen [this message]
2026-08-26 10:37 ` [PATCH v4 2/3] drm/amd/display: fix missing blend-mode-prop warning for DCN Melissa Wen
2026-08-26 10:37 ` [PATCH v4 3/3] drm/amd/display: advertise PIXEL_NONE and PREMULTI blend mode for DCE Melissa Wen
2026-08-26 10:47   ` Melissa Wen
2026-08-26 17:08   ` Alex Hung
2026-08-26 16:49 ` [PATCH v4 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning Timur Kristóf
2026-08-27 17:17   ` Melissa Wen
2026-08-27 13:34 ` Alex Deucher
2026-08-27 16:37   ` Melissa Wen
2026-08-27 17:14     ` Melissa Wen
2026-08-28  7:22       ` Thorsten Leemhuis
2026-08-28 12:19         ` Viktor Jägersküpper
2026-09-01  7:12           ` Thorsten Leemhuis
2026-09-02 18:58             ` Melissa Wen
2026-09-03  4:59               ` Greg KH

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=20260826104143.39077-2-mwen@igalia.com \
    --to=mwen@igalia.com \
    --cc=Daniel.Wheeler@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.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=mikhail.v.gavrilov@gmail.com \
    --cc=mripard@kernel.org \
    --cc=pekka.paalanen@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=timur.kristof@gmail.com \
    --cc=tzimmermann@suse.de \
    --cc=viktor_jaegerskuepper@freenet.de \
    --cc=xaver.hugl@gmail.com \
    /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