linux/drivers/video
Mikulas Patocka 6249665890 tgafb: fix mode setting with fbset
Mode setting in the TGA driver is broken for these reasons:

- info->fix.line_length is set just once in tgafb_init_fix function. If
  we change videomode, info->fix.line_length is not recalculated - so
  the video mode is changed but the screen is corrupted because of wrong
  info->fix.line_length.

- info->fix.smem_len is set in tgafb_init_fix to the size of the default
  video mode (640x480). If we set a higher resolution,
  info->fix.smem_len is smaller than the current screen size, preventing
  the userspace program from mapping the framebuffer.

This patch fixes it:

- info->fix.line_length initialization is moved to tgafb_set_par so that
  it is recalculated with each mode change.

- info->fix.smem_len is set to a fixed value representing the real
  amount of video ram (the values are taken from xfree86 driver).

- add a check to tgafb_check_var to prevent us from setting a videomode
  that doesn't fit into videoram.

- in tgafb_register, tgafb_init_fix is moved upwards, to be called
  before fb_find_mode (because fb_find_mode already needs the videoram
  size set in tgafb_init_fix).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vga.kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-02-11 15:01:04 +02:00
..
aty mach64: fix cursor when character width is not a multiple of 8 pixels 2014-02-11 15:01:04 +02:00
backlight drivers/video/backlight/lcd.c: call put_device if device_register fails 2014-01-30 16:56:54 -08:00
console fbcon: Clean up fbcon data in fb_info on FB_EVENT_FB_UNBIND with 0 fbs 2014-02-11 14:16:22 +02:00
exynos ARM: SoC fixes for 3.13 merge window 2013-11-16 12:45:55 -08:00
geode framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
i810 i810: delete useless variable 2014-01-17 10:57:50 +02:00
intelfb video: intelfb: remove unnecessary pci_set_drvdata() 2013-09-19 13:30:07 +03:00
kyro video: kyro: fix incorrect sizes when copying to userspace 2013-11-26 16:40:14 +02:00
logo video/logo: Remove MIPS-specific include section 2014-01-17 10:57:49 +02:00
matrox matroxfb: restore the registers M_ACCESS and M_PITCH 2014-02-11 15:01:04 +02:00
mb862xx video: mb862xx: Remove redundant dev_set_drvdata 2013-09-26 13:49:09 +03:00
mbx framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
mmp video: mmp: Using plain integer as NULL pointer 2014-01-17 10:57:48 +02:00
msm ARM: msm: Move mach/board.h contents to common.h 2013-08-06 11:18:02 -07:00
nvidia video: nvidiafb: remove unnecessary pci_set_drvdata() 2014-01-17 10:57:39 +02:00
omap video: omapfb: use dev_get_platdata() 2013-09-20 12:22:01 +03:00
omap2 Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
riva video: rivafb: remove unnecessary pci_set_drvdata() 2014-01-17 10:57:39 +02:00
savage video: savagefb: remove unnecessary pci_set_drvdata() 2013-09-19 13:30:09 +03:00
sis fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
vermilion video: vmlfb: remove unnecessary pci_set_drvdata() 2014-01-17 10:57:40 +02:00
via viafb: rename display_timing to via_display_timing 2013-01-24 08:59:44 +01:00
68328fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
acornfb.c drivers/video/acornfb.c: use __free_reserved_page() to simplify the code 2013-11-13 12:09:03 +09:00
acornfb.h drivers/video/acornfb.c: remove dead code 2013-09-11 15:56:22 -07:00
amba-clcd.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
amifb.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00
arcfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
arkfb.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
asiliantfb.c video: asiliantfb: remove unnecessary pci_set_drvdata() 2014-01-17 10:57:38 +02:00
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h
atafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
atafb.h
atmel_lcdfb.c atmel_lcdfb: fix module autoload 2013-12-04 10:48:12 +02:00
au1100fb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
au1100fb.h
au1200fb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
au1200fb.h
auo_k190x.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-04-30 09:36:50 -07:00
auo_k190x.h
auo_k1900fb.c AUO-K190x: add runtime-pm calls to controller init functions 2013-04-04 13:08:06 +03:00
auo_k1901fb.c AUO-K190x: add runtime-pm calls to controller init functions 2013-04-04 13:08:06 +03:00
bf54x-lq043fb.c Video / bf54x-lq043fb: Use module_platform_driver() to simplify code 2013-09-30 10:51:09 +03:00
bf537-lq035.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bfin_adv7393fb.c procfs: new helper - PDE_DATA(inode) 2013-04-09 14:13:32 -04:00
bfin_adv7393fb.h
bfin-lq035q1-fb.c fbdev: bfin-lq035q1-fb: Use dev_pm_ops 2013-06-26 16:16:26 +03:00
bfin-t350mcqb-fb.c Video / bfin-t350mcqb-fb: Use module_platform_driver() to simplify code 2013-09-30 10:51:08 +03:00
broadsheetfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
bt431.h
bt455.h
bw2.c video: bw2: Remove redundant dev_set_drvdata 2013-09-26 13:49:22 +03:00
c2p_core.h
c2p_iplan2.c
c2p_planar.c
c2p.h
carminefb_regs.h
carminefb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
carminefb.h
cfbcopyarea.c framebuffer: fix cfb_copyarea 2014-02-11 15:01:04 +02:00
cfbfillrect.c
cfbimgblt.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
cg3.c video: cg3: Remove redundant dev_set_drvdata 2013-09-26 13:49:23 +03:00
cg6.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
cg14.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
chipsfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
cirrusfb.c zorro: ZTWO_VADDR() should return "void __iomem *" 2013-11-26 11:09:07 +01:00
clps711xfb.c ARM defconfigs: add missing inclusions of linux/platform_device.h 2013-02-14 15:14:32 -08:00
cobalt_lcdfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
controlfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
controlfb.h
cyber2000fb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
cyber2000fb.h
da8xx-fb.c video: da8xx-fb: remove unwanted define 2013-10-30 13:36:48 +02:00
display_timing.c video: add display_timing and videomode 2013-01-24 09:03:04 +01:00
dnfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
edid.h
efifb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
ep93xx-fb.c video: ep93xx-fb: use dev_get_platdata() 2013-09-20 12:22:02 +03:00
fb_ddc.c
fb_defio.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fb_draw.h
fb_notify.c
fb_sys_fops.c
fb-puv3.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
fbcmap.c drivers: video: fbcmap: remove the redundency and incorrect checkings 2013-08-30 11:41:24 +03:00
fbcvt.c
fbmem.c Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-01-29 20:49:12 -08:00
fbmon.c Merge branch '3.10/fb-mmap' into for-next 2013-04-26 09:14:47 +03:00
fbsysfs.c fb: reorder the lock sequence to fix potential dead lock 2013-11-11 15:52:59 +02:00
ffb.c video: ffb: Remove redundant dev_set_drvdata 2013-09-26 13:49:24 +03:00
fm2fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
fsl-diu-fb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
g364fb.c
gbefb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
goldfishfb.c treewide: Fix typos in printk 2013-03-20 16:26:32 +01:00
grvga.c video: grvga: Remove redundant dev_set_drvdata 2013-09-26 13:49:07 +03:00
gxt4500.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
hdmi.c video/hdmi: Rename HDMI_IDENTIFIER to HDMI_IEEE_OUI 2013-08-30 08:42:01 +10:00
hecubafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
hgafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
hitfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
hpfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
hyperv_fb.c hyperv-fb: add blanking support 2013-10-09 12:52:50 +03:00
i740_reg.h
i740fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
igafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
imsttfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
imxfb.c video: imxfb: use dev_get_platdata() 2013-09-20 12:22:03 +03:00
jz4740_fb.c Video / jz4740_fb: Use module_platform_driver() to simplify code 2013-09-30 10:51:09 +03:00
Kconfig video: add OpenCores VGA/LCD framebuffer driver 2014-01-17 10:57:49 +02:00
leo.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
macfb.c m68k: Remove superfluous inclusions of <asm/bootinfo.h> 2013-11-26 11:09:22 +01:00
macmodes.c
macmodes.h
Makefile video: add OpenCores VGA/LCD framebuffer driver 2014-01-17 10:57:49 +02:00
maxinefb.c
metronomefb.c fbdev: fix error return code in metronomefb_probe() 2013-10-29 12:20:11 +02:00
modedb.c
mx3fb.c video: mx3fb: Allow blocking during framebuffer allocation 2014-01-17 10:57:44 +02:00
mxsfb.c video: mxsfb: fix broken videomode selection 2014-01-17 10:57:41 +02:00
n411.c
neofb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
nuc900fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
nuc900fb.h
ocfb.c video: add OpenCores VGA/LCD framebuffer driver 2014-01-17 10:57:49 +02:00
of_display_timing.c video: of: display_timing: correct display-timings node finding 2013-09-26 12:31:42 +03:00
of_videomode.c videomode: videomode_from_timing work 2013-03-21 14:34:33 +02:00
offb.c offb: Add palette hack for little endian 2013-12-10 11:25:07 +11:00
output.c video: output: convert class code to use dev_groups 2013-07-26 10:37:02 +03:00
p9100.c video: p9100: Remove redundant dev_set_drvdata 2013-09-26 13:49:25 +03:00
platinumfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
platinumfb.h
pm2fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
pm3fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
pmag-aa-fb.c
pmag-ba-fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
pmagb-b-fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
ps3fb.c fbdev/ps3fb: Fix section mismatch warning for ps3fb_probe 2013-09-11 11:39:39 +10:00
pvr2fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
pxa3xx-gcu.c Various fbdev changes for 3.11 2013-07-09 15:51:32 -07:00
pxa3xx-gcu.h
pxa168fb.c video: pxa168fb: use dev_get_platdata() 2013-09-20 12:22:01 +03:00
pxa168fb.h
pxafb.c video: pxafb: use dev_get_platdata() 2013-09-20 12:22:02 +03:00
pxafb.h
q40fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
s1d13xxxfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
s3c2410fb.c video: s3c2410: use dev_get_platdata() 2013-09-20 12:22:02 +03:00
s3c2410fb.h
s3c-fb.c video: s3c-fb: use dev_get_platdata() 2013-09-20 12:23:21 +03:00
s3fb.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
sa1100fb.c video: sa1100fb: use dev_get_platdata() 2013-09-20 12:22:02 +03:00
sa1100fb.h
sbuslib.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
sbuslib.h
sgivwfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
sh7760fb.c video: sh7760fb: fix to pass correct device identity to free_irq() 2013-07-29 11:25:03 +03:00
sh_mipi_dsi.c video: remove unnecessary platform_set_drvdata() 2013-06-26 14:44:40 +03:00
sh_mobile_hdmi.c fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare 2013-11-11 15:32:58 +02:00
sh_mobile_lcdcfb.c fbdev: sh_mobile_lcdcfb: Don't use plain 0 as NULL pointer 2014-01-17 10:57:38 +02:00
sh_mobile_lcdcfb.h fbdev: sh_mobile_lcdc: Store the backlight brightness internally 2012-11-21 15:50:01 +01:00
sh_mobile_meram.c fbdev: sh_mobile_meram: Fix defined but not used compiler warnings 2013-11-26 16:59:42 +02:00
simplefb.c simplefb: use write-combined remapping 2013-10-30 12:49:02 +02:00
skeletonfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
sm501fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
smscufx.c video: smscufx: Use NULL instead of 0 2013-09-26 11:50:08 +03:00
ssd1307fb.c video: ssd1307fb: Remove redundant of_match_ptr 2013-10-09 12:35:44 +03:00
sstfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
sticore.h parisc: sticon - unbreak on 64bit kernel 2013-11-07 22:46:20 +01:00
stifb.c fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
sunxvr500.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sunxvr1000.c video: sunxvr1000: Remove redundant dev_set_drvdata 2013-09-26 13:49:26 +03:00
sunxvr2500.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
svgalib.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
syscopyarea.c
sysfillrect.c
sysimgblt.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
tcx.c video: Remove unnecessary semicolons 2013-10-30 13:34:52 +02:00
tdfxfb.c video: tdfxfb: remove unnecessary pci_set_drvdata() 2013-09-19 13:30:10 +03:00
tgafb.c tgafb: fix mode setting with fbset 2014-02-11 15:01:04 +02:00
tmiofb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
tridentfb.c video: tridentfb: remove unnecessary pci_set_drvdata() 2013-09-19 13:30:10 +03:00
udlfb.c treewide: Fix typos in printk 2013-12-19 15:10:49 +01:00
uvesafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
valkyriefb.c m68k: Remove superfluous inclusions of <asm/bootinfo.h> 2013-11-26 11:09:22 +01:00
valkyriefb.h
vesafb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
vfb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
vga16fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
vgastate.c
videomode.c videomode: videomode_from_timing work 2013-03-21 14:34:33 +02:00
vt8500lcdfb.c video: vt8500: fix error handling in probe() 2013-12-04 10:50:16 +02:00
vt8500lcdfb.h
vt8623fb.c PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2013-12-21 10:06:10 -07:00
w100fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
w100fb.h
wm8505fb_regs.h
wm8505fb.c framebuffer: Use fb_<level> 2013-10-29 12:53:07 +02:00
wmt_ge_rops.c video: wmt_ge_rops: Fix a trivial typo 2013-10-09 12:35:46 +03:00
wmt_ge_rops.h video: vt8500: Make wmt_ge_rops optional 2013-04-04 13:07:33 +03:00
xen-fbfront.c xen/fb: allow xenfb initialization for hvm guests 2014-01-07 09:59:54 -05:00
xilinxfb.c video: xilinxfb: Fix for "Use standard variable name convention" 2013-10-29 10:49:40 +02:00