[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211213181131.17223-3-jose.exposito89@gmail.com>
Date: Mon, 13 Dec 2021 19:11:30 +0100
From: José Expósito <jose.exposito89@...il.com>
To: rodrigosiqueiramelo@...il.com
Cc: melissa.srw@...il.com, hamohammed.sa@...il.com, daniel@...ll.ch,
airlied@...ux.ie, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH 2/3] drm/vkms: add support for multiple overlay planes
Add a new module parameter to allow to set the number of overlay planes
to create. Set it to 1 by default in order to keep the "enable_overlay"
backwards compatible.
Signed-off-by: José Expósito <jose.exposito89@...il.com>
---
drivers/gpu/drm/vkms/vkms_drv.c | 5 +++++
drivers/gpu/drm/vkms/vkms_drv.h | 1 +
drivers/gpu/drm/vkms/vkms_output.c | 9 ++++++---
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
index 0ffe5f0e33f7..bb98f6c6c561 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.c
+++ b/drivers/gpu/drm/vkms/vkms_drv.c
@@ -51,6 +51,10 @@ static bool enable_overlay;
module_param_named(enable_overlay, enable_overlay, bool, 0444);
MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
+static unsigned int num_overlay_planes = 1;
+module_param_named(num_overlay_planes, num_overlay_planes, uint, 0444);
+MODULE_PARM_DESC(num_overlay_planes, "Number of overlay planes to create");
+
DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
static void vkms_release(struct drm_device *dev)
@@ -229,6 +233,7 @@ static int __init vkms_init(void)
config->cursor = enable_cursor;
config->writeback = enable_writeback;
config->overlay = enable_overlay;
+ config->num_overlay_planes = num_overlay_planes;
return vkms_create(config);
}
diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
index d48c23d40ce5..33bdf717e3cd 100644
--- a/drivers/gpu/drm/vkms/vkms_drv.h
+++ b/drivers/gpu/drm/vkms/vkms_drv.h
@@ -97,6 +97,7 @@ struct vkms_config {
bool writeback;
bool cursor;
bool overlay;
+ unsigned int num_overlay_planes;
/* only set when instantiated */
struct vkms_device *dev;
};
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 2e805b2d36ae..6f26998fdb7e 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -57,15 +57,18 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
struct vkms_plane *primary, *cursor = NULL;
int ret;
int writeback;
+ unsigned int n;
primary = vkms_plane_init(vkmsdev, DRM_PLANE_TYPE_PRIMARY, index);
if (IS_ERR(primary))
return PTR_ERR(primary);
if (vkmsdev->config->overlay) {
- ret = vkms_add_overlay_plane(vkmsdev, index, crtc);
- if (ret)
- return ret;
+ for (n = 0; n < vkmsdev->config->num_overlay_planes; n++) {
+ ret = vkms_add_overlay_plane(vkmsdev, index, crtc);
+ if (ret)
+ return ret;
+ }
}
if (vkmsdev->config->cursor) {
--
2.25.1
Powered by blists - more mailing lists