All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: RE: [PATCH v2 8/8] virtio-gpu: Add gl_flushed callback
Date: Tue, 15 Jun 2021 23:34:50 +0000	[thread overview]
Message-ID: <2439020937f0488abc7b56a22945c1b3@intel.com> (raw)
In-Reply-To: <20210615055026.m5az4qqmvh72iwbc@sirius.home.kraxel.org>

Hi Gerd,

> 
> > -    if (!cmd->finished) {
> > +    if (!cmd->finished && !(cmd->cmd_hdr.flags & VIRTIO_GPU_FLAG_FENCE)) {
> >          virtio_gpu_ctrl_response_nodata(g, cmd, cmd->error ? cmd->error :
> >                                          VIRTIO_GPU_RESP_OK_NODATA);
> >      }
> 
> My idea would be more along the lines of ...
> 
> if (!cmd->finished) {
>     if (renderer_blocked) {
>        g->pending_completion = cmd;
>     } else {
>        virtio_gpu_ctrl_response_nodata(...)
>     }
> }
> 
> Then, when resuming processing after unblock check pending_completion
> and call virtio_gpu_ctrl_response_nodata if needed.
> 
> Workflow:
> 
> virtio_gpu_simple_process_cmd()
>  -> virtio_gpu_resource_flush()
>    -> dpy_gfx_update()
>      -> gd_gl_area_update()
>         call graphic_hw_gl_block(true), create fence.
[Kasireddy, Vivek] So, with blobs, as you know we call dpy_gl_update() and this call
just "queues" the render/redraw. And, GTK then later calls the render signal callback 
which in this case would be gd_gl_area_draw() which is where the actual Blit happens
and also glFlush; only after which we can create a fence.

> virtio_gpu_simple_process_cmd()
>   -> will see renderer_blocked and delays RESOURCE_FLUSH completion.
> 
> Then, when the fence is ready, gtk will:
>  - call graphic_hw_gl_block(false)
>  - call graphic_hw_gl_flush()
>    -> virtio-gpu resumes processing the cmd queue.
[Kasireddy, Vivek] Yeah, I think this can be done.

> 
> When you use the existing block/unblock functionality the fence can be a
> gtk internal detail, virtio-gpu doesn't need to know that gtk uses a
> fence to wait for the moment when it can unblock virtio queue processing
> (the egl fence helpers still make sense).
[Kasireddy, Vivek] Ok, I'll try to include your suggestions in v3.

Thanks,
Vivek
> 
> take care,
>   Gerd



  reply	other threads:[~2021-06-15 23:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 22:48 [PATCH v2 0/8] virtio-gpu: Add a default synchronization mechanism for blobs Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 1/8] ui/gtk: Create a common release_dmabuf helper Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 2/8] ui/egl: Add egl helpers to help with synchronization Vivek Kasireddy
2021-06-15  5:31   ` Gerd Hoffmann
2021-06-15 23:11     ` Kasireddy, Vivek
2021-06-10 22:48 ` [PATCH v2 3/8] ui: Add a helper to wait on a dmabuf sync object Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 4/8] ui/gtk: Implement wait_dmabuf function Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 5/8] ui: Create sync objects only for blobs Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 6/8] ui/gtk-egl: Wait for the draw signal for dmabuf blobs Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 7/8] virtio-gpu: Add dmabuf helpers for synchronization Vivek Kasireddy
2021-06-10 22:48 ` [PATCH v2 8/8] virtio-gpu: Add gl_flushed callback Vivek Kasireddy
2021-06-15  5:50   ` Gerd Hoffmann
2021-06-15 23:34     ` Kasireddy, Vivek [this message]
2021-06-14 22:48 ` [PATCH v2 0/8] virtio-gpu: Add a default synchronization mechanism for blobs no-reply

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=2439020937f0488abc7b56a22945c1b3@intel.com \
    --to=vivek.kasireddy@intel.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.