qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nikola Pavlica <pavlica.nikola@gmail.com>
To: qemu-devel@nongnu.org, qemu-devel@nongnu.com
Cc: r_qemu@t-online.de, philmd@redhat.com, kraxel@redhat.com,
	Nikola Pavlica <pavlica.nikola@gmail.com>
Subject: [PATCH 2/2] ui/gtk: update monitor interval on egl displays
Date: Thu, 14 Jan 2021 14:48:51 +0100	[thread overview]
Message-ID: <20210114134851.292767-3-pavlica.nikola@gmail.com> (raw)
In-Reply-To: <20210114134851.292767-1-pavlica.nikola@gmail.com>

When running QEMU's GTK UI without EGL or OGL, the
gd_monitor_update_interval function gets executed and the display refresh
rate gets updated accordingly. However, when using EGL or just regular
OGL, the function never gets executed.

Which is why I decided that the function should be in gd_egl_refresh
where the display output gets updated, in the same vain as how it's done
for normal GTK UIs (aka. those without EGL) - in it's display refresh
function.

Since the gd_monitor_update_interval function now is exposed, we are
going to use it to update the refresh rate.

Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com>
---
 ui/gtk-egl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 99231a3597..71c3d698b4 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -113,6 +113,9 @@ void gd_egl_refresh(DisplayChangeListener *dcl)
 {
     VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
 
+    vc->gfx.dcl.update_interval = gd_monitor_update_interval(
+            vc->window ? vc->window : vc->gfx.drawing_area);
+
     if (!vc->gfx.esurface) {
         gd_egl_init(vc);
         if (!vc->gfx.esurface) {
-- 
2.30.0



  parent reply	other threads:[~2021-01-14 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14 13:48 [PATCH 0/2] ui/gtk: run gd_monitor_update_interval on EGL as well Nikola Pavlica
2021-01-14 13:48 ` [PATCH 1/2] ui/gtk: expose gd_monitor_update_interval Nikola Pavlica
2021-01-14 13:48 ` Nikola Pavlica [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-14 14:01 [PATCH 0/2] ui/gtk: Update refresh rate on EGL as well Nikola Pavlica
2021-01-14 14:01 ` [PATCH 2/2] ui/gtk: update monitor interval on egl displays Nikola Pavlica
2021-01-14 13:45 [PATCH 0/2] ui/gtk: run gd_monitor_update_interval on EGL as well Nikola Pavlica
2021-01-14 13:45 ` [PATCH 2/2] ui/gtk: update monitor interval on egl displays Nikola Pavlica

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=20210114134851.292767-3-pavlica.nikola@gmail.com \
    --to=pavlica.nikola@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=r_qemu@t-online.de \
    /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).