All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object
Date: Tue, 8 Jun 2021 15:57:59 +0200	[thread overview]
Message-ID: <20210608135759.v4t4qq2lqtqeuihc@sirius.home.kraxel.org> (raw)
In-Reply-To: <20210607232530.454435-3-vivek.kasireddy@intel.com>

  Hi,

> +    /* optional */
> +    void (*dpy_gl_wait_dmabuf)(DisplayChangeListener *dcl,
> +                               QemuDmaBuf *dmabuf);

Hmm, a blocking wait isn't the best plan here,
it'll stall the iothread.

We already have a way to stop virtio-gpu command processing:
graphic_hw_gl_block() + graphic_hw_gl_flush()

graphic_hw_gl_block(true) will block virtio-gpu command processing.
graphic_hw_gl_block(false) will unblock virtio-gpu command processing.
graphic_hw_gl_flush() will kick virtio-gpu so it resumes command processing.

I saw in patch #5 that you just do a blocking wait for the fence, which
isn't fundamentally different from what graphic_hw_gl_block does, so it
should be possible to make the gtk ui use that instead.

You'll need an async notification for the fence then.  I think you can
simply poll the fence fd.  Failing that you can either use a timer to
check the fence or do the blocking wait in a new thread.

One little detail is different with graphic_hw_gl_block:  It'll send the
completion no matter what, then stop fetching the next command from the
queue.  So that logic needs an update to also allow delaying the command
completion.

take care,
  Gerd



  reply	other threads:[~2021-06-08 13:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 23:25 [PATCH v1 0/5] virtio-gpu: Add implicit (and default) sync mechanism for blobs Vivek Kasireddy
2021-06-07 23:25 ` [PATCH v1 1/5] ui/gtk: Create a common release_dmabuf helper Vivek Kasireddy
2021-06-08 13:42   ` Gerd Hoffmann
2021-06-07 23:25 ` [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object Vivek Kasireddy
2021-06-08 13:57   ` Gerd Hoffmann [this message]
2021-06-07 23:25 ` [PATCH v1 3/5] ui/egl: Add egl helpers to help with synchronization Vivek Kasireddy
2021-06-08 14:00   ` Gerd Hoffmann
2021-06-08 21:41     ` Kasireddy, Vivek
2021-06-07 23:25 ` [PATCH v1 4/5] ui: Create sync objects only for blobs Vivek Kasireddy
2021-06-07 23:25 ` [PATCH v1 5/5] virtio-gpu: Make resource_flush wait on the sync object " Vivek Kasireddy
2021-06-09 14:28 ` [PATCH v1 0/5] virtio-gpu: Add implicit (and default) sync mechanism " 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=20210608135759.v4t4qq2lqtqeuihc@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 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.