“How to modify the panel backlight”的版本间的差异

来自百问网嵌入式Linux wiki
 
 
(未显示2个用户的2个中间版本)
第1行: 第1行:
[[Category:Linux_Operating_System]]
+
First identify the backlight device linked to your panel, thanks to the sysfs:
[[Category:Visual]]
+
{{Board$}} ls /sys/class/backlight
[[Category:DRM_KMS]]
+
5a000000.dsi.0
 +
 
 +
In the above example, there is a single entry named "5a000000.dsi.0", which is '''replaced by "*"''' in the below command.
 +
 
 +
 
 +
To adjust the panel backlight, enter the following command:
 +
{{Board$}} echo '''32''' > /sys/class/backlight/*/'''brightness'''    # set the dsi panel backlight to the value '''32'''
 +
Note: Only values between 0 and '''max_brightness''' must be used.
 +
 
 +
To get the maximum panel backlight value, enter:
 +
{{Board$}} cat /sys/class/backlight/*/'''max_brightness'''
 +
255
 +
 
 +
To get the actual panel backlight value, enter:
 +
{{Board$}} cat /sys/class/backlight/*/'''actual_brightness'''
 +
32
 +
 
 +
 
 +
Use one of the following commands to quickly test the panel backlight:
 +
{{Board$}} export bl=/sys/class/backlight/5a000000.dsi.0/brightness
 +
 +
{{Board$}} # switch on/off test
 +
{{Board$}} (while true; do echo 0 > $bl; sleep 0.5; echo 255 > $bl; sleep 0.5; done)
 +
 +
{{Board$}} # slow 32-step tests
 +
{{Board$}} (i=0; while true; do i=$(((i+32)%256)); echo $i > $bl; sleep 0.5; done)
 +
 +
{{Board$}} # fast 1-step test
 +
{{Board$}} (i=0; while true; do i=$(((i+1)%256)); echo $i > $bl; done)
 +
 
 +
 
 +
<noinclude>
 +
{{PublicationRequestId | 10715 | 2019-02-18 | AnneJ}}
 +
[[Category:How to run use cases]]
 +
[[Category:DRM KMS]]
 +
</noinclude>

2020年5月8日 (五) 22:31的最新版本

First identify the backlight device linked to your panel, thanks to the sysfs:

Board $> ls /sys/class/backlight
5a000000.dsi.0

In the above example, there is a single entry named "5a000000.dsi.0", which is replaced by "*" in the below command.


To adjust the panel backlight, enter the following command:

Board $> echo 32 > /sys/class/backlight/*/brightness    # set the dsi panel backlight to the value 32

Note: Only values between 0 and max_brightness must be used.

To get the maximum panel backlight value, enter:

Board $> cat /sys/class/backlight/*/max_brightness
255

To get the actual panel backlight value, enter:

Board $> cat /sys/class/backlight/*/actual_brightness
32


Use one of the following commands to quickly test the panel backlight:

Board $> export bl=/sys/class/backlight/5a000000.dsi.0/brightness

Board $> # switch on/off test
Board $> (while true; do echo 0 > $bl; sleep 0.5; echo 255 > $bl; sleep 0.5; done)

Board $> # slow 32-step tests
Board $> (i=0; while true; do i=$(((i+32)%256)); echo $i > $bl; sleep 0.5; done)

Board $> # fast 1-step test
Board $> (i=0; while true; do i=$(((i+1)%256)); echo $i > $bl; done)


<securetransclude src="ProtectedTemplate:PublicationRequestId" params="10715 | 2019-02-18 | AnneJ"></securetransclude>