From: Dongwon Kim <dongwon.kim@intel.com>
To: qemu-devel@nongnu.org
Cc: "Dongwon Kim" <dongwon.kim@intel.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Vivek Kasireddy" <vivek.kasireddy@intel.com>
Subject: [PATCH] ui/gtk: skip refresh if new dmabuf has been submitted
Date: Thu, 6 Jul 2023 11:33:55 -0700 [thread overview]
Message-ID: <20230706183355.29361-2-dongwon.kim@intel.com> (raw)
In-Reply-To: <20230706183355.29361-1-dongwon.kim@intel.com>
Skip refresh if a new dmabuf (guest scanout frame) has already been
submitted and ready to be drawn because the scanout will be updated
with new frame anyway.
Cc: Gerd Hoffmann <kraxel@redhat.com>
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-egl.c | 4 ++++
ui/gtk-gl-area.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index d59b8cd7d7..859aa8185e 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -144,6 +144,10 @@ void gd_egl_refresh(DisplayChangeListener *dcl)
gd_update_monitor_refresh_rate(
vc, vc->window ? vc->window : vc->gfx.drawing_area);
+ if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) {
+ return;
+ }
+
if (!vc->gfx.esurface) {
gd_egl_init(vc);
if (!vc->gfx.esurface) {
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index 7367dfd793..7da75bd025 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -123,6 +123,10 @@ void gd_gl_area_refresh(DisplayChangeListener *dcl)
gd_update_monitor_refresh_rate(vc, vc->window ? vc->window : vc->gfx.drawing_area);
+ if (vc->gfx.guest_fb.dmabuf && vc->gfx.guest_fb.dmabuf->draw_submitted) {
+ return;
+ }
+
if (!vc->gfx.gls) {
if (!gtk_widget_get_realized(vc->gfx.drawing_area)) {
return;
--
2.34.1
next prev parent reply other threads:[~2023-07-06 18:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 18:51 [PATCH] ui/gtk: skip refresh if new dmabuf is submitted Dongwon Kim
2023-07-04 15:54 ` Marc-André Lureau
2023-07-06 18:33 ` [PATCH] ui/gtk: set scanout-mode right before scheduling draw Dongwon Kim
2023-07-06 18:33 ` Dongwon Kim [this message]
2023-07-17 9:31 ` [PATCH] ui/gtk: skip refresh if new dmabuf has been submitted Marc-André Lureau
2023-07-17 9:29 ` [PATCH] ui/gtk: set scanout-mode right before scheduling draw Marc-André Lureau
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=20230706183355.29361-2-dongwon.kim@intel.com \
--to=dongwon.kim@intel.com \
--cc=kraxel@redhat.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).