Thread (4 messages) flat view 4 messages, 1 author, 2021-03-07
DORMANTno replies

[PATCH 3/3] drm: xlnx: zynqmp_dpsub: Add global alpha support

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: 2021-03-07 04:09:08
Also in: dri-devel
Subsystem: drm drivers, drm drivers and misc gpu patches, drm drivers for xilinx, the rest · Maintainers: David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Laurent Pinchart, Tomi Valkeinen, Linus Torvalds

The top (graphics) plane has a global alpha setting. Expose it through
the plane's alpha property.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index 4c23ffc75343..991dd6bebdc7 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -1173,7 +1173,7 @@ zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
 
 	if (layer->id == ZYNQMP_DISP_LAYER_GFX)
 		zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, false,
-						   0);
+						   plane->state->alpha >> 8);
 }
 
 static void
@@ -1203,7 +1203,7 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
 
 	if (layer->id == ZYNQMP_DISP_LAYER_GFX)
 		zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, true,
-						   255);
+						   plane->state->alpha >> 8);
 
 	/* Enable or re-enable the plane is the format has changed. */
 	if (format_changed)
@@ -1262,6 +1262,8 @@ static int zynqmp_disp_create_planes(struct zynqmp_disp *disp)
 				     &zynqmp_disp_plane_helper_funcs);
 
 		drm_plane_create_zpos_immutable_property(&layer->plane, i);
+		if (type == DRM_PLANE_TYPE_OVERLAY)
+			drm_plane_create_alpha_property(&layer->plane);
 	}
 
 	return 0;
-- 
Regards,

Laurent Pinchart


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help