[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3a285c6-2c0b-99e8-5d98-b5eb8d44d54a@redhat.com>
Date: Tue, 7 Mar 2023 13:34:24 +0100
From: Hans de Goede <hdegoede@...hat.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Mark Gross <markgross@...nel.org>, Lee Jones <lee@...nel.org>,
Daniel Thompson <daniel.thompson@...aro.org>,
Jingoo Han <jingoohan1@...il.com>,
Aditya Garg <gargaditya08@...e.com>,
platform-driver-x86@...r.kernel.org,
Matthew Garrett <mjg59@...f.ucam.org>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] backlight: apple_bl: Use acpi_video_get_backlight_type()
Hi,
On 3/7/23 13:27, Andy Shevchenko wrote:
> On Tue, Mar 07, 2023 at 01:05:40PM +0100, Hans de Goede wrote:
>> On some MacBooks both the apple_bl and the apple-gmux backlight drivers
>> may be able to export a /sys/class/backlight device.
>>
>> To avoid having 2 backlight devices for one LCD panel until now
>> the apple-gmux driver has been calling apple_bl_unregister() to move
>> the apple_bl backlight device out of the way when it loads.
>>
>> Similar problems exist on other x86 laptops and all backlight drivers
>> which may be used on x86 laptops have moved to using
>> acpi_video_get_backlight_type() to determine whether they should load
>> or not.
>>
>> Switch apple_bl to this model too, so that it is consistent with all
>> the other x86 backlight drivers.
>>
>> Besides code-simplification and consistency this has 2 other benefits:
>>
>> 1) It removes a race during boot where userspace will briefly see
>> an apple_bl backlight and then have it disappear again, leading to e.g.:
>> https://bbs.archlinux.org/viewtopic.php?id=269920
>>
>> 2) This allows user to switch between the drivers by passing
>> acpi_backlight=apple_gmux or acpi_backlight=vendor on the kernel
>> commandline.
>
> ...
>
>> + depends on ACPI_VIDEO=n || ACPI_VIDEO
>
> I'm wondering if "imply ACPI_VIDEO" (i.o.w. weak dependency) is what suitable
> here.
No, because then if apple_bl is builtin and acpi_video is a module
we will get unresolved dependencies.
The quoted bit of Kconfig magic is exactly to avoid that scenario,
other combinations are fine (due to stubs in acpi/video.h when
disabled).
Regards,
Hans
Powered by blists - more mailing lists