mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bert Karwatzki <spasswolf@web.de>
To: linux-kernel@vger.kernel.org
Cc: Bert Karwatzki <spasswolf@web.de>,
	linux-next@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Leandro Ribeiro <leandro.ribeiro@collabora.com>,
	"Wentland, Harry" <Harry.Wentland@amd.com>,
	Leo Li <Sunpeng.Li@amd.com>, Alex Hung <alex.hung@amd.com>,
	amd-gfx@lists.freedesktop.org, Jesse Zhang <jesse.zhang@amd.com>,
	Amber Lin <Amber.Lin@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 1/8] display: fix blend_mode for non-overlay planes
Date: Fri, 14 Aug 2026 17:17:00 +0200	[thread overview]
Message-ID: <20260814151701.65222-1-spasswolf@web.de> (raw)
In-Reply-To: <514c5423b98376e2e6f1fe4bb56c0f3607b4cd52.camel@web.de>

Previously drm_plane_create_blend_mode_property() was only called for
planes of type DRM_PLANE_TYPE_OVERLAY. Since commit commit 860e748bddcc
("drm: ensure blend mode supported if pixel format with alpha exposed")
this results in warnings from validate_blend_mode_for_alpha_formats().
We fix this here by calling drm_plane_create_blend_mode_property() for
all plane types if the plane is supporting a format with
per_pixel_alpha.

Signed-off-by: Bert Karwatzki <spasswolf@web.de>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c  | 5 ++++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 3 +--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
index 62eac6e65334..a6a54351ea56 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
@@ -755,13 +755,16 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
 	struct drm_plane *cursor_plane;
 	bool has_degamma;
 	int res = -ENOMEM;
+	struct dc_plane_cap dummy_cap = {
+		.per_pixel_alpha = 1,
+	};
 
 	cursor_plane = kzalloc_obj(*cursor_plane);
 	if (!cursor_plane)
 		goto fail;
 
 	cursor_plane->type = DRM_PLANE_TYPE_CURSOR;
-	res = amdgpu_dm_plane_init(dm, cursor_plane, 0, NULL);
+	res = amdgpu_dm_plane_init(dm, cursor_plane, 0, &dummy_cap);
 
 	acrtc = kzalloc_obj(struct amdgpu_crtc);
 	if (!acrtc)
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 824ef3ce5de0..4c0c6a8a0dac 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
@@ -2208,8 +2208,7 @@ 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) {
+	if (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);
-- 
2.55.0


      reply	other threads:[~2026-08-14 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 15:29 warnings from validate_blend_mode_for_alpha_formats() in next-20260715 Bert Karwatzki
2026-07-17 14:55 ` Alex Deucher
2026-07-17 22:54   ` Leandro Ribeiro
2026-07-18  9:21     ` Bert Karwatzki
2026-07-18 12:22       ` Bert Karwatzki
2026-08-14 15:17         ` Bert Karwatzki [this message]

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=20260814151701.65222-1-spasswolf@web.de \
    --to=spasswolf@web.de \
    --cc=Amber.Lin@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jesse.zhang@amd.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mario.limonciello@amd.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

all inboxes | Powered by JetHome®