From: Melissa Wen <mwen@igalia.com>
To: "José Expósito" <jose.exposito89@gmail.com>
Cc: rodrigosiqueiramelo@gmail.com, hamohammed.sa@gmail.com,
airlied@linux.ie, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, melissa.srw@gmail.com
Subject: Re: [PATCH 2/3] drm/vkms: add support for multiple overlay planes
Date: Thu, 23 Dec 2021 19:17:06 -0100 [thread overview]
Message-ID: <20211223201624.3w2zy265ehrfwm2w@mail.igalia.com> (raw)
In-Reply-To: <20211213181131.17223-3-jose.exposito89@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3465 bytes --]
On 12/13, José Expósito wrote:
> 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.
>
Hi José,
in general, lgtm. However, I think we need some limits for this number
of planes. I would suggest to just expand the enable_overlay option to
expose a predefined number of planes and to avoid passing "crazy"
numbers by another module option.
Afaik, we are also limited to 32, as you can see in this commit:
2a8d3eac3d6e1
drm: Warn if plane/crtc/encoder/connector index exceeds our 32bit bitmasks
I don't have a strong opinion on an exact/practical number. I took a
quick look at other drivers and exposing 8 planes seems reasonable to
me. Also, changing this number in the future would be pretty
straightfoward.
Thanks,
Melissa
> Signed-off-by: José Expósito <jose.exposito89@gmail.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
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-12-23 21:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-13 18:11 [PATCH 0/3] " José Expósito
2021-12-13 18:11 ` [PATCH 1/3] drm/vkms: refactor overlay plane creation José Expósito
2021-12-13 18:11 ` [PATCH 2/3] drm/vkms: add support for multiple overlay planes José Expósito
2021-12-23 20:17 ` Melissa Wen [this message]
2021-12-13 18:11 ` [PATCH 3/3] drm/vkms: drop "Multiple overlay planes" TODO José Expósito
2021-12-23 20:35 ` [PATCH 0/3] drm/vkms: add support for multiple overlay planes Melissa Wen
2021-12-24 11:55 ` José Expósito
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=20211223201624.3w2zy265ehrfwm2w@mail.igalia.com \
--to=mwen@igalia.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jose.exposito89@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=melissa.srw@gmail.com \
--cc=rodrigosiqueiramelo@gmail.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
all inboxes | Powered by JetHome®