]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
vgacon: unconfuse vc_origin when using soft scrollback
authorNicolas Pitre <nicolas.pitre@linaro.org>
Thu, 10 Jan 2019 21:33:55 +0000 (16:33 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7cffb540614e065aba75104a4c153ee2b2a7d369
tree144945295f6010a07db980bd45e6de9093e6ea1f
parentcde64cfc4d4efe1080911dc19abf2749b26a39f9
vgacon: unconfuse vc_origin when using soft scrollback

BugLink: https://bugs.launchpad.net/bugs/1837664
commit bfd8d8fe98b8792f362cd210a7873969f8d2fc04 upstream.

When CONFIG_VGACON_SOFT_SCROLLBACK is selected, the VGA display memory
index and vc_visible_origin don't change when scrollback is activated.
The actual screen content is saved away and the scrollbackdata is copied
over it. However the vt code, and /dev/vcs devices in particular, still
expect vc_origin to always point at the actual screen content not the
displayed scrollback content.

So adjust vc_origin to point at the saved screen content when scrollback
is active and set it back to vc_visible_origin when restoring the screen.

This fixes /dev/vcsa<n> that return scrollback content when they
shouldn't (onli /dev/vcsa without a number should), and also fixes
/dev/vcsu that should return scrollback content when scrollback is
active but currently doesn't.

An unnecessary call to vga_set_mem_top() is also removed.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/video/console/vgacon.c