L Liu Ying #
Message details and related content
Ping... Regards, Liu Ying On 01/20/2014 12:52 PM, Liu Ying wrote:
quoted hunk
We don't have to turn backlight on/off everytime a blanking or unblanking event comes because the backlight status may have already been what we want. Another thought is that one backlight device may be shared by multiple framebuffers. We don't hope blanking one of the framebuffers may turn the backlight off for all the other framebuffers, since they are likely being active to display something. This patch adds some logics to record each framebuffer's backlight usage to determine the backlight device use count and whether the backlight should be turned on or off. To be more specific, only one unblank operation on a certain blanked framebuffer may increase the backlight device's use count by one, while one blank operation on a certain unblanked framebuffer may decrease the use count by one, because the userspace is likely to unblank a unblanked framebuffer or blank a blanked framebuffer. Signed-off-by: Liu Ying <redacted> --- v1 can be found at https://lkml.org/lkml/2013/5/30/139 v1->v2: * Make the commit message be more specific about the condition in which backlight device use count can be increased/decreased. * Correct the setting for bd->props.fb_blank. drivers/video/backlight/backlight.c | 28 +++++++++++++++++++++------- include/linux/backlight.h | 6 ++++++ 2 files changed, 27 insertions(+), 7 deletions(-)diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 5d05555..42044be 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c@@ -34,13 +34,15 @@ static const char *const backlight_types[] = { defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)) /* This callback gets called when something important happens inside a * framebuffer driver. We're looking if that important event is blanking, - * and if it is, we're switching backlight power as well ... + * and if it is and necessary, we're switching backlight power as well ...