summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vkms/vkms_plane.c
diff options
context:
space:
mode:
authorMelissa Wen <melissa.srw@gmail.com>2021-04-24 05:26:10 -0300
committerMelissa Wen <melissa.srw@gmail.com>2021-04-29 18:53:05 -0300
commit310e506c06e495b8fbe3502c70d896bc5b8b2502 (patch)
tree618543d8ecead43d09170a7d84df8d1670dee7c2 /drivers/gpu/drm/vkms/vkms_plane.c
parent32a1648aca440904e0943b9cf36d5a3318205bb1 (diff)
drm/vkms: add overlay support
Add support to overlay plane, in addition to primary and cursor planes. In this approach, the plane composition still requires an active primary plane and planes are composed associatively in the order: (primary <- overlay) <- cursor It enables to run the following IGT tests successfully: - kms_plane_cursor: - pipe-A-[overlay, primary, viewport]-size-[64, 128, 256] - kms_atomic: - plane-overlay-legacy and preserves the successful execution of kms_cursor_crc, kms_writeback and kms_flip Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/8261bf93d8a0e3ffaf81d8e7c9b3e9c229116be3.1619250933.git.melissa.srw@gmail.com
Diffstat (limited to 'drivers/gpu/drm/vkms/vkms_plane.c')
-rw-r--r--drivers/gpu/drm/vkms/vkms_plane.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index da4251aff67f..107521ace597 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -133,7 +133,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);
- if (plane->type == DRM_PLANE_TYPE_CURSOR)
+ if (plane->type != DRM_PLANE_TYPE_PRIMARY)
can_position = true;
ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
@@ -200,14 +200,23 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
const u32 *formats;
int nformats;
- if (type == DRM_PLANE_TYPE_CURSOR) {
+ 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;
- } else {
+ 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,