From: Dongwon Kim <dongwon.kim@intel.com>
To: qemu-devel@nongnu.org
Cc: "Dongwon Kim" <dongwon.kim@intel.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>
Subject: [PATCH 2/3] ui/gtk: unblock pipeline only if fence hasn't been signaled yet
Date: Wed, 13 Dec 2023 20:24:18 +0000 [thread overview]
Message-ID: <20231213202419.15459-2-dongwon.kim@intel.com> (raw)
In-Reply-To: <20231213202419.15459-1-dongwon.kim@intel.com>
It is needed to unblock the pipeline only if there is an active dmabuf
to be rendered and the fence for it is not yet signaled.
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
ui/gtk.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index ea8d07833e..073c9eadb8 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -597,10 +597,16 @@ void gd_hw_gl_flushed(void *vcon)
VirtualConsole *vc = vcon;
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
- qemu_set_fd_handler(dmabuf->fence_fd, NULL, NULL, NULL);
- close(dmabuf->fence_fd);
- dmabuf->fence_fd = -1;
- graphic_hw_gl_block(vc->gfx.dcl.con, false);
+ if (!dmabuf) {
+ return;
+ }
+
+ if (dmabuf->fence_fd > 0) {
+ qemu_set_fd_handler(dmabuf->fence_fd, NULL, NULL, NULL);
+ close(dmabuf->fence_fd);
+ dmabuf->fence_fd = -1;
+ graphic_hw_gl_block(vc->gfx.dcl.con, false);
+ }
}
/** DisplayState Callbacks (opengl version) **/
--
2.34.1
next prev parent reply other threads:[~2023-12-14 4:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 18:40 [PATCH] ui/gtk: flush display pipeline before saving vmstate when blob=true Dongwon Kim
2023-12-05 7:14 ` Marc-André Lureau
2023-12-05 22:05 ` Kim, Dongwon
2023-12-06 7:02 ` Marc-André Lureau
2023-12-13 20:24 ` [PATCH 1/3] " Dongwon Kim
2023-12-13 20:24 ` Dongwon Kim [this message]
2023-12-15 8:36 ` [PATCH 2/3] ui/gtk: unblock pipeline only if fence hasn't been signaled yet Marc-André Lureau
2023-12-15 12:49 ` BALATON Zoltan
2023-12-28 18:40 ` Kim, Dongwon
2023-12-13 20:24 ` [PATCH 3/3] virtio-gpu: first surface update with blob scanout after resumed Dongwon Kim
2024-03-05 12:56 ` Marc-André Lureau
2024-03-05 22:22 ` [PATCH 1/2] ui/gtk: flush display pipeline before saving vmstate when blob=true dongwon.kim
2024-03-05 22:22 ` [PATCH 2/2] virtio-gpu: first surface update with blob scanout after resumed dongwon.kim
2024-03-06 8:42 ` Marc-André Lureau
2023-12-15 8:33 ` [PATCH 1/3] ui/gtk: flush display pipeline before saving vmstate when blob=true Marc-André Lureau
2023-12-29 7:28 ` Kasireddy, Vivek
2023-12-29 19:22 ` 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=20231213202419.15459-2-dongwon.kim@intel.com \
--to=dongwon.kim@intel.com \
--cc=marcandre.lureau@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 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).