vgacon/vt: clear buffer attributes when we load a 512 character font (v2)
authorDave Airlie <airlied@redhat.com>
Thu, 24 Jan 2013 04:14:19 +0000 (14:14 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Mar 2013 03:23:50 +0000 (03:23 +0000)
commit154184713475e6a077724f0db41b0a921008512d
treeca1490ecdb5ebfea5d3363ec5f32bc4ba06827d7
parent6684f6e7ac5669cfcaad4d89b09773b7139e30fb
vgacon/vt: clear buffer attributes when we load a 512 character font (v2)

commit 2a2483072393b27f4336ab068a1f48ca19ff1c1e upstream.

When we switch from 256->512 byte font rendering mode, it means the
current contents of the screen is being reinterpreted. The bit that holds
the high bit of the 9-bit font, may have been previously set, and thus
the new font misrenders.

The problem case we see is grub2 writes spaces with the bit set, so it
ends up with data like 0x820, which gets reinterpreted into 0x120 char
which the font translates into G with a circumflex. This flashes up on
screen at boot and is quite ugly.

A current side effect of this patch though is that any rendering on the
screen changes color to a slightly darker color, but at least the screen
no longer corrupts.

v2: as suggested by hpa, always clear the attribute space, whether we
are are going to or from 512 chars.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/tty/vt/vt.c
drivers/video/console/vgacon.c
include/linux/vt_kern.h