docs: backlight: Clarify `actual_brightness`
PATCH 1/1 docs: backlight: Clarify `actual_brightness`
From: Mario Limonciello <[email protected]>
Currently userspace software systemd treats brightness and actual_brightness identically due to a bug found in an out of tree driver.
This however causes problems for in-tree drivers that use brightness to report user requested brightness and actual_brightness to report what the hardware actually has programmed.
Clarify the documentation to match the behavior described in commit 6ca017658b1f9 ("[PATCH] backlight: Backlight Class Improvements").
--- Documentation/ABI/stable/sysfs-class-backlight | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/ABI/stable/sysfs-class-backlight +3 -1
@@ -26,7 +26,9 @@ Date: March 2006 KernelVersion: 2.6.17 Contact: Richard Purdie <[email protected]> Description: - Show the actual brightness by querying the hardware. + Show the actual brightness by querying the hardware. This + takes into account other factors besides the value programmed + for 'brightness' and may not match the value in 'brightness'. Users: HAL What: /sys/class/backlight/<backlight>/max_brightness
Signature · 1 line
2.43.0
Lee Jones
maintainerQuoted 26 lines · Mario Limonciello
From: Mario Limonciello <[email protected]>
Currently userspace software systemd treats
brightnessandactual_brightnessidentically due to a bug found in an out of tree driver.This however causes problems for in-tree drivers that use brightness to report user requested
brightnessandactual_brightnessto report what the hardware actually has programmed.Clarify the documentation to match the behavior described in commit
6ca017658b1f9("[PATCH] backlight: Backlight Class Improvements").Cc Lennart Poettering <[email protected]>Signed-off-by Mario Limonciello <[email protected]>--- Documentation/ABI/stable/sysfs-class-backlight | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Documentation/ABI/stable/sysfs-class-backlight +0
-0
Documentation/ABI/stable/sysfs-class-backlight Date: March 2006 · line 31
Quoted 7 lines
Documentation/ABI/stable/sysfs-class-backlight +3
-1@@ -26,7 +26,9 @@ Date: March 2006 KernelVersion: 2.6.17 Contact: Richard Purdie <[email protected]> Description: - Show the actual brightness by querying the hardware. + Show the actual brightness by querying the hardware. This + takes into account other factors besides the value programmed + for 'brightness' and may not match the value in 'brightness'.
Which factors? Under what circumstances may the values not match?
Quoted 6 lines
Documentation/ABI/stable/sysfs-class-backlight +0
-0Users: HAL What: /sys/class/backlight/<backlight>/max_brightnessSignature · 1 line
2.43.0
Signature · 1 line
Lee Jones [李琼斯]
Quoted 23 lines · Lee Jones
Quoted 21 lines · Mario Limonciello
From: Mario Limonciello <[email protected]>
Currently userspace software systemd treats
brightnessandactual_brightnessidentically due to a bug found in an out of tree driver.This however causes problems for in-tree drivers that use brightness to report user requested
brightnessandactual_brightnessto report what the hardware actually has programmed.Clarify the documentation to match the behavior described in commit
6ca017658b1f9("[PATCH] backlight: Backlight Class Improvements").Cc Lennart Poettering <[email protected]>Signed-off-by Mario Limonciello <[email protected]>--- Documentation/ABI/stable/sysfs-class-backlight | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 14 lines
Documentation/ABI/stable/sysfs-class-backlight Date: March 2006 · line 31
Quoted 12 lines
Documentation/ABI/stable/sysfs-class-backlight +3
-1@@ -26,7 +26,9 @@ Date: March 2006 KernelVersion: 2.6.17 Contact: Richard Purdie <[email protected]> Description: - Show the actual brightness by querying the hardware. + Show the actual brightness by querying the hardware. This + takes into account other factors besides the value programmed + for 'brightness' and may not match the value in 'brightness'.Which factors? Under what circumstances may the values not match?
Is this question for your background or are you saying these should be enumerated here in the documentation?
Richard Purdie mentioned:
"The challenge back then was that things like framebuffer blanking would turn off the backlight but the single brightness attribute was implemented inconsistently. Some drivers would report no backlight when blanking was active, some would report the value stored in brightness. This had multiple issues"
For AMD the two cases that can cause this on amdgpu are Custom brightness curves and Adaptive Backlight Management (ABM).
Quoted 8 lines
Quoted 7 lines
Documentation/ABI/stable/sysfs-class-backlight +0
-0Users: HAL What: /sys/class/backlight/<backlight>/max_brightnessSignature · 1 line
2.43.0
Lee Jones
maintainerQuoted 39 lines · Mario Limonciello
Quoted 23 lines · Lee Jones
Quoted 21 lines · Mario Limonciello
From: Mario Limonciello <[email protected]>
Currently userspace software systemd treats
brightnessandactual_brightnessidentically due to a bug found in an out of tree driver.This however causes problems for in-tree drivers that use brightness to report user requested
brightnessandactual_brightnessto report what the hardware actually has programmed.Clarify the documentation to match the behavior described in commit
6ca017658b1f9("[PATCH] backlight: Backlight Class Improvements").Cc Lennart Poettering <[email protected]>Signed-off-by Mario Limonciello <[email protected]>--- Documentation/ABI/stable/sysfs-class-backlight | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Quoted 14 lines
Documentation/ABI/stable/sysfs-class-backlight Date: March 2006 · line 31
Quoted 12 lines
Documentation/ABI/stable/sysfs-class-backlight +3
-1@@ -26,7 +26,9 @@ Date: March 2006 KernelVersion: 2.6.17 Contact: Richard Purdie <[email protected]> Description: - Show the actual brightness by querying the hardware. + Show the actual brightness by querying the hardware. This + takes into account other factors besides the value programmed + for 'brightness' and may not match the value in 'brightness'.Which factors? Under what circumstances may the values not match?
Quoted 2 lines
Is this question for your background or are you saying these should be enumerated here in the documentation?
Both.
Quoted 10 lines
Richard Purdie mentioned:
"The challenge back then was that things like framebuffer blanking would turn off the backlight but the single brightness attribute was implemented inconsistently. Some drivers would report no backlight when blanking was active, some would report the value stored in brightness. This had multiple issues"
For AMD the two cases that can cause this on amdgpu are Custom brightness curves and Adaptive Backlight Management (ABM).
Okay, that was for me. Please update the documentation. =:-)
Signature · 1 line
Lee Jones [李琼斯]
Quoted 23 lines · Lee Jones
Quoted 21 lines · Mario Limonciello
From: Mario Limonciello <[email protected]>
Currently userspace software systemd treats
brightnessandactual_brightnessidentically due to a bug found in an out of tree driver.This however causes problems for in-tree drivers that use brightness to report user requested
brightnessandactual_brightnessto report what the hardware actually has programmed.Clarify the documentation to match the behavior described in commit
6ca017658b1f9("[PATCH] backlight: Backlight Class Improvements").Cc Lennart Poettering <[email protected]>Signed-off-by Mario Limonciello <[email protected]>--- Documentation/ABI/stable/sysfs-class-backlight | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 14 lines
Documentation/ABI/stable/sysfs-class-backlight Date: March 2006 · line 31
Quoted 12 lines
Documentation/ABI/stable/sysfs-class-backlight +3
-1@@ -26,7 +26,9 @@ Date: March 2006 KernelVersion: 2.6.17 Contact: Richard Purdie <[email protected]> Description: - Show the actual brightness by querying the hardware. + Show the actual brightness by querying the hardware. This + takes into account other factors besides the value programmed + for 'brightness' and may not match the value in 'brightness'.Which factors? Under what circumstances may the values not match?
At least for i915, the brightness range in sysfs isn't guaranteed to be the range in hardware. For example, you might want sysfs to start from 0, but the hardware has a minimum that is non-zero. Or you might just want to have a fixed range, say, 0-100 in sysfs. Any scaling may introduce rounding errors in the round-trip.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel