diff options
author | Borislav Petkov <bp@suse.de> | 2020-05-22 20:06:25 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-05-22 20:06:25 +0200 |
commit | 9bb4cbf4862dfa139f73e12912129e5b76baea1a (patch) | |
tree | 281445c282163ff286d7eb5b6b60f1a5eb608625 /drivers/firmware/efi/earlycon.c | |
parent | b9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce (diff) | |
parent | b4f1874c62168159fdb419ced4afc77c1b51c475 (diff) | |
download | kernel_replicant_linux-9bb4cbf4862dfa139f73e12912129e5b76baea1a.tar.gz kernel_replicant_linux-9bb4cbf4862dfa139f73e12912129e5b76baea1a.tar.bz2 kernel_replicant_linux-9bb4cbf4862dfa139f73e12912129e5b76baea1a.zip |
Merge tag 'efi-fixes-for-v5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgent
Pull EFI fixes from Ard Biesheuvel:
"- fix EFI framebuffer earlycon for wide fonts
- avoid filling screen_info with garbage if the EFI framebuffer is not
available
- fix a potential host tool build error due to a symbol clash on x86
- work around a EFI firmware bug regarding the binary format of the TPM
final events table
- fix a missing memory free by reworking the E820 table sizing routine to
not do the allocation in the first place
- add CPER parsing for firmware errors"
Diffstat (limited to 'drivers/firmware/efi/earlycon.c')
-rw-r--r-- | drivers/firmware/efi/earlycon.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/firmware/efi/earlycon.c b/drivers/firmware/efi/earlycon.c index 5d4f84781aa0..a52236e11e5f 100644 --- a/drivers/firmware/efi/earlycon.c +++ b/drivers/firmware/efi/earlycon.c @@ -114,14 +114,16 @@ static void efi_earlycon_write_char(u32 *dst, unsigned char c, unsigned int h) const u32 color_black = 0x00000000; const u32 color_white = 0x00ffffff; const u8 *src; - u8 s8; - int m; + int m, n, bytes; + u8 x; - src = font->data + c * font->height; - s8 = *(src + h); + bytes = BITS_TO_BYTES(font->width); + src = font->data + c * font->height * bytes + h * bytes; - for (m = 0; m < 8; m++) { - if ((s8 >> (7 - m)) & 1) + for (m = 0; m < font->width; m++) { + n = m % 8; + x = *(src + m / 8); + if ((x >> (7 - n)) & 1) *dst = color_white; else *dst = color_black; |