mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
To: lukas@wunner.de
Cc: atharvatiwarilinuxdev@gmail.com, hansg@kernel.org,
	ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v2] apple-gmux: preserve brightness using EFI
Date: Wed,  4 Feb 2026 18:28:15 +0000	[thread overview]
Message-ID: <20260204182816.1179-1-atharvatiwarilinuxdev@gmail.com> (raw)
In-Reply-To: <aYNjob2b9MTusPvO@wunner.de>

> Older Intel Macs with a gmux can be booted in CSM mode (bypassing EFI).
> I'm wondering what happens on those with the above change?
> Do they only get the warning or do they crash?
> The warning is probably uncalled for on CSM-booted Macs.

I guess CSM-booted Macs would just trigger a warning when EFI isn’t enabled,
as efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE) will return 0.

> On my MacBookPro9,1 (which does have a gmux), the backlight-level variable
> has 6 bytes which currently contain (hexdump): 07 00 00 80 35 00
> I guess this is actually a struct of a 32-bit and a 16-bit value
> or alternatively three 16-bit values.  Yet you're only writing a
> single 16-bit value to the variable.  How many bytes does the variable
> have on your iMac and what are their contents?  I'm worried that
> your change may not be compatible with all Macs which have this variable.

This function actually writes 6 bytes, which is u32 efi_attr (first 32-bits)
and u16 efi_data (last 16-bits), but im confused about the fact, that the
hexdumps show that ur attr are different. the attr should be 07 00 00 00 but its
07 00 00 80, i think we should retrieve the attr in the probe function and use that for
writing. to fix this problem

> Finally, there are Macs which don't have a gmux but which do have a
> backlight.  They usually control brightness through i915 I think.
> It would be nice to save brightness to the EFI variable on those as well.

There should be something for Amdgpus aswell for mac pro, but i cant test i915 nor amdgpu,
as i dont have these devices. so i think we should currently drop this idea.

  reply	other threads:[~2026-02-04 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 10:06 Atharva Tiwari
2026-02-04 15:20 ` Lukas Wunner
2026-02-04 18:28   ` Atharva Tiwari [this message]
2026-02-05  8:43     ` Lukas Wunner

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=20260204182816.1179-1-atharvatiwarilinuxdev@gmail.com \
    --to=atharvatiwarilinuxdev@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --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

Powered by JetHome