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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Mar 7 04:06:10 GMT 2021


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 at ideasonboard.com>
---
 drivers/gpu/drm/xlnx/zynqmp_disp.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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);
 
-- 
Regards,

Laurent Pinchart




More information about the linux-arm-kernel mailing list