summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_plane.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2019-07-11 15:52:19 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-08-23 10:15:11 +0300
commit3037e0c5e8af377c33f264f2e146d8b3b82bcb1b (patch)
tree339057c2968254d81be5d3fb7ecde6ba17a7430b /drivers/gpu/drm/omapdrm/omap_plane.c
parent0a9a4b611a033f625df02a84575a72c0048d5e5e (diff)
downloadlinux-3037e0c5e8af377c33f264f2e146d8b3b82bcb1b.tar.bz2
drm/omap: Add 'alpha' and 'pixel blend mode' plane properties
Add the following properties for planes: * alpha * pixel blend mode. Only "Pre-multiplied" and "Coverage" are supported Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190711135219.23402-1-jjhiblot@ti.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_plane.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 84e1be981cfe..73ec99819a3d 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -53,8 +53,12 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
memset(&info, 0, sizeof(info));
info.rotation_type = OMAP_DSS_ROT_NONE;
info.rotation = DRM_MODE_ROTATE_0;
- info.global_alpha = 0xff;
+ info.global_alpha = state->alpha >> 8;
info.zorder = state->normalized_zpos;
+ if (state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI)
+ info.pre_mult_alpha = 1;
+ else
+ info.pre_mult_alpha = 0;
/* update scanout: */
omap_framebuffer_update_scanout(state->fb, state, &info);
@@ -285,6 +289,9 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
omap_plane_install_properties(plane, &plane->base);
drm_plane_create_zpos_property(plane, 0, 0, num_planes - 1);
+ drm_plane_create_alpha_property(plane);
+ drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PREMULTI) |
+ BIT(DRM_MODE_BLEND_COVERAGE));
return plane;