History

tty: vt: define a common enum for VESA blanking constants

There are currently two places with VESA blanking constants definitions: fb.h and console.h. Extract/unify the two to a separate header (vesa.h). Given the fb's is in an uapi header, create the common header in uapi too. Note that instead of macros, an enum (vesa_blank_mode) is created. But the macros are kept too (they now expand to the enum constants), just in case someone in userspace performs some #ifdeffery.

Jiri Slaby (SUSE) committed 2 years ago

Commit ace4ebf1 parent 735a5193 files · +20 −13Browse files

Showing the changes to include/uapi (2 of 3 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/fb.h +1 −7
  2. include/uapi/linux/vesa.h +18 −0
include/uapi/linux/fb.h+1−7
@@ -4,6 +4,7 @@ · 3 unmodified lines
44
55 #include <linux/types.h>
66 #include <linux/i2c.h>
7+#include <linux/vesa.h>
78
89 /* Definitions of frame buffers */
910
@@ -293,13 +294,6 @@ struct fb_con2fbmap { · 283 unmodified lines
293294 __u32 framebuffer;
294295 };
295296
296−/* VESA Blanking Levels */
297−#define VESA_NO_BLANKING 0
298−#define VESA_VSYNC_SUSPEND 1
299−#define VESA_HSYNC_SUSPEND 2
300−#define VESA_POWERDOWN 3
301−
302−
303297 enum {
304298 /* screen: unblanked, hsync: on, vsync: on */
305299 FB_BLANK_UNBLANK = VESA_NO_BLANKING,
include/uapi/linux/vesa.h+18−0
@@ -0,0 +1,18 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+#ifndef _UAPI_LINUX_VESA_H
3+#define _UAPI_LINUX_VESA_H
4+
5+/* VESA Blanking Levels */
6+enum vesa_blank_mode {
7+ VESA_NO_BLANKING = 0,
8+#define VESA_NO_BLANKING VESA_NO_BLANKING
9+ VESA_VSYNC_SUSPEND = 1,
10+#define VESA_VSYNC_SUSPEND VESA_VSYNC_SUSPEND
11+ VESA_HSYNC_SUSPEND = 2,
12+#define VESA_HSYNC_SUSPEND VESA_HSYNC_SUSPEND
13+ VESA_POWERDOWN = VESA_VSYNC_SUSPEND | VESA_HSYNC_SUSPEND,
14+#define VESA_POWERDOWN VESA_POWERDOWN
15+ VESA_BLANK_MAX = VESA_POWERDOWN,
16+};
17+
18+#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t