dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: "Baorui.Liu" <baorliu@amd.com>, dri-devel@lists.freedesktop.org
Cc: virtualization@lists.linux.dev, airlied@redhat.com,
	kraxel@redhat.com, gurchetansingh@chromium.org,
	olvaffe@gmail.com, lili.gong@amd.com,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Simona Vetter <simona@ffwll.ch>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/virtio: add overlay plane format support
Date: Fri, 9 Oct 2026 21:20:53 +0300	[thread overview]
Message-ID: <8eb83031-432b-43be-b45c-71d28ebe0c2a@collabora.com> (raw)
In-Reply-To: <20260924142242.676-1-baorliu@amd.com>

24.09.2026 17:22, Baorui.Liu пишет:
> From: Sophia Gong <lili.gong@amd.com>
> 
> Advertise additional pixel formats for virtio-gpu overlay planes so a
> userspace compositor can use KMS overlay composition instead of
> falling back to GPU composition.
> 
> Handle DRM_PLANE_TYPE_OVERLAY in virtio_gpu_plane_init() with a
> dedicated format list, and reuse the primary plane update path for
> overlay scanout.
> 
> Signed-off-by: Sophia Gong <lili.gong@amd.com>
> Signed-off-by: Baorui.Liu <baorliu@amd.com>
> ---
>  drivers/gpu/drm/virtio/virtgpu_plane.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
> index 29e4b458ae57..23ca880692f1 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
> @@ -41,6 +41,21 @@ static const uint32_t virtio_gpu_cursor_formats[] = {
>  	DRM_FORMAT_HOST_ARGB8888,
>  };
>  
> +static const uint32_t virtio_gpu_overlay_formats[] = {
> +	DRM_FORMAT_XRGB8888,
> +	DRM_FORMAT_ARGB8888,
> +	DRM_FORMAT_BGRX8888,
> +	DRM_FORMAT_BGRA8888,
> +	DRM_FORMAT_RGBX8888,
> +	DRM_FORMAT_RGBA8888,
> +	DRM_FORMAT_XBGR8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XRGB2101010,
> +	DRM_FORMAT_BGRX1010102,
> +	DRM_FORMAT_NV12,
> +	DRM_FORMAT_P010,
> +};
> +
>  uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
>  {
>  	uint32_t format;
> @@ -572,6 +587,13 @@ static const struct drm_plane_helper_funcs virtio_gpu_cursor_helper_funcs = {
>  	.atomic_update		= virtio_gpu_cursor_plane_update,
>  };
>  
> +static const struct drm_plane_helper_funcs virtio_gpu_overlay_helper_funcs = {
> +	.prepare_fb		= virtio_gpu_plane_prepare_fb,
> +	.cleanup_fb		= virtio_gpu_plane_cleanup_fb,
> +	.atomic_check		= virtio_gpu_plane_atomic_check,
> +	.atomic_update		= virtio_gpu_primary_plane_update,
> +};
> +
>  struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
>  					enum drm_plane_type type,
>  					int index)
> @@ -586,6 +608,10 @@ struct drm_plane *virtio_gpu_plane_init(struct virtio_gpu_device *vgdev,
>  		formats = virtio_gpu_cursor_formats;
>  		nformats = ARRAY_SIZE(virtio_gpu_cursor_formats);
>  		funcs = &virtio_gpu_cursor_helper_funcs;
> +	} else if (type == DRM_PLANE_TYPE_OVERLAY) {
> +		formats = virtio_gpu_overlay_formats;
> +		nformats = ARRAY_SIZE(virtio_gpu_overlay_formats);
> +		funcs = &virtio_gpu_overlay_helper_funcs;
>  	} else {
>  		formats = virtio_gpu_formats;
>  		nformats = ARRAY_SIZE(virtio_gpu_formats);

This won't work on its own without actually creating overlay planes and
having host supporting overlays based on virtio-gpu specification
defining how overlays are defined in protocol and work.

Upstreaming such feature will require you to provide spec, full guest
and host implementations of overlays.

-- 
Best regards,
Dmitry

      parent reply	other threads:[~2026-10-09 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 14:22 [PATCH] drm/virtio: add overlay plane format support Baorui.Liu
2026-09-24 14:33 ` sashiko-bot
2026-10-09 18:20 ` Dmitry Osipenko [this message]

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=8eb83031-432b-43be-b45c-71d28ebe0c2a@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=airlied@redhat.com \
    --cc=baorliu@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=kraxel@redhat.com \
    --cc=lili.gong@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux.dev \
    /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