{"id":2223733,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2223733/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260415-virtio-gpu-refresh-rate-v2-1-b71599d84755@slonk.ing/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260415-virtio-gpu-refresh-rate-v2-1-b71599d84755@slonk.ing>","date":"2026-04-15T09:19:05","name":"[v2] add a refresh_rate option to virtio-gpu","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"159f0a2638369cdc02769151b6ce1a54c600be7e","submitter":{"id":93151,"url":"http://patchwork.ozlabs.org/api/1.1/people/93151/?format=json","name":"slonkazoid","email":"slonkazoid@slonk.ing"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260415-virtio-gpu-refresh-rate-v2-1-b71599d84755@slonk.ing/mbox/","series":[{"id":500073,"url":"http://patchwork.ozlabs.org/api/1.1/series/500073/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=500073","date":"2026-04-15T09:19:05","name":"[v2] add a refresh_rate option to virtio-gpu","version":2,"mbox":"http://patchwork.ozlabs.org/series/500073/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2223733/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2223733/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=permerror header.d=slonk.ing header.i=@slonk.ing header.a=rsa-sha1\n header.s=mta header.b=ol2uH8ba;\n\tdkim=fail reason=\"key not found in DNS\" header.d=slonk.ing\n header.i=@slonk.ing header.a=rsa-sha256 header.s=202407r header.b=H3jHXtS4;\n\tdkim=fail reason=\"key not found in DNS\" header.d=slonk.ing\n header.i=@slonk.ing header.a=ed25519-sha256 header.s=202407e\n header.b=gb8ih4W9;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fx4Wz527Jz1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 14:18:54 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wDEBI-0000r4-Im; Thu, 16 Apr 2026 00:18:20 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1)\n (envelope-from <bounce+23e6cb.a38f4-qemu-devel=nongnu.org@slonk.ing>)\n id 1wCwP0-0004Oh-G7\n for qemu-devel@nongnu.org; Wed, 15 Apr 2026 05:19:18 -0400","from v523.v5ed9ac7d.euw1.send.eu.mailgun.net ([141.193.32.23])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1)\n (envelope-from <bounce+23e6cb.a38f4-qemu-devel=nongnu.org@slonk.ing>)\n id 1wCwOx-00049W-SC\n for qemu-devel@nongnu.org; Wed, 15 Apr 2026 05:19:17 -0400","from mail.slonk.ing (127.183.70.95.static.turk.net [95.70.183.127])\n by\n 3227148c7315d7b8ed159b4eee550e840a3c5c9326b4dd5b32061137fbaa3c06 with SMTP id\n 69df5810e1e94239b61f20ca; Wed, 15 Apr 2026 09:19:12 GMT"],"DKIM-Signature":["a=rsa-sha256; v=1; c=relaxed/relaxed; d=slonk.ing; q=dns/txt;\n s=mta; t=1776244752; x=1776251952;\n h=Cc: To: To: Message-Id: Content-Transfer-Encoding: Content-Type:\n MIME-Version: Subject: Subject: Date: From: From: Sender: Sender;\n bh=wfxP6BRW0Z5vudEw1tO1maLW1OLCibiTlJsKRc5xUl8=;\n b=ol2uH8baCd2JzvhYvUtJwyg0f3JTLaTlbri+iAGNja1t77EFlW9cHa9hDR+dUDfmzP5BQ9OvTyAS7ff3lkbfXrjmeKHKQ/Zq/ZcKZbVx9TyfWzVTRAYWHusspAqpkcyOJ2YhvcpOdf5gltLZeR0djV0kO/dEqZ5z5gqZjWQUlMAdxLIGXA45o0qa0dhobQGxyGZNH7e58CLcJh09r6UOTh3/cuj8XAro7qBESYzUnl4Z2oE9utY6jTVQhIhitBdn0GNUHtYppsljabXCarbkhSMlw++/e+aUXJOV5CZIgTozTwoB3PC4GW49kYzHfJMSQ3Sr+Kjq9MSRe5j8US1n/w==","v=1; a=rsa-sha256; s=202407r; d=slonk.ing; c=relaxed/relaxed;\n h=To:Message-Id:Subject:Date:From; t=1776244749;\n bh=wfxP6BRW0Z5vudEw1tO1maL\n W1OLCibiTlJsKRc5xUl8=; b=H3jHXtS4ht47/oMg6LuXEcklIH0hPKJtJuQG7iyR9y6JxhICAS\n +kL/0fxpqpJFBS92H/9CXv9z9+D50hbPeyHtAicjCDJDCP4xqIxPVqPkAfT1K/uIoAFEjtiwO5x\n fPt0BPub3g6mOcgMta6RevI8s5IaczQoNPseMwoUl2/YRT7o2DO02KJHyDp7FqFuQnxY5yoKnQt\n X/HjIz0GUxBWi+SQY0Uu2XtvgGYQMeP0rCJvQQJLNEJRLEXNM75HzGV+dFzH6kY+pUWGLfXGZYj\n 2jdpr33c2bc9+9c8dlGwnKqj4XUr4TEIuMCbRjFliV5nQBcN0g4neketftHfUHZteug==;","v=1; a=ed25519-sha256; s=202407e; d=slonk.ing;\n c=relaxed/relaxed;\n h=To:Message-Id:Subject:Date:From; t=1776244749; bh=wfxP6BRW0Z5vudEw1tO1maL\n W1OLCibiTlJsKRc5xUl8=; b=gb8ih4W9vcwgY+ZWOCbXwDndatojMc2HiNQ4OtD+PMlLnyE/bS\n 2NZYSGMyapXxs27pgDJ16u6kl9UNvKt8EvDQ==;"],"X-Mailgun-Sid":"WyI0MzM2NSIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsImEzOGY0Il0=","X-Mailgun-Sending-Ip":"141.193.32.23","Date":"Wed, 15 Apr 2026 12:19:05 +0300","Subject":"[PATCH v2] add a refresh_rate option to virtio-gpu","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260415-virtio-gpu-refresh-rate-v2-1-b71599d84755@slonk.ing>","X-B4-Tracking":"v=1; b=H4sIAAAAAAAC/4WNQQ6CMBBFr0Jm7RhaKiAr72FYgIww0bRkWhsN6\n d2tXMDl+z///Q08CZOHrthAKLJnZzPoQwG3ZbAzIU+ZQZe6Lo0yGFkCO5zXFwrdhfyCMgTCqhm\n rtqVmmhoNeb3mlt+7+dpnXtgHJ5/9KKpf+t8ZFSo8namudEmjNnTxT2cfR7Yz9CmlL3s5D6K+A\n AAA","X-Change-ID":"20260414-virtio-gpu-refresh-rate-37b388e7dd72","To":"qemu-devel@nongnu.org","Cc":"\"Michael S. Tsirkin\" <mst@redhat.com>,\n =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n  Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,\n  Dmitry Osipenko <dmitry.osipenko@collabora.com>,\n  slonkazoid <slonkazoid@slonk.ing>","X-Mailer":"b4 0.14.3","Received-SPF":"pass client-ip=141.193.32.23;\n envelope-from=bounce+23e6cb.a38f4-qemu-devel=nongnu.org@slonk.ing;\n helo=v523.v5ed9ac7d.euw1.send.eu.mailgun.net","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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-Mailman-Approved-At":"Thu, 16 Apr 2026 00:18:04 -0400","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-to":"slonkazoid <slonkazoid@slonk.ing>","From":"slonkazoid via qemu development <qemu-devel@nongnu.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Signed-off-by: slonkazoid <slonkazoid@slonk.ing>\n---\ncurrently, the virtio-gpu module does not set a refresh rate, making it\ndefault to 75Hz in the qemu edid generation logic. i wrote a sloppy patch\nthat adds a `refresh_rate` option to virtio-gpu, which propagates to all\nthe devices based on it (i was interested in virtio-vga-gl). it's not of\nmuch use by itself but when combined with something like Sunshine or\nlooking-glass, it can provide *far* smoother guest graphics than the\ninbuilt display devices. i have done a bare minimum amount of manual\ntesting (virtio-vga-gl with venus XOR amdgpu drm native context streaming\nvideo games) and it functions as intended, and should not break the code\npath to fetch the refresh rate from the active display device (?), however,\ni have never contributed to QEMU before and i don't know the customs\nconcerning testing, documentation, etc. if there's more i should do, please\ntell me! if this is something that would benefit QEMU, feel free to merge it.\nit's probably not a copyrightable change anyways.\n---\nChanges in v2:\n- Update default value of refresh_rate to the old implied default of 75000\n- Link to v1: https://lore.kernel.org/qemu-devel/20260414-virtio-gpu-refresh-rate-v1-1-59e6320eb24e@slonk.ing\n---\n hw/display/virtio-gpu-base.c   | 1 +\n include/hw/virtio/virtio-gpu.h | 4 +++-\n 2 files changed, 4 insertions(+), 1 deletion(-)\n\n\n---\nbase-commit: 985062e2319e6bf4a4be9c216ede6d34379e5777\nchange-id: 20260414-virtio-gpu-refresh-rate-37b388e7dd72\n\nBest regards,","diff":"diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c\nindex cb76302e2d..d87f6604d0 100644\n--- a/hw/display/virtio-gpu-base.c\n+++ b/hw/display/virtio-gpu-base.c\n@@ -232,6 +232,7 @@ virtio_gpu_base_device_realize(DeviceState *qdev,\n \n     g->req_state[0].width = g->conf.xres;\n     g->req_state[0].height = g->conf.yres;\n+    g->req_state[0].refresh_rate = g->conf.refresh_rate;\n \n     for (output_idx = 0, node = g->conf.outputs;\n          node && output_idx < g->conf.max_outputs;\ndiff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h\nindex f69fc19462..e440535fa0 100644\n--- a/include/hw/virtio/virtio-gpu.h\n+++ b/include/hw/virtio/virtio-gpu.h\n@@ -131,6 +131,7 @@ struct virtio_gpu_base_conf {\n     uint32_t flags;\n     uint32_t xres;\n     uint32_t yres;\n+    uint32_t refresh_rate;\n     uint64_t hostmem;\n     VirtIOGPUOutputList *outputs;\n };\n@@ -176,7 +177,8 @@ struct VirtIOGPUBaseClass {\n     DEFINE_PROP_BIT(\"edid\", _state, _conf.flags, \\\n                     VIRTIO_GPU_FLAG_EDID_ENABLED, true), \\\n     DEFINE_PROP_UINT32(\"xres\", _state, _conf.xres, 1280), \\\n-    DEFINE_PROP_UINT32(\"yres\", _state, _conf.yres, 800)\n+    DEFINE_PROP_UINT32(\"yres\", _state, _conf.yres, 800), \\\n+    DEFINE_PROP_UINT32(\"refresh_rate\", _state, _conf.refresh_rate, 75000)\n \n typedef struct VGPUDMABuf {\n     QemuDmaBuf *buf;\n","prefixes":["v2"]}