Re: [RFC PATCH v1 1/1] ACPI: PM: s2idle: Add lps0_screen_off sysfs interface
From: Mario Limonciello (AMD) (kernel.org)
Date: Tue Dec 02 2025 - 21:12:13 EST
On 12/2/2025 4:35 PM, Dmitry Osipenko wrote:
On 12/3/25 00:25, Mario Limonciello (AMD) (kernel.org) wrote:
An inhibitor process in logind can handle this gracefully very simply.
Involving the DRM subsystem just adds a lot of complexity and it is
not clear what the benefit would be. There are no known devices that
hook DRM components into that DSM.
By doing it this way userspace still has control, but it's not
mandatory for userspace to be changed.
On that note, the screen off calls/userspace implementations are
optional under both patch series. If userspace is not aware of them,
they are still called by the kernel when suspending.
With the proposal I mentioned you can get the LPS0 _DSM called on a
handheld when the screen gets called without changing userspace.
Current userland also duplicates the functionality of the screen off
call, which is primarily turning off the keyboard backlight. So along
implementing this call, userspace software like powerdevil/upower
needs to be tweaked to avoid doing that if the screen off state is
available.
Sure Any hooking for turning off LEDs manually based off the screen off
_DSM is totally feasible.
It's not that trivial to add screen on/off hooks to DRM, there is no one
central place for that from what I can tell. I'm seeing variant with DRM
hooks as unnecessary complexity that doesn't solve any practical problem.
Is it really that hard? I figured that any time
connector->dpms != mode from drm_atomic_connector_commit_dpms() could
walk through all the connectors and make a judgement call whether to
notify the potentially exported symbol.
A week ago in a private conversation, Daniel Stone gave an example of
laptop's lid-close handling that is done purely in userspace.
Technically, kernel could have DRM hooks for that too, but it doesn't.
All the way into hardware sleep? There are certain requirements needed
for hardware sleep that kernel drivers are normally used to put devices
into the right state. I guess PCIe devices you can hack around with
userspace PCI config space writes but you're going to confuse the kernel
pretty badly.
Userspace would need to be taught about new power modes in any case.
Addition of DRM hooks should require a well-defined justification, which
is currently absent.
Why does userspace need to know about them? Besides the inhibitor can't
this be invisible to userspace? I thought this mostly is for the
firmware to flash some LEDs and maybe change some power limits.