<div dir="ltr">Hi, I would like to inform that I use UEFI boot. I don't have a spare machine/disk to test legacy unfortunately.<div><br></div><div>regards</div><div>Anton.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-06-27 7:20 GMT+04:00 Aaron Lu <span dir="ltr"><<a href="mailto:aaron.lu@intel.com" target="_blank">aaron.lu@intel.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 06/25/2014 07:08 PM, Jani Nikula wrote:<br>
> On Tue, 24 Jun 2014, Aaron Lu <<a href="mailto:aaron.lu@intel.com">aaron.lu@intel.com</a>> wrote:<br>
>> Some Thinkpad laptops' firmware will initiate a backlight level change<br>
>> request through operation region on the events of AC plug/unplug, but<br>
>> since we are not using firmware's interface to do the backlight setting<br>
>> on these affected laptops, we do not want the firmware to use some<br>
>> arbitrary value from its ASL variable to set the backlight level on<br>
>> AC plug/unplug either.<br>
><br>
> I'm curious whether this happens with EFI boot, or only with legacy.<br>
<br>
</div>Igor, Anton,<br>
<br>
Are you using legacy boot or UEFI boot?<br>
Possible to test the other case?<br>
<br>
><br>
> One comment inline, otherwise<br>
<br>
Will add that in next revision.<br>
<br>
><br>
> Acked-by: Jani Nikula <<a href="mailto:jani.nikula@intel.com">jani.nikula@intel.com</a>><br>
<br>
Thanks for the review!<br>
<span class="HOEnZb"><font color="#888888"><br>
-Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> for merging through the ACPI tree, as the change is more likely to<br>
> conflict there.<br>
><br>
>> Buglink: <a href="https://bugzilla.kernel.org/show_bug.cgi?id=76491" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=76491</a><br>
>> Buglink: <a href="https://bugzilla.kernel.org/show_bug.cgi?id=77091" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=77091</a><br>
>> Reported-and-tested-by: Igor Gnatenko <<a href="mailto:i.gnatenko.brain@gmail.com">i.gnatenko.brain@gmail.com</a>><br>
>> Reported-and-tested-by: Anton Gubarkov <<a href="mailto:anton.gubarkov@gmail.com">anton.gubarkov@gmail.com</a>><br>
>> Signed-off-by: Aaron Lu <<a href="mailto:aaron.lu@intel.com">aaron.lu@intel.com</a>><br>
>> ---<br>
>> drivers/acpi/video.c | 3 ++-<br>
>> drivers/gpu/drm/i915/intel_opregion.c | 7 +++++++<br>
>> include/acpi/video.h | 2 ++<br>
>> 3 files changed, 11 insertions(+), 1 deletion(-)<br>
>><br>
>> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c<br>
>> index fb9ffe9adc64..cf99d6d2d491 100644<br>
>> --- a/drivers/acpi/video.c<br>
>> +++ b/drivers/acpi/video.c<br>
>> @@ -241,13 +241,14 @@ static bool acpi_video_use_native_backlight(void)<br>
>> return use_native_backlight_dmi;<br>
>> }<br>
>><br>
>> -static bool acpi_video_verify_backlight_support(void)<br>
>> +bool acpi_video_verify_backlight_support(void)<br>
>> {<br>
>> if (acpi_osi_is_win8() && acpi_video_use_native_backlight() &&<br>
>> backlight_device_registered(BACKLIGHT_RAW))<br>
>> return false;<br>
>> return acpi_video_backlight_support();<br>
>> }<br>
>> +EXPORT_SYMBOL(acpi_video_verify_backlight_support);<br>
>><br>
>> /* backlight device sysfs support */<br>
>> static int acpi_video_get_brightness(struct backlight_device *bd)<br>
>> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c<br>
>> index 2e2c71fcc9ed..02943d93e88e 100644<br>
>> --- a/drivers/gpu/drm/i915/intel_opregion.c<br>
>> +++ b/drivers/gpu/drm/i915/intel_opregion.c<br>
>> @@ -403,6 +403,13 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)<br>
>><br>
>> DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp);<br>
>><br>
>> + /*<br>
>> + * If the acpi_video interface is not supposed to be used, don't<br>
>> + * bother processing backlight level change requests from firmware.<br>
>> + */<br>
>> + if (!acpi_video_verify_backlight_support())<br>
>> + return 0;<br>
><br>
> I'd appreciate a DRM_DEBUG_KMS here about what happened. We're bound to<br>
> wonder about that staring at some dmesg later on!<br>
><br>
>> +<br>
>> if (!(bclp & ASLE_BCLP_VALID))<br>
>> return ASLC_BACKLIGHT_FAILED;<br>
>><br>
>> diff --git a/include/acpi/video.h b/include/acpi/video.h<br>
>> index ea4c7bbded4d..92f8c4bffefb 100644<br>
>> --- a/include/acpi/video.h<br>
>> +++ b/include/acpi/video.h<br>
>> @@ -22,6 +22,7 @@ extern void acpi_video_unregister(void);<br>
>> extern void acpi_video_unregister_backlight(void);<br>
>> extern int acpi_video_get_edid(struct acpi_device *device, int type,<br>
>> int device_id, void **edid);<br>
>> +extern bool acpi_video_verify_backlight_support(void);<br>
>> #else<br>
>> static inline int acpi_video_register(void) { return 0; }<br>
>> static inline void acpi_video_unregister(void) { return; }<br>
>> @@ -31,6 +32,7 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type,<br>
>> {<br>
>> return -ENODEV;<br>
>> }<br>
>> +static bool acpi_video_verify_backlight_support() { return false; }<br>
>> #endif<br>
>><br>
>> #endif<br>
>> --<br>
>> 1.9.3<br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>