public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: "Atharva Tiwari" <atharvatiwarilinuxdev@gmail.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/2] efi: Save Brightness using EFI on Macs
Date: Mon, 9 Feb 2026 09:46:44 +0100	[thread overview]
Message-ID: <f4409418-bd9e-471e-8a97-5c99481cba51@kernel.org> (raw)
In-Reply-To: <aYiMqKJgtaah8pLW@wunner.de>

Hi,

On 8-Feb-26 14:16, Lukas Wunner wrote:
> On Sun, Feb 08, 2026 at 11:45:55AM +0100, Hans de Goede wrote:
>> I was already worried about the shutdown approach on v1,
>> but did not say anything since I'm not that familiar
>> with apple hw and other apple code is already doing
>> something similar.
> 
> Yes, macOS saves the brightness so that it's persisted across reboots
> and can be set already by the EFI firmware, avoiding a bloom effect
> (brightness change) on handover to the OS.  We want to provide the
> same seamless user experience on Linux that users have grown accustomed
> to on macOS, I think that's a reasonable thing to do.
> 
>> But writing a non-volatile EFI variable every 300ms is
>> just a very very bad idea.
> 
> Agreed.  But what do you think about a delayed write when brightness
> is changed, so that brightness is persisted even if the OS crashes?
> Users don't change brightness that often, I can't imagine that it
> amounts to a significantly higher number of writes than if it's
> only done on shutdown.

How about saving the bootup brightness and then on shutdown
compare and store it only if it changed ?

That seems the safest approach. OS crashes should be seldom and
the brightness not getting restored will be the least of a user's
worries if those happen.

Something like this should really be written to minimize
the amount of nvram writes.

It might actually be a good idea to change the existing apply
brightness saving code in the same way.

Regards,

Hans




  reply	other threads:[~2026-02-09  8:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 12:56 [PATCH 0/2] Save Brightness on Macs Atharva Tiwari
2026-02-06 12:56 ` [PATCH 1/2] efi: Save Brightness using EFI " Atharva Tiwari
2026-02-08 10:45   ` Hans de Goede
2026-02-08 13:16     ` Lukas Wunner
2026-02-09  8:46       ` Hans de Goede [this message]
2026-02-06 12:56 ` [PATCH 2/2] platform/apple-gmux: use apple_brightness to save brightness to EFI Atharva Tiwari

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=f4409418-bd9e-471e-8a97-5c99481cba51@kernel.org \
    --to=hansg@kernel.org \
    --cc=ardb@kernel.org \
    --cc=atharvatiwarilinuxdev@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --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