From nobody Sun Apr 5 21:14:19 2026 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (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 8490D27CB35 for ; Tue, 24 Feb 2026 04:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771907532; cv=none; b=lXVWphdoIdtzOENDLRT/LaFqlp3LMWnFPHF5XU/QkJ+f9um6BkThPTc81WBfQ9gYSi4ciisZ43ElCu2uaaGfZXNNpFX4v2mKOh4doWPfbLAxrEukf1cVUqS5IroGY1nltqLalNKheKGsgOcbOT1BRHFS+ATggrk29uhxRRW0YbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771907532; c=relaxed/simple; bh=nEkPRkLVQRHHUQm1Vvmpv+kKOYwKxIhi1fJkMphZTdM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lzZh4uuQgNlCrv6NQQVcnNJQCJ1Ic5n76xwji6dH0T49Fn2H+iFX76ZdVQE6cOlo6d4oEqq8zflBn83jxhbHd7ZgjDILp8kBLRoth1xSVyImZEGVxoiYIwSpNjJ6fMHz4Y30c4ZT35uwL2QF41WRbOpvT3CSU/2olLbekHL+Cm4= 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=cy0MA9fJ; arc=none smtp.client-ip=74.125.82.50 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="cy0MA9fJ" Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-124a635476fso4763385c88.0 for ; Mon, 23 Feb 2026 20:32:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771907530; x=1772512330; 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=lW0PTJ2xSTHIHILISSH+wlmCW38PDwPsaAVhAgtz/fQ=; b=cy0MA9fJcPeIMC0t9WC84uxf35I7d0LBdYj47KCH3LPtpcaJrFUp+abNTJiBgUGuW0 bahrP/DiW53ujUviOJmmFYcQMOAy8iGZ07yUMWBUEbMFTg95zGvEeIoJ5XtwjKbPoUff AjULip7RayIiYAzNnpnXkFYfLBosxB8udYKJ+HXw5vIRU/4n39vD9iyhQET8QIXrjAXZ fHxkfbsO3zLz7PeAnrwrwKj3oPya7MpG28H6++4qIlWpbfU1pGvoh1hNT9hwgOL+F2RJ e+rtvr+5rnrU2uP2Mz6Qajst2zkNQvdnLGIo3zyGLcjB7GUWnE9EIb0lO8c0iEE2kq0u 9P0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771907530; x=1772512330; 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=lW0PTJ2xSTHIHILISSH+wlmCW38PDwPsaAVhAgtz/fQ=; b=ATnYwQ+oaEAQAzpTc+mo2mExgVeOCNDMDQviu1i7h7gwhBcPfHg6LlRsLM0yAzns2q zteyspGySymIAJvsdLO9P9+EZRr+MfP6F8sbkOWlUDQdLMNSxxjf1p4AkWpdq75ve9N/ j+0mBSYvqt2IOrRnKAQGszT6XbCWpDyxWOIa2rKOcZ/6cW+kaRphc3L2MBC5WU0aTrE3 N61w3DhNMe75s2ar1c9vDHWKFdnTDlpSIVEkGbEXo+58iWGjg2gmmtsy0rQf5Oi3mRiG 7nzj+und+AX/ouEQFxETXOg1iVvpP6X40e+KiURAsyIOKsHW3E7LSwAXCcDh6MZQasDn LuMQ== X-Forwarded-Encrypted: i=1; AJvYcCXAxSfB+e72f5VTBtS78g1+Bj/sBxbozRM/eDDVj255xGqPicL1lxR+t3LzQsan8A41Oua6EpHd2QiRg5w=@vger.kernel.org X-Gm-Message-State: AOJu0YxcklpaSTuyf9uv1bXBB4qj798vbVYJGmhihcKGVssEMJSTzhtS njuzQMeU+Xn2Q+yxYjkyS9wha07Pqp8NAAVcsCYW7U9pFG9H2fK4H+FN X-Gm-Gg: AZuq6aKLtpbQN2EIOk+DTSm4cbFW7cXGHv+4Vs+Srjg6BiQa0I+4GyFu0ZGF2yYFiIz YvH5l0KzW68NYlUysT7FnNwD/DPSNFWlvznKx7X//8rUtZavjLabURDx4mefyIlnLsBOZVBB051 LLLaj+SOS5Ezr7wpIOdBs7No8DzhaG6EyO9sZtQ35bMMmlX45Cx7vFDICxIO7fDRJi+RFeFAAeO WU5utDD48NT0kkYOGe0xZY18t5y9zSXAkTm67c6HoJDHZ4VtV5GjYg3Om6s6ibzOS+dvj+tBz5f cCEAThC3J8/no5DhWFaY7OvWgFr1zd+ppPIGizAEX1Lat9d8AR755PHG/mjNcq4gTMQAgxGFMxu 119WI6NrTeDmjwYYnkB2TwPR/i/EZOj9iqHBjrIhvilq/G0ReYVEq/WelyDH1YMjobuzYcxbtpq zG2Kjo7sp+vmpo3ur1/t/fpWIPHhUlJigzOptlzaabfKEvuwl8Fd3rZNicHiWTzDV4eigM38Anl oI= X-Received: by 2002:a05:7022:6b93:b0:122:33e:6d41 with SMTP id a92af1059eb24-1276ad11a3fmr3001986c88.23.1771907529704; Mon, 23 Feb 2026 20:32:09 -0800 (PST) Received: from lappy (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1276af7b4c7sm9607887c88.9.2026.02.23.20.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 20:32:09 -0800 (PST) From: "Derek J. Clark" To: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Hans de Goede Cc: Mark Pearson , Armin Wolf , Jonathan Corbet , Rong Zhang , Kurt Borja , "Derek J . Clark" , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/6] platform/x86: lenovo-wmi-other: Add GPU tunable attributes Date: Tue, 24 Feb 2026 04:31:58 +0000 Message-ID: <20260224043200.2680384-5-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260224043200.2680384-1-derekjohn.clark@gmail.com> References: <20260224043200.2680384-1-derekjohn.clark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use an enum for all GPU attribute feature ID's and add GPU attributes. Reviewed-by: Mark Pearson Signed-off-by: Derek J. Clark --- .../wmi/devices/lenovo-wmi-other.rst | 11 ++ drivers/platform/x86/lenovo/wmi-capdata.h | 1 + drivers/platform/x86/lenovo/wmi-other.c | 105 ++++++++++++++++++ 3 files changed, 117 insertions(+) diff --git a/Documentation/wmi/devices/lenovo-wmi-other.rst b/Documentation= /wmi/devices/lenovo-wmi-other.rst index f4763ed66cc6..f7564b23bb7f 100644 --- a/Documentation/wmi/devices/lenovo-wmi-other.rst +++ b/Documentation/wmi/devices/lenovo-wmi-other.rst @@ -70,6 +70,17 @@ Each attribute has the following properties: The following firmware-attributes are implemented: - cpu_oc_stat: CPU Overlocking Status - cpu_temp: CPU Thermal Load Limit + - dgpu_boost_clk: Dedicated GPU Boost Clock + - dgpu_enable: Dedicated GPU Enabled Status + - gpu_didvid: GPU Device Identifier and Vendor Identifier + - gpu_mode: GPU Mode by Power Limit + - gpu_nv_ac_offset: Nvidia GPU AC Total Processing Power Baseline Offset + - gpu_nv_bpl: Nvidia GPU Base Power Limit + - gpu_nv_cpu_boost: Nvidia GPU to CPU Dynamic Boost Limit + - gpu_nv_ctgp: Nvidia GPU Configurable Total Graphics Power + - gpu_nv_ppab: Nvidia GPU Power Performance Aware Boost Limit + - gpu_oc_stat: GPU Overclocking Status + - gpu_temp: GPU Thermal Load Limit - ppt_cpu_cl: CPU Cross Loading Power Limit - ppt_pl1_apu_spl: Platform Profile Tracking APU Sustained Power Limit - ppt_pl1_spl: Platform Profile Tracking Sustained Power Limit diff --git a/drivers/platform/x86/lenovo/wmi-capdata.h b/drivers/platform/x= 86/lenovo/wmi-capdata.h index aa48f43cbb43..b7f9ee7b301a 100644 --- a/drivers/platform/x86/lenovo/wmi-capdata.h +++ b/drivers/platform/x86/lenovo/wmi-capdata.h @@ -25,6 +25,7 @@ =20 enum lwmi_device_id { LWMI_DEVICE_ID_CPU =3D 0x01, + LWMI_DEVICE_ID_GPU =3D 0x02, LWMI_DEVICE_ID_FAN =3D 0x04, }; =20 diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86= /lenovo/wmi-other.c index 87aba244da84..67768f6a50e0 100644 --- a/drivers/platform/x86/lenovo/wmi-other.c +++ b/drivers/platform/x86/lenovo/wmi-other.c @@ -65,6 +65,19 @@ enum lwmi_feature_id_cpu { LWMI_FEATURE_ID_CPU_IPL =3D 0x09, }; =20 +enum lwmi_feature_id_gpu { + LWMI_FEATURE_ID_GPU_NV_PPAB =3D 0x01, + LWMI_FEATURE_ID_GPU_NV_CTGP =3D 0x02, + LWMI_FEATURE_ID_GPU_TEMP =3D 0x03, + LWMI_FEATURE_ID_GPU_AC_OFFSET =3D 0x04, + LWMI_FEATURE_ID_DGPU_BOOST_CLK =3D 0x06, + LWMI_FEATURE_ID_DGPU_EN =3D 0x07, + LWMI_FEATURE_ID_GPU_MODE =3D 0x08, + LWMI_FEATURE_ID_DGPU_DIDVID =3D 0x09, + LWMI_FEATURE_ID_GPU_NV_BPL =3D 0x0a, + LWMI_FEATURE_ID_GPU_NV_CPU_BOOST =3D 0x0b, +}; + #define LWMI_FEATURE_ID_FAN_RPM 0x03 =20 #define LWMI_TYPE_ID_NONE 0x00 @@ -631,6 +644,66 @@ static struct tunable_attr_01 ppt_pl4_ipl_cl =3D { .type_id =3D LWMI_TYPE_ID_CROSSLOAD, }; =20 +static struct tunable_attr_01 gpu_nv_ppab =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_NV_PPAB, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_nv_ctgp =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_NV_CTGP, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_temp =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_TEMP, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_nv_ac_offset =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_AC_OFFSET, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 dgpu_boost_clk =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_DGPU_BOOST_CLK, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 dgpu_enable =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_DGPU_EN, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_mode =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_MODE, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 dgpu_didvid =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_DGPU_DIDVID, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_nv_bpl =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_NV_BPL, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + +static struct tunable_attr_01 gpu_nv_cpu_boost =3D { + .device_id =3D LWMI_DEVICE_ID_GPU, + .feature_id =3D LWMI_FEATURE_ID_GPU_NV_CPU_BOOST, + .type_id =3D LWMI_TYPE_ID_NONE, +}; + struct capdata01_attr_group { const struct attribute_group *attr_group; struct tunable_attr_01 *tunable_attr; @@ -1069,6 +1142,7 @@ static int lwmi_attr_01_is_supported(struct tunable_a= ttr_01 *tunable_attr) .name =3D _fsname, .attrs =3D _attrname##_attrs \ } =20 +/* CPU tunable attributes */ LWMI_ATTR_GROUP_TUNABLE_CAP01(cpu_temp, "cpu_temp", "Set the CPU thermal load limit"); LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_cpu_cl, "ppt_cpu_cl", @@ -1094,9 +1168,40 @@ LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl4_ipl, "ppt_pl4_= ipl", LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl4_ipl_cl, "ppt_pl4_ipl_cl", "Set the CPU cross loading instantaneous power limit"); =20 +/* GPU tunable attributes */ +LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_boost_clk, "gpu_boost_clk", + "Set the dedicated GPU boost clock"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_didvid, "gpu_didvid", + "Get the GPU device identifier and vendor identifier"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_enable, "dgpu_enable", + "Set the dedicated Nvidia GPU enabled status"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_mode, "gpu_mode", + "Set the GPU mode by power limit"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ac_offset, "gpu_nv_ac_offset", + "Set the Nvidia GPU AC total processing power baseline offset"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_bpl, "gpu_nv_bpl", + "Set the Nvidia GPU base power limit"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_cpu_boost, "gpu_nv_cpu_boost", + "Set the Nvidia GPU to CPU dynamic boost limit"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ctgp, "gpu_nv_ctgp", + "Set the GPU configurable total graphics power"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ppab, "gpu_nv_ppab", + "Set the Nvidia GPU power performance aware boost limit"); +LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_temp, "gpu_temp", + "Set the GPU thermal load limit"); =20 static struct capdata01_attr_group cd01_attr_groups[] =3D { { &cpu_temp_attr_group, &cpu_temp }, + { &dgpu_boost_clk_attr_group, &dgpu_boost_clk }, + { &dgpu_didvid_attr_group, &dgpu_didvid }, + { &dgpu_enable_attr_group, &dgpu_enable }, + { &gpu_mode_attr_group, &gpu_mode }, + { &gpu_nv_ac_offset_attr_group, &gpu_nv_ac_offset }, + { &gpu_nv_bpl_attr_group, &gpu_nv_bpl }, + { &gpu_nv_cpu_boost_attr_group, &gpu_nv_cpu_boost }, + { &gpu_nv_ctgp_attr_group, &gpu_nv_ctgp }, + { &gpu_nv_ppab_attr_group, &gpu_nv_ppab }, + { &gpu_temp_attr_group, &gpu_temp }, { &ppt_cpu_cl_attr_group, &ppt_cpu_cl }, { &ppt_pl1_apu_spl_attr_group, &ppt_pl1_apu_spl }, { &ppt_pl1_spl_attr_group, &ppt_pl1_spl }, --=20 2.52.0