mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: ACPI Video Driver creates backlight on desktop board
       [not found] <75866748-f574-ae50-6183-ef6892c935c5@molgen.mpg.de>
@ 2020-03-30 20:51 ` Hans de Goede
  2020-03-30 21:25   ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2020-03-30 20:51 UTC (permalink / raw)
  To: Paul Menzel, Zhang Rui; +Cc: linux-acpi, linux-kernel

Hi,

On 3/29/20 11:36 AM, Paul Menzel wrote:
> Dear Linux folks,
> 
> 
> On the MSI desktop board [1]
> 
>      [    0.000000] DMI: Micro-Star International Co., Ltd. MS-7A37/B350M MORTAR (MS-7A37), BIOS 1.MR 12/02/2019
> 
> with an AMD Ryzen 3 2200G with Radeon Vega Graphics, the ACPI Video Driver `video` is loaded and creates a backlight device.
> 
>      $ readlink -f /sys/class/backlight/acpi_video0
>      /sys/devices/pci0000:00/0000:00:08.1/0000:26:00.0/backlight/acpi_video0
> 
> I wonder what the driver is used for as the AMDGPU driver exists for the graphics device.

Backlight on x86 hw is a bit of a mess, there is an ACPI standard for accessing it
and with older (Windows XP era) laptops that is the interface which usually works,
then there are a bunch of vendor specific SMBIOS or WMI backlight interfaces and
then there is the option of directly accessing the hardware as the amdgpu driver
is doing.

We have a bunch of heuristics to avoid the acpi_video driver registering a
backlight interface when it should not, either because the direct hw access
should be used instead; or because there simply is no builtin LCD panel and thus
no backlight to control.

These heuristics are failing on your board.

> If it’s useful, is there a way to prevent the backlight interface from getting created?

You can pass "acpi_backlight=ignore" on the kernel commandline to disable the
interface, this will stop e.g. gnome from showing a non working brightness
slider in its top right system menu.

If this works you can make this permanent and avoid other users from having to
do the same thing by writing a patch adding a quirk for this like this one:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d21a91629f4b8e794fc4c0e0c17c85cedf1d806c

Regards,

Hans


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI Video Driver creates backlight on desktop board
  2020-03-30 20:51 ` ACPI Video Driver creates backlight on desktop board Hans de Goede
@ 2020-03-30 21:25   ` Randy Dunlap
  2020-03-30 21:32     ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2020-03-30 21:25 UTC (permalink / raw)
  To: Hans de Goede, Paul Menzel, Zhang Rui; +Cc: linux-acpi, linux-kernel

On 3/30/20 1:51 PM, Hans de Goede wrote:
> Hi,
> 
> On 3/29/20 11:36 AM, Paul Menzel wrote:
>> Dear Linux folks,
>>
>>
>> On the MSI desktop board [1]
>>
>>      [    0.000000] DMI: Micro-Star International Co., Ltd. MS-7A37/B350M MORTAR (MS-7A37), BIOS 1.MR 12/02/2019
>>
>> with an AMD Ryzen 3 2200G with Radeon Vega Graphics, the ACPI Video Driver `video` is loaded and creates a backlight device.
>>
>>      $ readlink -f /sys/class/backlight/acpi_video0
>>      /sys/devices/pci0000:00/0000:00:08.1/0000:26:00.0/backlight/acpi_video0
>>
>> I wonder what the driver is used for as the AMDGPU driver exists for the graphics device.
> 
> Backlight on x86 hw is a bit of a mess, there is an ACPI standard for accessing it
> and with older (Windows XP era) laptops that is the interface which usually works,
> then there are a bunch of vendor specific SMBIOS or WMI backlight interfaces and
> then there is the option of directly accessing the hardware as the amdgpu driver
> is doing.
> 
> We have a bunch of heuristics to avoid the acpi_video driver registering a
> backlight interface when it should not, either because the direct hw access
> should be used instead; or because there simply is no builtin LCD panel and thus
> no backlight to control.
> 
> These heuristics are failing on your board.
> 
>> If it’s useful, is there a way to prevent the backlight interface from getting created?
> 
> You can pass "acpi_backlight=ignore" on the kernel commandline to disable the

Hi Hans,
Should that be "acpi_backlight=none"?  I don't see 'ignore' allowed here:

static void acpi_video_parse_cmdline(void)
{
	if (!strcmp("vendor", acpi_video_backlight_string))
		acpi_backlight_cmdline = acpi_backlight_vendor;
	if (!strcmp("video", acpi_video_backlight_string))
		acpi_backlight_cmdline = acpi_backlight_video;
	if (!strcmp("native", acpi_video_backlight_string))
		acpi_backlight_cmdline = acpi_backlight_native;
	if (!strcmp("none", acpi_video_backlight_string))
		acpi_backlight_cmdline = acpi_backlight_none;
}

and Documentation/admin-guide/kernel-parameters.txt could stand to be updated
with a few of those options.


> interface, this will stop e.g. gnome from showing a non working brightness
> slider in its top right system menu.
> 
> If this works you can make this permanent and avoid other users from having to
> do the same thing by writing a patch adding a quirk for this like this one:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d21a91629f4b8e794fc4c0e0c17c85cedf1d806c


-- 
~Randy


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI Video Driver creates backlight on desktop board
  2020-03-30 21:25   ` Randy Dunlap
@ 2020-03-30 21:32     ` Hans de Goede
  2020-03-31  0:13       ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2020-03-30 21:32 UTC (permalink / raw)
  To: Randy Dunlap, Paul Menzel, Zhang Rui; +Cc: linux-acpi, linux-kernel

Hi,

On 3/30/20 11:25 PM, Randy Dunlap wrote:
> On 3/30/20 1:51 PM, Hans de Goede wrote:
>> Hi,
>>
>> On 3/29/20 11:36 AM, Paul Menzel wrote:
>>> Dear Linux folks,
>>>
>>>
>>> On the MSI desktop board [1]
>>>
>>>       [    0.000000] DMI: Micro-Star International Co., Ltd. MS-7A37/B350M MORTAR (MS-7A37), BIOS 1.MR 12/02/2019
>>>
>>> with an AMD Ryzen 3 2200G with Radeon Vega Graphics, the ACPI Video Driver `video` is loaded and creates a backlight device.
>>>
>>>       $ readlink -f /sys/class/backlight/acpi_video0
>>>       /sys/devices/pci0000:00/0000:00:08.1/0000:26:00.0/backlight/acpi_video0
>>>
>>> I wonder what the driver is used for as the AMDGPU driver exists for the graphics device.
>>
>> Backlight on x86 hw is a bit of a mess, there is an ACPI standard for accessing it
>> and with older (Windows XP era) laptops that is the interface which usually works,
>> then there are a bunch of vendor specific SMBIOS or WMI backlight interfaces and
>> then there is the option of directly accessing the hardware as the amdgpu driver
>> is doing.
>>
>> We have a bunch of heuristics to avoid the acpi_video driver registering a
>> backlight interface when it should not, either because the direct hw access
>> should be used instead; or because there simply is no builtin LCD panel and thus
>> no backlight to control.
>>
>> These heuristics are failing on your board.
>>
>>> If it’s useful, is there a way to prevent the backlight interface from getting created?
>>
>> You can pass "acpi_backlight=ignore" on the kernel commandline to disable the
> 
> Hi Hans,
> Should that be "acpi_backlight=none"?  I don't see 'ignore' allowed here:
> 
> static void acpi_video_parse_cmdline(void)
> {
> 	if (!strcmp("vendor", acpi_video_backlight_string))
> 		acpi_backlight_cmdline = acpi_backlight_vendor;
> 	if (!strcmp("video", acpi_video_backlight_string))
> 		acpi_backlight_cmdline = acpi_backlight_video;
> 	if (!strcmp("native", acpi_video_backlight_string))
> 		acpi_backlight_cmdline = acpi_backlight_native;
> 	if (!strcmp("none", acpi_video_backlight_string))
> 		acpi_backlight_cmdline = acpi_backlight_none;
> }

Yes you are right that should be "acpi_backlight=none".

> and Documentation/admin-guide/kernel-parameters.txt could stand to be updated
> with a few of those options.

Ack, I've put this on my (much too long) TODO list. Feel free to
beat me to it.

Regards,

Hans




> 
> 
>> interface, this will stop e.g. gnome from showing a non working brightness
>> slider in its top right system menu.
>>
>> If this works you can make this permanent and avoid other users from having to
>> do the same thing by writing a patch adding a quirk for this like this one:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d21a91629f4b8e794fc4c0e0c17c85cedf1d806c
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ACPI Video Driver creates backlight on desktop board
  2020-03-30 21:32     ` Hans de Goede
@ 2020-03-31  0:13       ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2020-03-31  0:13 UTC (permalink / raw)
  To: Hans de Goede, Paul Menzel, Zhang Rui; +Cc: linux-acpi, linux-kernel

On 3/30/20 2:32 PM, Hans de Goede wrote:
> Hi,
> 
> On 3/30/20 11:25 PM, Randy Dunlap wrote:
>> On 3/30/20 1:51 PM, Hans de Goede wrote:
>>> Hi,
>>>
>>> On 3/29/20 11:36 AM, Paul Menzel wrote:
>>>> Dear Linux folks,
>>>>
>>>>
>>>> On the MSI desktop board [1]
>>>>
>>>>       [    0.000000] DMI: Micro-Star International Co., Ltd. MS-7A37/B350M MORTAR (MS-7A37), BIOS 1.MR 12/02/2019
>>>>
>>>> with an AMD Ryzen 3 2200G with Radeon Vega Graphics, the ACPI Video Driver `video` is loaded and creates a backlight device.
>>>>
>>>>       $ readlink -f /sys/class/backlight/acpi_video0
>>>>       /sys/devices/pci0000:00/0000:00:08.1/0000:26:00.0/backlight/acpi_video0
>>>>
>>>> I wonder what the driver is used for as the AMDGPU driver exists for the graphics device.
>>>
>>> Backlight on x86 hw is a bit of a mess, there is an ACPI standard for accessing it
>>> and with older (Windows XP era) laptops that is the interface which usually works,
>>> then there are a bunch of vendor specific SMBIOS or WMI backlight interfaces and
>>> then there is the option of directly accessing the hardware as the amdgpu driver
>>> is doing.
>>>
>>> We have a bunch of heuristics to avoid the acpi_video driver registering a
>>> backlight interface when it should not, either because the direct hw access
>>> should be used instead; or because there simply is no builtin LCD panel and thus
>>> no backlight to control.
>>>
>>> These heuristics are failing on your board.
>>>
>>>> If it’s useful, is there a way to prevent the backlight interface from getting created?
>>>
>>> You can pass "acpi_backlight=ignore" on the kernel commandline to disable the
>>
>> Hi Hans,
>> Should that be "acpi_backlight=none"?  I don't see 'ignore' allowed here:
>>
>> static void acpi_video_parse_cmdline(void)
>> {
>>     if (!strcmp("vendor", acpi_video_backlight_string))
>>         acpi_backlight_cmdline = acpi_backlight_vendor;
>>     if (!strcmp("video", acpi_video_backlight_string))
>>         acpi_backlight_cmdline = acpi_backlight_video;
>>     if (!strcmp("native", acpi_video_backlight_string))
>>         acpi_backlight_cmdline = acpi_backlight_native;
>>     if (!strcmp("none", acpi_video_backlight_string))
>>         acpi_backlight_cmdline = acpi_backlight_none;
>> }
> 
> Yes you are right that should be "acpi_backlight=none".
> 
>> and Documentation/admin-guide/kernel-parameters.txt could stand to be updated
>> with a few of those options.
> 
> Ack, I've put this on my (much too long) TODO list. Feel free to
> beat me to it.

Sure, I'll send a patch shortly.

-- 
~Randy


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-31  0:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <75866748-f574-ae50-6183-ef6892c935c5@molgen.mpg.de>
2020-03-30 20:51 ` ACPI Video Driver creates backlight on desktop board Hans de Goede
2020-03-30 21:25   ` Randy Dunlap
2020-03-30 21:32     ` Hans de Goede
2020-03-31  0:13       ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®