Skip to content

Commit 650f120

Browse files
committed
drm: xlnx: zynqmp_dpsub: Add global alpha support
The graphics plane has a global alpha setting. Expose it through the plane's alpha property. Signed-off-by: Laurent Pinchart <[email protected]>
1 parent e06926e commit 650f120

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpu/drm/xlnx/zynqmp_disp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,8 @@ zynqmp_disp_plane_atomic_disable(struct drm_plane *plane,
11641164
zynqmp_disp_layer_disable(layer);
11651165

11661166
if (zynqmp_disp_layer_is_gfx(layer))
1167-
zynqmp_disp_blend_set_global_alpha(layer->disp, false, 0);
1167+
zynqmp_disp_blend_set_global_alpha(layer->disp, false,
1168+
plane->state->alpha >> 8);
11681169
}
11691170

11701171
static void
@@ -1195,7 +1196,8 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane,
11951196
zynqmp_disp_layer_update(layer, new_state);
11961197

11971198
if (zynqmp_disp_layer_is_gfx(layer))
1198-
zynqmp_disp_blend_set_global_alpha(layer->disp, true, 255);
1199+
zynqmp_disp_blend_set_global_alpha(layer->disp, true,
1200+
plane->state->alpha >> 8);
11991201

12001202
/* Enable or re-enable the plane is the format has changed. */
12011203
if (format_changed)
@@ -1249,6 +1251,9 @@ static int zynqmp_disp_create_planes(struct zynqmp_disp *disp)
12491251

12501252
drm_plane_helper_add(&layer->plane,
12511253
&zynqmp_disp_plane_helper_funcs);
1254+
1255+
if (zynqmp_disp_layer_is_gfx(layer))
1256+
drm_plane_create_alpha_property(&layer->plane);
12521257
}
12531258

12541259
return 0;

0 commit comments

Comments
 (0)