Skip to contentSkip to conversation

ACPI video: introduce module parameter video.use_bios_initial_backlight

PATCH Applied Zhang Rui 3 participants 4 messages Dec 6, 2010 – Dec 14, 2010 ACPI

lore
Share & tools
lore

Zhang Rui

author
#0 lore raw

PATCH 6/7 ACPI video: introduce module parameter video.use_bios_initial_backlight

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.

---
 drivers/acpi/video.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/acpi/video.c +12 -3
Index: 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;
 	}
 
#1 lore raw
Quoted 9 lines · 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?

Quoted 31 lines
---
 drivers/acpi/video.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +8 -3
@@ -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) {

drivers/acpi/video.c acpi_video_init_brightness(struct acpi_v

Quoted 10 lines
drivers/acpi/video.c +4 -1
+			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 ***

reviewer
#2 lore raw
In reply to Zhang Rui
Quoted 2 lines · Zhang Rui

Introduce module parameter video.use_bios_initial_backlight.

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

Quoted 6 lines

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

Quoted 41 lines
---
 drivers/acpi/video.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +12 -3
@@ -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;
 	}
 
author
#3 lore raw
Quoted 7 lines · Len Brown
Quoted 2 lines · Zhang Rui

Introduce module parameter video.use_bios_initial_backlight.

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

Quoted 8 lines
Quoted 6 lines

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.

Quoted 2 lines

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

Quoted 44 lines

thanks,
-Len

Quoted 41 lines
---
 drivers/acpi/video.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/video.c
===================================================================

drivers/acpi/video.c +12 -3
@@ -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;
 	}