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.

vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta()

Since commit 74d58cd48a8f ("USB: sisusbvga: remove console support"),
vgacon_scrolldelta() is the only user of vc_scrolldelta_helper().

Inline the helper into vgacon_scrolldelta() and drop it.

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

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
17465747 6613476e

+34 -45
-40
drivers/tty/vt/vt.c
··· 4748 4748 { 4749 4749 notify_update(vc); 4750 4750 } 4751 - 4752 - void vc_scrolldelta_helper(struct vc_data *c, int lines, 4753 - unsigned int rolled_over, void *base, unsigned int size) 4754 - { 4755 - unsigned long ubase = (unsigned long)base; 4756 - ptrdiff_t scr_end = (void *)c->vc_scr_end - base; 4757 - ptrdiff_t vorigin = (void *)c->vc_visible_origin - base; 4758 - ptrdiff_t origin = (void *)c->vc_origin - base; 4759 - int margin = c->vc_size_row * 4; 4760 - int from, wrap, from_off, avail; 4761 - 4762 - /* Turn scrollback off */ 4763 - if (!lines) { 4764 - c->vc_visible_origin = c->vc_origin; 4765 - return; 4766 - } 4767 - 4768 - /* Do we have already enough to allow jumping from 0 to the end? */ 4769 - if (rolled_over > scr_end + margin) { 4770 - from = scr_end; 4771 - wrap = rolled_over + c->vc_size_row; 4772 - } else { 4773 - from = 0; 4774 - wrap = size; 4775 - } 4776 - 4777 - from_off = (vorigin - from + wrap) % wrap + lines * c->vc_size_row; 4778 - avail = (origin - from + wrap) % wrap; 4779 - 4780 - /* Only a little piece would be left? Show all incl. the piece! */ 4781 - if (avail < 2 * margin) 4782 - margin = 0; 4783 - if (from_off < margin) 4784 - from_off = 0; 4785 - if (from_off > avail - margin) 4786 - from_off = avail; 4787 - 4788 - c->vc_visible_origin = ubase + (from + from_off) % wrap; 4789 - } 4790 - EXPORT_SYMBOL_GPL(vc_scrolldelta_helper);
+34 -2
drivers/video/console/vgacon.c
··· 138 138 139 139 static void vgacon_scrolldelta(struct vc_data *c, int lines) 140 140 { 141 - vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base, 142 - vga_vram_size); 141 + unsigned long scr_end = c->vc_scr_end - vga_vram_base; 142 + unsigned long vorigin = c->vc_visible_origin - vga_vram_base; 143 + unsigned long origin = c->vc_origin - vga_vram_base; 144 + int margin = c->vc_size_row * 4; 145 + int from, wrap, from_off, avail; 146 + 147 + /* Turn scrollback off */ 148 + if (!lines) { 149 + c->vc_visible_origin = c->vc_origin; 150 + return; 151 + } 152 + 153 + /* Do we have already enough to allow jumping from 0 to the end? */ 154 + if (vga_rolled_over > scr_end + margin) { 155 + from = scr_end; 156 + wrap = vga_rolled_over + c->vc_size_row; 157 + } else { 158 + from = 0; 159 + wrap = vga_vram_size; 160 + } 161 + 162 + from_off = (vorigin - from + wrap) % wrap + lines * c->vc_size_row; 163 + avail = (origin - from + wrap) % wrap; 164 + 165 + /* Only a little piece would be left? Show all incl. the piece! */ 166 + if (avail < 2 * margin) 167 + margin = 0; 168 + if (from_off < margin) 169 + from_off = 0; 170 + if (from_off > avail - margin) 171 + from_off = avail; 172 + 173 + c->vc_visible_origin = vga_vram_base + (from + from_off) % wrap; 174 + 143 175 vga_set_mem_top(c); 144 176 } 145 177
-3
include/linux/vt_kern.h
··· 168 168 void vt_kbd_con_start(unsigned int console); 169 169 void vt_kbd_con_stop(unsigned int console); 170 170 171 - void vc_scrolldelta_helper(struct vc_data *c, int lines, 172 - unsigned int rolled_over, void *_base, unsigned int size); 173 - 174 171 #endif /* _VT_KERN_H */