Thread (19 messages) 19 messages, 2 authors, 2025-02-20

[PATCH 03/13] fbdev: Send old blank state in FB_EVENT_BLANK

flat view
STALE593d

From: Thomas Zimmermann <tzimmermann@suse.de>
Date: 2025-02-06 15:40:51
Also in: dri-devel, linux-leds
Subsystem: framebuffer core, framebuffer layer, the rest · Maintainers: Simona Vetter, Helge Deller, Linus Torvalds

Revision rfc of 4 in this series.

Revisions (4)
  1. rfc current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
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 optional as it ties backlight code to fbdev. A
subsystem should also 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>
---
 drivers/video/fbdev/core/fbmem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index f34a80c7fc3a..997f0bfcdbb6 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -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 = &blank;
+	event.data = data;
 
 	info->blank = blank;
 
-- 
2.48.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help