public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight
@ 2010-12-06  7:04 Zhang Rui
  2010-12-06 16:03 ` Randy Dunlap
  2010-12-14  5:10 ` Len Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Rui @ 2010-12-06  7:04 UTC (permalink / raw)
  To: Brown, Len; +Cc: linux-acpi@vger.kernel.org, Matthew Garrett, Zhang, Rui


Introduce module parameter video.use_bios_initial_backlight.

Some BIOSes claim they use the minimum backlight at boot,
and this may bring dimming screen after boot.
https://bugzilla.kernel.org/show_bug.cgi?id=21212

use video.use_bios_initl_backlight=0 to use
the maximum backlight level after boot.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/video.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================
--- linux-2.6.orig/drivers/acpi/video.c
+++ linux-2.6/drivers/acpi/video.c
@@ -80,6 +80,13 @@ module_param(brightness_switch_enabled, 
 static int allow_duplicates;
 module_param(allow_duplicates, bool, 0644);
 
+/*
+ * Some BIOSes claim they use minimum backlight at boot,
+ * and this may bring dimming screen after boot
+ */
+static int use_bios_initial_backlight = 1;
+module_param(use_bios_initial_backlight, bool, 0644);
+
 static int register_count = 0;
 static int acpi_video_bus_add(struct acpi_device *device);
 static int acpi_video_bus_remove(struct acpi_device *device, int type);
@@ -705,9 +712,11 @@ acpi_video_init_brightness(struct acpi_v
 		 * when invoked for the first time, i.e. level_old is invalid.
 		 * set the backlight to max_level in this case
 		 */
-		for (i = 2; i < br->count; i++)
-			if (level_old == br->levels[i])
-				level = level_old;
+		if (use_bios_initial_backlight) {
+			for (i = 2; i < br->count; i++)
+				if (level_old == br->levels[i])
+					level = level_old;
+		}
 		goto set_level;
 	}
 



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

* Re: [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight
  2010-12-06  7:04 [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight Zhang Rui
@ 2010-12-06 16:03 ` Randy Dunlap
  2010-12-14  5:10 ` Len Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2010-12-06 16:03 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Brown, Len, linux-acpi@vger.kernel.org, Matthew Garrett

On Mon, 06 Dec 2010 15:04:27 +0800 Zhang Rui wrote:

> 
> Introduce module parameter video.use_bios_initial_backlight.
> 
> Some BIOSes claim they use the minimum backlight at boot,
> and this may bring dimming screen after boot.
> https://bugzilla.kernel.org/show_bug.cgi?id=21212
> 
> use video.use_bios_initl_backlight=0 to use
> the maximum backlight level after boot.

Hi,
Where is this documented?


> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/video.c |   15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/video.c
> +++ linux-2.6/drivers/acpi/video.c
> @@ -80,6 +80,13 @@ module_param(brightness_switch_enabled, 
>  static int allow_duplicates;
>  module_param(allow_duplicates, bool, 0644);
>  
> +/*
> + * Some BIOSes claim they use minimum backlight at boot,
> + * and this may bring dimming screen after boot
> + */
> +static int use_bios_initial_backlight = 1;
> +module_param(use_bios_initial_backlight, bool, 0644);
> +
>  static int register_count = 0;
>  static int acpi_video_bus_add(struct acpi_device *device);
>  static int acpi_video_bus_remove(struct acpi_device *device, int type);
> @@ -705,9 +712,11 @@ acpi_video_init_brightness(struct acpi_v
>  		 * when invoked for the first time, i.e. level_old is invalid.
>  		 * set the backlight to max_level in this case
>  		 */
> -		for (i = 2; i < br->count; i++)
> -			if (level_old == br->levels[i])
> -				level = level_old;
> +		if (use_bios_initial_backlight) {
> +			for (i = 2; i < br->count; i++)
> +				if (level_old == br->levels[i])
> +					level = level_old;
> +		}
>  		goto set_level;
>  	}
>  
> 
> 
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight
  2010-12-06  7:04 [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight Zhang Rui
  2010-12-06 16:03 ` Randy Dunlap
@ 2010-12-14  5:10 ` Len Brown
  2010-12-14  5:21   ` Zhang Rui
  1 sibling, 1 reply; 4+ messages in thread
From: Len Brown @ 2010-12-14  5:10 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-acpi@vger.kernel.org, Matthew Garrett

On Mon, 6 Dec 2010, Zhang Rui wrote:

> 
> Introduce module parameter video.use_bios_initial_backlight.

there must be a more concise way to say that...

> Some BIOSes claim they use the minimum backlight at boot,
> and this may bring dimming screen after boot.
> https://bugzilla.kernel.org/show_bug.cgi?id=21212
> 
> use video.use_bios_initl_backlight=0 to use
> the maximum backlight level after boot.

this looks like a BIOS workaround.
should there be a way to invoke this workaround automatically?

thanks,
-Len

> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
>  drivers/acpi/video.c |   15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6/drivers/acpi/video.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/video.c
> +++ linux-2.6/drivers/acpi/video.c
> @@ -80,6 +80,13 @@ module_param(brightness_switch_enabled, 
>  static int allow_duplicates;
>  module_param(allow_duplicates, bool, 0644);
>  
> +/*
> + * Some BIOSes claim they use minimum backlight at boot,
> + * and this may bring dimming screen after boot
> + */
> +static int use_bios_initial_backlight = 1;
> +module_param(use_bios_initial_backlight, bool, 0644);
> +
>  static int register_count = 0;
>  static int acpi_video_bus_add(struct acpi_device *device);
>  static int acpi_video_bus_remove(struct acpi_device *device, int type);
> @@ -705,9 +712,11 @@ acpi_video_init_brightness(struct acpi_v
>  		 * when invoked for the first time, i.e. level_old is invalid.
>  		 * set the backlight to max_level in this case
>  		 */
> -		for (i = 2; i < br->count; i++)
> -			if (level_old == br->levels[i])
> -				level = level_old;
> +		if (use_bios_initial_backlight) {
> +			for (i = 2; i < br->count; i++)
> +				if (level_old == br->levels[i])
> +					level = level_old;
> +		}
>  		goto set_level;
>  	}
>  
> 
> 

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

* Re: [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight
  2010-12-14  5:10 ` Len Brown
@ 2010-12-14  5:21   ` Zhang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2010-12-14  5:21 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi@vger.kernel.org, Matthew Garrett

On Tue, 2010-12-14 at 13:10 +0800, Len Brown wrote:
> On Mon, 6 Dec 2010, Zhang Rui wrote:
> 
> > 
> > Introduce module parameter video.use_bios_initial_backlight.
> 
> there must be a more concise way to say that...
> 
> > Some BIOSes claim they use the minimum backlight at boot,
> > and this may bring dimming screen after boot.
> > https://bugzilla.kernel.org/show_bug.cgi?id=21212
> > 
> > use video.use_bios_initl_backlight=0 to use
> > the maximum backlight level after boot.
> 
> this looks like a BIOS workaround.

yes.

> should there be a way to invoke this workaround automatically?
> 
no.
because it's hard for software to detect if the screen is dark.
maybe we need another dmi list for this issue.

thanks,
rui

> thanks,
> -Len
> 
> > 
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> >  drivers/acpi/video.c |   15 ++++++++++++---
> >  1 file changed, 12 insertions(+), 3 deletions(-)
> > 
> > Index: linux-2.6/drivers/acpi/video.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/acpi/video.c
> > +++ linux-2.6/drivers/acpi/video.c
> > @@ -80,6 +80,13 @@ module_param(brightness_switch_enabled, 
> >  static int allow_duplicates;
> >  module_param(allow_duplicates, bool, 0644);
> >  
> > +/*
> > + * Some BIOSes claim they use minimum backlight at boot,
> > + * and this may bring dimming screen after boot
> > + */
> > +static int use_bios_initial_backlight = 1;
> > +module_param(use_bios_initial_backlight, bool, 0644);
> > +
> >  static int register_count = 0;
> >  static int acpi_video_bus_add(struct acpi_device *device);
> >  static int acpi_video_bus_remove(struct acpi_device *device, int type);
> > @@ -705,9 +712,11 @@ acpi_video_init_brightness(struct acpi_v
> >  		 * when invoked for the first time, i.e. level_old is invalid.
> >  		 * set the backlight to max_level in this case
> >  		 */
> > -		for (i = 2; i < br->count; i++)
> > -			if (level_old == br->levels[i])
> > -				level = level_old;
> > +		if (use_bios_initial_backlight) {
> > +			for (i = 2; i < br->count; i++)
> > +				if (level_old == br->levels[i])
> > +					level = level_old;
> > +		}
> >  		goto set_level;
> >  	}
> >  
> > 
> > 



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

end of thread, other threads:[~2010-12-14  5:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06  7:04 [PATCH 6/7] ACPI video: introduce module parameter video.use_bios_initial_backlight Zhang Rui
2010-12-06 16:03 ` Randy Dunlap
2010-12-14  5:10 ` Len Brown
2010-12-14  5:21   ` Zhang Rui

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