summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vkms
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2023-04-20 20:22:27 -0300
committerMaíra Canal <mairacanal@riseup.net>2023-04-26 17:24:55 -0300
commita03f028542779fbdb0130b6a5e15445c94a859e8 (patch)
tree53334e5a63bd369e2737214ff708852ecd5c8e7b /drivers/gpu/drm/vkms
parent94545f27155df50d2db7a1c896ca6b8e81fb62d1 (diff)
drm/vkms: allow full alpha blending on all planes
Before commit bc0d7fdefec6 ("drm: vkms: Supports to the case where primary plane doesn't match the CRTC"), the composition was executed on top of the primary plane. Therefore, the primary plane was not able to support the alpha channel. After commit bc0d7fdefec6, this is possible, as the composition is now executed on top of the CRTC. So, allow all planes to support the alpha channel, making full alpha blending possible in vkms. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Arthur Grillo <arthurgrillo@riseup.net> Signed-off-by: Maíra Canal <mairacanal@riseup.net> Link: https://patchwork.freedesktop.org/patch/msgid/20230420232228.273340-1-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/vkms')
-rw-r--r--drivers/gpu/drm/vkms/vkms_plane.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 0a23875900ec..87b2bccaf083 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -12,12 +12,6 @@
#include "vkms_formats.h"
static const u32 vkms_formats[] = {
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_XRGB16161616,
- DRM_FORMAT_RGB565
-};
-
-static const u32 vkms_plane_formats[] = {
DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XRGB16161616,
@@ -185,7 +179,7 @@ static void vkms_cleanup_fb(struct drm_plane *plane,
drm_gem_fb_vunmap(fb, shadow_plane_state->map);
}
-static const struct drm_plane_helper_funcs vkms_primary_helper_funcs = {
+static const struct drm_plane_helper_funcs vkms_plane_helper_funcs = {
.atomic_update = vkms_plane_atomic_update,
.atomic_check = vkms_plane_atomic_check,
.prepare_fb = vkms_prepare_fb,
@@ -196,38 +190,16 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
enum drm_plane_type type, int index)
{
struct drm_device *dev = &vkmsdev->drm;
- const struct drm_plane_helper_funcs *funcs;
struct vkms_plane *plane;
- const u32 *formats;
- int nformats;
-
- switch (type) {
- case DRM_PLANE_TYPE_PRIMARY:
- formats = vkms_formats;
- nformats = ARRAY_SIZE(vkms_formats);
- funcs = &vkms_primary_helper_funcs;
- break;
- case DRM_PLANE_TYPE_CURSOR:
- case DRM_PLANE_TYPE_OVERLAY:
- formats = vkms_plane_formats;
- nformats = ARRAY_SIZE(vkms_plane_formats);
- funcs = &vkms_primary_helper_funcs;
- break;
- default:
- formats = vkms_formats;
- nformats = ARRAY_SIZE(vkms_formats);
- funcs = &vkms_primary_helper_funcs;
- break;
- }
plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 1 << index,
&vkms_plane_funcs,
- formats, nformats,
+ vkms_formats, ARRAY_SIZE(vkms_formats),
NULL, type, NULL);
if (IS_ERR(plane))
return plane;
- drm_plane_helper_add(&plane->base, funcs);
+ drm_plane_helper_add(&plane->base, &vkms_plane_helper_funcs);
return plane;
}