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: change consw::con_set_origin() return type

The return value of consw::con_set_origin() is only true/false, meaining
if vc->vc_origin is set to vc->vc_screenbuf or not.

So switch the type and returned values accordingly.

And document the hook.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-39-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
42822fab 4f596170

+8 -5
+4 -4
drivers/video/console/vgacon.c
··· 65 65 * Interface used by the world 66 66 */ 67 67 68 - static int vgacon_set_origin(struct vc_data *c); 68 + static bool vgacon_set_origin(struct vc_data *c); 69 69 70 70 static struct uni_pagedict *vgacon_uni_pagedir; 71 71 static int vgacon_refcount; ··· 1100 1100 return 0; 1101 1101 } 1102 1102 1103 - static int vgacon_set_origin(struct vc_data *c) 1103 + static bool vgacon_set_origin(struct vc_data *c) 1104 1104 { 1105 1105 if (vga_is_gfx || /* We don't play origin tricks in graphic modes */ 1106 1106 (console_blanked && !vga_palette_blanked)) /* Nor we write to blanked screens */ 1107 - return 0; 1107 + return false; 1108 1108 c->vc_origin = c->vc_visible_origin = vga_vram_base; 1109 1109 vga_set_mem_top(c); 1110 1110 vga_rolled_over = 0; 1111 - return 1; 1111 + return true; 1112 1112 } 1113 1113 1114 1114 static void vgacon_save_screen(struct vc_data *c)
+4 -1
include/linux/console.h
··· 55 55 * @con_set_palette: sets the palette of the console to @table (optional) 56 56 * @con_scrolldelta: the contents of the console should be scrolled by @lines. 57 57 * Invoked by user. (optional) 58 + * @con_set_origin: set origin (see &vc_data::vc_origin) of the @vc. If not 59 + * provided or returns false, the origin is set to 60 + * @vc->vc_screenbuf. (optional) 58 61 */ 59 62 struct consw { 60 63 struct module *owner; ··· 90 87 void (*con_set_palette)(struct vc_data *vc, 91 88 const unsigned char *table); 92 89 void (*con_scrolldelta)(struct vc_data *vc, int lines); 93 - int (*con_set_origin)(struct vc_data *vc); 90 + bool (*con_set_origin)(struct vc_data *vc); 94 91 void (*con_save_screen)(struct vc_data *vc); 95 92 u8 (*con_build_attr)(struct vc_data *vc, u8 color, 96 93 enum vc_intensity intensity,