From nobody Sun Feb 8 09:30:45 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 --- 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