[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object
From: |
Gerd Hoffmann |
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 |
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
- [PATCH v1 0/5] virtio-gpu: Add implicit (and default) sync mechanism for blobs, Vivek Kasireddy, 2021/06/07
- [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object, Vivek Kasireddy, 2021/06/07
- Re: [PATCH v1 2/5] ui: Add a helper to wait on a dmabuf sync object,
Gerd Hoffmann <=
- [PATCH v1 5/5] virtio-gpu: Make resource_flush wait on the sync object for blobs, Vivek Kasireddy, 2021/06/07
- [PATCH v1 3/5] ui/egl: Add egl helpers to help with synchronization, Vivek Kasireddy, 2021/06/07
- [PATCH v1 4/5] ui: Create sync objects only for blobs, Vivek Kasireddy, 2021/06/07
- [PATCH v1 1/5] ui/gtk: Create a common release_dmabuf helper, Vivek Kasireddy, 2021/06/07
- Re: [PATCH v1 0/5] virtio-gpu: Add implicit (and default) sync mechanism for blobs, no-reply, 2021/06/09