aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/via
AgeCommit message (Collapse)Author
2009-05-12viafb: make it work on x86_64Harald Welte
Fix a bug in viafb on x86_64 builds (e.g. for VIA Nano CPU). You cannot make the assumption that sizeof(unsigned int) == sizeof(unsigned long), so the parsing of the default mode (640x480) fails, leading to a division by zero during insmod of the driver. Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Cc: <JosephChan@via.com.tw> Cc: <ScottFang@viatech.com.cn> Cc: Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-01viafb: returns 0 two too earlyRoel Kluin
Otherwise this will already return 0 if iteration MAXLOOP-2 occurs in the first loop. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Joseph Chan <josephchan@via.com.tw> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-03-31proc 2/2: remove struct proc_dir_entry::ownerAlexey Dobriyan
Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy as correctly noted at bug #12454. Someone can lookup entry with NULL ->owner, thus not pinning enything, and release it later resulting in module refcount underflow. We can keep ->owner and supply it at registration time like ->proc_fops and ->data. But this leaves ->owner as easy-manipulative field (just one C assignment) and somebody will forget to unpin previous/pin current module when switching ->owner. ->proc_fops is declared as "const" which should give some thoughts. ->read_proc/->write_proc were just fixed to not require ->owner for protection. rmmod'ed directories will be empty and return "." and ".." -- no harm. And directories with tricky enough readdir and lookup shouldn't be modular. We definitely don't want such modular code. Removing ->owner will also make PDE smaller. So, let's nuke it. Kudos to Jeff Layton for reminding about this, let's say, oversight. http://bugzilla.kernel.org/show_bug.cgi?id=12454 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
2009-01-06viafb: fix sparse warningsHannes Eder
Fix this sparse warnings: drivers/video/via/viafbdev.c:871:3: warning: returning void-valued expression drivers/video/via/viafbdev.c:938:3: warning: returning void-valued expression drivers/video/via/viafbdev.c:995:3: warning: returning void-valued expression Signed-off-by: Hannes Eder <hannes@hanneseder.net> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-04viafb: fix crashes due to 4k stack overflowBruno Prémont
The function viafb_cursor() uses 2 stack-variables of CURSOR_SIZE bits; CURSOR_SIZE is defined as (8 * 1024). Using up twice 1k on stack is too much for 4k-stack (though it works with 8k-stacks). Make those two variables kzalloc'ed to preserve stack space. Also merge the whole lot of local struct's in viafb_ioctl into a union so the stack usage gets minimized here as well. (struct's are only accessed in their indicidual IOCTL case) This second part is only compile-tested as I know of no userspace app using the IOCTLs. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Cc: <JosephChan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-19viafb: fix releasing of /proc/viafb/ subtreeBruno Prémont
When unloading viafb module it does not remove it's /proc/viafb/ subtree which causes multiple viafb directories to appear below proc when mobprobing viafb and also lets kernel WARN() on duplicate proc entries: [ 145.458387] WARNING: at /usr/src/linux-2.6.28-rc3-git6/fs/proc/generic.c:551 proc_register+0xe6/0x160() [ 145.458945] proc_dir_entry '/proc/viafb' already registered [ 145.459278] Modules linked in: viafb(+) i2c_algo_bit cfbcopyarea cfbimgblt cfbfillrect snd_hda_intel snd_pcm snd_timer snd soundcore snd_page_alloc sg via_agp agpgart [last unloaded: drm] [ 145.460647] Pid: 1904, comm: modprobe Tainted: G W 2.6.28-rc3-git6 #4 [ 145.461064] Call Trace: [ 145.461248] [<c01066f1>] ? dump_stack+0x1/0x80 [ 145.461533] [<c01228a3>] warn_slowpath+0x63/0x80 [ 145.461851] [<c0253ec9>] ? idr_get_empty_slot+0xe9/0x250 [ 145.462186] [<c0254120>] ? ida_get_new_above+0xf0/0x150 [ 145.462528] [<c019fb86>] proc_register+0xe6/0x160 [ 145.462827] [<c019fdc6>] proc_mkdir_mode+0x36/0x50 [ 145.463135] [<c019fdef>] proc_mkdir+0xf/0x20 [ 145.463457] [<f807173c>] viafb_init+0x73c/0xc86 [viafb] [ 145.463823] [<f8071000>] ? viafb_init+0x0/0xc86 [viafb] [ 145.464147] [<c010111d>] do_one_initcall+0x2d/0x160 [ 145.464460] [<c01a6543>] ? sysfs_add_file+0x13/0x20 [ 145.464786] [<c015f031>] ? vfree+0x21/0x30 [ 145.465049] [<c01433b5>] ? load_module+0x1215/0x1500 [ 145.465381] [<c014e455>] ? __alloc_pages_internal+0x95/0x400 [ 145.465755] [<c0143723>] sys_init_module+0x83/0x1a0 [ 145.466065] [<c016ceed>] ? sys_read+0x3d/0x70 [ 145.466354] [<c0103bc1>] sysenter_do_call+0x12/0x25 [ 145.466653] ---[ end trace c84b37826e16748c ]--- Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Cc: <JosephChan@via.com.tw> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-30viafb: removed duplicated #include'sHuang Weiyi
Removed duplicated #include's in drivers/video/via/global.h. debug.h viafbdev.h viamode.h Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Cc: Joseph Chan <josephchan@via.com.tw> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: via_utility.c, via_utility.h, vt1636.c, vt1636.hJoseph Chan
via_utility.c, via_utility.h: support user mode application with additional information vt1636.c, vt1636.h: setting for chip vt1636 Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: via_i2c.c, via_i2c.h, viamode.c, viamode.hJoseph Chan
via_i2c.c, via_i2c.h: Implement i2c specification. viamode.c, viamode.c: all support modes information. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: viafbdev.c (update)Joseph Chan
Remove the macro MMIO_OUT32, and replace it with writel() function. And replace "u32" with "unsigned long" in writel() function (original MMIO_OUT32 marco) for avoiding warning message in 64bit OS. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: viafbdev.c, viafbdev.hJoseph Chan
Correct by following Jiri Slaby's suggestions. Initialization, remove and some other important functions of viafb. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: tbl1636.c, tbl1636.h, tblDPASetting.c, tblDPASetting.hJoseph Chan
tbl1636.c, tbl1636.h: patch setting for VT1636. tblDPASetting.c, tblDPASetting.h: patch for graphic clock skew. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: Makefile, share.hJoseph Chan
Makefile for drivers/video/via/ share.h: shared macro for viafb Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: lcd.c, lcd.h, lcdtbl.hJoseph Chan
lcd.c, lcd.h: LVDS generic process. lcdtbl.h: patch register for simultaneous case. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: iface.c, iface.h, ioctl.c, ioctl.hJoseph Chan
iface.c, iface.h: support getting video memory from backdoor. ioctl.c, ioctl.h: support user mode application with additional information Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: hw.c, hw.hJoseph Chan
Display HW setting and other chips initialization. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: dvi.c, dvi.h, global.c and global.hJoseph Chan
dvi.c, dvi.h: TMDS generic process and setting. global.c, global.h: define global variabls. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: chip.h, debug.hJoseph Chan
Header file of information about via chipsets and debug function. Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16viafb: accel.c, accel.hJoseph Chan
2D and HW cursor stuff of viafb driver. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Joseph Chan <josephchan@via.com.tw> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>