Skip to content

Commit dfb4bf1

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
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>
1 parent 7e3711e commit dfb4bf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/video/fbdev/core/fbmem.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ int fb_blank(struct fb_info *info, int blank)
343343
{
344344
int old_blank = info->blank;
345345
struct fb_event event;
346+
int data[2];
346347
int ret;
347348

348349
if (!info->fbops->fb_blank)
@@ -351,8 +352,10 @@ int fb_blank(struct fb_info *info, int blank)
351352
if (blank > FB_BLANK_POWERDOWN)
352353
blank = FB_BLANK_POWERDOWN;
353354

355+
data[0] = blank;
356+
data[1] = old_blank;
354357
event.info = info;
355-
event.data = &blank;
358+
event.data = data;
356359

357360
info->blank = blank;
358361

0 commit comments

Comments
 (0)