summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vkms/vkms_output.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_output.c
parent32a1648aca440904e0943b9cf36d5a3318205bb1 (diff)
downloadlwn-310e506c06e495b8fbe3502c70d896bc5b8b2502.tar.gz
lwn-310e506c06e495b8fbe3502c70d896bc5b8b2502.zip
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_output.c')
-rw-r--r--drivers/gpu/drm/vkms/vkms_output.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 6979fbc7f821..04406bd3ff02 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -39,7 +39,7 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
struct drm_connector *connector = &output->connector;
struct drm_encoder *encoder = &output->encoder;
struct drm_crtc *crtc = &output->crtc;
- struct vkms_plane *primary, *cursor = NULL;
+ struct vkms_plane *primary, *cursor = NULL, *overlay = NULL;
int ret;
int writeback;
@@ -47,6 +47,15 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
if (IS_ERR(primary))
return PTR_ERR(primary);
+ if (vkmsdev->config->overlay) {
+ overlay = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_OVERLAY, index);
+ if (IS_ERR(overlay))
+ return PTR_ERR(overlay);
+
+ if (!overlay->base.possible_crtcs)
+ overlay->base.possible_crtcs = drm_crtc_mask(crtc);
+ }
+
if (vkmsdev->config->cursor) {
cursor = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_CURSOR, index);
if (IS_ERR(cursor))