From nobody Tue Feb 10 04:13:31 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 45A132F9D98 for ; Sun, 25 Jan 2026 18:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366381; cv=none; b=E1zCaGp4XzedxeikahZ8/zMIJBAhlmu7jWt7VsGVJJ7RFqgP57/i6Kmnys6gLK33VlLFip8BUzb0sqhNTYIgMxltPKS8dQDu3fphPXC4TRS0QSmGRHBE6/UvPsX58yb72zrrGmiwM14vTFOGMRie53nEumOmVHZJP7I9MXJ/w+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366381; c=relaxed/simple; bh=iwaWUeFlDmNDzJzGhaVkoQYgdOxQVFLKLdSfv1D+Mwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UcQtBrLzEaeMdRMgK/03nsZqCbSdYX0N5DUHc2ic1GGtjDN1RVFR/pXFMUy5Mlx/1Hsb/2tWX7FeXZwwj8ffNXfv9lEmsT+HIv9eOLqQTR/lCx5VKyZidxE3aMIZwjfIkB2sALyEJIj5d1/xSc8Ww6ddPtGFTkB1nGM6jNZ3hhc= 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=HlbKfXTQ; arc=none smtp.client-ip=209.85.218.53 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="HlbKfXTQ" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b8719f5a2b5so50779666b.3 for ; Sun, 25 Jan 2026 10:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769366379; x=1769971179; 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=ecPuaGgfpB06f+q+wYbBx7hNGw3dVlBz9Vc5r6vMzJA=; b=HlbKfXTQ1ZlRFMWzAkfvUyTtl/Oz7Hh630fayRmfgID1EnlJw775iVBq6h+D8zWM3Z R+Hev/fJud33mjRxA0jj3DL8uJxRD2N0b8tXKa7wLwvicC6Jwci//n+mXdz1cdip7c1z Wb6WGkHKSHDurhSX9wuGdJxB+7GIG7b0cApGmO0yJYaICZLNqQyDt/ueYn1pGNtHt/BN fdDl5enqUtzmFCjPBiwsVQ4JuDIae9QmGS+NQR1ard8lnJXcHbZxXcUs2PUd4lhRPcuW k5IWjtRbsiA1QlvMFo+CndJIauq1/D8t5ijtkatpOym/ovYNGgugLM8biRlJTtrIrsQA AB6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769366379; x=1769971179; 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=ecPuaGgfpB06f+q+wYbBx7hNGw3dVlBz9Vc5r6vMzJA=; b=wx6uH8XOPjyAByzbgS3/qXj4Kx6EKtJCprb7NgzJ+eFCWMwoazz+e99lLXl/RPGRuH ofoBpDLIGHzZXmddpPsX6ry4v1/Kp9HSplROP0AcN1WN353hJi/EfkdctTp0oNTpetr5 TI7LAqLiOZJZzro8x5RYSXys01TBSpg8xKmBV3qS7lpFRx3WGgH71YsyYl1gmoq3aJ5C srIYslVjDdC7q50pmzdGUH4Gefc42Gwi41uQMqkf4Zwg3JOH8FhnjsWMYWfyYc2wL26x ogFvnkXStRaQFZqmXxZwSfubLvcIqEN38YibmhKZEF7/OzeHwxdvd8GGbF7DXtTfDEbC tadg== X-Forwarded-Encrypted: i=1; AJvYcCUmSjhV1jCWL4/iOiQGGrOrEYQgLwx8SRNiuv4sBZdMZe4opztmBgTek74hPxUSf+15FDn/N08HjvDIa7c=@vger.kernel.org X-Gm-Message-State: AOJu0YwCbUlikJpdhfZ3VUUcKl20Bubk0/IOetaw672E4qmAHdHAGkAl NjF5kUmr6h06lEvzK4t7xWnVkDLeem/39V5QPgOv21pbXRRP6AxhMwVV X-Gm-Gg: AZuq6aJyWb5J1iXr4VBmtpJmj6pMSkViRn3E9+9mP403Yv0362ejCNGlVhCztvcNr8U kIW9HOAnybcGK/Lee0aogvHKqFsJwDBn9M9IKv4qlbP3KdXMdp8h1Z6GCE6f4cpRIOFVR3fQ8Ls fiWgNx8xyo2vb/touU9PHZLaopP83OPfR2+Fts1WeW9LQwWpCvhO+afnLdayad90RYmW3hsw1nR mHsP0ny7CrnTiQIq16pQt0jbB0vjaCpys/jMg61c855gHz1ts4wAgmPf88dbQCLnjHQ7KU7+Gbv Gexh2SQylYpoU4cwaybvHlrBNBmcOxZHg6DR4WRC091MOWCW+OlDXu2b+ZU4O5kIMxOCitilACr URrQcVHp8XLESdmZlwpPf9uAMelefNs0GBkb34yI+2We7xt5wvUgqKiOQLDg2qdQztXhqWnMyZ/ gkJ/z8Usu8kO4+hLbtYYHG2LVySEyifwlezG+Wd+7uHonzEViLyZbm4UhMhEZdHaw1 X-Received: by 2002:a17:907:c28:b0:b87:106c:88eb with SMTP id a640c23a62f3a-b8d20d64cdcmr80438666b.0.1769366378380; Sun, 25 Jan 2026 10:39:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 10:39:38 -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 16/19] drm/amd/display: Add parameter to control ALLM behavior Date: Sun, 25 Jan 2026 19:39:11 +0100 Message-ID: <20260125183914.459228-17-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] 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 paramter Signed-off-by: Tomasz Paku=C5=82a --- 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 | 42 +++++++++++++++---- 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdg= pu/amdgpu.h index 9c11535c44c6..c9eab44ad5b3 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; =20 extern int amdgpu_wbrf; extern int amdgpu_user_queue; +extern int amdgpu_allm_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 771c89c84608..3bdbb46e4d69 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 =3D -1; /* auto */ int amdgpu_user_queue =3D -1; uint amdgpu_hdmi_hpd_debounce_delay_ms; +int amdgpu_allm_mode =3D 1; =20 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 =3D auto (default), 0= =3D disable, 1 =3D enable, 2 =3D enable UQs and disable KQs)"); module_param_named(user_queue, amdgpu_user_queue, int, 0444); =20 -/* +/** */ * 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, in= t, 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_de= lay_ms, uint, 0644); =20 +/** + * DOC: allm_mode (int) + * Changes ALLM triggering mode (if sink supports ALLM). Possible values: + * + * - 0 =3D ALLM disabled + * - 1 =3D ALLM dynamically triggered based on VRR state / Game Content T= ype Hint + * - 2 =3D ALLM forced always on + */ +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); + /* 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/gp= u/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" =20 #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 =3D pipe_ctx->stream->timing.vic; unsigned int rid =3D pipe_ctx->stream->timing.rid; unsigned int fr_ind =3D pipe_ctx->stream->timing.fr_index; - enum dc_timing_3d_format format; - bool allm; =20 if (stream->avi_infopacket.valid) { *info_packet =3D stream->avi_infopacket; @@ -4658,10 +4657,8 @@ static void set_avi_info_frame( ///VIC if (pipe_ctx->stream->timing.hdmi_vic !=3D 0) vic =3D 0; - format =3D stream->timing.timing_3d_format; - allm =3D stream->link->local_sink->edid_caps.allm; /*todo, add 3DStereo support*/ - if ((format !=3D 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/dr= ivers/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); =20 +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 0db2db7a197f..7516ab9a7554 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 @@ * */ =20 -#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" =20 enum vsc_packet_revision { vsc_packet_undefined =3D 0, @@ -54,6 +55,12 @@ enum vsc_packet_revision { #define HF_VSIF_3D_BIT 0 #define HF_VSIF_ALLM_BIT 1 =20 +enum allm_trigger_mode { + ALLM_MODE_DISABLED =3D 0, + ALLM_MODE_ENABLED_DYNAMIC =3D 1, + ALLM_MODE_ENABLED_FORCED =3D 2, +}; + // VTEM Byte Offset #define VTEM_PB0 0 #define VTEM_PB1 1 @@ -499,9 +506,30 @@ void mod_build_vsc_infopacket(const struct dc_stream_s= tate *stream, } } =20 -static bool is_hdmi_vic_mode(const struct dc_stream_state *stream) +static bool is_hdmi_allm_mode(const struct dc_stream_state *stream) { - bool allm =3D stream->link->local_sink->edid_caps.allm; + /* 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 =3D=3D DISPLAY_CONTENT_TYPE_GAME || + stream->vrr_active_variable; +} + +bool is_hdmi_vic_mode(const struct dc_stream_state *stream) +{ + bool allm =3D is_hdmi_allm_mode(stream); bool stereo =3D stream->view_format !=3D VIEW_3D_FORMAT_NONE; =20 if (stream->timing.hdmi_vic =3D=3D 0) @@ -540,7 +568,7 @@ void mod_build_hf_vsif_infopacket(const struct dc_strea= m_state *stream, =20 info_packet->valid =3D false; =20 - allm =3D stream->link->local_sink->edid_caps.allm; + allm =3D is_hdmi_allm_mode(stream); format =3D stream->view_format =3D=3D VIEW_3D_FORMAT_NONE ? TIMING_3D_FORMAT_NONE : stream->timing.timing_3d_format; --=20 2.52.0