From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5247FC4361B for ; Sun, 6 Dec 2020 10:45:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B5EDE22D2C for ; Sun, 6 Dec 2020 10:45:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5EDE22D2C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klrXk-00078C-1v for qemu-devel@archiver.kernel.org; Sun, 06 Dec 2020 05:45:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klrWT-0006ZO-Gm for qemu-devel@nongnu.org; Sun, 06 Dec 2020 05:44:09 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1klrWP-0002Jz-66 for qemu-devel@nongnu.org; Sun, 06 Dec 2020 05:44:09 -0500 Received: by mail-wr1-x42b.google.com with SMTP id a12so2967629wrv.8 for ; Sun, 06 Dec 2020 02:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:message-id:mime-version; bh=aZromsGPVWhgEGAbX0R3ykwKMtXKFIIMyG5jvRpj8rw=; b=ogYaXhPkrwK/p68gFqH9XfmZJy5ruUhLrXLh7EIqHSaZqFTUxr1mrf8vSn+863X+FY XKRhC0AsVJgrtRtc7aYxMI0ahtkyGmncIDDbjCUQ9mIGsEz/vOLk6jdectz07VtRdmoq lV3WhQ3xsu8lYlCeUQ84LV7L11lukDc3oNe3K5dEw5H1/WLEewbBGRq0ehDSp1rLutGK VWVOiV8PMAMRxg8v/FHuxtlqB7QuyknNTd6mNpLAPSJDFvthT8eddAqUe2pvLUskW+V1 KT3YhdbaIt6VG+KT9mnSPizP48xtSSx/WO32m0QrVKGHuPhgflE4qUmQ3L3bQ8Z5xjVX CpwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:message-id:mime-version; bh=aZromsGPVWhgEGAbX0R3ykwKMtXKFIIMyG5jvRpj8rw=; b=i/qWJCM0xFQe2jYCzXL9FWG6jSWZlM6ARoo7hIcWE2K10pnZqkb3RlbhcKb7VX7AhQ BFkjmn0Oh9f4wh129YEF0EdGHAtiL80PTgvSWBvRZEY5+6LX3W51bjZ01wexw2Y/Blj2 Nf+wlBCLQGuhVYeuz+Ybi856+vriIG1hwx+F6fIjnadmgBjdfmbbd4nEdk0OXf2QPbAO KHu+VOiRYoST29Wu4U2NPRPsK8hdAut1aZv7Msi1ZFxn4dG7+Dfw0xdANchVqPiz4Mya i9nbppGMv4Z2HeD7V2BbRK/s7MdYXZs46Yn8A38cndbeuncLB0oP6OeRdC0nKVOr+wCB bszg== X-Gm-Message-State: AOAM531HogrdhYXa2NGJpUdlxmg/TtbNRck76qgXqyp56uBXmqjng5ik IbCXb5UnkBkVKdFkkgWy8rqGgZibABM= X-Google-Smtp-Source: ABdhPJwMqW8cwS9Cbqq+M+JioTjJeZUbH57wlW25n82IbMM9Ju6MSMke4I8QOu7IQju2/DtbVRgGrg== X-Received: by 2002:a5d:638e:: with SMTP id p14mr7160356wru.358.1607251440538; Sun, 06 Dec 2020 02:44:00 -0800 (PST) Received: from [192.168.100.143] ([213.91.86.150]) by smtp.gmail.com with ESMTPSA id b200sm10138996wmb.10.2020.12.06.02.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2020 02:44:00 -0800 (PST) Date: Sun, 06 Dec 2020 11:43:52 +0100 From: Nikola Pavlica Subject: [PATCH 1/1] ui/gtk: Launching GTK UI with OpenGL on causes the refreshrate update to not run To: qemu-devel@nongnu.org Message-Id: <55ZWKQ.X7E8ESP709H31@gmail.com> X-Mailer: geary/3.38.1 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-KSmno0xbOQSAOuM4iuOb" Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=pavlica.nikola@gmail.com; helo=mail-wr1-x42b.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, HTML_MESSAGE=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: kraxel@redhat.com, f4bug@amsat.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --=-KSmno0xbOQSAOuM4iuOb Content-Type: text/plain; charset=us-ascii; format=flowed I've discussed this issue back January and September. But it still occurs on my machine, despite the two patches. This time, the issue is that the UI refresh rate doesn't get updated when I launch QEMU with gl=on. My fix for this issue is to move the code for updating the refresh rate above the code that checks for OpenGL. Or because OpenGL is meant to be called back with the "render" callback, should we instead add the refresh rate checking code there? Anyway, regardless of method, I'm happy with any solution that just fixes the issue. Signed-off-by: Nikola Pavlica (pavlica.nikola@gmail.com) --- diff --git a/ui/gtk.c b/ui/gtk.c index a752aa22be..74287edde8 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -776,18 +776,6 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque) int fbw, fbh; int refresh_rate_millihz; -#if defined(CONFIG_OPENGL) - if (vc->gfx.gls) { - if (gtk_use_gl_area) { - /* invoke render callback please */ - return FALSE; - } else { - gd_egl_draw(vc); - return TRUE; - } - } -#endif - if (!gtk_widget_get_realized(widget)) { return FALSE; } @@ -801,6 +789,18 @@ static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque) vc->gfx.dcl.update_interval = MILLISEC_PER_SEC / refresh_rate_millihz; } +#if defined(CONFIG_OPENGL) + if (vc->gfx.gls) { + if (gtk_use_gl_area) { + /* invoke render callback please */ + return FALSE; + } else { + gd_egl_draw(vc); + return TRUE; + } + } +#endif + fbw = surface_width(vc->gfx.ds); fbh = surface_height(vc->gfx.ds); -- 2.21.1 --=-KSmno0xbOQSAOuM4iuOb Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable
I've discussed this issue back January and September. But it still occ= urs on my machine, despite the two patches. This time, the issue is that the UI refresh rate doesn't get updated when I= launch QEMU with gl=3Don. My fix for this issue is to move the code for updating the refresh rate abo= ve the code that checks for OpenGL.

Or because OpenGL is meant to be called bac= k with the "render" callback, should we instead add the refresh 
rate checking code there= ?

=
Anyway, regardless of method, I= 'm happy with any solution that just fixes the issue.
Signed-off-by: Nikola Pavlica (pavlica.nikola@gmail.com) ---
diff --git a/ui/gtk.c b/ui/gtk.c
index a752a= a22be..74287edde8 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c<= /div>
@@ -776,18 +776,6 @@ static gboolean gd_draw_event(GtkWidget *wid= get, cairo_t *cr, void *opaque)
     int fbw, fbh;=
     int refresh_rate_millihz;
 
-#if defined(CONFIG_OPENGL)
-    if (vc->gf= x.gls) {
-        if (gtk_use_gl_area) {
-            /* invoke render callback = please */
-            return FALSE= ;
-        } else {
-    =        gd_egl_draw(vc);
-     &nbs= p;      return TRUE;
-        = }
-    }
-#endif
-
 =    if (!gtk_widget_get_realized(widget)) {
  &nbs= p;      return FALSE;
     }
<= div>@@ -801,6 +789,18 @@ static gboolean gd_draw_event(GtkWidget *widget, c= airo_t *cr, void *opaque)
         vc-&g= t;gfx.dcl.update_interval =3D MILLISEC_PER_SEC / refresh_rate_millihz;
     }
 
+#if defined(CONFIG_= OPENGL)
+    if (vc->gfx.gls) {
+   &= nbsp;    if (gtk_use_gl_area) {
+       =      /* invoke render callback please */
+   =          return FALSE;
+     &= nbsp;  } else {
+            g= d_egl_draw(vc);
+            return= TRUE;
+        }
+    }<= /div>
+#endif
+
     fbw =3D surface= _width(vc->gfx.ds);
     fbh =3D surface_height= (vc->gfx.ds);
--=20
2.21.1
--=-KSmno0xbOQSAOuM4iuOb--