stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported
@ 2015-11-16  3:32 Azael Avalos
  2015-11-20 23:16 ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Azael Avalos @ 2015-11-16  3:32 UTC (permalink / raw)
  To: Darren Hart, platform-driver-x86, linux-kernel
  Cc: stable, Fabian Koester, Azael Avalos

If transflective backlight is supported and the brightness is zero
(lowest brightness level), the set_lcd_brightness function will activate
the transflective backlight, making the LCD appear to be turned off.

This patch fixes the issue by incrementing the brightness level, and
by doing so, avoiding the activation of the tranflective backlight.

Cc: <stable@vger.kernel.org> # 4.3+
Reported-and-tested-by: Fabian Koester <fabian.koester@bringnow.com>
Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
---
 drivers/platform/x86/toshiba_acpi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 2ca3f91..b6a7dc9 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -2634,6 +2634,14 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
 	brightness = __get_lcd_brightness(dev);
 	if (brightness < 0)
 		return 0;
+	/*
+	 * If transflective backlight is supported and the brightness is zero
+	 * (lowest brightness level), the set_lcd_brightness function will
+	 * activate the transflective backlight, making the LCD appear to be
+	 * turned off, simply increment the brightness level to avoid that.
+	 */
+	if (dev->tr_backlight_supported && brightness == 0)
+		brightness++;
 	ret = set_lcd_brightness(dev, brightness);
 	if (ret) {
 		pr_debug("Backlight method is read-only, disabling backlight support\n");
-- 
2.6.2


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

* Re: [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported
  2015-11-16  3:32 [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported Azael Avalos
@ 2015-11-20 23:16 ` Darren Hart
  2015-11-20 23:46   ` Azael Avalos
  0 siblings, 1 reply; 4+ messages in thread
From: Darren Hart @ 2015-11-20 23:16 UTC (permalink / raw)
  To: Azael Avalos; +Cc: platform-driver-x86, linux-kernel, stable, Fabian Koester

On Sun, Nov 15, 2015 at 08:32:47PM -0700, Azael Avalos wrote:
> If transflective backlight is supported and the brightness is zero
> (lowest brightness level), the set_lcd_brightness function will activate
> the transflective backlight, making the LCD appear to be turned off.
> 
> This patch fixes the issue by incrementing the brightness level, and
> by doing so, avoiding the activation of the tranflective backlight.

So... I'm not sure this is a bug or even wrong behavior. The lowest setting on
my Thinkpad Yoga 12 is also "off" in Linux. Same is true for my Mac Book Pro (in
Mac OS X).

>From what I can tell, what this patch does is merely disable the lowest setting.

What is it about this behavior that is considered to be wrong?

> 
> Cc: <stable@vger.kernel.org> # 4.3+
> Reported-and-tested-by: Fabian Koester <fabian.koester@bringnow.com>
> Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
> ---
>  drivers/platform/x86/toshiba_acpi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index 2ca3f91..b6a7dc9 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -2634,6 +2634,14 @@ static int toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)
>  	brightness = __get_lcd_brightness(dev);
>  	if (brightness < 0)
>  		return 0;
> +	/*
> +	 * If transflective backlight is supported and the brightness is zero
> +	 * (lowest brightness level), the set_lcd_brightness function will
> +	 * activate the transflective backlight, making the LCD appear to be
> +	 * turned off, simply increment the brightness level to avoid that.
> +	 */
> +	if (dev->tr_backlight_supported && brightness == 0)
> +		brightness++;
>  	ret = set_lcd_brightness(dev, brightness);
>  	if (ret) {
>  		pr_debug("Backlight method is read-only, disabling backlight support\n");
> -- 
> 2.6.2
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center

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

* Re: [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported
  2015-11-20 23:16 ` Darren Hart
@ 2015-11-20 23:46   ` Azael Avalos
  2015-11-21  0:48     ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Azael Avalos @ 2015-11-20 23:46 UTC (permalink / raw)
  To: Darren Hart
  Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable, Fabian Koester

Hi Darren,

2015-11-20 16:16 GMT-07:00 Darren Hart <dvhart@infradead.org>:
> On Sun, Nov 15, 2015 at 08:32:47PM -0700, Azael Avalos wrote:
>> If transflective backlight is supported and the brightness is zero
>> (lowest brightness level), the set_lcd_brightness function will activate
>> the transflective backlight, making the LCD appear to be turned off.
>>
>> This patch fixes the issue by incrementing the brightness level, and
>> by doing so, avoiding the activation of the tranflective backlight.
>
> So... I'm not sure this is a bug or even wrong behavior. The lowest setting on
> my Thinkpad Yoga 12 is also "off" in Linux. Same is true for my Mac Book Pro (in
> Mac OS X).

Yeah, and even on "regular" (with non transflective backlight) Toshibas
zero is also "off" and no problem is observed.

>
> From what I can tell, what this patch does is merely disable the lowest setting.

Nope, we are just not letting the driver enable transflective backlight
and continue using the "normal" brightness range.

>
> What is it about this behavior that is considered to be wrong?
>

The problem is with laptops with transflective backlight support.

The code for transflective backlight is fused with the LCD backlight
code (go figure...), so if a Toshiba laptop with transflective support
is detected, the max brightness levels are raised by one.

A regular laptop's brightness levels are 0-7, but on a laptop with
transflective support, the brightness levels are 0-8, zero being
"activate transflective backlight" and 1-8 the regular brightness
levels.

So, when a laptop with transflective support AND an initial
brightness level of zero gets probed for backlight support,
the set_lcd_brightness function activates the transfective
backlight, as the brightness levels are still not incremented,
and thus, the screen goes dark.


I hope this clarifies a bit the situation here.


Cheers
Azael


-- 
-- El mundo apesta y vosotros apestais tambien --

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

* Re: [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported
  2015-11-20 23:46   ` Azael Avalos
@ 2015-11-21  0:48     ` Darren Hart
  0 siblings, 0 replies; 4+ messages in thread
From: Darren Hart @ 2015-11-21  0:48 UTC (permalink / raw)
  To: Azael Avalos
  Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable, Fabian Koester

On Fri, Nov 20, 2015 at 04:46:07PM -0700, Azael Avalos wrote:
> Hi Darren,
> 
> 2015-11-20 16:16 GMT-07:00 Darren Hart <dvhart@infradead.org>:
> > On Sun, Nov 15, 2015 at 08:32:47PM -0700, Azael Avalos wrote:
> >> If transflective backlight is supported and the brightness is zero
> >> (lowest brightness level), the set_lcd_brightness function will activate
> >> the transflective backlight, making the LCD appear to be turned off.
> >>
> >> This patch fixes the issue by incrementing the brightness level, and
> >> by doing so, avoiding the activation of the tranflective backlight.
> >
> > So... I'm not sure this is a bug or even wrong behavior. The lowest setting on
> > my Thinkpad Yoga 12 is also "off" in Linux. Same is true for my Mac Book Pro (in
> > Mac OS X).
> 
> Yeah, and even on "regular" (with non transflective backlight) Toshibas
> zero is also "off" and no problem is observed.
> 
> >
> > From what I can tell, what this patch does is merely disable the lowest setting.
> 
> Nope, we are just not letting the driver enable transflective backlight
> and continue using the "normal" brightness range.
> 
> >
> > What is it about this behavior that is considered to be wrong?
> >
> 
> The problem is with laptops with transflective backlight support.
> 
> The code for transflective backlight is fused with the LCD backlight
> code (go figure...), so if a Toshiba laptop with transflective support
> is detected, the max brightness levels are raised by one.
> 
> A regular laptop's brightness levels are 0-7, but on a laptop with
> transflective support, the brightness levels are 0-8, zero being
> "activate transflective backlight" and 1-8 the regular brightness
> levels.
> 
> So, when a laptop with transflective support AND an initial
> brightness level of zero gets probed for backlight support,
> the set_lcd_brightness function activates the transfective
> backlight, as the brightness levels are still not incremented,
> and thus, the screen goes dark.
> 
> 
> I hope this clarifies a bit the situation here.


Thanks, queued to testing.

-- 
Darren Hart
Intel Open Source Technology Center

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

end of thread, other threads:[~2015-11-21  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16  3:32 [PATCH] toshiba_acpi: Fix blank screen at boot if transflective backlight is supported Azael Avalos
2015-11-20 23:16 ` Darren Hart
2015-11-20 23:46   ` Azael Avalos
2015-11-21  0:48     ` Darren Hart

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).