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

Unified · Split

3 files
  1. include/linux/console.h +1 −6
  2. include/uapi/linux/fb.h +1 −7
  3. include/uapi/linux/vesa.h +18 −0
include/linux/console.h+1−6
@@ -18,6 +18,7 @@ · 17 unmodified lines
18#include <linux/bits.h>18#include <linux/bits.h>
19#include <linux/rculist.h>19#include <linux/rculist.h>
20#include <linux/types.h>20#include <linux/types.h>
21#include <linux/vesa.h>
21 22
22struct vc_data;23struct vc_data;
23struct console_font_op;24struct console_font_op;
@@ -520,12 +521,6 @@ void vcs_remove_sysfs(int index); · 496 unmodified lines
520 */521 */
521extern atomic_t ignore_console_lock_warning;522extern atomic_t ignore_console_lock_warning;
522 523
523/* VESA Blanking Levels */
524#define VESA_NO_BLANKING 0
525#define VESA_VSYNC_SUSPEND 1
526#define VESA_HSYNC_SUSPEND 2
527#define VESA_POWERDOWN 3
528
529extern void console_init(void);524extern void console_init(void);
530 525
531/* For deferred console takeover */526/* For deferred console takeover */
include/uapi/linux/fb.h+1−7
@@ -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
303enum {297enum {
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,
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 */
6enum 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