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.
Showing the changes to include/uapi (2 of 3 files). Show all
Unified · Split
| @@ -4,6 +4,7 @@ · 3 unmodified lines | |||
| 4 | 4 | ||
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | #include <linux/i2c.h> | 6 | #include <linux/i2c.h> |
| 7 | #include <linux/vesa.h> | ||
| 7 | 8 | ||
| 8 | /* Definitions of frame buffers */ | 9 | /* Definitions of frame buffers */ |
| 9 | 10 | ||
| @@ -293,13 +294,6 @@ struct fb_con2fbmap { · 283 unmodified lines | |||
| 293 | __u32 framebuffer; | 294 | __u32 framebuffer; |
| 294 | }; | 295 | }; |
| 295 | 296 | ||
| 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 | |||
| 303 | enum { | 297 | enum { |
| 304 | /* screen: unblanked, hsync: on, vsync: on */ | 298 | /* screen: unblanked, hsync: on, vsync: on */ |
| 305 | FB_BLANK_UNBLANK = VESA_NO_BLANKING, | 299 | FB_BLANK_UNBLANK = VESA_NO_BLANKING, |
| @@ -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 | ||