From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Pekka Paalanen" <ppaalanen@gmail.com>,
"Simon Ser" <contact@emersion.fr>,
"Michel Dänzer" <michel@daenzer.net>,
"Zhang, Tina" <tina.zhang@intel.com>,
"Kim, Dongwon" <dongwon.kim@intel.com>
Subject: RE: [RFC v1 0/4] drm: Add support for DRM_CAP_DEFERRED_OUT_FENCE capability
Date: Wed, 4 Aug 2021 07:27:00 +0000 [thread overview]
Message-ID: <48d7f260adcc4c3e8dac28ec19bcf998@intel.com> (raw)
In-Reply-To: <20210803075147.n5rbmdsrbhh5auk5@sirius.home.kraxel.org>
Hi Gerd,
>
> > > virtio_gpu_primary_plane_update() will send RESOURCE_FLUSH only for
> > > DIRTYFB and both SET_SCANOUT + RESOURCE_FLUSH for page-flip, and I
> > > think for the page-flip case the host (aka qemu) doesn't get the
> > > "wait until old framebuffer is not in use any more" right yet.
> > [Kasireddy, Vivek] As you know, with the GTK UI backend and this patch series:
> > https://lists.nongnu.org/archive/html/qemu-devel/2021-06/msg06745.html
> > we do create a sync file fd -- after the Blit -- and wait (adding it to Qemu's main
> > event loop) for it to ensure that the Guest scanout FB is longer in use on the Host.
> > This mechanism works in a similarly way for both frontbuffer DIRTYFB case and
> > also the double-buffer case.
>
> Well, we don't explicitly wait on the old framebuffer. Not fully sure
> this is actually needed, maybe the command ordering (SET_SCANOUT goes
> first) is enough.
[Kasireddy, Vivek] When the sync file fd is signaled, the new FB can be considered done/free
on the Host; and, when this new FB becomes the old FB -- after another FB is submitted
by the Guest -- we don't need to explicitly wait as we already did that in the previous
cycle.
Strictly speaking, in the double-buffered Guest case, we should be waiting for the
sync file fd of the old FB and not the new one. However, if we do this, we saw that
the Guest will render faster (~90 FPS) than what the Host can consume (~60 FPS)
resulting in unnecessary GPU cycles. And, in addition, we can't be certain about
whether a Guest is using double-buffering or single as we noticed that Windows
Guests tend to switch between single and double-buffering at runtime based on
the damage, etc.
>
> > > So we'll need a host-side fix for that and a guest-side fix to switch
> > > from a blocking wait on the fence to vblank events.
> > [Kasireddy, Vivek] Do you see any concerns with the blocking wait?
>
> Well, it's sync vs. async for userspace.
>
> With the blocking wait the userspace ioctl (PAGE_FLIP or the atomic
> version of it) will return when the host is done.
>
> Without the blocking wait the userspace ioctl will return right away and
> userspace can do something else until the host is done (and the vbland
> event is sent to notify userspace).
[Kasireddy, Vivek] Right, but upstream Weston -- and I am guessing Mutter as well --
almost always choose DRM_MODE_ATOMIC_NONBLOCK. In this case, the
atomic ioctl call would not block and the blocking wait will instead happen in the
commit_work/commit_tail workqueue thread.
>
> > And, are you
> > suggesting that we use a vblank timer?
>
> I think we should send the vblank event when the RESOURCE_FLUSH fence
> signals the host is done.
[Kasireddy, Vivek] That is how it works now:
drm_atomic_helper_commit_planes(dev, old_state, 0);
drm_atomic_helper_commit_modeset_enables(dev, old_state);
drm_atomic_helper_fake_vblank(old_state);
The blocking wait is in the plane_update hook called by drm_atomic_helper_commit_planes()
and immediately after that the fake vblank is sent.
Thanks,
Vivek
>
> take care,
> Gerd
next prev parent reply other threads:[~2021-08-04 7:27 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 8:16 [RFC v1 0/4] drm: Add support for DRM_CAP_DEFERRED_OUT_FENCE capability Vivek Kasireddy
2021-07-29 8:16 ` [RFC v1 1/4] drm: Add a capability flag to support deferred out_fence signalling Vivek Kasireddy
2021-07-29 8:16 ` [RFC v1 2/4] virtio-gpu uapi: Add VIRTIO_GPU_F_OUT_FENCE feature Vivek Kasireddy
2021-07-29 9:50 ` Gerd Hoffmann
2021-07-29 18:53 ` Kasireddy, Vivek
2021-07-29 8:16 ` [RFC v1 3/4] drm/virtio: Add VIRTIO_GPU_CMD_RESOURCE_OUT_FENCE cmd Vivek Kasireddy
2021-07-29 8:16 ` [RFC v1 4/4] drm/virtio: Probe and implement VIRTIO_GPU_F_OUT_FENCE feature Vivek Kasireddy
2021-07-29 9:52 ` Gerd Hoffmann
2021-07-29 18:55 ` Kasireddy, Vivek
2021-07-30 10:25 ` [RFC v1 0/4] drm: Add support for DRM_CAP_DEFERRED_OUT_FENCE capability Daniel Vetter
2021-07-30 12:50 ` Michel Dänzer
2021-08-02 7:59 ` Daniel Vetter
2021-08-02 8:49 ` Michel Dänzer
2021-08-02 9:06 ` Daniel Vetter
2021-08-02 9:19 ` Michel Dänzer
2021-07-30 13:38 ` Gerd Hoffmann
2021-08-02 9:09 ` Daniel Vetter
2021-08-02 12:50 ` Gerd Hoffmann
2021-08-02 14:35 ` Daniel Vetter
2021-08-03 6:18 ` Kasireddy, Vivek
2021-08-03 7:51 ` Gerd Hoffmann
2021-08-04 7:27 ` Kasireddy, Vivek [this message]
2021-08-02 4:48 ` Zhang, Tina
2021-08-02 6:51 ` Kasireddy, Vivek
2021-08-02 8:14 ` Daniel Vetter
2021-08-03 6:11 ` Kasireddy, Vivek
2021-08-03 7:33 ` Michel Dänzer
2021-08-04 7:25 ` Kasireddy, Vivek
2021-08-04 12:11 ` Daniel Vetter
2021-08-05 4:15 ` Kasireddy, Vivek
2021-08-05 12:08 ` Daniel Vetter
2021-08-06 7:27 ` Kasireddy, Vivek
2021-08-09 14:15 ` Daniel Vetter
2021-08-10 8:21 ` Kasireddy, Vivek
2021-08-10 8:30 ` Daniel Vetter
2021-08-10 10:57 ` Michel Dänzer
2021-08-11 7:25 ` Kasireddy, Vivek
2021-08-11 7:20 ` Kasireddy, Vivek
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=48d7f260adcc4c3e8dac28ec19bcf998@intel.com \
--to=vivek.kasireddy@intel.com \
--cc=contact@emersion.fr \
--cc=daniel@ffwll.ch \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=michel@daenzer.net \
--cc=ppaalanen@gmail.com \
--cc=tina.zhang@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).