From: "Tomasz Pakuła" <tomasz.pakula.oficjalny@gmail.com>
To: Harry Wentland <harry.wentland@amd.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 16/19] drm/amd/display: Add parameter to control ALLM behavior
Date: Fri, 06 Feb 2026 21:52:57 +0100 [thread overview]
Message-ID: <79264ab170e48e1372b3b847d75f4635dcc57aa6.camel@gmail.com> (raw)
In-Reply-To: <f19af3c6-f865-4758-8c50-aba40ec1cf68@amd.com>
On Fri, 2026-02-06 at 13:52 -0500, Harry Wentland wrote:
> On 2026-02-03 13:56, Tomasz Pakuła wrote:
> > [Why]
> > Some users prefer to always manually control ALLM/Gaming mode while
> > others might want it permanently forced on.
> >
> > [How]
> > Since there isn't yet an API to control this, expose module parameter
> >
> > Changes in v3:
> > - Include a fix for possible NULL pointer dereference by Peter
> >
> > Closes: https://github.com/CachyOS/linux-cachyos/issues/680
> >
> > Co-developed-by: Peter Jung <admin@ptr1337.dev>
> > Signed-off-by: Peter Jung <admin@ptr1337.dev>
> > 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 | 14 +++++-
> > .../gpu/drm/amd/display/dc/core/dc_resource.c | 7 +--
> > .../amd/display/modules/inc/mod_info_packet.h | 1 +
> > .../display/modules/info_packet/info_packet.c | 46 ++++++++++++++++---
> > 5 files changed, 56 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > index 447e734c362b..312aa32064d5 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> > @@ -268,6 +268,7 @@ extern int amdgpu_rebar;
> >
> > extern int amdgpu_wbrf;
> > extern int amdgpu_user_queue;
> > +extern uint amdgpu_allm_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 d6d0a6e34c6b..4b038c8bbf9f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -248,6 +248,7 @@ int amdgpu_umsch_mm_fwlog;
> > int amdgpu_rebar = -1; /* auto */
> > int amdgpu_user_queue = -1;
> > uint amdgpu_hdmi_hpd_debounce_delay_ms;
> > +uint amdgpu_allm_mode = 1;
> >
> > DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0,
> > "DRM_UT_CORE",
> > @@ -1124,7 +1125,7 @@ module_param_named(rebar, amdgpu_rebar, int, 0444);
> > MODULE_PARM_DESC(user_queue, "Enable user queues (-1 = auto (default), 0 = disable, 1 = enable, 2 = enable UQs and disable KQs)");
> > module_param_named(user_queue, amdgpu_user_queue, int, 0444);
> >
> > -/*
> > +/**
> > * DOC: hdmi_hpd_debounce_delay_ms (uint)
> > * HDMI HPD disconnect debounce delay in milliseconds.
> > *
> > @@ -1134,6 +1135,17 @@ module_param_named(user_queue, amdgpu_user_queue, int, 0444);
> > MODULE_PARM_DESC(hdmi_hpd_debounce_delay_ms, "HDMI HPD disconnect debounce delay in milliseconds (0 to disable (by default), 1500 is common)");
> > module_param_named(hdmi_hpd_debounce_delay_ms, amdgpu_hdmi_hpd_debounce_delay_ms, uint, 0644);
> >
> > +/**
> > + * DOC: allm_mode (int)
> > + * Changes ALLM triggering mode (if sink supports ALLM). Possible values:
> > + *
> > + * - 0 = ALLM disabled
> > + * - 1 = ALLM dynamically triggered based on VRR state / Game Content Type Hint
> > + * - 2 = ALLM forced always on
> > + */
> > +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);
> > +
> > /* These devices are not supported by amdgpu.
> > * They are supported by the mach64, r128, radeon drivers
> > */
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> > index 4a7c9f810e35..b779aac28dfa 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> > @@ -44,6 +44,7 @@
> > #include "clk_mgr.h"
> > #include "dc_state_priv.h"
> > #include "dc_stream_priv.h"
> > +#include "modules/inc/mod_info_packet.h"
>
> Architecturally DC can't have a dependency on modules.
> Is there a different way we can handle this?
>
> Could we do the determination in amdgpu_dm (with help of
> the module) and then set a flag on the stream?
>
> Harry
Sure. I don't have any opinion on how it should be done. I think I only
did this like that because I wanted it to be easily changeable at
runtime, but the value of having this RW is next to none.
>
> >
> > #include "virtual/virtual_link_hwss.h"
> > #include "link/hwss/link_hwss_dio.h"
> > @@ -4503,8 +4504,6 @@ static void set_avi_info_frame(
> > unsigned int vic = pipe_ctx->stream->timing.vic;
> > unsigned int rid = pipe_ctx->stream->timing.rid;
> > unsigned int fr_ind = pipe_ctx->stream->timing.fr_index;
> > - enum dc_timing_3d_format format;
> > - bool allm;
> >
> > if (stream->avi_infopacket.valid) {
> > *info_packet = stream->avi_infopacket;
> > @@ -4658,10 +4657,8 @@ static void set_avi_info_frame(
> > ///VIC
> > if (pipe_ctx->stream->timing.hdmi_vic != 0)
> > vic = 0;
> > - format = stream->timing.timing_3d_format;
> > - allm = stream->link->local_sink->edid_caps.allm;
> > /*todo, add 3DStereo support*/
> > - if ((format != TIMING_3D_FORMAT_NONE) || allm) {
> > + if (!is_hdmi_vic_mode(pipe_ctx->stream)) {
> > // Based on HDMI specs hdmi vic needs to be converted to cea vic when 3D is enabled
> > switch (pipe_ctx->stream->timing.hdmi_vic) {
> > case 1:
> > diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h b/drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h
> > index 306eb7355c25..9ec123ecc7c4 100644
> > --- a/drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h
> > +++ b/drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h
> > @@ -41,6 +41,7 @@ void set_vsc_packet_colorimetry_data(
> > enum dc_color_space cs,
> > enum color_transfer_func tf);
> >
> > +bool is_hdmi_vic_mode(const struct dc_stream_state *stream);
> > void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
> > struct dc_info_packet *info_packet,
> > enum dc_color_space cs,
> > 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 53e488fdb4ea..829cce9455db 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
> > @@ -23,12 +23,13 @@
> > *
> > */
> >
> > -#include "mod_info_packet.h"
> > +#include "amdgpu.h"
> > #include "core_types.h"
> > -#include "dc_types.h"
> > -#include "mod_shared.h"
> > -#include "mod_freesync.h"
> > #include "dc.h"
> > +#include "dc_types.h"
> > +#include "mod_freesync.h"
> > +#include "mod_info_packet.h"
> > +#include "mod_shared.h"
> >
> > enum vsc_packet_revision {
> > vsc_packet_undefined = 0,
> > @@ -54,6 +55,12 @@ enum vsc_packet_revision {
> > #define HF_VSIF_3D_BIT 0
> > #define HF_VSIF_ALLM_BIT 1
> >
> > +enum allm_trigger_mode {
> > + ALLM_MODE_DISABLED = 0,
> > + ALLM_MODE_ENABLED_DYNAMIC = 1,
> > + ALLM_MODE_ENABLED_FORCED = 2,
> > +};
> > +
> > // VTEM Byte Offset
> > #define VTEM_PB0 0
> > #define VTEM_PB1 1
> > @@ -499,7 +506,32 @@ void mod_build_vsc_infopacket(const struct dc_stream_state *stream,
> > }
> > }
> >
> > -static bool is_hdmi_vic_mode(const struct dc_stream_state *stream)
> > +static bool is_hdmi_allm_mode(const struct dc_stream_state *stream)
> > +{
> > + /* No local sink */
> > + if (!stream->link->local_sink)
> > + return false;
> > +
> > + /* Sink doesn't expose ALLM support in edid */
> > + if (!stream->link->local_sink->edid_caps.allm)
> > + return false;
> > +
> > + switch (amdgpu_allm_mode) {
> > + case ALLM_MODE_DISABLED:
> > + return false;
> > +
> > + case ALLM_MODE_ENABLED_DYNAMIC:
> > + break;
> > +
> > + case ALLM_MODE_ENABLED_FORCED:
> > + return true;
> > + }
> > +
> > + return stream->content_type == DISPLAY_CONTENT_TYPE_GAME ||
> > + stream->vrr_active_variable;
> > +}
> > +
> > +bool is_hdmi_vic_mode(const struct dc_stream_state *stream)
> > {
> > if (stream->timing.hdmi_vic == 0)
> > return false;
> > @@ -512,7 +544,7 @@ static bool is_hdmi_vic_mode(const struct dc_stream_state *stream)
> > if (stream->view_format != VIEW_3D_FORMAT_NONE)
> > return false;
> >
> > - if (stream->link->local_sink->edid_caps.allm)
> > + if (is_hdmi_allm_mode(stream))
> > return false;
> >
> > return true;
> > @@ -541,7 +573,7 @@ void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream,
> >
> > info_packet->valid = false;
> >
> > - allm = stream->link->local_sink->edid_caps.allm;
> > + allm = is_hdmi_allm_mode(stream);
> > format = stream->view_format == VIEW_3D_FORMAT_NONE ?
> > TIMING_3D_FORMAT_NONE :
> > stream->timing.timing_3d_format;
next prev parent reply other threads:[~2026-02-06 20:53 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 [this message]
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
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=79264ab170e48e1372b3b847d75f4635dcc57aa6.camel@gmail.com \
--to=tomasz.pakula.oficjalny@gmail.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=harry.wentland@amd.com \
--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=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®