From: Mario Limonciello <mario.limonciello@amd.com>
To: Antheas Kapenekakis <lkml@antheas.dev>, linux-pm@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org, luke@ljones.dev,
me@kylegospodneti.ch, Denis Benato <benato.denis96@gmail.com>
Subject: Re: [PATCH v2 2/5] acpi/x86: s2idle: handle Display On/Off calls outside of suspend sequence
Date: Mon, 23 Sep 2024 11:03:24 -0500 [thread overview]
Message-ID: <1a9b611c-51f0-4c3d-8bc2-62c6b6104fd2@amd.com> (raw)
In-Reply-To: <20240922172258.48435-3-lkml@antheas.dev>
On 9/22/2024 12:22, Antheas Kapenekakis wrote:
> Currently, the Display On/Off calls are handled within the suspend
> sequence, which is a deviation from Windows. This causes issues with
> certain devices, where the notification interacts with a USB device
> that expects the kernel to be fully awake.
>
> This patch calls the Display On/Off callbacks before entering the suspend
> sequence, which fixes this issue. In addition, it opens the possibility
> of modelling a state such as "Screen Off" that mirrors Windows, as the
> callbacks will be accessible and validated to work outside of the
> suspend sequence.
>
> Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
> kernel/power/suspend.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
> index c527dc0ae5ae..610f8ecaeebd 100644
> --- a/kernel/power/suspend.c
> +++ b/kernel/power/suspend.c
> @@ -589,6 +589,13 @@ static int enter_state(suspend_state_t state)
> if (state == PM_SUSPEND_TO_IDLE)
> s2idle_begin();
>
> + /*
> + * Linux does not have the concept of a "Screen Off" state, so call
> + * the platform functions for Display On/Off prior to the suspend
> + * sequence, mirroring Windows which calls them outside of it as well.
> + */
> + platform_suspend_display_off();
> +
I thought about it some more over the weekend and if moving the screen
on/off _DSM at all I don't feel this is the right place for triggering it.
IMO it should be called by DRM core. That is when the number of CRTCs
active goes 1+ -> 0 call screen off and when it goes 0->1+ call screen on.
There could be an argument made only for eDP this happens, but I think
that's a slippery slope if you end up with an AIO design that uses DP
instead of eDP or a desktop for example. So the safest policy should be
across all CRTCs of all GPUs. During the suspend sequence any that were
left on will get turned off, and then it could be triggered at that time
instead.
By making such a change then when the compositor turns off all displays
at runtime you can potentially support dark screen background downloads
that have specifically called this _DSM and any actions that are taken
from doing so.
> if (sync_on_suspend_enabled) {
> trace_suspend_resume(TPS("sync_filesystems"), 0, true);
> ksys_sync_helper();
> @@ -616,6 +623,8 @@ static int enter_state(suspend_state_t state)
> suspend_finish();
> Unlock:
> mutex_unlock(&system_transition_mutex);
> +
> + platform_suspend_display_on();
> return error;
> }
>
next prev parent reply other threads:[~2024-09-23 16:03 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-22 17:22 [PATCH v2 0/5] acpi/x86: s2idle: move Display off/on calls outside suspend (fixes ROG Ally suspend) Antheas Kapenekakis
2024-09-22 17:22 ` [PATCH v2 1/5] acpi/x86: s2idle: add support for Display Off and Display On callbacks Antheas Kapenekakis
2024-09-23 15:57 ` Mario Limonciello
2024-09-22 17:22 ` [PATCH v2 2/5] acpi/x86: s2idle: handle Display On/Off calls outside of suspend sequence Antheas Kapenekakis
2024-09-23 16:03 ` Mario Limonciello [this message]
2024-09-23 16:15 ` Antheas Kapenekakis
2024-09-23 16:30 ` Mario Limonciello
2024-09-23 16:43 ` Antheas Kapenekakis
2024-09-23 17:01 ` Antheas Kapenekakis
2024-09-23 17:05 ` Mario Limonciello
2024-09-23 17:13 ` Antheas Kapenekakis
2024-09-22 17:22 ` [PATCH v2 3/5] acpi/x86: s2idle: add quirk table for modern standby delays Antheas Kapenekakis
2024-09-22 17:54 ` Denis Benato
2024-09-22 18:00 ` Antheas Kapenekakis
2024-09-22 17:22 ` [PATCH v2 4/5] acpi/x86: s2idle: call Display On/Off as part of callbacks and rename Antheas Kapenekakis
2024-09-22 17:22 ` [PATCH v2 5/5] platform/x86: asus-wmi: remove Ally (1st gen) and Ally X suspend quirk Antheas Kapenekakis
2024-09-22 18:15 ` [PATCH v2 0/5] acpi/x86: s2idle: move Display off/on calls outside suspend (fixes ROG Ally suspend) Derek J. Clark
2024-09-22 19:40 ` Antheas Kapenekakis
2024-09-23 1:35 ` Derek J. Clark
2024-09-23 5:57 ` Antheas Kapenekakis
2024-09-23 11:09 ` Luke Jones
2024-09-23 13:11 ` Antheas Kapenekakis
2024-09-23 15:56 ` Mario Limonciello
2024-09-23 16:11 ` Antheas Kapenekakis
2024-09-23 16:21 ` Mario Limonciello
2024-09-23 16:54 ` Antheas Kapenekakis
2024-09-23 17:15 ` Mario Limonciello
2024-09-23 17:48 ` Antheas Kapenekakis
2024-10-05 14:21 ` Hans de Goede
2024-10-05 15:10 ` Antheas Kapenekakis
2024-10-05 16:24 ` Hans de Goede
2024-10-05 16:27 ` Hans de Goede
2024-10-05 16:50 ` Antheas Kapenekakis
2024-10-05 16:57 ` Antheas Kapenekakis
2024-10-05 21:47 ` Hans de Goede
2024-10-05 22:15 ` Antheas Kapenekakis
2024-10-06 10:16 ` Hans de Goede
2024-10-06 11:29 ` Antheas Kapenekakis
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=1a9b611c-51f0-4c3d-8bc2-62c6b6104fd2@amd.com \
--to=mario.limonciello@amd.com \
--cc=benato.denis96@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=lkml@antheas.dev \
--cc=luke@ljones.dev \
--cc=me@kylegospodneti.ch \
--cc=platform-driver-x86@vger.kernel.org \
/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