linux/drivers/video/fbdev
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>
History 2024-08-11 12:47:16 +02:00
..
aty fbdev: atyfb: only use ioremap_uc() on i386 and ia64 2023-09-23 20:50:29 +02:00
core drm/omapdrm: Fix console with deferred ops 2024-06-12 11:11:56 +02:00
geode fbdev/geode/lxfb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
i810 fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
intelfb fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
kyro Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
matrox fbdev: Remove FBINFO_FLAG_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:39 +02:00
mb862xx Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
mmp fbdev: mmp: Annotate struct mmphw_ctrl with __counted_by 2023-09-23 20:35:14 +02:00
nvidia fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
omap fbdev: omapfb: fix some error codes 2023-10-16 23:04:26 +02:00
omap2 Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
riva fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
savage fbdev: savage: Handle err return when savagefb_check_var failed 2024-06-16 13:47:37 +02:00
sis fbdev: sisfb: hide unused variables 2024-06-12 11:12:00 +02:00
vermilion fbdev: Remove FBINFO_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:38 +02:00
via fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 2024-04-13 13:07:39 +02:00
68328fb.c fbdev: Remove FBINFO_DEFAULT from static structs 2023-07-24 16:50:38 +02:00
acornfb.c fbdev/acornfb: Fix name of fb_ops initializer macro 2024-01-25 15:35:45 -08:00
acornfb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
amba-clcd.c fbdev: Remove FBINFO_FLAG_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:39 +02:00
amifb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
arcfb.c fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
arkfb.c fbdev: Add support for the nomodeset kernel parameter 2022-11-16 13:26:25 +01:00
asiliantfb.c fbdev/asiliantfb: Use fbdev I/O helpers 2023-08-04 15:54:34 +02:00
atafb.c fbdev/atafb: Remove flag FBINFO_FLAG_DEFAULT 2023-07-24 16:50:39 +02:00
atafb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atafb_iplan2p2.c fbdev: atafb: Remove obsolete module support 2019-04-01 17:46:55 +02:00
atafb_iplan2p4.c fbdev: atafb: Remove obsolete module support 2019-04-01 17:46:55 +02:00
atafb_iplan2p8.c fbdev: atafb: Remove obsolete module support 2019-04-01 17:46:55 +02:00
atafb_mfb.c fbdev: atafb: Remove obsolete module support 2019-04-01 17:46:55 +02:00
atafb_utils.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel_lcdfb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
au1100fb.c fbdev: au1100fb: Convert to platform remove callback returning void 2023-05-30 18:33:25 +02:00
au1100fb.h video: fbdev: au1100fb: Spelling s/palette/palette/ 2022-02-16 10:54:42 +01:00
au1200fb.c fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe 2023-07-20 07:52:54 +02:00
au1200fb.h fbdev: au1200fb: delete duplicate header contents 2018-01-04 16:53:49 +01:00
broadsheetfb.c fbdev: Align deferred I/O with naming of helpers 2023-07-31 20:07:24 +02:00
bt431.h video: fbdev: bt431: Correct cursor format control macro 2016-02-26 13:06:11 +02:00
bt455.h video: fbdev: pmag-ba-fb: Optimize Bt455 colormap addressing 2016-02-26 13:06:11 +02:00
bw2.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
c2p.h video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
c2p_core.h fbdev: c2p: Use BUILD_BUG() instead of custom solution 2020-03-09 11:12:19 +01:00
c2p_iplan2.c video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
c2p_planar.c video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
carminefb.c fbdev/carminefb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
carminefb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
carminefb_regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cg3.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
cg6.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
cg14.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
chipsfb.c fbdev/chipsfb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
cirrusfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
clps711x-fb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
cobalt_lcdfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
controlfb.c fbdev: Remove FBINFO_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:38 +02:00
controlfb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cyber2000fb.c fbdev: Remove FBINFO_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:38 +02:00
cyber2000fb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
da8xx-fb.c fbdev/da8xx-fb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
dnfb.c video: fbdev: Make *fb_setup() and *fb_init() static 2022-07-18 07:54:20 +02:00
edid.h video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
efifb.c fbdev/efifb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
ep93xx-fb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
ffb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
fm2fb.c fbdev/fm2fb: Use fbdev I/O helpers 2023-08-04 15:54:35 +02:00
fsl-diu-fb.c fbdev: fsl-diu-fb: mark wr_reg_wa() static 2023-11-20 11:59:38 +01:00
g364fb.c fbdev/g364fb: fix build failure with mips 2023-09-02 08:18:40 -07:00
gbefb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
goldfishfb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
grvga.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
gxt4500.c fbdev/gxt4500: Use fbdev I/O helpers 2023-08-04 15:54:36 +02:00
hecubafb.c fbdev: Align deferred I/O with naming of helpers 2023-07-31 20:07:24 +02:00
hgafb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
hitfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
hpfb.c fbdev: Remove FBINFO_DEFAULT from static structs 2023-07-24 16:50:38 +02:00
hyperv_fb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
i740_reg.h video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
i740fb.c fbdev/i740fb: Use fbdev I/O helpers 2023-08-04 15:54:36 +02:00
imsttfb.c fbdev: imsttfb: fix a resource leak in probe 2023-11-20 11:59:38 +01:00
imxfb.c fbdev: imxfb: fix left margin setting 2024-01-25 15:35:40 -08:00
Kconfig fbdev: sh7760fb: allow modular build 2024-06-12 11:12:02 +02:00
leo.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
macfb.c fbdev/macfb: Use fbdev I/O helpers 2023-08-04 15:54:36 +02:00
macmodes.c video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
macmodes.h video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
Makefile fbdev: mx3fb: Remove the driver 2023-08-31 22:58:25 +02:00
maxinefb.c fbdev/maxinefb: Use fbdev I/O helpers 2023-08-04 15:54:36 +02:00
metronomefb.c fbdev: Align deferred I/O with naming of helpers 2023-07-31 20:07:24 +02:00
n411.c Annotate hardware config module parameters in drivers/video/ 2017-04-20 12:02:32 +01:00
neofb.c fbdev: neofb: Shorten Neomagic product name in info struct 2023-09-01 00:29:33 +02:00
ocfb.c fbdev/ocfb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
offb.c fbdev/offb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
p9100.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
platinumfb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
platinumfb.h video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00
pm2fb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
pm3fb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
pmag-aa-fb.c fbdev/pmag-aa-fb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
pmag-ba-fb.c fbdev/pmag-ba-fb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
pmagb-b-fb.c fbdev/pmagb-b-fb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
ps3fb.c fbdev/ps3fb: Build without kernel device 2023-08-03 16:08:14 +02:00
pvr2fb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
pxa3xx-gcu.c fbdev: pxa3xx-gcu: Convert to platform remove callback returning void 2023-04-24 11:48:31 +02:00
pxa3xx-gcu.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxa3xx-regs.h ARM: pxa: move regs-lcd.h into driver 2022-04-19 16:29:03 +02:00
pxa168fb.c fbdev/pxa168fb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
pxa168fb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pxafb.c fbdev/pxafb: Use fbdev I/O helpers 2023-08-04 15:54:37 +02:00
pxafb.h video: pxafb: Remove cpufreq policy notifier 2019-08-26 10:02:02 +02:00
q40fb.c fbdev/q40fb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
s1d13xxxfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
s3c-fb.c fbdev/s3cfb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
s3fb.c fbdev: Add support for the nomodeset kernel parameter 2022-11-16 13:26:25 +01:00
sa1100fb.c fbdev: sa1100fb: mark sa1100fb_init() static 2023-10-16 23:04:27 +02:00
sa1100fb.h ARM/fbdev: sa11x0: Switch to use GPIO descriptors 2020-04-17 15:50:11 +02:00
sbuslib.c fbdev: Explicitly include correct DT includes 2023-07-20 07:56:30 +02:00
sbuslib.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sh7760fb.c fbdev/sh7760fb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
sh_mobile_lcdcfb.c fbdev: shmobile: fix snprintf truncation 2024-06-12 11:11:58 +02:00
sh_mobile_lcdcfb.h fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify 2019-06-12 20:28:11 +02:00
simplefb.c fbdev/simplefb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
skeletonfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
sm501fb.c fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
sm712.h fbdev: sm712fb: use 1024x768 by default on non-MIPS, fix garbled display 2019-04-01 17:46:59 +02:00
sm712fb.c fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
smscufx.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
ssd1307fb.c pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
sstfb.c fbdev/sstfb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
stifb.c sticon/parisc: Fix STI console on 64-bit only machines 2023-06-30 17:14:14 +02:00
sunxvr500.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
sunxvr1000.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
sunxvr2500.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
tcx.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00
tdfxfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
tgafb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
tridentfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
udlfb.c fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:38 +02:00
uvesafb.c fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit() 2023-10-16 23:19:34 +02:00
valkyriefb.c fbdev/valkyriefb: Use fbdev I/O helpers 2023-08-04 15:54:38 +02:00
valkyriefb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
vesafb.c fbdev: vesafb: Detect VGA compatibility from screen info's VESA attributes 2024-08-11 12:47:16 +02:00
vfb.c fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
vga16fb.c fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs 2023-07-24 16:50:39 +02:00
vt8500lcdfb.c fbdev: Remove FBINFO_DEFAULT from kzalloc()'ed structs 2023-07-24 16:50:38 +02:00
vt8500lcdfb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
vt8623fb.c fbdev: Add support for the nomodeset kernel parameter 2022-11-16 13:26:25 +01:00
wm8505fb.c fbdev: Remove FBINFO_DEFAULT from devm_kzalloc()'ed structs 2023-07-24 16:50:38 +02:00
wm8505fb_regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
wmt_ge_rops.c fbdev: Include <linux/io.h> in various drivers 2023-05-18 11:06:19 +02:00
wmt_ge_rops.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen-fbfront.c fbdev: Align deferred I/O with naming of helpers 2023-07-31 20:07:24 +02:00
xilinxfb.c Linux 6.5-rc7 2023-08-24 07:26:06 +10:00