From nobody Fri Nov 14 17:03:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1761047751; cv=none; d=zohomail.com; s=zohoarc; b=J63APqtkm8qjkzFCfJWQqck/b5J7DRnE4JmcBR5dkuXO272gM1sXBfZr6xrTIOQVDXWa/4tMe0059qfJN9/3cN+wwoRGfSD8Uf+yZ3w1GcI5H/GeffFNFMo/LNLrPdedgjWjUv5ucDJQSu/RoZIbCzFUhwTaHm6EiDFBBDrxi0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1761047751; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=6dveA7Bc3abeeRSBTidZ0/ShQem6EzpLqb7v5SFYum0=; b=Vh+/1ub99s5WpgyG4sYVe1kmCjHcFBsD/7P8eeh9DGEl5ZzazM+GOD2yrFj8D+5j8wAfxLHirtQ/MtIImT3L89O84YybGjmg1uC2AOyKw394/tTdfo2dfdmfUSlhvEOivAbhOI7y2xKAhRwf71AdwVdRphN3VVLpopDFEsh8YVQ= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1761047751438925.3150301427534; Tue, 21 Oct 2025 04:55:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vBAxO-0008Gj-91; Tue, 21 Oct 2025 07:55:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vBAxM-0008Dv-9k for qemu-devel@nongnu.org; Tue, 21 Oct 2025 07:55:12 -0400 Received: from m32-23.eu.mailgun.net ([141.193.32.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vBAxJ-0001wz-Aw for qemu-devel@nongnu.org; Tue, 21 Oct 2025 07:55:11 -0400 Received: from mail.slonk.ing (127.183.70.95.static.turk.net [95.70.183.127]) by 6953e733b90d5ef343660439d7c29c450468d4a3aa3b1c95405cc0ef60d8ffd0 with SMTP id 68f77497f52e2e44eb13b126; Tue, 21 Oct 2025 11:55:03 GMT DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=slonk.ing; q=dns/txt; s=mta; t=1761047703; x=1761054903; h=Content-Transfer-Encoding: Content-Type: Cc: To: To: Subject: Subject: From: From: MIME-Version: Date: Message-ID: Sender: Sender; bh=6dveA7Bc3abeeRSBTidZ0/ShQem6EzpLqb7v5SFYum0=; b=rA2VZvUz2O+K9l3uP5PBi3W3Gw4jB+qCc2Kmhg/hjxczupXOuMau63ZlWIgDn3WANEdaFYGQrBWp9nfAX7FC3bgnMHXGw6mepL6wHKloVep1El5k9N9/qDgBO6gZXAzDISTGO/KFcaMXGnOihjia7aV1pH259JU1EDAG9FdtyvDo/XIkPowQxEkBr47y03TGa1aeJ5KpmaR9txc9AM4AoC255oyrA0H0lkzZxmZ7lLmUR0G/aUzFVvEPYhwNiT9ItXTFv7C6sXyWqEVr9unMqulq17tnNLHgEymwei7pKJS6XzLERlkx/fjWWIW6bvv3FMzQrJGeg6Av2cdSm2VR2w== X-Mailgun-Sid: WyI0MzM2NSIsInFlbXUtZGV2ZWxAbm9uZ251Lm9yZyIsImEzOGY0Il0= X-Mailgun-Sending-Ip: 141.193.32.23 DKIM-Signature: v=1; a=rsa-sha256; s=202407r; d=slonk.ing; c=relaxed/relaxed; h=To:Subject:From:Date:Message-ID; t=1761047701; bh=6dveA7Bc3abeeRSBTidZ0/S hQem6EzpLqb7v5SFYum0=; b=aVvwt44tmoagFknVMnzcB1/iOHZG/HVYNMS2KiXFk4Pi0et6t3 ylVnolG5AIBqzt7zLsQmjgjJFnEhPuMpaum5nOVm8Nf/QAlyJpXt8p0t0jFks5hFp0OquuB2wG8 7ifbj7NVGwCBzh2xOMVb/QZg3efbpIR30HrflWB4hF2wRLJ6SKpMnh/BBcGzm/Gi8fMrp7C85xD Fbdrurmu14WXy0Ihn5hIJt1aqKH+LPpmBEcBmo+OYWMJnEzw8cbHcOud0PNaWPqmBWSjCWnxcB+ 1t5ee7Uu5l/c/KjUweFCoJVDzpdGS24QmZfgZzTrJHKlP//a1r3AH9gqwXCazQwC+qA==; DKIM-Signature: v=1; a=ed25519-sha256; s=202407e; d=slonk.ing; c=relaxed/relaxed; h=To:Subject:From:Date:Message-ID; t=1761047701; bh=6dveA7Bc3abeeRSBTidZ0/S hQem6EzpLqb7v5SFYum0=; b=i8W4e1oBaB87vMlgeA9BX97CvfETwGFrugsBQn4ivEiVXu38gY gDU2L8MfVo9tphZkGtz3D8FEEKXfUrAZDPBg==; Message-ID: <9051e5a9-92ad-4279-b8fd-f4cd92e05bac@slonk.ing> Date: Tue, 21 Oct 2025 14:55:01 +0300 MIME-Version: 1.0 User-Agent: Betterbird (Linux) Subject: virtio-gpu refresh rate option To: qemu-devel@nongnu.org Content-Language: en-US Cc: qemu-trivial@nongnu.org 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=141.193.32.23; envelope-from=bounce+23e6cb.a38f4-qemu-devel=nongnu.org@slonk.ing; helo=m32-23.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: slonkazoid From: slonkazoid via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1761047751987154100 Content-Type: text/plain; charset="utf-8"; format="flowed" currently, the virtio-gpu module does not set a refresh rate, making it=20 default to 75Hz in the qemu edid generation logic. i wrote a sloppy=20 patch that adds a `refresh_rate` option to virtio-gpu, which propagates=20 to all the devices based on it (i was interested in virtio-vga-gl). it's=20 not of much use by itself but when combined with something like Sunshine=20 or looking-glass, it can provide *far* smoother guest graphics than the=20 inbuilt display devices. i have done a bare minimum amount of manual=20 testing (virtio-vga-gl with venus XOR amdgpu drm native context=20 streaming video games) and it functions as intended, and should not=20 break the code path to fetch the refresh rate from the active display=20 device (?), however, i have never contributed to QEMU before and i don't=20 know the customs concerning testing, documentation, etc. if there's more=20 i should do, please tell me! if this is something that would benefit=20 QEMU, feel free to merge it. it's not a copyrightable change anyways. From bf599519fcf0fb03bffc2ce82051c91472591f26 Mon Sep 17 00:00:00 2001 From: slonkazoid > Date: Tue, 21 Oct 2025 12:35:57 +0300 Subject: [PATCH] add a refresh_rate option to virtio-gpu Signed-off-by: slonkazoid =20 > hw/display/virtio-gpu-base.c | 1 + include/hw/virtio/virtio-gpu.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index 7269477a1c..8e3ae958bf 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -232,6 +232,7 @@ virtio_gpu_base_device_realize(DeviceState *qdev, g->req_state[0].width =3D g->conf.xres; g->req_state[0].height =3D g->conf.yres; + g->req_state[0].refresh_rate =3D g->conf.refresh_rate; g->hw_ops =3D &virtio_gpu_ops; for (i =3D 0; i < g->conf.max_outputs; i++) { diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 9f16f89a36..8831514bb3 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -128,6 +128,7 @@ struct virtio_gpu_base_conf { uint32_t flags; uint32_t xres; uint32_t yres; + uint32_t refresh_rate; uint64_t hostmem; VirtIOGPUOutputList *outputs; }; @@ -173,7 +174,8 @@ struct VirtIOGPUBaseClass { DEFINE_PROP_BIT("edid", _state, _conf.flags, \ VIRTIO_GPU_FLAG_EDID_ENABLED, true), \ DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1280), \ - DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800) + DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800), \ + DEFINE_PROP_UINT32("refresh_rate", _state, _conf.refresh_rate, 60000) typedef struct VGPUDMABuf { QemuDmaBuf *buf; -- 2.51.0