All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] platform/x86: asus-armoury: Add dgpu_power_state and check in dgpu_disable
@ 2026-08-05 18:28 Marco Scardovi
  2026-08-05 18:28 ` [PATCH 1/3] platform/x86: asus-wmi: Add ASUS_WMI_DEVID_DGPU_POWER_STATE define Marco Scardovi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco Scardovi @ 2026-08-05 18:28 UTC (permalink / raw)
  To: Corentin Chary, Luke D . Jones, Denis Benato, Hans de Goede,
	Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Marco Scardovi

This patch series adds support for WMI device ID 0x00120097
(ASUS_WMI_DEVID_DGPU_POWER_STATE) to query the power state level of the
discrete GPU (dGPU) on ASUS ROG laptops, and uses it to prevent disabling
the dGPU while it is in active use.

--- Background & How it Works ---

Modern ASUS ROG firmware provides WMI device ID 0x00120097 in the ACPI DSTS
evaluation method:

If ((IIA0 == 0x00120097))
{
  Return (0x00010000)
}

When queried, DSTS returns:
  - Bit 16 (0x00010000): Presence bit (set when supported by ACPI).
  - Bit 0  (0x00000001): Power state status:
      * 0: D3 cold (off / suspended)
      * 1: D0 (active / powered on)

--- Patch Series Summary ---

- Patch 1/3: Defines ASUS_WMI_DEVID_DGPU_POWER_STATE (0x00120097) in
  include/linux/platform_data/x86/asus-wmi.h.
- Patch 2/3: Registers the read-only sysfs attribute 'dgpu_power_state' in
  drivers/platform/x86/asus-armoury.c under firmware_attributes class.
- Patch 3/3: Consolidates dgpu_disable checks under a single 'if (disable)'
  block and returns -EBUSY if an attempt is made to disable the dGPU while active.

--- Testing ---

Verified on ASUS ROG G614PR hardware:
- Reading 'current_value' returns 0 when the dGPU is suspended in D3 cold,
  and 1 when active in D0.
- Attempting to disable the dGPU while in use returns -EBUSY.

Suggested-by: Denis Benato <denis.benato@linux.dev>
Signed-off-by: Marco Scardovi <scardracs@disroot.org>

Marco Scardovi (3):
  platform/x86: asus-wmi: Add ASUS_WMI_DEVID_DGPU_POWER_STATE define
  platform/x86: asus-armoury: Add dgpu_power_state attribute
  platform/x86: asus-armoury: Prevent disabling dGPU when in use

 drivers/platform/x86/asus-armoury.c        | 29 ++++++++++++++++------
 include/linux/platform_data/x86/asus-wmi.h |  3 ++-
 2 files changed, 24 insertions(+), 8 deletions(-)

-- 
2.55.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-05 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 18:28 [PATCH 0/3] platform/x86: asus-armoury: Add dgpu_power_state and check in dgpu_disable Marco Scardovi
2026-08-05 18:28 ` [PATCH 1/3] platform/x86: asus-wmi: Add ASUS_WMI_DEVID_DGPU_POWER_STATE define Marco Scardovi
2026-08-05 18:28 ` [PATCH 2/3] platform/x86: asus-armoury: Add dgpu_power_state attribute Marco Scardovi
2026-08-05 18:28 ` [PATCH 3/3] platform/x86: asus-armoury: Prevent disabling dGPU when in use Marco Scardovi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.