From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Dongwon Kim <dongwon.kim@intel.com>, dri-devel@lists.freedesktop.org
Cc: kraxel@redhat.com, vivek.kasireddy@intel.com
Subject: Re: [RFC PATCH v2 1/1] drm/virtio: new fence for every plane update
Date: Mon, 23 Oct 2023 15:24:16 +0300 [thread overview]
Message-ID: <675400bf-74fb-8495-b2b8-3ff717979369@collabora.com> (raw)
In-Reply-To: <20231003010013.15794-2-dongwon.kim@intel.com>
On 10/3/23 04:00, Dongwon Kim wrote:
> Having a fence linked to a virtio_gpu_framebuffer in the plane update sequence
> would cause conflict when several planes referencing the same framebuffer
> (e.g. Xorg screen covering multi-displays configured for an extended mode)
> and those planes are updated concurrently. So it is needed to allocate a
> fence for every plane state instead of the framebuffer.
>
> The plane state for virtio-gpu, "struct virtio_gpu_plane_state" is added for
> this. This structure represents drm_plane_state and it contains the reference
> to virtio_gpu_fence, which was previously in "struct virtio_gpu_framebuffer".
>
> "virtio_gpu_plane_duplicate_state" is added as well to create a
> virtio_gpu_plane_state on top of duplicated drm plane state.
>
> Several drm helpers were slightly modified accordingly to use the fence in new
> plane state structure. virtio_gpu_plane_cleanup_fb was completely removed as
> dma_fence_put shouldn't be called here as it can mess up with the ref count
> of the fence. The fence should be put after the fence is signaled in
> virtio_gpu_resource_flush then released in virtio_gpu_array_add_fence while
> the next virtio message is being queued.
>
> Also, the condition for adding fence, (plane->state->fb != new_state->fb) was
> removed since we now allocate a new fence for the new plane state even if both
> old and new planes are pointing to the same framebuffer.
>
> v2: removed virtio_gpu_plane_duplicate_state as the existing helper,
> drm_atomic_helper_plane_destroy_state does the same.
>
> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
> drivers/gpu/drm/virtio/virtgpu_drv.h | 7 +++
> drivers/gpu/drm/virtio/virtgpu_plane.c | 66 +++++++++++++++++---------
> 2 files changed, 51 insertions(+), 22 deletions(-)
Please write a guide how to test it. Are you using spice for the
multi-display viewer?
--
Best regards,
Dmitry
next prev parent reply other threads:[~2023-10-23 12:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 1:00 [RFC PATCH v2 0/1] fence per plane state Dongwon Kim
2023-10-03 1:00 ` [RFC PATCH v2 1/1] drm/virtio: new fence for every plane update Dongwon Kim
2023-10-23 12:24 ` Dmitry Osipenko [this message]
2023-10-23 17:31 ` Kim, Dongwon
2023-11-13 16:15 ` Dmitry Osipenko
2023-11-13 18:25 ` Kim, Dongwon
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=675400bf-74fb-8495-b2b8-3ff717979369@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=vivek.kasireddy@intel.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;
as well as URLs for NNTP newsgroup(s).