regressions.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Dadap <ddadap@nvidia.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Youssef Aly <youssefaswad@gmail.com>,
	"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [REGRESSION] Backlight control broken on Dell G15 5515 since 6.1
Date: Tue, 10 Jan 2023 18:40:29 -0600	[thread overview]
Message-ID: <Y74FfQmjN8WJcCIG@lenny> (raw)
In-Reply-To: <16fde015-73d7-8169-3fc5-7a4915508c05@redhat.com>

On Tue, Jan 10, 2023 at 04:27:56PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 1/10/23 16:19, Youssef Aly wrote:
> > Hi Hans,
> > 
> > Yes, I added "acpi_backlight=nvidia_wmi_ec" to
> > the kernel commandline for the patched kernel, it doesn't work without it.
> > 
> > I have 2 modes in the bios Hybrid on/off (hybrid / discrete). I tried
> > the modes with "acpi_backlight=nvidia_wmi_ec" and
> > "acpi_backlight=native" using the patched kernel (v6.1.4):
> > 
> > Hybrid:
> > "acpi_backlight=native": Does not work, /sys/class/backlight contains
> > amdgpu_bl1.
> > "acpi_backlight=nvidia_wmi_ec": Works as expected,
> > /sys/class/backlight contains nvidia_wmi_ec_backlight.
> > 
> > Discrete:
> > "acpi_backlight=native": Works but when brightness from 0-10 is the
> > same as 0-100, for example 10 is full brightness like 100, 8 is the
> > same as 80, etc... ,
> > /sys/class/backlight contains nvidia_0.
> > "acpi_backlight=nvidia_wmi_ec": Does not work, /sys/class/backlight
> > contains nvidia_wmi_ec_backlight.
> 
> Thank you for testing!
> 
> Ok so it seems there are 2 issues at play here:
> 
> 1. Depending on the BIOS setting we need to use either native (discrete mode)
>    or nvidia_wmi_ec (hybrid mode)
> 
> 2. There is a bug in the nvidia binary drivers backlight control in native
>    mode on this system causing the range to be wrong
> 
> Daniel, we really need help from NVidia with fixing 1. can you see if
> there is a way to check the BIOS setting/mode from inside the kernel ?

Yes, the ACPI MXDM method should be able to do this. However, querying
WMI_BRIGHTNESS_METHOD_SOURCE is supposed to be the canonical way to
determine whether the backlight is supposed to be EC-driven, since there
are EC-driven and non-EC-driven designs, so the BIOS mode is supposed to
be orthogonal to whether or not the EC driver should be used. It sounds
like the BIOS is possibly reporting a wrong value for that query.

I guess we could wire up a quirk that checks MXDM and overrides the
WMI_BRIGHTNESS_METHOD_SOURCE query with a value derived from the current
mux operation mode. Then that quirk could be applied to this system.
I can put together a patch for that.

As for the native range bug, that does sound like a scaling issue. I'll
take a look at how the NVIDIA driver determines the range of possible
backlight values and see if Ican find an obvious way that might fail on
a particular system.
 
> Regards,
> 
> Hans
> 
> p.s.
> 
> Youssef, for your next email please use reply to all. You keep dropping
> Daniel and the regressions-list from the To/Cc, using reply-to-all should
> keep these in the To/Cc.
> 
> 
> 
> 
> > On Tue, 10 Jan 2023 at 10:39, Hans de Goede <hdegoede@redhat.com> wrote:
> >>
> >> Hi,
> >>
> >> On 1/10/23 02:07, Youssef Aly wrote:
> >>> Hello,
> >>>
> >>> Just reporting back, building with the patch fixed the issue.
> >>
> >> I assume that you also added "acpi_backlight=nvidia_wmi_ec" to
> >> the kernel commandline for the patched kernel, right ?
> >>
> >> If you have time, can you please also check the other BIOS
> >> (hybrid / discrete / ...) modes in the BIOS?
> >>
> >> Based on the previous bug report, I would expect you to need
> >> to pass "acpi_backlight=native" in at least some of the other
> >> modes ...
> >>
> >> Regards,
> >>
> >> Hans
> >>
> >>
> >>
> >>> On Mon, 9 Jan 2023 at 22:23, Youssef Aly <youssefaswad@gmail.com> wrote:
> >>>>
> >>>> Hello Hans,
> >>>>
> >>>> Ok, I'll try building with the patch you provided, and report back.
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Youssef
> >>>>
> >>>> On Mon, 9 Jan 2023 at 21:19, Hans de Goede <hdegoede@redhat.com> wrote:
> >>>>>
> >>>>> Hi Youssef,
> >>>>>
> >>>>> On 1/9/23 17:18, Youssef Aly wrote:
> >>>>>> Hello,
> >>>>>>
> >>>>>> The backlight control has been broken on Dell G15 5515 since 6.1, it
> >>>>>> is always at full brightness, this is only the case in hybrid (mux)
> >>>>>> graphics mode.
> >>>>>>
> >>>>>> As per the output of lsmod the nvidia_wmi_ec_backlight is loaded:
> >>>>>> nvidia_wmi_ec_backlight    16384  0
> >>>>>> video                  61440  5
> >>>>>> nvidia_wmi_ec_backlight,dell_wmi,amdgpu,dell_laptop,nvidia_modeset
> >>>>>> wmi                    36864  7
> >>>>>> video,nvidia_wmi_ec_backlight,alienware_wmi,dell_wmi,wmi_bmof,dell_smbios,dell_wmi_descriptor
> >>>>>>
> >>>>>> but it is not present in /sys/class/backlight, only amdgpu_bl1 is
> >>>>>> present which is not functional
> >>>>>> contents of /sys/class/backlight
> >>>>>> total 0
> >>>>>> lrwxrwxrwx 1 root root 0 Jan  9 00:49 amdgpu_bl1 ->
> >>>>>> ../../devices/pci0000:00/0000:00:08.1/0000:06:00.0/backlight/amdgpu_bl1/
> >>>>>>
> >>>>>> this is the content on 6.0.12
> >>>>>> total 0
> >>>>>> lrwxrwxrwx 1 root root 0 Jan  8 20:59 amdgpu_bl1 ->
> >>>>>> ../../devices/pci0000:00/0000:00:08.1/0000:06:00.0/backlight/amdgpu_bl1/
> >>>>>> lrwxrwxrwx 1 root root 0 Jan  8 20:59 nvidia_wmi_ec_backlight ->
> >>>>>> ../../devices/pci0000:00/PNP0C14:00/wmi_bus/wmi_bus-PNP0C14:00/603E9613-EF25-4338-A3D0-C46177516DB7/backlight/nvidia_wmi_ec_backlight/
> >>>>>>
> >>>>>> Distro: Endeavour OS
> >>>>>> Kernel: 6.1.4-arch1-1
> >>>>>> GPU: RTX 3060 Using nvidia proprietary drivers version 525.78.01
> >>>>>>
> >>>>>> #regzbot introduced v6.1..v6.1.4
> >>>>>
> >>>>> Hmm, this is likely caused by:
> >>>>>
> >>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f46acc1efd4b5846de9fa05f966e504f328f34a6
> >>>>>
> >>>>> Which was added because according to the reporter on their G15 5515
> >>>>> backlight control only works in native mode ...
> >>>>>
> >>>>> I'm getting the feeling that we need to detect the BIOS setting
> >>>>> and use a different backlight device depending on the setting...
> >>>>>
> >>>>> Daniel, any ideas?
> >>>>>
> >>>>> For now can you try building a kernel with the attached patch
> >>>>> (which I've also just submitted upstream) and with:
> >>>>>
> >>>>> acpi_backlight=nvidia_wmi_ec
> >>>>>
> >>>>> added to your kernel commandline. That should work around this
> >>>>> for now...
> >>>>>
> >>>>> Regards,
> >>>>>
> >>>>> Hans
> >>>
> >>
> > 
> 

  parent reply	other threads:[~2023-01-11  0:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 16:18 [REGRESSION] Backlight control broken on Dell G15 5515 since 6.1 Youssef Aly
2023-01-09 19:19 ` Hans de Goede
2023-01-09 20:23   ` Youssef Aly
     [not found]     ` <CAKsK3A=3QbFfO4mmetD+CUJdJDawmfzazi_w9+fi-mX9tLaHGA@mail.gmail.com>
2023-01-10  8:39       ` Hans de Goede
     [not found]         ` <CAKsK3An_b_FAZxJzTk9GZZ41-9+_Ym2icWVaN41WV6qEySWx4A@mail.gmail.com>
2023-01-10 15:27           ` Hans de Goede
2023-01-10 17:03             ` Youssef Aly
2023-01-11  0:42               ` Daniel Dadap
2023-01-11  0:40             ` Daniel Dadap [this message]
2023-01-11  9:51               ` Hans de Goede
2023-01-11 10:42                 ` Youssef Aly
2023-01-11 12:45                   ` Hans de Goede
2023-01-11 22:35                     ` Daniel Dadap
2023-01-12 12:27                       ` Hans de Goede
2023-01-16 16:46                 ` Hans de Goede
2023-01-17 20:56                   ` Daniel Dadap
2023-01-17 21:24                     ` Daniel Dadap
2023-01-17 23:13                       ` Youssef Aly
2023-01-18  0:20                         ` Daniel Dadap
2023-01-18  9:33                           ` Iris
2023-01-18 20:41                             ` Daniel Dadap
2023-01-18 21:20                               ` Iris
2023-01-18 22:02                                 ` Youssef Aly
2023-01-18 22:11                                   ` Daniel Dadap
2023-02-17 12:36                                     ` Linux regression tracking (Thorsten Leemhuis)
     [not found]                                       ` <CAKsK3AndZCBGaiJbQMMo9i9Gg5BHuLpvVY2tTAJWrbJ-RETZAQ@mail.gmail.com>
2023-02-17 18:56                                         ` Daniel Dadap
2023-02-17 20:47                                           ` Youssef Ahmed
2023-03-13 14:58                                             ` Linux regression tracking (Thorsten Leemhuis)
2023-03-13 15:20                                               ` Youssef Aly
2023-04-12  4:39                                                 ` Bagas Sanjaya
2023-04-12  8:01                                                   ` Bagas Sanjaya
2023-04-13  4:19                                                     ` Bagas Sanjaya
2023-01-18 22:03                                 ` Daniel Dadap

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=Y74FfQmjN8WJcCIG@lenny \
    --to=ddadap@nvidia.com \
    --cc=hdegoede@redhat.com \
    --cc=regressions@lists.linux.dev \
    --cc=youssefaswad@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).