From nobody Tue Feb 10 04:02:50 2026 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 022162FD66B for ; Sun, 25 Jan 2026 18:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366385; cv=none; b=WGwmJBbRK/RttJZEsz63zfpEe+KTcBw+EPHMu1z0d3C7FkgMlAzZAYF+tng/I2y+BZHPaMPxoxSk2SRB85nPtfvOH+Pe1aO3WjjfI/8u3Qb1kxO2rVZAzsh4/rxE8uCwOt8CeWniiFnmSKKl3pJ7iyguNa36/ZVQrbAjmPzQaEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366385; c=relaxed/simple; bh=Y8zLqnNcTvmX637b94D1n6R8UZzz/boGOxILJU9ldhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uBadtpVZr8X67ydOGoiq+x75bvRQKuB3VXXkye64sbAEENeDKHfHcJfIdtcwz38nQvsbDqfZdcssP52DGlZpbspehF4UUzmcI6yDLa9Zcg3Nn/sGgguXdMHm9KZ+0ZptT4QWcTOosQAMl1OqoD7erBMaVh7I04VuT9Yi3oZnm7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nKaVUvFL; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nKaVUvFL" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-64b686e7d04so672525a12.3 for ; Sun, 25 Jan 2026 10:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769366382; x=1769971182; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pzpJ4RJ7cNME7CVFy7TynUsF3JEY3Q9X0Du26C0ArzQ=; b=nKaVUvFLx0jtt90oFSMoiHVVcbnWG6wQhKXFCH+XAQf/WrU1LPZ3Mf1BzrjkmydTRs 9DaLDf+QC0eC8grGPZ3wGXXutDEAm/R0HHCUy7VhdFgiXDIjfzlTWq248oAQ1D9PJtMh qZ2bW3Wo3H8N7Qnx99jcwEj747rghruh+tUkDC+u2vHEG8uyqFbRRnV7aB/WxPFjIDdV PjJSrZfg8F9O1ancF1NvAhSDK5U2sJOtszq2FBmCU0PRrMESP93YGRq+jejCcO9I6AB4 2TetYJQT2PskM6oNsuZDG3cbeokeMDaFf5PFbGx+xAY5MKk5F/3YgnvlTljKu8CcPHAD Oc6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769366382; x=1769971182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pzpJ4RJ7cNME7CVFy7TynUsF3JEY3Q9X0Du26C0ArzQ=; b=Vi+oZpAut7/ZyVbPewLZZpKv6FLTAe4kPWBOAN7fskW4VD28tWsaJ4aJDHbnDWRWB6 5YcAqp0w6xotH0R3CLhzB0C6FxZo7Ns4hSpvwMsqX0vRXpqms01HIYFj3MQe5OiuqoWJ xBzhYZC4y3bbnSufABfUw5VPfAr/MJnoUitbZDGBX7MDc60uN/7i0KlyBKpq2qJXzTB9 kRXtGJE1LWg54sugqWkYJMJs0pHwt8awF7SVQSo1rY4IsoykkHOawuz5khNBiKrekik+ wbgG2JyNfE9dX8+bqVpzssDKBBenqXRVNkq0DVJR71xXRbdoYH5xBToaggDgHZKbQ8mW jTdw== X-Forwarded-Encrypted: i=1; AJvYcCWkt9/e12RyC9wraXOB9vMKK2iLhzCH92YqIHpaJ/jAXl4nUbWcWlv4zPEskUHcTXGj3262Wrzw1xKd9r8=@vger.kernel.org X-Gm-Message-State: AOJu0YxO6/kCZF5E9aICNxE10p9Avq+9ARYei2LscUviRu/hRFEpQKzG GM8mJC2VhKz+PMOQzeOqkt+K18H8Yxng7w2D67oaGiGuyW5Ng2Zy4RPp X-Gm-Gg: AZuq6aIiiwjuDypTQkoFKFrWLo8p72lyg0UPRkcWNbigTAAPF/Sg375Ojef7iKB0qqp F9YBHOoBcAEVsVwIuyjvpiTWubMxPd9eS7zwLtuqjAXjic8eBEKbkLQLxKsQkGqTZdf9Cg8MSA/ Nsz4CyX5WpEnm32fTNtOsEK7v31vnzfkApLENGVx3WQ6p3X6+KLWfQKgnZ9omaTMp7IvMNKQUwA z2qRWB/ruOV12CDeZvd0RGDZxvu6KQv20oFKWJAQJ9oqHuGsK68FXknKvjtOA+dAxcRREpN5Dgk rnIanl4aSF7nwIxOK7jR5DsBukQ7AnNCkkkwPkQQasq6BvfhKdUpFVCFNVrmCvfQINuLfFngMSN +tzcL07hgtbEk3X6BkVZMBpPT5+8XyG/qDMc/PzPm7yDjNb4oz7R1OWICltcUHLae4PGv3paRKF yKnH2v3ngDfk/l8lD4VR83AcCJXYTRqThMvLo4BeZPpmpwl5Bdm4y3aAp36g9yrTzd X-Received: by 2002:a17:906:c104:b0:b87:3087:54f0 with SMTP id a640c23a62f3a-b8d3fa9d567mr110207266b.3.1769366382183; Sun, 25 Jan 2026 10:39:42 -0800 (PST) Received: from laptok.lan (87-205-5-123.static.ip.netia.com.pl. [87.205.5.123]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b885b3dad3asm499133766b.12.2026.01.25.10.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 10:39:41 -0800 (PST) From: =?UTF-8?q?Tomasz=20Paku=C5=82a?= To: alexander.deucher@amd.com, harry.wentland@amd.com, sunpeng.li@amd.com Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, siqueira@igalia.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, tomasz.pakula.oficjalny@gmail.com, bernhard.berger@gmail.com, michel.daenzer@mailbox.org, daniel@fooishbar.org Subject: [PATCH v2 19/19] drm/amd/display: Add HDMI VRR desktop mode Date: Sun, 25 Jan 2026 19:39:14 +0100 Message-ID: <20260125183914.459228-20-tomasz.pakula.oficjalny@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260125183914.459228-1-tomasz.pakula.oficjalny@gmail.com> References: <20260125183914.459228-1-tomasz.pakula.oficjalny@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable [Why] Many TVs and other HDMI sinks suffer from blanking and possibly other glitches when VRR is toggled. With FreeSync present on such sinks, they behave like the signal is always variable, even in fixed refresh rate situations. [How] Keep HDMI VRR toggled if it's supported and not explicitly disabled. Additionnally, add module parameter which allows users to configure HDMI VRR triggering to only happen when the signal is truly asking for variable state. This is useful if end user has a TV that automatically toggles ALLM/Game mode when VRR is active and such user doesn't want gaming mode in normal desktop usage. Signed-off-by: Tomasz Paku=C5=82a --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++++++ .../amd/display/modules/info_packet/info_packet.c | 10 ++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdg= pu/amdgpu.h index c9eab44ad5b3..dddd8ed361a0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -269,6 +269,7 @@ extern int amdgpu_rebar; extern int amdgpu_wbrf; extern int amdgpu_user_queue; extern int amdgpu_allm_mode; +extern bool amdgpu_hdmi_vrr_desktop_mode; =20 extern uint amdgpu_hdmi_hpd_debounce_delay_ms; =20 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_drv.c index 3bdbb46e4d69..f4551450bf31 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -249,6 +249,7 @@ int amdgpu_rebar =3D -1; /* auto */ int amdgpu_user_queue =3D -1; uint amdgpu_hdmi_hpd_debounce_delay_ms; int amdgpu_allm_mode =3D 1; +bool amdgpu_hdmi_vrr_desktop_mode =3D true; =20 DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, "DRM_UT_CORE", @@ -1146,6 +1147,18 @@ module_param_named(hdmi_hpd_debounce_delay_ms, amdgp= u_hdmi_hpd_debounce_delay_ms MODULE_PARM_DESC(allm_mode, "Changes ALLM trigger mode (0 =3D disable, 1 = =3D enable (default), 2 =3D force enable)"); module_param_named(allm_mode, amdgpu_allm_mode, int, 0644); =20 +/** + * DOC: hdmi_vrr_on_dekstop (bool) + * Enables FreeSync behavior mimicking by keeping HDMI VRR signalling acti= ve in + * fixed refresh rate conditions like normal desktop work/web browsing. + * Possible values: + * + * - false =3D HDMI VRR is only enabled if refresh rate is truly variable + * - true =3D Mimics FreeSync behavior and keeps HDMI VRR always active + */ +MODULE_PARM_DESC(hdmi_vrr_desktop_mode, "Changes HDMI VRR desktop mode (fa= lse =3D disable, true =3D enable (default))"); +module_param_named(hdmi_vrr_desktop_mode, amdgpu_hdmi_vrr_desktop_mode, bo= ol, 0644); + /* These devices are not supported by amdgpu. * They are supported by the mach64, r128, radeon drivers */ diff --git a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c = b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c index 38056b2d37b2..c61bbf912a8b 100644 --- a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +++ b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c @@ -651,8 +651,14 @@ static void build_vtem_infopacket_data(const struct dc= _stream_state *stream, bool rb =3D false; =20 hdmi_vic_mode =3D is_hdmi_vic_mode(stream); - vrr_active =3D vrr->state =3D=3D VRR_STATE_ACTIVE_VARIABLE || - vrr->state =3D=3D VRR_STATE_ACTIVE_FIXED; + + if (amdgpu_hdmi_vrr_desktop_mode) { + vrr_active =3D vrr->state !=3D VRR_STATE_UNSUPPORTED && + vrr->state !=3D VRR_STATE_DISABLED; + } else { + vrr_active =3D vrr->state =3D=3D VRR_STATE_ACTIVE_VARIABLE || + vrr->state =3D=3D VRR_STATE_ACTIVE_FIXED; + } =20 infopacket->sb[VTEM_MD0] =3D VTEM_M_CONST << VTEM_M_CONST_BIT; infopacket->sb[VTEM_MD0] |=3D VTEM_FVA_FACTOR << VTEM_FVA_BIT; --=20 2.52.0