Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: vt: use enum constants for VESA blanking modes

Use the new enum for VESA constants. This improves type checking in
consw::con_blank().

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-parisc@vger.kernel.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-35-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
0a58d83d 15d0fff7

+20 -12
+2 -2
drivers/tty/vt/vt.c
··· 175 175 int console_blanked; 176 176 EXPORT_SYMBOL(console_blanked); 177 177 178 - static int vesa_blank_mode; /* 0:none 1:suspendV 2:suspendH 3:powerdown */ 178 + static enum vesa_blank_mode vesa_blank_mode; 179 179 static int vesa_off_interval; 180 180 static int blankinterval; 181 181 core_param(consoleblank, blankinterval, int, 0444); ··· 4320 4320 return -EFAULT; 4321 4321 4322 4322 console_lock(); 4323 - vesa_blank_mode = (mode < 4) ? mode : VESA_NO_BLANKING; 4323 + vesa_blank_mode = (mode <= VESA_BLANK_MAX) ? mode : VESA_NO_BLANKING; 4324 4324 console_unlock(); 4325 4325 4326 4326 return 0;
+4 -2
drivers/video/console/dummycon.c
··· 79 79 raw_notifier_call_chain(&dummycon_output_nh, 0, NULL); 80 80 } 81 81 82 - static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch) 82 + static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 83 + int mode_switch) 83 84 { 84 85 /* Redraw, so that we get putc(s) for output done while blanked */ 85 86 return 1; ··· 90 89 unsigned int x) { } 91 90 static void dummycon_putcs(struct vc_data *vc, const u16 *s, unsigned int count, 92 91 unsigned int ypos, unsigned int xpos) { } 93 - static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch) 92 + static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 93 + int mode_switch) 94 94 { 95 95 return 0; 96 96 }
+2 -1
drivers/video/console/mdacon.c
··· 451 451 return true; /* redrawing needed */ 452 452 } 453 453 454 - static int mdacon_blank(struct vc_data *c, int blank, int mode_switch) 454 + static int mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 455 + int mode_switch) 455 456 { 456 457 if (mda_type == TYPE_MDA) { 457 458 if (blank)
+2 -1
drivers/video/console/newport_con.c
··· 476 476 return true; 477 477 } 478 478 479 - static int newport_blank(struct vc_data *c, int blank, int mode_switch) 479 + static int newport_blank(struct vc_data *c, enum vesa_blank_mode blank, 480 + int mode_switch) 480 481 { 481 482 unsigned short treg; 482 483
+2 -1
drivers/video/console/sticon.c
··· 298 298 return true; /* needs refreshing */ 299 299 } 300 300 301 - static int sticon_blank(struct vc_data *c, int blank, int mode_switch) 301 + static int sticon_blank(struct vc_data *c, enum vesa_blank_mode blank, 302 + int mode_switch) 302 303 { 303 304 if (blank == VESA_NO_BLANKING) { 304 305 if (mode_switch)
+4 -3
drivers/video/console/vgacon.c
··· 81 81 static bool vga_can_do_color; /* Do we support colors? */ 82 82 static unsigned int vga_default_font_height __read_mostly; /* Height of default screen font */ 83 83 static unsigned char vga_video_type __read_mostly; /* Card type */ 84 - static int vga_vesa_blanked; 84 + static enum vesa_blank_mode vga_vesa_blanked; 85 85 static bool vga_palette_blanked; 86 86 static bool vga_is_gfx; 87 87 static bool vga_512_chars; ··· 683 683 unsigned char ClockingMode; /* Seq-Controller:01h */ 684 684 } vga_state; 685 685 686 - static void vga_vesa_blank(struct vgastate *state, int mode) 686 + static void vga_vesa_blank(struct vgastate *state, enum vesa_blank_mode mode) 687 687 { 688 688 /* save original values of VGA controller registers */ 689 689 if (!vga_vesa_blanked) { ··· 797 797 } 798 798 } 799 799 800 - static int vgacon_blank(struct vc_data *c, int blank, int mode_switch) 800 + static int vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 801 + int mode_switch) 801 802 { 802 803 switch (blank) { 803 804 case VESA_NO_BLANKING: /* Unblank */
+2 -1
drivers/video/fbdev/core/fbcon.c
··· 2198 2198 } 2199 2199 } 2200 2200 2201 - static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) 2201 + static int fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 2202 + int mode_switch) 2202 2203 { 2203 2204 struct fb_info *info = fbcon_info_from_console(vc->vc_num); 2204 2205 struct fbcon_ops *ops = info->fbcon_par;
+2 -1
include/linux/console.h
··· 70 70 unsigned int bottom, enum con_scroll dir, 71 71 unsigned int lines); 72 72 bool (*con_switch)(struct vc_data *vc); 73 - int (*con_blank)(struct vc_data *vc, int blank, int mode_switch); 73 + int (*con_blank)(struct vc_data *vc, enum vesa_blank_mode blank, 74 + int mode_switch); 74 75 int (*con_font_set)(struct vc_data *vc, struct console_font *font, 75 76 unsigned int vpitch, unsigned int flags); 76 77 int (*con_font_get)(struct vc_data *vc, struct console_font *font,