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: make types around consw::con_blank() bool

Both the mode_switch parameter and the return value (a redraw needed)
are true/false. So switch them to bool, so that users won't return
-Eerrors or anything else.

And document the hook.

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-36-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
77e11093 0a58d83d

+29 -24
+6 -6
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, enum vesa_blank_mode blank, 83 - int mode_switch) 82 + static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 83 + bool mode_switch) 84 84 { 85 85 /* Redraw, so that we get putc(s) for output done while blanked */ 86 - return 1; 86 + return true; 87 87 } 88 88 #else 89 89 static void dummycon_putc(struct vc_data *vc, u16 c, unsigned int y, 90 90 unsigned int x) { } 91 91 static void dummycon_putcs(struct vc_data *vc, const u16 *s, unsigned int count, 92 92 unsigned int ypos, unsigned int xpos) { } 93 - static int dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 94 - int mode_switch) 93 + static bool dummycon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 94 + bool mode_switch) 95 95 { 96 - return 0; 96 + return false; 97 97 } 98 98 #endif 99 99
+4 -4
drivers/video/console/mdacon.c
··· 451 451 return true; /* redrawing needed */ 452 452 } 453 453 454 - static int mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 455 - int mode_switch) 454 + static bool mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 455 + bool mode_switch) 456 456 { 457 457 if (mda_type == TYPE_MDA) { 458 458 if (blank) ··· 460 460 mda_convert_attr(c->vc_video_erase_char), 461 461 c->vc_screenbuf_size); 462 462 /* Tell console.c that it has to restore the screen itself */ 463 - return 1; 463 + return true; 464 464 } else { 465 465 if (blank) 466 466 outb_p(0x00, mda_mode_port); /* disable video */ 467 467 else 468 468 outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, 469 469 mda_mode_port); 470 - return 0; 470 + return false; 471 471 } 472 472 } 473 473
+4 -3
drivers/video/console/newport_con.c
··· 476 476 return true; 477 477 } 478 478 479 - static int newport_blank(struct vc_data *c, enum vesa_blank_mode blank, 480 - int mode_switch) 479 + static bool newport_blank(struct vc_data *c, enum vesa_blank_mode blank, 480 + bool mode_switch) 481 481 { 482 482 unsigned short treg; 483 483 ··· 492 492 newport_vc2_set(npregs, VC2_IREG_CONTROL, 493 493 (treg & ~(VC2_CTRL_EDISP))); 494 494 } 495 - return 1; 495 + 496 + return true; 496 497 } 497 498 498 499 static int newport_set_font(int unit, struct console_font *op, unsigned int vpitch)
+5 -4
drivers/video/console/sticon.c
··· 298 298 return true; /* needs refreshing */ 299 299 } 300 300 301 - static int sticon_blank(struct vc_data *c, enum vesa_blank_mode blank, 302 - int mode_switch) 301 + static bool sticon_blank(struct vc_data *c, enum vesa_blank_mode blank, 302 + bool mode_switch) 303 303 { 304 304 if (blank == VESA_NO_BLANKING) { 305 305 if (mode_switch) 306 306 vga_is_gfx = 0; 307 - return 1; 307 + return true; 308 308 } 309 309 sti_clear(sticon_sti, 0, 0, c->vc_rows, c->vc_cols, BLANK, 310 310 font_data[c->vc_num]); 311 311 if (mode_switch) 312 312 vga_is_gfx = 1; 313 - return 1; 313 + 314 + return true; 314 315 } 315 316 316 317 static u8 sticon_build_attr(struct vc_data *conp, u8 color,
+2 -2
drivers/video/console/vgacon.c
··· 797 797 } 798 798 } 799 799 800 - static int vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 801 - int mode_switch) 800 + static bool vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank, 801 + bool mode_switch) 802 802 { 803 803 switch (blank) { 804 804 case VESA_NO_BLANKING: /* Unblank */
+3 -3
drivers/video/fbdev/core/fbcon.c
··· 2198 2198 } 2199 2199 } 2200 2200 2201 - static int fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 2202 - int mode_switch) 2201 + static bool fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank, 2202 + bool mode_switch) 2203 2203 { 2204 2204 struct fb_info *info = fbcon_info_from_console(vc->vc_num); 2205 2205 struct fbcon_ops *ops = info->fbcon_par; ··· 2238 2238 else 2239 2239 fbcon_add_cursor_work(info); 2240 2240 2241 - return 0; 2241 + return false; 2242 2242 } 2243 2243 2244 2244 static void fbcon_debug_enter(struct vc_data *vc)
+5 -2
include/linux/console.h
··· 49 49 * Invoked by csi_M and printing to the console. 50 50 * @con_switch: notifier about the console switch; it is supposed to return 51 51 * true if a redraw is needed. 52 + * @con_blank: blank/unblank the console. The target mode is passed in @blank. 53 + * @mode_switch is set if changing from/to text/graphics. The hook 54 + * is supposed to return true if a redraw is needed. 52 55 * @con_set_palette: sets the palette of the console to @table (optional) 53 56 * @con_scrolldelta: the contents of the console should be scrolled by @lines. 54 57 * Invoked by user. (optional) ··· 73 70 unsigned int bottom, enum con_scroll dir, 74 71 unsigned int lines); 75 72 bool (*con_switch)(struct vc_data *vc); 76 - int (*con_blank)(struct vc_data *vc, enum vesa_blank_mode blank, 77 - int mode_switch); 73 + bool (*con_blank)(struct vc_data *vc, enum vesa_blank_mode blank, 74 + bool mode_switch); 78 75 int (*con_font_set)(struct vc_data *vc, struct console_font *font, 79 76 unsigned int vpitch, unsigned int flags); 80 77 int (*con_font_get)(struct vc_data *vc, struct console_font *font,