diff mbox series

[2/3] drm: xlnx: zynqmp_dpsub: Fix graphics layer blending

Message ID 20210307040611.29246-3-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series drm: xlnx: zynqmp_dpsub: Fix plane handling | expand

Commit Message

Laurent Pinchart March 7, 2021, 4:06 a.m. UTC
To display the graphics layer, the global alpha needs to be enabled.
Enable it when the graphics plane is enabled (with full opacity), and
disable it otherwise.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/xlnx/zynqmp_disp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index 6296f6d5acbc..4c23ffc75343 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -1170,6 +1170,10 @@  zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
 		return;
 
 	zynqmp_disp_layer_disable(layer);
+
+	if (layer->id == ZYNQMP_DISP_LAYER_GFX)
+		zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, false,
+						   0);
 }
 
 static void
@@ -1197,6 +1201,10 @@  zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
 
 	zynqmp_disp_layer_update(layer, plane->state);
 
+	if (layer->id == ZYNQMP_DISP_LAYER_GFX)
+		zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, true,
+						   255);
+
 	/* Enable or re-enable the plane is the format has changed. */
 	if (format_changed)
 		zynqmp_disp_layer_enable(layer);
@@ -1463,7 +1471,6 @@  zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc,
 	zynqmp_disp_blend_set_output_format(&disp->blend,
 					    ZYNQMP_DPSUB_FORMAT_RGB);
 	zynqmp_disp_blend_set_bg_color(&disp->blend, 0, 0, 0);
-	zynqmp_disp_blend_set_global_alpha(&disp->blend, false, 0);
 
 	zynqmp_disp_enable(disp);