From nobody Sun Feb 8 02:21:50 2026 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2524930EF6E for ; Thu, 13 Nov 2025 20:37:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066262; cv=none; b=ASv8QG2i7823G3+ogy3+lVKhsukpKDerU2kC8ZnNs1hlPC0aXN6CPfCYhVswWV6ZKyq+LYkKk3bAjRFDK3uLoghOpl72E1YT/66RnXgUF3BdYUVtUfV193uTdEwvqyx1kBDOgaCiy+n/jH5qYa92ElcVHAUFB7GMzD3KZbECPs8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066262; c=relaxed/simple; bh=IhyYAvJB32HKe5lsW0NW8SiaWTvB2JLJ65qK635EKYg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r3kdDXLKPEQCgCVlFzGRKYadXK2cv/CUOvdN7YuB03FQdOChQSAXAUG0+wT49a7dHuIgN6DV+HDxLKZ/DEDiqCHiID2aXgezr3Au16coE+6y0yFXYCyaq7Vudpx5shEXUNJ0+7YGobn4NUT3ue1R/u/HRzbcSpPu6Ym7FzMHA+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Nw+bCFei; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Nw+bCFei" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763066258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h7IYL1pgjM3KN4/LrZAIitgGAICVxDY/o/Vd5ldE/rY=; b=Nw+bCFei5gtwCkmjhI1568AvJE36lyE7Ma5ND4beUS8rq3TCsZ8vVYJg4p+X+6A34JyE8D mcCa33NwIUP3Pm+aZGPB71KanfyzjtvXTkqpWkDgjoBHjqSHd3FzogdmKuafcCYHNpX4rY BsNicK/O220MIMu3kGQWWPbgVvh7edA= From: Sean Anderson To: Laurent Pinchart , Tomi Valkeinen , dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Mike Looijmans , David Airlie , Thomas Zimmermann , Maarten Lankhorst , Anatoliy Klymenko , Maxime Ripard , linux-arm-kernel@lists.infradead.org, Simona Vetter , Michal Simek , Sean Anderson Subject: [PATCH 1/3] drm: zynqmp: Check property creation status Date: Thu, 13 Nov 2025 15:37:12 -0500 Message-Id: <20251113203715.2768107-2-sean.anderson@linux.dev> In-Reply-To: <20251113203715.2768107-1-sean.anderson@linux.dev> References: <20251113203715.2768107-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Make sure to return an error in the event that we can't create our properties. Fixes: 650f12042b85 ("drm: xlnx: zynqmp_dpsub: Add global alpha support") Fixes: 8c772f0b2b8e ("drm: xlnx: zynqmp_dpsub: Expose plane ordering to use= rspace") Signed-off-by: Sean Anderson Reviewed-by: Thomas Zimmermann Tested-by: Mikko Rapeli --- drivers/gpu/drm/xlnx/zynqmp_kms.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqm= p_kms.c index 2bee0a2275ed..c80a2d4034f3 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -174,9 +174,15 @@ static int zynqmp_dpsub_create_planes(struct zynqmp_dp= sub *dpsub) =20 drm_plane_helper_add(plane, &zynqmp_dpsub_plane_helper_funcs); =20 - drm_plane_create_zpos_immutable_property(plane, i); - if (i =3D=3D ZYNQMP_DPSUB_LAYER_GFX) - drm_plane_create_alpha_property(plane); + ret =3D drm_plane_create_zpos_immutable_property(plane, i); + if (ret) + return ret; + + if (i =3D=3D ZYNQMP_DPSUB_LAYER_GFX) { + ret =3D drm_plane_create_alpha_property(plane); + if (ret) + return ret; + } } =20 return 0; --=20 2.35.1.1320.gc452695387.dirty From nobody Sun Feb 8 02:21:50 2026 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69D4C31BC90 for ; Thu, 13 Nov 2025 20:37:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066264; cv=none; b=pEtqIAH2p2jApFRsuWNu43li7l9bM39GH4nWU+X6Bn3GCDe9NdXg40K9F9b4WnhvhirBhfGQNoL4ygXGZbl6wAT4aSV60YxmYqqFzMc+LQKE0mR7ZKpjwdhUUIsFKbocJlhvNYNuMFHDD/TrsTv++wpBRBobRY0L74pbHwB0Qmo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066264; c=relaxed/simple; bh=YeWpCDeY55QOC7VEGSkbstJ96N3g9b7EuRAO2g8jFNs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=R4iOYeH5WoK531MP95Q2A3+nll7nTOcyHwHAvecOur2lrrhLWFV7fpcAjFlg+w/XFWjDRmE0XnkLQysmw692A6v02xi4lDokOStVALqMDDv6RD6GxvebnkiIMt/jVOunAyjaG36+ZYfNErQGmaS8fr0maQssM1jQLhs89d4vsTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=w8X9Xq+j; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="w8X9Xq+j" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763066260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ocCd5w26fdc1J8cjXCJJ44FOPQqL/aFGod/qtI7VzAQ=; b=w8X9Xq+jerxDx0SSpkQri6sf4OS6D6LncLOPZkPgFHpWLI0Y1tBCDTlAPa0MLvZSla5ZeH 4HkuOPyiGf7h2L7hcXg1hDiLMJQye7l/8fPwykUjfmKKCQAe6Dar7aoDkyNnxMZvdfAi1f XpkKEre7Q2GWyU4Sjh9SCtX0e1vv2XM= From: Sean Anderson To: Laurent Pinchart , Tomi Valkeinen , dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Mike Looijmans , David Airlie , Thomas Zimmermann , Maarten Lankhorst , Anatoliy Klymenko , Maxime Ripard , linux-arm-kernel@lists.infradead.org, Simona Vetter , Michal Simek , Sean Anderson Subject: [PATCH 2/3] drm: zynqmp: Make the video plane primary Date: Thu, 13 Nov 2025 15:37:13 -0500 Message-Id: <20251113203715.2768107-3-sean.anderson@linux.dev> In-Reply-To: <20251113203715.2768107-1-sean.anderson@linux.dev> References: <20251113203715.2768107-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The zynqmp has two planes: "video" and "graphics". The video plane - Is on the bottom (zpos=3D0) (except when chroma keying as the master plan= e) - Supports "live" input (e.g. from an external source) - Supports RGB, YUV, and YCbCr formats, including XRGB8888 - Does not support transparency, except via chroma keying (colorkey) - Must cover the entire screen (translation/resizing not supported) The graphics plane - Is on the top (zpos=3D1) - Supports "live" input (e.g. from an external source) - Supports RGB and YUV444 formats, but not XRGB8888 - Supports transparency either via - Global alpha channel, which disables per-pixel alpha when enabled - Per-pixel alpha, which cannot be used with global alpha - Chroma keying (colorkey) - Must cover the entire screen (translation/resizing not supported) Currently the graphics plane is the primary plane. Make the video plane the primary plane: - The video plane supports XRGB8888, which is the default 24-bit colorspace for X. This results in improved performance when compared to RGB565. - The graphics plane can be used as an overlay because it has a higher z-pos and supports a per-pixel alpha channel. Unfortunately, clients like weston cannot currently take advantage of this because they expect overlay planes to support translation/resizing. One downside to this approach could be that the graphics plane has worse support for YUV and YCBCr, so it may be more difficult to compose video streams into the window of a media player. However, no existing software could rely on this because there is no way to enable the per-pixel alpha channel when the graphics plane is enabled. This makes it impossible to "carve out" an area in the graphics plane where the video plane shows through. This limitation is addressed in the next patch, but it means we do not need to worry about compatibility in this area. An alternate approach could be to pretend that the graphics plane supports XRGB8888 by using the supported ARGB8888 mode instead and enabling the global alpha channel. However, this would rule out ever using the per-pixel alpha channel. Signed-off-by: Sean Anderson Tested-by: Mikko Rapeli --- drivers/gpu/drm/xlnx/zynqmp_kms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqm= p_kms.c index c80a2d4034f3..456ada9ac003 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -161,8 +161,8 @@ static int zynqmp_dpsub_create_planes(struct zynqmp_dps= ub *dpsub) if (!formats) return -ENOMEM; =20 - /* Graphics layer is primary, and video layer is overlay. */ - type =3D i =3D=3D ZYNQMP_DPSUB_LAYER_VID + /* Graphics layer is overlay, and video layer is primary. */ + type =3D i =3D=3D ZYNQMP_DPSUB_LAYER_GFX ? DRM_PLANE_TYPE_OVERLAY : DRM_PLANE_TYPE_PRIMARY; ret =3D drm_universal_plane_init(&dpsub->drm->dev, plane, 0, &zynqmp_dpsub_plane_funcs, @@ -322,7 +322,7 @@ static const struct drm_crtc_funcs zynqmp_dpsub_crtc_fu= ncs =3D { =20 static int zynqmp_dpsub_create_crtc(struct zynqmp_dpsub *dpsub) { - struct drm_plane *plane =3D &dpsub->drm->planes[ZYNQMP_DPSUB_LAYER_GFX]; + struct drm_plane *plane =3D &dpsub->drm->planes[ZYNQMP_DPSUB_LAYER_VID]; struct drm_crtc *crtc =3D &dpsub->drm->crtc; int ret; =20 --=20 2.35.1.1320.gc452695387.dirty From nobody Sun Feb 8 02:21:50 2026 Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA36B31D734 for ; Thu, 13 Nov 2025 20:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066266; cv=none; b=eFQ7c0lijmaccmP7wQVQsF4RKHRV8yFQIfX3B1yDsZg/Y3AIVCjEmxoq5Va4YZZDoVnZO2QmUHopL60NWTCNPQwuT/KNKNYbPMacN20Pco+eyOG5x//BqWye4Hva9lmF1vtH5waHMUDiVxvNdWKLsZIB8KZhJGFkWWSnCTRruhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763066266; c=relaxed/simple; bh=Quqta0N9JVNenz9TY4419fCpPZfwL9MDib/2p2sk/Rw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XNoLXBQhR1Ui3qhEoaxEH997pZQKFabl60c7OsOL9cpf6vUp+wakyq+MQfngQuc0DSn+2wvqV85/kALzKs83GxIt1+uK9tzUuTd9A/zZYBntRT65g7IfUYdpqd+8OCc9wPsosEMzdPvpqGOD84ay9W1XNEFV8M0qwHqw+xRZQhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uSKmSG49; arc=none smtp.client-ip=95.215.58.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uSKmSG49" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763066262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qpum9vm04MMfFjjX9uvR2U04f3Rh475IoGXXdM3y9yo=; b=uSKmSG49Q/hKO3b5cWvFs+1/o2C+vgWvVvlyp7DI7AFAUQLkV8WSrH/7LDIdUvoIBk3TOD lQqwz6WXeZRtPhXY3TZXDuHxCvJ1MVKKNw0gIRj9Oloij+FNhutsbS3ZAZ+hEVZraq2YVN dS/UbOaZgYvzeL1KBgygqEinumm7PmE= From: Sean Anderson To: Laurent Pinchart , Tomi Valkeinen , dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Mike Looijmans , David Airlie , Thomas Zimmermann , Maarten Lankhorst , Anatoliy Klymenko , Maxime Ripard , linux-arm-kernel@lists.infradead.org, Simona Vetter , Michal Simek , Sean Anderson Subject: [PATCH 3/3] drm: zynqmp: Add blend mode property to graphics plane Date: Thu, 13 Nov 2025 15:37:14 -0500 Message-Id: <20251113203715.2768107-4-sean.anderson@linux.dev> In-Reply-To: <20251113203715.2768107-1-sean.anderson@linux.dev> References: <20251113203715.2768107-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" When global alpha is enabled, per-pixel alpha is ignored. Allow userspace to explicitly specify whether to use per-pixel alpha by exposing it through the blend mode property. I'm not sure whether the per-pixel alpha is pre-multiplied or not [1], but apparently it *must* be pre-multiplied so I guess we have to advertise it. [1] All we get is "The alpha value available with the graphics stream will define the transparency of the graphics." Signed-off-by: Sean Anderson Tested-by: Mikko Rapeli --- drivers/gpu/drm/xlnx/zynqmp_kms.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqm= p_kms.c index 456ada9ac003..fa1cfc16db36 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -61,6 +61,13 @@ static int zynqmp_dpsub_plane_atomic_check(struct drm_pl= ane *plane, if (!new_plane_state->crtc) return 0; =20 + if (new_plane_state->pixel_blend_mode !=3D DRM_MODE_BLEND_PIXEL_NONE && + new_plane_state->alpha >> 8 !=3D 0xff) { + drm_dbg_kms(plane->dev, + "Plane alpha must be 1.0 when using pixel alpha\n"); + return -EINVAL; + } + crtc_state =3D drm_atomic_get_crtc_state(state, new_plane_state->crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); @@ -117,9 +124,13 @@ static void zynqmp_dpsub_plane_atomic_update(struct dr= m_plane *plane, =20 zynqmp_disp_layer_update(layer, new_state); =20 - if (plane->index =3D=3D ZYNQMP_DPSUB_LAYER_GFX) - zynqmp_disp_blend_set_global_alpha(dpsub->disp, true, + if (plane->index =3D=3D ZYNQMP_DPSUB_LAYER_GFX) { + bool blend =3D plane->state->pixel_blend_mode =3D=3D + DRM_MODE_BLEND_PIXEL_NONE; + + zynqmp_disp_blend_set_global_alpha(dpsub->disp, blend, plane->state->alpha >> 8); + } =20 /* * Unconditionally enable the layer, as it may have been disabled @@ -179,9 +190,18 @@ static int zynqmp_dpsub_create_planes(struct zynqmp_dp= sub *dpsub) return ret; =20 if (i =3D=3D ZYNQMP_DPSUB_LAYER_GFX) { + unsigned int blend_modes =3D + BIT(DRM_MODE_BLEND_PIXEL_NONE) | + BIT(DRM_MODE_BLEND_PREMULTI); + ret =3D drm_plane_create_alpha_property(plane); if (ret) return ret; + + ret =3D drm_plane_create_blend_mode_property(plane, + blend_modes); + if (ret) + return ret; } } =20 --=20 2.35.1.1320.gc452695387.dirty