* [PATCH] ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd
@ 2021-11-21 17:22 Dongwon Kim
2021-11-22 12:10 ` [PATCH-for-6.2?] " Philippe Mathieu-Daudé
0 siblings, 1 reply; 2+ messages in thread
From: Dongwon Kim @ 2021-11-21 17:22 UTC (permalink / raw)
To: qemu-devel; +Cc: Vivek Kasireddy, Dongwon Kim, Gerd Hoffmann
The dmabuf often becomes invalid right after unblocking pipeline
and graphic_hw_gl_flushed in case a new scanout blob is submitted
because the dmabuf associated with the current guest scanout is
freed after swapping.
So both graphic_hw_gl_block and graphic_hw_gl_flushed should be
executed after closing fence_fd for the current dmabuf.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
ui/gtk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index 7abe1a69d8..2a3a9db13f 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -589,11 +589,11 @@ void gd_hw_gl_flushed(void *vcon)
VirtualConsole *vc = vcon;
QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
- graphic_hw_gl_block(vc->gfx.dcl.con, false);
- graphic_hw_gl_flushed(vc->gfx.dcl.con);
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);
+ graphic_hw_gl_flushed(vc->gfx.dcl.con);
}
/** DisplayState Callbacks (opengl version) **/
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH-for-6.2?] ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd
2021-11-21 17:22 [PATCH] ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd Dongwon Kim
@ 2021-11-22 12:10 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-22 12:10 UTC (permalink / raw)
To: Dongwon Kim, Vivek Kasireddy, Gerd Hoffmann; +Cc: qemu-devel
On 11/21/21 18:22, Dongwon Kim wrote:
> The dmabuf often becomes invalid right after unblocking pipeline
> and graphic_hw_gl_flushed in case a new scanout blob is submitted
> because the dmabuf associated with the current guest scanout is
> freed after swapping.
>
> So both graphic_hw_gl_block and graphic_hw_gl_flushed should be
> executed after closing fence_fd for the current dmabuf.
>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
If so:
Fixes: 65b847d284c ("ui: Create sync objects and fences only for blobs")
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
> ui/gtk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 7abe1a69d8..2a3a9db13f 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -589,11 +589,11 @@ void gd_hw_gl_flushed(void *vcon)
> VirtualConsole *vc = vcon;
> QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;
>
> - graphic_hw_gl_block(vc->gfx.dcl.con, false);
> - graphic_hw_gl_flushed(vc->gfx.dcl.con);
> 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);
> + graphic_hw_gl_flushed(vc->gfx.dcl.con);
> }
>
> /** DisplayState Callbacks (opengl version) **/
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-22 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-21 17:22 [PATCH] ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd Dongwon Kim
2021-11-22 12:10 ` [PATCH-for-6.2?] " Philippe Mathieu-Daudé
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).