From nobody Tue Nov 18 14:12:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610632124; cv=none; d=zohomail.com; s=zohoarc; b=gzIdYAP2+hrcbYoeUegM4JJ2Tbocsy2kLXRgwEF8dKNyzHsYnjg2dyp9Dye8bqnrIPmHoJhQfyolJhfQKNT6bGm6HBlZeugKvkAhXwmoFPtcYWci/8u2988cNziEDeZhQv1+MbM+odQxn/EwR/0F8hdAaXtvk68O+B+ZgEmh/aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610632124; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=76J19Z46dfDAROoPlZLlI73X5SF0+xkfiFl0PfM58YM=; b=lLwALrKhVojqIYlWLBdsusYqSOR2O5vfMFBLFDBS+PAFuDKjXmopqeOh6OdjdkReJOjNCCOVpiE3+g8I99Thxg14U8xPwemvxurVQSnTCpCo5HD8/mHR1aqQGMHFLdT1CYiTf2j7iF7eXoRGpI600MX00+v5BvA0ZpCZH7fta0I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610632124527289.6372073699239; Thu, 14 Jan 2021 05:48:44 -0800 (PST) Received: from localhost ([::1]:37494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l02zT-0006af-GY for importer@patchew.org; Thu, 14 Jan 2021 08:48:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l02xO-0004OZ-JL for qemu-devel@nongnu.org; Thu, 14 Jan 2021 08:46:34 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:47032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l02xJ-00010j-Ul for qemu-devel@nongnu.org; Thu, 14 Jan 2021 08:46:34 -0500 Received: by mail-wr1-x42e.google.com with SMTP id d13so5795490wrc.13 for ; Thu, 14 Jan 2021 05:46:29 -0800 (PST) Received: from localhost.localdomain ([213.91.86.150]) by smtp.googlemail.com with ESMTPSA id h184sm8832924wmh.23.2021.01.14.05.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 05:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=76J19Z46dfDAROoPlZLlI73X5SF0+xkfiFl0PfM58YM=; b=VAFif2PrSady+Myc3KFcrNz0WA1W/1AwJrpLSBkTYDt/BUeF0TieIBQ0RMWZaDbVAR /mdH1bGRRxl9bAlPs5/BDvVEMh2T+8he0sKcEoY7TDWGTp8GFRhcvmlqEDHS0OV8R6TU bokusEI4UbcVDCd537XJQWCc9cFaYokqwuCG/ocDNgfvDFGKYu/5PQgT1xNHZ/HPX5FO i6D51+g8GNh+VX3zMuzeih7pZNRhDqpENVFNnyeZEeWE0Ob/eq8M/GDWsZoh3Novi9x6 xK8SNYhGtXMhL2zAxPOb+6fOu5ONiS8nJQqiw9myWQ3QnVZ8u/H9fXpNMPkYjt52mDto w4WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=76J19Z46dfDAROoPlZLlI73X5SF0+xkfiFl0PfM58YM=; b=NMdrkFPKl47C99Np1VuAY70EPaPLyCVMz8paavQUHSKVOfugRw5mUXx5jkaPtFGXR0 PT5XuIxYOMMyq/90S97ckJCUdWrJ8Xbx90LmStfsDh0dDOvxIG2awvkvQNGmIZZ9bxe0 6n+Ro7sfviCds7mHlfiZblYgGXeIEcI2cFfV7RSWXy6zbxfMTB+uCZCizvaEaMsJZnzZ 9h5X2nkus8r72UCLABiXpu+8qzoFe0h+60ntdATjcA4DyjBQhY+KXAv8HRqaMIqF7nbJ zL7ho/T2Sw3Q3owd7yO7ed4GPzLnQeHEEiEWhakTKxd2dUXISgsXXQiDHI4BThxwvZ/y HWtw== X-Gm-Message-State: AOAM532zkaCq5b56orrOn/RJX1l/NvBoolM7L8jy9HjpBtabhMAcFlve skIQQ6xr/QqrMmpthtJtOx/HBPGuu8S4f8iw X-Google-Smtp-Source: ABdhPJzW90JhJK3wmuN77EQhW8F6RzS3HddToPShz3mU9+nF+fwTQAfy+lH80MYn9GuFrAQr5GbmcQ== X-Received: by 2002:adf:e541:: with SMTP id z1mr8034942wrm.143.1610631988221; Thu, 14 Jan 2021 05:46:28 -0800 (PST) From: Nikola Pavlica To: qemu-devel@nongnu.org, qemu-devel@nongnu.com Subject: [PATCH 1/2] ui/gtk: expose gd_monitor_update_interval Date: Thu, 14 Jan 2021 14:45:56 +0100 Message-Id: <20210114134557.292337-2-pavlica.nikola@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210114134557.292337-1-pavlica.nikola@gmail.com> References: <20210114134557.292337-1-pavlica.nikola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=pavlica.nikola@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: r_qemu@t-online.de, philmd@redhat.com, kraxel@redhat.com, Nikola Pavlica Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The gd_egl_refresh function, as the name suggests, is responsible for refreshing displays when using EGL graphics with QEMU's GTK UI. This is a perfect candidate for a function to update the refresh rate in. Since gd_monitor_update_interval is inaccessible from the gd_egl_refresh function, we need to expose/globalize it in the include/ui/gtk.h file. Signed-off-by: Nikola Pavlica --- include/ui/gtk.h | 1 + ui/gtk.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 80851fb4c7..3f395d7f94 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -86,6 +86,7 @@ extern bool gtk_use_gl_area; =20 /* ui/gtk.c */ void gd_update_windowsize(VirtualConsole *vc); +int gd_monitor_update_interval(GtkWidget *widget); =20 /* ui/gtk-egl.c */ void gd_egl_init(VirtualConsole *vc); diff --git a/ui/gtk.c b/ui/gtk.c index d2004a4dc1..26665cd2e6 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -752,7 +752,7 @@ static void gd_resize_event(GtkGLArea *area, * If available, return the update interval of the monitor in ms, * else return 0 (the default update interval). */ -static int gd_monitor_update_interval(GtkWidget *widget) +int gd_monitor_update_interval(GtkWidget *widget) { #ifdef GDK_VERSION_3_22 GdkWindow *win =3D gtk_widget_get_window(widget); --=20 2.30.0 From nobody Tue Nov 18 14:12:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1610632241; cv=none; d=zohomail.com; s=zohoarc; b=DPlSrerDBElojIl8VQDu2mzb41/fhr7UImG7H3yWvpPBtCMI3a8oYiWX52e/PHTF+DMPkWBOlkgW8+AbNzxyeKxv7dvTD0xbFPgqrvUQOmPk1niVSa759EEduHDhEElyNHnavJXSS21eya6GjbcbyGn4vdslaLxWNWn78j67QyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610632241; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Rmx4TdmD0MZ2eVuO2ekdHKsxNp6i3G8BEbLuvtvKoq4=; b=SSeZ8kx/YvQoa+BeErHfB70Op0HE8dlNfII8a5+vBeKKl6Ydtp3XdSFLXwVLHB2LyjPWrmRHctSba2QRc9AwY0iB415aSKxNfPJkMfxcpsZjHEIdbsw4c/q7rZtfOaYUr8Ojbr0iCeaVIyfDZbqmYy0p/histuyJOXCD9ttHaC8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610632241305223.77079626625084; Thu, 14 Jan 2021 05:50:41 -0800 (PST) Received: from localhost ([::1]:41816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l031M-0008Ts-6F for importer@patchew.org; Thu, 14 Jan 2021 08:50:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l02xN-0004Mh-EJ for qemu-devel@nongnu.org; Thu, 14 Jan 2021 08:46:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:44023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l02xL-00012A-Rz for qemu-devel@nongnu.org; Thu, 14 Jan 2021 08:46:33 -0500 Received: by mail-wr1-x42f.google.com with SMTP id y17so5805045wrr.10 for ; Thu, 14 Jan 2021 05:46:31 -0800 (PST) Received: from localhost.localdomain ([213.91.86.150]) by smtp.googlemail.com with ESMTPSA id h184sm8832924wmh.23.2021.01.14.05.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 05:46:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rmx4TdmD0MZ2eVuO2ekdHKsxNp6i3G8BEbLuvtvKoq4=; b=jwKtt/c9EZ4J6l8X8BG7KGgArLvJGsRRNGzOmX1lFslJft5L+DSGnqb0NBuSEIJ33M 4zvLKaZiYAP/ATxzHToy80chMCiWu+jvLGDNGwxe2EdpK22A7Q+3UoPu+mSRSgtyDwWo lGBHhCGoZJD+GUP0wQ6UlT5/V8c1QP35qG4U9l/+Qdu8Xn2g/rj70uafddz1TzlmmUL0 sxJ61thDWd7PoTvQXqjoZvvLoaHDa+IaR7iIS57TwgzoKPJy2Lx60qTqTb21jyyqa7e4 yullcV9eoEVENOxPpuzVWEOtNsmsk7b0EORdz8KgmOxOzht1OI6vFGGT7bmjLXYjCLKC YIgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rmx4TdmD0MZ2eVuO2ekdHKsxNp6i3G8BEbLuvtvKoq4=; b=Y2TtoLY8XNeh1qwLx/AUfzW4ouRUWgU3f92eUVyXW/Ve8SSeCSiEL0qtEZ+mlN3dtO U517SlhY1hyrA1iGcPhiBADGfGhKEEv7hOnbd6dMgz1U9a+slCuoyMc14PvO17XSQaoB /Qad0CQCNzhNT9aJ/hJO79rELjb4jeJKOvvJwp4776bKap1arUDdHw2y28WX4vd08Y4P WtzmsP/+06JVmd1R1ofIPKyKv4RynSO8vvQd4hHfpB7NfSjWoMLgw2DbJqJi/0fHLLeP IMRe8GPkaOPw2F2d9ZkIIg6pUahlstcmKEuN5RUGjNpI36pZn2r2zNkYb376/pkcfIK9 uZ/A== X-Gm-Message-State: AOAM5317JiOYQLRYx/Nmjcejw/m/R4MPykmz7syNH4eL7ZP6qb1h1CHM 9KjnZFwiarm6LKSpJmhT4Jz9jndlTyQQew7P X-Google-Smtp-Source: ABdhPJzq7ErTpymyD4p4Fmwf/5sq9Ct27zvRlf95pfGAawClgO///++UiBjpd7KdpTUSNCvuOxnq9g== X-Received: by 2002:adf:9b9b:: with SMTP id d27mr8157164wrc.125.1610631989994; Thu, 14 Jan 2021 05:46:29 -0800 (PST) From: Nikola Pavlica To: qemu-devel@nongnu.org, qemu-devel@nongnu.com Subject: [PATCH 2/2] ui/gtk: update monitor interval on egl displays Date: Thu, 14 Jan 2021 14:45:57 +0100 Message-Id: <20210114134557.292337-3-pavlica.nikola@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210114134557.292337-1-pavlica.nikola@gmail.com> References: <20210114134557.292337-1-pavlica.nikola@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=pavlica.nikola@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: r_qemu@t-online.de, philmd@redhat.com, kraxel@redhat.com, Nikola Pavlica Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- 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 =3D container_of(dcl, VirtualConsole, gfx.dcl); =20 + vc->gfx.dcl.update_interval =3D gd_monitor_update_interval( + vc->window ? vc->window : vc->gfx.drawing_area); + if (!vc->gfx.esurface) { gd_egl_init(vc); if (!vc->gfx.esurface) { --=20 2.30.0