From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: <tomi.valkeinen@ti.com>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
Jean-Jacques Hiblot <jjhiblot@ti.com>
Subject: [PATCH] drm/omap: Add 'alpha' and 'pixel blend mode' plane properties
Date: Thu, 11 Jul 2019 15:52:19 +0200 [thread overview]
Message-ID: <20190711135219.23402-1-jjhiblot@ti.com> (raw)
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>
---
drivers/gpu/drm/omapdrm/omap_plane.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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;
--
2.17.1
next reply other threads:[~2019-07-11 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 13:52 Jean-Jacques Hiblot [this message]
2019-08-01 8:33 ` [PATCH] drm/omap: Add 'alpha' and 'pixel blend mode' plane properties Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190711135219.23402-1-jjhiblot@ti.com \
--to=jjhiblot@ti.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).