mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
fbdev: Send old blank state in FB_EVENT_BLANK
The event FB_EVENT_BLANK sends the new blank state in the event's data field. Also send the old state. It's an additional field in the data array; existing receivers won't notice the difference. The backlight subsystem currently tracks blank state per display per backlight. That is not optimal as it ties backlight code to fbdev. A subsystem should not track internal state of another subsystem. With both, new and old, blank state in FB_EVENT_BLANK, the backlight code will not require its own state tracker any longer. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Simona Vetter <simona.vetter@ffwll.ch> Link: https://lore.kernel.org/r/20250321095517.313713-4-tzimmermann@suse.de Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
committed by
Lee Jones
parent
7e3711eb87
commit
dfb4bf1ac4
@@ -343,6 +343,7 @@ int fb_blank(struct fb_info *info, int blank)
|
||||
{
|
||||
int old_blank = info->blank;
|
||||
struct fb_event event;
|
||||
int data[2];
|
||||
int ret;
|
||||
|
||||
if (!info->fbops->fb_blank)
|
||||
@@ -351,8 +352,10 @@ int fb_blank(struct fb_info *info, int blank)
|
||||
if (blank > FB_BLANK_POWERDOWN)
|
||||
blank = FB_BLANK_POWERDOWN;
|
||||
|
||||
data[0] = blank;
|
||||
data[1] = old_blank;
|
||||
event.info = info;
|
||||
event.data = ␣
|
||||
event.data = data;
|
||||
|
||||
info->blank = blank;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user