Skip to contentSkip to conversation

drm/atomic-state-helper: fixes for blend-mode-prop warning

PATCH Superseded Melissa Wen 7 participants 18 messages Aug 13 – Aug 26

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover drm/atomic-state-helper: fixes for blend-mode-prop warning

PREMULTI was the default DRM blend mode until 9813e158d13d ("drm/drm_blend: allow blend mode property without PREMULTI") introduced the possibility of exposing the blend mode property without PREMULTI being supported. However, __drm_atomic_helper_plane_state_init() still resets pixel_blend_mode to PREMULTI (hardcoded), ignoring the supported mode in this property. In the same series, 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") starts warning drivers that supports alpha formats in a given planes but doesn't support blend mode property, which includes AMD primary and cursor planes.

For AMD DCN families, overlay and primary planes support the three blend modes, and therefore PREMULTI is still the default mode. So the warning can be fixed by just creating blend mode properties for primary planes too. PREMULTI is the default/unique mode for cursor planes in DCN and DCE driver. However, looks like PIXEL_NONE is the unique blend mode supported by DCE-generation driver. I don't have the hardware to check it out, but looking at the code I understand that, even if the hardware can do PREMULTI or COVERAGE, the way it programs registers doesn't make these other blend modes actually available.

Bearing this in mind, this series is organized as follow:

- Patch 1 fixes the pixel_blend_mode reset when the blend mode property is advertised without PREMULTI support. It's needed for AMD DCE-generation (patch 3) and I think with this we can also remove a workaround in nouveau nv50_wndw_default_state() caused by the hardcoded PREMULTI default value [1].

- Patch 2 fixes the missing-blend-mode-property warning for DCN primary plane and for DCN+DCE cursor plane. The alpha property keeps only on overlay planes because looks like this is not supported by AMD primary planes and it doesn't affect the blend mode warning we are targetting. Enabling alpha properties to primary was also causing -EINVAL on IGT alpha tests because it started testing primary planes and disabling it (which is not allowed by the AMD display driver).

- Patch 3 fixes the warning for DCE primary plane, but I detached this solution from the previous patch because I don't have hardware to validate if my assumption about PIXEL_NONE-only is correct.

[1] https://lore.kernel.org/dri-devel/[email protected]/

[v1]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- new patch for pixel_blend_mode default value other than PREMULTI.
- remove DCE11 which supports per_pixel_alpha but doesn't support DCN_UNIVERSAL_PLANE.
- new patch for the primary plane blend mode on DCE-generations

[v2]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- keep alpha property only for overlay planes (looks like primary plane doesn't actually support it) - alpha prop in primary planes causes IGT test failures with RX 7900 XT on a 4k60 HP U27 as reported by Daniel Wheeler.
- improve readability of if conditions (Alex H)
- add Leandro's r-b tags.

Best Regards,

Melissa

Melissa Wen (3):
drm/atomic-state-helper: set pixel_blend_mode to prop default on reset drm/amd/display: fix missing blend-mode-prop warning for DCN drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 25 ++++++++++++++++---
 drivers/gpu/drm/drm_atomic_state_helper.c     |  7 ++++++
 2 files changed, 29 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH v3 1/3 drm/atomic-state-helper: set pixel_blend_mode to prop default on reset

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")
---
 drivers/gpu/drm/drm_atomic_state_helper.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/drm_atomic_state_helper.c +7 -0
index d90d1d7c9cf9..a2ef272e9f27 100644
@@ -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,
Signature · 1 line
2.53.0
#2 lore raw

PATCH v3 2/3 drm/amd/display: fix missing blend-mode-prop warning for DCN

In reply to Melissa Wen

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")

---
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(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +18 -3
index 1b564cfe2120..ab9bbe8ca333 100644
@@ -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
Signature · 1 line
2.53.0
#3 lore raw

Re: [PATCH v3 2/3] drm/amd/display: fix missing blend-mode-prop warning for DCN

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

Quoted 59 lines · Melissa Wen

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")

---
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(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +18 -3
index 1b564cfe2120..ab9bbe8ca333 100644
@@ -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
Reviewed-by on v3 2/3
#4 lore raw

Re: [PATCH v3 2/3] drm/amd/display: fix missing blend-mode-prop warning for DCN

In reply to Melissa Wen
Quoted 59 lines · Melissa Wen

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")

---
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(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +18 -3
index 1b564cfe2120..ab9bbe8ca333 100644
@@ -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
#5 lore raw

PATCH v3 3/3 drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

In reply to Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)

---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +11 -7
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 	if (res)
 		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+	 * being always PIXEL_NONE across DCE versions.
 	 */
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 					  BIT(DRM_MODE_BLEND_PREMULTI) |
 					  BIT(DRM_MODE_BLEND_COVERAGE);
Signature · 1 line
2.53.0
#6 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Calling drm_plane_create_blend_mode_property() without PREMULTI support triggers a kernel warning…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling drm_plane_create_blend_mode_property() without PREMULTI support triggers a kernel warning (WARN_ON) and fails to create the property. --

--- Patch [3]: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations --- commit 44681caffc8bcfc7085bcfe1ec288a0eafc8c992
Author: Melissa Wen <[email protected]>

drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

This commit changes the blend mode property creation for primary planes on DCE generations. It modifies the driver to create the blend mode property with PIXEL_NONE only, instead of the DRM default PREMULTI mode.

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index 423e3cd7b9c98..e02cbafc8c5d0 100644

[ ... ]

Quoted 1 line
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
@@ -2208,14 +2208,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,

[ ... ]

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1934

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +2 -4
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));

[Severity: High]
Does this trigger a kernel warning and fail to create the property?

Looking at drm_plane_create_blend_mode_property() in drm_blend.c, the DRM core explicitly enforces that DRM_MODE_BLEND_PREMULTI must be supported:

int drm_plane_create_blend_mode_property(struct drm_plane *plane,
unsigned int supported_modes)

{
	...
	if (WARN_ON((supported_modes & ~valid_mode_mask) ||
		    ((supported_modes & BIT(DRM_MODE_BLEND_PREMULTI)) == 0)))
		return -EINVAL;
	...
}

Since amdgpu_dm_plane_init() now passes only BIT(DRM_MODE_BLEND_PIXEL_NONE), this will trigger the WARN_ON and return -EINVAL during device probe, meaning the property is not created at all.

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +3 -0
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 					  BIT(DRM_MODE_BLEND_PREMULTI) |
 					  BIT(DRM_MODE_BLEND_COVERAGE);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#7 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

Quoted 43 lines · On 13/08/2026 16:44, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling drm_plane_create_blend_mode_property() without PREMULTI support triggers a kernel warning (WARN_ON) and fails to create the property. --

--- Patch [3]: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations --- commit 44681caffc8bcfc7085bcfe1ec288a0eafc8c992
Author: Melissa Wen <[email protected]>

drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

This commit changes the blend mode property creation for primary planes on DCE generations. It modifies the driver to create the blend mode property with PIXEL_NONE only, instead of the DRM default PREMULTI mode.

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index 423e3cd7b9c98..e02cbafc8c5d0 100644

[ ... ]

Quoted 1 line
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
@@ -2208,14 +2208,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,

[ ... ]

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1934

Quoted 6 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +2 -4
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));

[Severity: High]
Does this trigger a kernel warning and fail to create the property?

Looking at drm_plane_create_blend_mode_property() in drm_blend.c, the DRM core explicitly enforces that DRM_MODE_BLEND_PREMULTI must be supported:

int drm_plane_create_blend_mode_property(struct drm_plane *plane,
unsigned int supported_modes)

{
	...
	if (WARN_ON((supported_modes & ~valid_mode_mask) ||
		    ((supported_modes & BIT(DRM_MODE_BLEND_PREMULTI)) == 0)))
		return -EINVAL;
	...
}
Quoted 3 lines

Since amdgpu_dm_plane_init() now passes only BIT(DRM_MODE_BLEND_PIXEL_NONE), this will trigger the WARN_ON and return -EINVAL during device probe, meaning the property is not created at all.

No, you are probably looking at an outdated codebase.

Other blend modes are supported since:

9813e158d13d5 ("drm/drm_blend: allow blend mode property without PREMULTI") in drm-misc-next.

Melissa

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +3 -0
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
  		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
  					  BIT(DRM_MODE_BLEND_PREMULTI) |
  					  BIT(DRM_MODE_BLEND_COVERAGE);
Reviewed-by on v3 3/3
#8 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

In reply to Melissa Wen
Quoted 49 lines · Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)

---
  .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 +++++++++++-------
  1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +11 -7
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
  	if (res)
  		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+	 * being always PIXEL_NONE across DCE versions.
  	 */
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
  		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
  					  BIT(DRM_MODE_BLEND_PREMULTI) |
  					  BIT(DRM_MODE_BLEND_COVERAGE);
#9 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

In reply to Melissa Wen

[ Adding Timur ]

Quoted 39 lines · Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)

---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +6 -5
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 	if (res)
 		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+	 * being always PIXEL_NONE across DCE versions.
 	 */
-	if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
-	     plane->type == DRM_PLANE_TYPE_PRIMARY) &&

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1940

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +5 -2
-	    plane_cap && plane_cap->per_pixel_alpha &&
-	    plane_cap->type == DC_PLANE_TYPE_DCN_UNIVERSAL) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 					  BIT(DRM_MODE_BLEND_PREMULTI) |
 					  BIT(DRM_MODE_BLEND_COVERAGE);

With this patch applied to the mainline kernel, my display freezes when Kwin is started (either by SDDM or by launching a KDE Plasma session). GDM and Gnome work fine. The journal doesn't have much information, it's mainly this:

kwin_wayland[8402]: Applying output configuration failed!

and after that several KDE processes with:

<kde_process>[xxxx]: There are no outputs - creating placeholder screen

Any idea how I can debug this further? Maybe ask the KDE developers?

With only the first two patches of this series applied, Kwin works as before, but I get the warnings of course.

Viktor

#10 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

Quoted 60 lines · Viktor Jägersküpper

[ Adding Timur ]

Quoted 39 lines · Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)

---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +6 -5
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 	if (res)
 		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+	 * being always PIXEL_NONE across DCE versions.
 	 */
-	if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
-	     plane->type == DRM_PLANE_TYPE_PRIMARY) &&

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1940

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +5 -2
-	    plane_cap && plane_cap->per_pixel_alpha &&
-	    plane_cap->type == DC_PLANE_TYPE_DCN_UNIVERSAL) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 					  BIT(DRM_MODE_BLEND_PREMULTI) |
 					  BIT(DRM_MODE_BLEND_COVERAGE);

With this patch applied to the mainline kernel, my display freezes when Kwin is started (either by SDDM or by launching a KDE Plasma session). GDM and Gnome work fine. The journal doesn't have much information, it's mainly this:

kwin_wayland[8402]: Applying output configuration failed!

Quoted 8 lines

and after that several KDE processes with:

<kde_process>[xxxx]: There are no outputs - creating placeholder screen

Any idea how I can debug this further? Maybe ask the KDE developers?

With only the first two patches of this series applied, Kwin works as before, but I get the warnings of course.

I completely forgot that I'm observing this with AMD Pitcairn running KDE 6.7.4 on Arch Linux. The kernel is built from source (mainline as of today) with this patch series applied on top.

Viktor

author Reviewed-by Leandro Ribeiro
#11 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

Quoted 49 lines · Viktor Jägersküpper
Quoted 48 lines · Viktor Jägersküpper

[ Adding Timur ]

Quoted 45 lines · Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)

---
  .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 +++++++++++-------
  1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +10 -7
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
  	if (res)
  		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+	 * being always PIXEL_NONE across DCE versions.
  	 */
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1940

Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +1 -0
+		   plane_cap && plane_cap->per_pixel_alpha) {
  		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
  					  BIT(DRM_MODE_BLEND_PREMULTI) |
  					  BIT(DRM_MODE_BLEND_COVERAGE);

With this patch applied to the mainline kernel, my display freezes when Kwin is started (either by SDDM or by launching a KDE Plasma session). GDM and Gnome work fine. The journal doesn't have much information, it's mainly this:

I suspect KDE is not interpreting correctly the blend mode, but I think we can keep it working as before by adding PREMULTI. In the end there is no overlay plane for DCE, and PIXEL_NONE and PREMULTI are equivalent when one primary is composed on top of a black background.

Can you replace this commit by the patch attached?
It might solve the issue as long as background continues being black. I didn't apply it to drm-misc, so let me know how does this new patch works on your side.

/cc Xaver to take a look at the KDE part.

Melissa

Quoted 9 lines
Quoted 9 lines

kwin_wayland[8402]: Applying output configuration failed!

and after that several KDE processes with:

<kde_process>[xxxx]: There are no outputs - creating placeholder screen

Any idea how I can debug this further? Maybe ask the KDE developers?

Quoted 7 lines
Quoted 2 lines

With only the first two patches of this series applied, Kwin works as before, but I get the warnings of course.

I completely forgot that I'm observing this with AMD Pitcairn running KDE 6.7.4 on Arch Linux. The kernel is built from source (mainline as of today) with this patch series applied on top.

Viktor

From 9d097db70ee2bcfa35d307673c91c39f9dcad5f2 Mon Sep 17 00:00:00 2001
From: Melissa Wen <[email protected]>
Date: Tue, 4 Aug 2026 12:44:28 +0200
Subject: [PATCH] drm/amd/display: advertise PIXEL_NONE and PREMULTI blend mode
for DCE

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE and PREMULTI for primary planes. As long as the background is black and there is no overlay plane, PIXEL_NONE and PREMULTI are equivalent, and PREMULTI has been the mandatory/default mode for years, so keep it to avoid regressions.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed")

---
v3:
- fix indentation (Alex H)
v4:
- add PREMULTI to avoid regression (reported by Viktor)

---
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 24 +++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +17 -7
index ab9bbe8ca333..402f0d333150 100644
@@ -1923,14 +1923,24 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 	if (res)
 		return res;
 
-	/* 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.
+	/* Blend mode support varies on DCE generations according to HW caps
+	 * and number of planes per CRTC. However, as current driver
+	 * implementation only creates one primary and one cursor plane per
+	 * CRTC for DCE (overlay is only created if
+	 * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode is
+	 * ignored across DCE versions. Keep PREMULTI to avoid uAPI
+	 * regressions: it was the default/mandatory mode for many years and,
+	 * with no overlay plane, primary composes on top of a black
+	 * background, where PREMULTI and PIXEL_NONE are equivalent.
 	 */
-	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) {
+	if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) {
+		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
+					  BIT(DRM_MODE_BLEND_PREMULTI);
+
+		drm_plane_create_blend_mode_property(plane, blend_caps);
+	} else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+		    plane->type == DRM_PLANE_TYPE_PRIMARY) &&
+		   plane_cap && plane_cap->per_pixel_alpha) {
 		unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
 					  BIT(DRM_MODE_BLEND_PREMULTI) |
 					  BIT(DRM_MODE_BLEND_COVERAGE);
Signature · 1 line
2.53.0
#12 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

Quoted 1 line

I suspect KDE is not interpreting correctly the blend mode

Yeah, KWin made the assumption that pre-multiplied is always supported, since the documentation said so in the past. Thanks for notifying me, I'll have that fixed in the next bugfix update.

Quoted 1 line

I think we can keep it working as before by adding PREMULTI. In the end there is no overlay plane for DCE, and PIXEL_NONE and PREMULTI are equivalent when one primary is composed on top of a black background.

Makes sense to me.

- Xaver

#13 lore raw

Re: [PATCH v3 3/3] drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

In reply to Melissa Wen
Quoted 77 lines · Melissa Wen
Quoted 58 lines · Viktor Jägersküpper
Quoted 57 lines · Viktor Jägersküpper

[ Adding Timur ]

Quoted 54 lines · Melissa Wen

DCE can support PREMULTI and COVERAGE blend mode depending on its generation, however current driver implementation either doesn't expose more than primary and cursor plane, or doesn't program registers for any
blend mode other than PIXEL_NONE. To fix the missing-blend-mode-prop warning according to current DCE plane caps, create blend mode property with PIXEL_NONE only for primary planes, instead of the DRM default PREMULTI.

Fixes 860e748bddcc ("drm: ensure blend mode supported if pixel

format with alpha exposed")

---
v3:
- fix indentation (Alex H)
---
  .../amd/display/amdgpu_dm/amdgpu_dm_plane.c    | 18 ++++++++++
+-------

  1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index ab9bbe8ca333..3b5b6943b67d 100644
@@ -1923,14 +1923,18 @@ int amdgpu_dm_plane_init(struct
 amdgpu_display_manager *dm,
       if (res)
           return res;

  -    /* 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.
+    /* Blend mode support varies on DCE generations according to HW caps
+     * and number of planes per CRTC. However, as current driver +     * implementation only creates one primary and one cursor plane per
+     * CRTC for DCE (overlay is only created if
+     * DC_PLANE_TYPE_DCN_UNIVERSAL), the primary plane blend mode ends up
+     * being always PIXEL_NONE across DCE versions.
       */
-    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) {
+    if (plane_cap && plane_cap->type != DC_PLANE_TYPE_DCN_UNIVERSAL) { +        drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PIXEL_NONE));
+    } else if ((plane->type == DRM_PLANE_TYPE_OVERLAY ||
+            plane->type == DRM_PLANE_TYPE_PRIMARY) &&

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

+           plane_cap && plane_cap->per_pixel_alpha) { unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | BIT(DRM_MODE_BLEND_PREMULTI) | BIT(DRM_MODE_BLEND_COVERAGE);

With this patch applied to the mainline kernel, my display freezes when Kwin is started (either by SDDM or by launching a KDE Plasma session). GDM and Gnome work fine. The journal doesn't have much information, it's mainly this:

I suspect KDE is not interpreting correctly the blend mode, but I think we can
keep it working as before by adding PREMULTI. In the end there is no overlay
plane for DCE, and PIXEL_NONE and PREMULTI are equivalent when one primary is composed on top of a black background.

Quoted 4 lines

Can you replace this commit by the patch attached?
It might solve the issue as long as background continues being black. I didn't apply it to drm-misc, so let me know how does this new patch works on your side.

The attached patch solves the issue, I tested both KDE/SDDM and Gnome/GDM, the warnings are gone as expected. You can add:

Thanks,
Viktor

#14 lore raw
In reply to Melissa Wen

Public

Thanks for the fixes Melissa, we'll re-add them to next week's promotion and re-test.

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Melissa Wen <[email protected]>
Sent: Thursday, August 13, 2026 10:30 AM
To: [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Li, Sun peng (Leo) <[email protected]>; [email protected]
Cc: Hung, Alex <[email protected]>; Wheeler, Daniel <[email protected]>; [email protected]; Lyude Paul <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v3 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning

PREMULTI was the default DRM blend mode until 9813e158d13d
("drm/drm_blend: allow blend mode property without PREMULTI") introduced the possibility of exposing the blend mode property without PREMULTI being supported. However, __drm_atomic_helper_plane_state_init() still resets pixel_blend_mode to PREMULTI (hardcoded), ignoring the supported mode in this property. In the same series, 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") starts warning drivers that supports alpha formats in a given planes but doesn't support blend mode property, which includes AMD primary and cursor planes.

For AMD DCN families, overlay and primary planes support the three blend modes, and therefore PREMULTI is still the default mode. So the warning can be fixed by just creating blend mode properties for primary planes too. PREMULTI is the default/unique mode for cursor planes in DCN and DCE driver. However, looks like PIXEL_NONE is the unique blend mode supported by DCE-generation driver. I don't have the hardware to check it out, but looking at the code I understand that, even if the hardware can do PREMULTI or COVERAGE, the way it programs registers doesn't make these other blend modes actually available.

Bearing this in mind, this series is organized as follow:

- Patch 1 fixes the pixel_blend_mode reset when the blend mode property is advertised without PREMULTI support. It's needed for AMD DCE-generation (patch 3) and I think with this we can also remove a workaround in nouveau nv50_wndw_default_state() caused by the hardcoded PREMULTI default value [1].

- Patch 2 fixes the missing-blend-mode-property warning for DCN primary plane and for DCN+DCE cursor plane. The alpha property keeps only on overlay planes because looks like this is not supported by AMD primary planes and it doesn't affect the blend mode warning we are targetting. Enabling alpha properties to primary was also causing -EINVAL on IGT alpha tests because it started testing primary planes and disabling it (which is not allowed by the AMD display driver).

- Patch 3 fixes the warning for DCE primary plane, but I detached this solution from the previous patch because I don't have hardware to validate if my assumption about PIXEL_NONE-only is correct.

[1] https://lore.kernel.org/dri-devel/[email protected]/

[v1]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- new patch for pixel_blend_mode default value other than PREMULTI.
- remove DCE11 which supports per_pixel_alpha but doesn't support DCN_UNIVERSAL_PLANE.
- new patch for the primary plane blend mode on DCE-generations

[v2]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- keep alpha property only for overlay planes (looks like primary plane doesn't actually support it) - alpha prop in primary planes causes IGT test failures with RX 7900 XT on a 4k60 HP U27 as reported by Daniel Wheeler.
- improve readability of if conditions (Alex H)
- add Leandro's r-b tags.

Best Regards,

Melissa

Melissa Wen (3):
drm/atomic-state-helper: set pixel_blend_mode to prop default on reset drm/amd/display: fix missing blend-mode-prop warning for DCN drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 25 ++++++++++++++++---
 drivers/gpu/drm/drm_atomic_state_helper.c     |  7 ++++++
 2 files changed, 29 insertions(+), 3 deletions(-)

--
2.53.0

#15 lore raw
Quoted 3 lines · Daniel

Public

Thanks for the fixes Melissa, we'll re-add them to next week's promotion and re-test.

Nice!

Thank you!

Melissa

Quoted 76 lines

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Melissa Wen <[email protected]>
Sent: Thursday, August 13, 2026 10:30 AM
To: [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Li, Sun peng (Leo) <[email protected]>; [email protected]
Cc: Hung, Alex <[email protected]>; Wheeler, Daniel <[email protected]>; [email protected]; Lyude Paul <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v3 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning

PREMULTI was the default DRM blend mode until 9813e158d13d
("drm/drm_blend: allow blend mode property without PREMULTI") introduced the possibility of exposing the blend mode property without PREMULTI being supported. However, __drm_atomic_helper_plane_state_init() still resets pixel_blend_mode to PREMULTI (hardcoded), ignoring the supported mode in this property. In the same series, 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") starts warning drivers that supports alpha formats in a given planes but doesn't support blend mode property, which includes AMD primary and cursor planes.

For AMD DCN families, overlay and primary planes support the three blend modes, and therefore PREMULTI is still the default mode. So the warning can be fixed by just creating blend mode properties for primary planes too. PREMULTI is the default/unique mode for cursor planes in DCN and DCE driver. However, looks like PIXEL_NONE is the unique blend mode supported by DCE-generation driver. I don't have the hardware to check it out, but looking at the code I understand that, even if the hardware can do PREMULTI or COVERAGE, the way it programs registers doesn't make these other blend modes actually available.

Bearing this in mind, this series is organized as follow:

- Patch 1 fixes the pixel_blend_mode reset when the blend mode property is advertised without PREMULTI support. It's needed for AMD DCE-generation (patch 3) and I think with this we can also remove a workaround in nouveau nv50_wndw_default_state() caused by the hardcoded PREMULTI default value [1].

- Patch 2 fixes the missing-blend-mode-property warning for DCN primary plane and for DCN+DCE cursor plane. The alpha property keeps only on overlay planes because looks like this is not supported by AMD primary planes and it doesn't affect the blend mode warning we are targetting. Enabling alpha properties to primary was also causing -EINVAL on IGT alpha tests because it started testing primary planes and disabling it (which is not allowed by the AMD display driver).

- Patch 3 fixes the warning for DCE primary plane, but I detached this solution from the previous patch because I don't have hardware to validate if my assumption about PIXEL_NONE-only is correct.

[1] https://lore.kernel.org/dri-devel/[email protected]/

[v1]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- new patch for pixel_blend_mode default value other than PREMULTI.
- remove DCE11 which supports per_pixel_alpha but doesn't support DCN_UNIVERSAL_PLANE.
- new patch for the primary plane blend mode on DCE-generations

[v2]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- keep alpha property only for overlay planes (looks like primary plane doesn't actually support it) - alpha prop in primary planes causes IGT test failures with RX 7900 XT on a 4k60 HP U27 as reported by Daniel Wheeler.
- improve readability of if conditions (Alex H)
- add Leandro's r-b tags.

Best Regards,

Melissa

Melissa Wen (3):
drm/atomic-state-helper: set pixel_blend_mode to prop default on reset drm/amd/display: fix missing blend-mode-prop warning for DCN drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

  .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 25 ++++++++++++++++---
  drivers/gpu/drm/drm_atomic_state_helper.c     |  7 ++++++
  2 files changed, 29 insertions(+), 3 deletions(-)

--
2.53.0

Tested-by on the v3 series
#16 lore raw
In reply to Melissa Wen

Public

Hi Melissa,

The updated patches passed all my testing this week, so the tested-by can be added if you'd like.

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Melissa Wen <[email protected]>
Sent: Thursday, August 13, 2026 10:30 AM
To: [email protected]; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; Wentland, Harry <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Li, Sun peng (Leo) <[email protected]>; [email protected]
Cc: Hung, Alex <[email protected]>; Wheeler, Daniel <[email protected]>; [email protected]; Lyude Paul <[email protected]>; [email protected]; [email protected]
Subject: [PATCH v3 0/3] drm/atomic-state-helper: fixes for blend-mode-prop warning

PREMULTI was the default DRM blend mode until 9813e158d13d
("drm/drm_blend: allow blend mode property without PREMULTI") introduced the possibility of exposing the blend mode property without PREMULTI being supported. However, __drm_atomic_helper_plane_state_init() still resets pixel_blend_mode to PREMULTI (hardcoded), ignoring the supported mode in this property. In the same series, 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") starts warning drivers that supports alpha formats in a given planes but doesn't support blend mode property, which includes AMD primary and cursor planes.

For AMD DCN families, overlay and primary planes support the three blend modes, and therefore PREMULTI is still the default mode. So the warning can be fixed by just creating blend mode properties for primary planes too. PREMULTI is the default/unique mode for cursor planes in DCN and DCE driver. However, looks like PIXEL_NONE is the unique blend mode supported by DCE-generation driver. I don't have the hardware to check it out, but looking at the code I understand that, even if the hardware can do PREMULTI or COVERAGE, the way it programs registers doesn't make these other blend modes actually available.

Bearing this in mind, this series is organized as follow:

- Patch 1 fixes the pixel_blend_mode reset when the blend mode property is advertised without PREMULTI support. It's needed for AMD DCE-generation (patch 3) and I think with this we can also remove a workaround in nouveau nv50_wndw_default_state() caused by the hardcoded PREMULTI default value [1].

- Patch 2 fixes the missing-blend-mode-property warning for DCN primary plane and for DCN+DCE cursor plane. The alpha property keeps only on overlay planes because looks like this is not supported by AMD primary planes and it doesn't affect the blend mode warning we are targetting. Enabling alpha properties to primary was also causing -EINVAL on IGT alpha tests because it started testing primary planes and disabling it (which is not allowed by the AMD display driver).

- Patch 3 fixes the warning for DCE primary plane, but I detached this solution from the previous patch because I don't have hardware to validate if my assumption about PIXEL_NONE-only is correct.

[1] https://lore.kernel.org/dri-devel/[email protected]/

[v1]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- new patch for pixel_blend_mode default value other than PREMULTI.
- remove DCE11 which supports per_pixel_alpha but doesn't support DCN_UNIVERSAL_PLANE.
- new patch for the primary plane blend mode on DCE-generations

[v2]: https://lore.kernel.org/dri-devel/[email protected]/
Changes:
- keep alpha property only for overlay planes (looks like primary plane doesn't actually support it) - alpha prop in primary planes causes IGT test failures with RX 7900 XT on a 4k60 HP U27 as reported by Daniel Wheeler.
- improve readability of if conditions (Alex H)
- add Leandro's r-b tags.

Best Regards,

Melissa

Melissa Wen (3):
drm/atomic-state-helper: set pixel_blend_mode to prop default on reset drm/amd/display: fix missing blend-mode-prop warning for DCN drm/amd/display: advertise PIXEL_NONE as blend mode for DCE generations

 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   | 25 ++++++++++++++++---
 drivers/gpu/drm/drm_atomic_state_helper.c     |  7 ++++++
 2 files changed, 29 insertions(+), 3 deletions(-)

--
2.53.0

Tested-by on the v3 series
#17 lore raw
In reply to Melissa Wen

Hi,

On current mainline every boot on my machine produces this at amdgpu probe:

[PLANE:44:plane-0] pixel format with alpha exposed but blend mode not setup

  WARNING: drivers/gpu/drm/drm_mode_config.c:872 at drm_mode_config_validate+0xa16/0x13b0

16 times per boot: 8 per GPU, on the 4 primary and 4 cursor planes of each of the two cards in this box. I bisected it to 860e748bddcc ("drm: ensure blend mode supported if pixel format with alpha exposed") and confirmed it by reverting that commit, before I found this series.

With all three patches of this series applied the warnings are gone.

Base: 66498c75b4f8, kernel 7.2.0-66498c75b4f8+ #154, KASAN and lockdep enabled. Hardware:
0000:03:00.0 Navi 31 (0x1002:0x744C), DCN 3.2
0000:0f:00.0 Raphael iGPU (0x1002:0x164E), DCN 3.1.5

After booting into a normal desktop session:

  dmesg | grep -c 'blend mode not setup'      -> 0
  dmesg | grep -c 'drm_mode_config_validate'  -> 0
  drm_info | grep -c 'pixel blend mode'       -> 20

i.e. all 10 planes on each GPU (4 primary, 2 overlay, 4 cursor) now expose the property. No WARNING, no UBSAN and no lockdep report anywhere in the buffer.

What I did not cover: I have no DCE hardware, so patch 3/3 is untested; and since PREMULTI is present in the blend caps of every plane here, the property default lookup added by 1/3 resolves to the same value that was hardcoded before, so that path is exercised only in its trivial case.

One question about routing: 860e748bddcc landed in the 7.3 merge window, so this is a merge-window regression - it was never in a release, and no stable backport is involved. But the fix should still make 7.3 rather than wait for the 7.4 merge window: right now every amdgpu machine on mainline hits this at probe. 271e90eb5f9f ("drm: use drm_warn() in validate_blend_mode_for_alpha_formats()") is already in drm-misc-next-fixes, while this series is in neither linux-next nor amd-staging-drm-next. Could it go the same way - drm-misc-next-fixes while the window is open, drm-fixes after -rc1 - instead of through amd-staging-drm-next, which is aimed at 7.4 now? Splitting it looks wrong anyway: 3/3 gives DCE planes a property with PIXEL_NONE only, which needs 1/3 to not end up with PREMULTI in the default state.

Signature · 2 lines
Thanks,
Mikhail