mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "Tomasz Pakuła" <tomasz.pakula.oficjalny@gmail.com>,
	alexander.deucher@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,
	bernhard.berger@gmail.com, michel.daenzer@mailbox.org,
	daniel@fooishbar.org, admin@ptr1337.dev
Subject: Re: [PATCH v3 19/19] drm/amd/display: Add HDMI VRR desktop mode
Date: Fri, 6 Feb 2026 13:58:20 -0500	[thread overview]
Message-ID: <ee4a21fc-3625-4086-b2d0-9acf20b5d2ef@amd.com> (raw)
In-Reply-To: <20260203185626.55428-20-tomasz.pakula.oficjalny@gmail.com>

On 2026-02-03 13:56, Tomasz Pakuła wrote:
> [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.
> 

Can't this already be done by the compositor by simply setting the
VRR_ENABLED property on a crtc?

I don't like doing behavior behind the backs of compositors that
they might not be expecting.

Harry

> Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
> ---
>  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   |  9 +++++++--
>  3 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 312aa32064d5..d49cd55e0f35 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 uint amdgpu_allm_mode;
> +extern bool amdgpu_hdmi_vrr_desktop_mode;
>  
>  extern uint amdgpu_hdmi_hpd_debounce_delay_ms;
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 4b038c8bbf9f..f53c2ffeffa2 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 = -1; /* auto */
>  int amdgpu_user_queue = -1;
>  uint amdgpu_hdmi_hpd_debounce_delay_ms;
>  uint amdgpu_allm_mode = 1;
> +bool amdgpu_hdmi_vrr_desktop_mode = true;
>  
>  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, amdgpu_hdmi_hpd_debounce_delay_ms
>  MODULE_PARM_DESC(allm_mode, "Changes ALLM trigger mode (0 = disable, 1 = enable (default), 2 = force enable)");
>  module_param_named(allm_mode, amdgpu_allm_mode, uint, 0644);
>  
> +/**
> + * DOC: hdmi_vrr_on_dekstop (bool)
> + * Enables FreeSync behavior mimicking by keeping HDMI VRR signalling active in
> + * fixed refresh rate conditions like normal desktop work/web browsing.
> + * Possible values:
> + *
> + * - false = HDMI VRR is only enabled if refresh rate is truly variable
> + * - true  = Mimics FreeSync behavior and keeps HDMI VRR always active
> + */
> +MODULE_PARM_DESC(hdmi_vrr_desktop_mode, "Changes HDMI VRR desktop mode (false = disable, true = enable (default))");
> +module_param_named(hdmi_vrr_desktop_mode, amdgpu_hdmi_vrr_desktop_mode, bool, 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 5fd9e8aadc98..b41e2240e1ae 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
> @@ -654,8 +654,13 @@ static void build_vtem_infopacket_data(const struct dc_stream_state *stream,
>  	bool vrr_active = false;
>  	bool rb = false;
>  
> -	vrr_active = vrr->state == VRR_STATE_ACTIVE_VARIABLE ||
> -		     vrr->state == VRR_STATE_ACTIVE_FIXED;
> +	if (amdgpu_hdmi_vrr_desktop_mode) {
> +		vrr_active = vrr->state != VRR_STATE_UNSUPPORTED &&
> +			     vrr->state != VRR_STATE_DISABLED;
> +	} else {
> +		vrr_active = vrr->state == VRR_STATE_ACTIVE_VARIABLE ||
> +			     vrr->state == VRR_STATE_ACTIVE_FIXED;
> +	}
>  
>  	infopacket->sb[VTEM_MD0] = VTEM_M_CONST << VTEM_M_CONST_BIT;
>  	infopacket->sb[VTEM_MD0] |= VTEM_FVA_FACTOR << VTEM_FVA_BIT;


  reply	other threads:[~2026-02-06 18:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 18:56 [PATCH v3 00/19] drm/amd: VRR fixes, HDMI Gaming Features Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 01/19] drm/amd/display: Return if DisplayID not found in parse_amd_vsdb() Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 02/19] drm/amd/display: Refactor amdgpu_dm_update_freesync_caps() Tomasz Pakuła
2026-02-06 18:22   ` Harry Wentland
2026-02-06 20:46     ` Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 03/19] drm/amd/display: Check for VRR range in CEA AMD vsdb Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 04/19] drm/amd/display: Use bigger VRR range if found in " Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 05/19] drm/amd/display: Refactor PCON VRR compatibility check Tomasz Pakuła
2026-02-06 18:39   ` Harry Wentland
2026-02-03 18:56 ` [PATCH v3 06/19] drm/amd/display: Add PCON VRR ID check override Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 07/19] drm/amd/display: Add CH7218 PCON ID Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 08/19] drm/edid: Parse more info from HDMI Forum vsdb Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 09/19] drm/amd/display: Rename PCON adaptive sync types Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 10/19] drm/amd/display: Enable HDMI VRR over PCON Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 11/19] drm/amd/display: Support HDMI VRRmax=0 Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 12/19] drm/amd/display: Build HDMI vsif in correct slot Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 13/19] drm/amd/display: Save HDMI gaming info to edid caps Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 14/19] drm/amd/display: Restore ALLM support in HDMI vsif Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 15/19] drm/amd/display: Trigger ALLM if it's available Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 16/19] drm/amd/display: Add parameter to control ALLM behavior Tomasz Pakuła
2026-02-06 18:52   ` Harry Wentland
2026-02-06 20:52     ` Tomasz Pakuła
2026-02-06 22:04       ` Alex Deucher
2026-02-10 18:44         ` Tomasz Pakuła
2026-02-10 19:17           ` Alex Deucher
2026-02-10 20:54             ` Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 17/19] drm/amd/display: Reintroduce VTEM info frame Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 18/19] drm/amd/display: Enable HDMI VRR Tomasz Pakuła
2026-02-03 18:56 ` [PATCH v3 19/19] drm/amd/display: Add HDMI VRR desktop mode Tomasz Pakuła
2026-02-06 18:58   ` Harry Wentland [this message]
2026-02-06 21:08     ` Tomasz Pakuła
2026-02-06 22:06   ` Alex Deucher
2026-02-06 19:00 ` [PATCH v3 00/19] drm/amd: VRR fixes, HDMI Gaming Features Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee4a21fc-3625-4086-b2d0-9acf20b5d2ef@amd.com \
    --to=harry.wentland@amd.com \
    --cc=admin@ptr1337.dev \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bernhard.berger@gmail.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    --cc=tomasz.pakula.oficjalny@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®