linux/drivers/video
Thomas Zimmermann 340bbe90cc fbdev: vesafb: Detect VGA compatibility from screen info's VESA attributes
[ Upstream commit c2bc958b2b ]

Test the vesa_attributes field in struct screen_info for compatibility
with VGA hardware. Vesafb currently tests bit 1 in screen_info's
capabilities field which indicates a 64-bit lfb address and is
unrelated to VGA compatibility.

Section 4.4 of the Vesa VBE 2.0 specifications defines that bit 5 in
the mode's attributes field signals VGA compatibility. The mode is
compatible with VGA hardware if the bit is clear. In that case, the
driver can access VGA state of the VBE's underlying hardware. The
vesafb driver uses this feature to program the color LUT in palette
modes. Without, colors might be incorrect.

The problem got introduced in commit 89ec4c238e ("[PATCH] vesafb: Fix
incorrect logo colors in x86_64"). It incorrectly stores the mode
attributes in the screen_info's capabilities field and updates vesafb
accordingly. Later, commit 5e8ddcbe86 ("Video mode probing support for
the new x86 setup code") fixed the screen_info, but did not update vesafb.
Color output still tends to work, because bit 1 in capabilities is
usually 0.

Besides fixing the bug in vesafb, this commit introduces a helper that
reads the correct bit from screen_info.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 5e8ddcbe86 ("Video mode probing support for the new x86 setup code")
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: <stable@vger.kernel.org> # v2.6.23+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-11 12:47:16 +02:00
..
backlight pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
console drm: fix up fbdev Kconfig defaults 2023-09-18 10:52:55 +02:00
fbdev fbdev: vesafb: Detect VGA compatibility from screen info's VESA attributes 2024-08-11 12:47:16 +02:00
logo video: logo: Drop full path of the input filename in generated file 2024-08-03 08:54:32 +02:00
aperture.c video/aperture: Provide a VGA helper for gma500 and internal use 2023-04-16 14:18:10 +02:00
cmdline.c fbdev: Handle video= parameter in video/cmdline.c 2023-02-20 14:56:48 +01:00
display_timing.c
hdmi.c
Kconfig video: Add helpers for decoding screen_info 2024-08-11 12:47:15 +02:00
Makefile video: Provide screen_info_get_pci_dev() to find screen_info's PCI device 2024-08-11 12:47:15 +02:00
nomodeset.c
of_display_timing.c
of_videomode.c
screen_info_generic.c video: Add helpers for decoding screen_info 2024-08-11 12:47:15 +02:00
screen_info_pci.c firmware/sysfb: Update screen_info for relocated EFI framebuffers 2024-08-11 12:47:16 +02:00
sticore.c sticon/parisc: Fix STI console on 64-bit only machines 2023-06-30 17:14:14 +02:00
vgastate.c
videomode.c