Skip to content

Commit e06926e

Browse files
committed
drm: xlnx: zynqmp_dpsub: Fix graphics layer blending
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 <[email protected]>
1 parent b7f4753 commit e06926e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/gpu/drm/xlnx/zynqmp_disp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ static void zynqmp_disp_avbuf_write(struct zynqmp_disp *disp, int reg, u32 val)
415415
writel(val, disp->avbuf.base + reg);
416416
}
417417

418+
static bool zynqmp_disp_layer_is_gfx(const struct zynqmp_disp_layer *layer)
419+
{
420+
return layer->id == ZYNQMP_DISP_LAYER_GFX;
421+
}
422+
418423
static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer)
419424
{
420425
return layer->id == ZYNQMP_DISP_LAYER_VID;
@@ -1157,6 +1162,9 @@ zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
11571162
return;
11581163

11591164
zynqmp_disp_layer_disable(layer);
1165+
1166+
if (zynqmp_disp_layer_is_gfx(layer))
1167+
zynqmp_disp_blend_set_global_alpha(layer->disp, false, 0);
11601168
}
11611169

11621170
static void
@@ -1186,6 +1194,9 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
11861194

11871195
zynqmp_disp_layer_update(layer, new_state);
11881196

1197+
if (zynqmp_disp_layer_is_gfx(layer))
1198+
zynqmp_disp_blend_set_global_alpha(layer->disp, true, 255);
1199+
11891200
/* Enable or re-enable the plane is the format has changed. */
11901201
if (format_changed)
11911202
zynqmp_disp_layer_enable(layer);
@@ -1447,7 +1458,6 @@ zynqmp_disp_crtc_atomic_enable(struct drm_crtc *crtc,
14471458

14481459
zynqmp_disp_blend_set_output_format(disp, ZYNQMP_DPSUB_FORMAT_RGB);
14491460
zynqmp_disp_blend_set_bg_color(disp, 0, 0, 0);
1450-
zynqmp_disp_blend_set_global_alpha(disp, false, 0);
14511461

14521462
zynqmp_disp_enable(disp);
14531463

0 commit comments

Comments
 (0)