summaryrefslogtreecommitdiff
path: root/drivers/char/agp
AgeCommit message (Collapse)Author
2007-07-27intel_agp: really fix 945/965GMEZhenyu Wang
Fix some missing places to check with device id info, which should probe the device gart correctly. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-07-27agp: don't lock pagesNick Piggin
AGP should not need to lock pages. They are not protecting any race because there is no lock_page calls, only SetPageLocked. This is causing hangs with d00806b183152af6d24f46f0c33f14162ca1262a. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-07-27Fix "use after free" / "double free" bug in ati_create_gatt_pages / ↵Jesper Juhl
ati_free_gatt_pages Hi, Coverity spotted a "use after free" bug in drivers/char/agp/ati-agp.c::ati_create_gatt_pages(). The same one that was in drivers/char/agp/amd-k7-agp.c::amd_create_gatt_pages() The problem is this: If "entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL);" fails, then there's a loop in the function to free all entries allocated so far and break out of the allocation loop. That in itself is pretty sane, but then the (now freed) 'tables' is assigned to ati_generic_private.gatt_pages and 'retval' is set to -ENOMEM which causes ati_free_gatt_pages(); to be called at the end of the function. The problem with this is that ati_free_gatt_pages() will then loop 'ati_generic_private.num_tables' times and try to free each entry in tables[] - this is bad since tables has already been freed and furthermore it will call kfree(tables) at the end - a double free. This patch removes the freeing loop in ati_create_gatt_pages() and instead relies entirely on the call to ati_free_gatt_pages() to free everything we allocated in case of an error. It also sets ati_generic_private.num_tables to the actual number of entries allocated instead of just using the value passed in from the caller - this ensures that ati_free_gatt_pages() will only attempt to free stuff that was actually allocated. Note: I'm in no way intimate with this code and I have no way to actually test this patch (besides compile test it), so while I've tried to be careful in reading the code and make sure the patch does the right thing an ACK from someone who actually knows the code in-depth would be very much appreciated. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-12Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgartLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart: [AGPGART] Hand off AGP maintainence.
2007-07-11PCI: Change all drivers to use pci_device->revisionAuke Kok
Instead of all drivers reading pci config space to get the revision ID, they can now use the pci_device->revision member. This exposes some issues where drivers where reading a word or a dword for the revision number, and adding useless error-handling around the read. Some drivers even just read it for no purpose of all. In devices where the revision ID is being copied over and used in what appears to be the equivalent of hotpath, I have left the copy code and the cached copy as not to influence the driver's performance. Compile tested with make all{yes,mod}config on x86_64 and i386. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-09[AGPGART] Hand off AGP maintainence.Dave Jones
Most of the AGP changes recently have been done in lock-step with DRM updates, so it's probably easier to have airlied pushing AGP changes at the same time he does DRM updates. [Also remove my name from the boot messages. Cautionary tale to others: Never do this, when computers don't boot, people assume you're responsible even if 15 other subsystems initialised after yours. :-) ] Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-06-21[AGPGART] intel_agp: don't load if no IGD and AGP portWang Zhenyu
After i915 chip, GMCH has no AGP port. Origin bridge driver in device table will try to access illegal regs like APBASE, APSIZE, etc. This may cause problem. So mark them as NULL in the table, we won't load if no IGD got detect and bridge has no AGP port. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-14Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgartLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart: [AGPGART] intel_agp: fix device probe
2007-06-14[AGPGART] intel_agp: fix device probeWang Zhenyu
This patch trys to fix device probe in two cases. First we should correctly detect device if integrated graphics device is not enabled or exists, like an add-in card is plugged. Second on some type of intel GMCH, it might have multiple graphic chip models, like 945GME case, so we should be sure the detect works through the whole table. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-11Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgartLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart: [AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsets [AGPGART] intel_agp: add support for 945GME [AGPGART] intel_agp: add support for 965GME/GLE [AGPGART] intel_agp: use table for device probe [AGPGART] intel_agp: cleanup intel private data
2007-06-06[AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsetsWang Zhenyu
This patch adds pci ids for G33, Q33 and Q35 chips, and update with new GTT size and stolen mem size detect method on these chips. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-06[AGPGART] intel_agp: add support for 945GMEWang Zhenyu
Add pci id info for 945GME. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-06[AGPGART] intel_agp: add support for 965GME/GLEWang Zhenyu
Add pci id info for 965GME/GLE support. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-06[AGPGART] intel_agp: use table for device probeWang Zhenyu
Fixed issues noted by Christoph Hellwig, and I changed device table scan a bit to allow the case that some models of graphics chips may have same host bridge type. This type of chip will be added in the future. This patch cleans up device probe function. Eric Anholt was the original author. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-06[AGPGART] intel_agp: cleanup intel private dataWang Zhenyu
Remove volatile type declare for IO mem variables. A single private gart data is used by all drivers, this makes it clean. Eric Anholt wrote the original patch. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-05-21Detach sched.h from mm.hAlexey Dobriyan
First thing mm.h does is including sched.h solely for can_do_mlock() inline function which has "current" dereference inside. By dealing with can_do_mlock() mm.h can be detached from sched.h which is good. See below, why. This patch a) removes unconditional inclusion of sched.h from mm.h b) makes can_do_mlock() normal function in mm/mlock.c c) exports can_do_mlock() to not break compilation d) adds sched.h inclusions back to files that were getting it indirectly. e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were getting them indirectly Net result is: a) mm.h users would get less code to open, read, preprocess, parse, ... if they don't need sched.h b) sched.h stops being dependency for significant number of files: on x86_64 allmodconfig touching sched.h results in recompile of 4083 files, after patch it's only 3744 (-8.3%). Cross-compile tested on all arm defconfigs, all mips defconfigs, all powerpc defconfigs, alpha alpha-up arm i386 i386-up i386-defconfig i386-allnoconfig ia64 ia64-up m68k mips parisc parisc-up powerpc powerpc-up s390 s390-up sparc sparc-up sparc64 sparc64-up um-x86_64 x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig as well as my two usual configs. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-13[AGPGART] Fix wrong ID in via-agp.cGabriel Mansi
there is a wrong id in drivers/char/agp/via-agp.c #define PCI_DEVICE_ID_VIA_CX700 0x8324 It must be 0x0324 Notice that PCI_DEVICE_ID_VIA_CX700 is also used in drivers/i2c/busses/i2c-viapro.c and drivers/ide/pci/via82cxxx.c So, I think that constant must be renamed to avoid conflicting. I attached a proposed patch. Signed-off-by: Dave Jones <davej@redhat.com>
2007-05-11x86_64: off-by-two error in aperture.cAndrew Hastings
I'm using a custom BIOS to configure the northbridge GART at address 0x80000000, size 2G. Linux complains: "Aperture from northbridge cpu 0 beyond 4GB. Ignoring." I think there's an off-by-two error in arch/x86_64/kernel/aperture.c: AK: use correct types for i386 Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08Merge branch 'linux-2.6'Paul Mackerras
2007-05-05Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6Linus Torvalds
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (231 commits) [PATCH] i386: Don't delete cpu_devs data to identify different x86 types in late_initcall [PATCH] i386: type may be unused [PATCH] i386: Some additional chipset register values validation. [PATCH] i386: Add missing !X86_PAE dependincy to the 2G/2G split. [PATCH] x86-64: Don't exclude asm-offsets.c in Documentation/dontdiff [PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu [PATCH] i386: white space fixes in i387.h [PATCH] i386: Drop noisy e820 debugging printks [PATCH] x86-64: Fix allnoconfig error in genapic_flat.c [PATCH] x86-64: Shut up warnings for vfat compat ioctls on other file systems [PATCH] x86-64: Share identical video.S between i386 and x86-64 [PATCH] x86-64: Remove CONFIG_REORDER [PATCH] x86-64: Print type and size correctly for unknown compat ioctls [PATCH] i386: Remove copy_*_user BUG_ONs for (size < 0) [PATCH] i386: Little cleanups in smpboot.c [PATCH] x86-64: Don't enable NUMA for a single node in K8 NUMA scanning [PATCH] x86: Use RDTSCP for synchronous get_cycles if possible [PATCH] i386: Add X86_FEATURE_RDTSCP [PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386 [PATCH] i386: Implement alternative_io for i386 ... Fix up trivial conflict in include/linux/highmem.h manually. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-04Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6Linus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (59 commits) PCI: Free resource files in error path of pci_create_sysfs_dev_files() pci-quirks: disable MSI on RS400-200 and RS480 PCI hotplug: Use menuconfig objects PCI: ZT5550 CPCI Hotplug driver fix PCI: rpaphp: Remove semaphores PCI: rpaphp: Ensure more pcibios_add/pcibios_remove symmetry PCI: rpaphp: Use pcibios_remove_pci_devices() symmetrically PCI: rpaphp: Document is_php_dn() PCI: rpaphp: Document find_php_slot() PCI: rpaphp: Rename rpaphp_register_pci_slot() to rpaphp_enable_slot() PCI: rpaphp: refactor tail call to rpaphp_register_slot() PCI: rpaphp: remove rpaphp_set_attention_status() PCI: rpaphp: remove print_slot_pci_funcs() PCI: rpaphp: Remove setup_pci_slot() PCI: rpaphp: remove a call that does nothing but a pointer lookup PCI: rpaphp: Remove another wrappered function PCI: rpaphp: Remve another call that is a wrapper PCI: rpaphp: remove a function that does nothing but wrap debug printks PCI: rpaphp: Remove un-needed goto PCI: rpaphp: Fix a memleak; slot->location string was never freed ...
2007-05-02PCI: Convert to alloc_pci_dev()Michael Ellerman
Convert code that allocs a struct pci_dev to use alloc_pci_dev(). Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-05-02[PATCH] x86: fix amd64-agp aperture validationJan Beulich
Under CONFIG_DISCONTIGMEM, assuming that a !pfn_valid() implies all subsequent pfn-s are also invalid is wrong. Thus replace this by explicitly checking against the E820 map. AK: make e820 on x86-64 not initdata Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andi Kleen <ak@suse.de> Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
2007-05-02[POWERPC] Rename get_property to of_get_property: driversStephen Rothwell
These are all the remaining instances of get_property. Simple rename of get_property to of_get_property. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-04-26[AGPGART] sworks-agp: Switch to PCI ref counting APIsAlan Cox
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] Nvidia AGP: Use refcount aware PCI interfacesAlan Cox
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] Fix sparse warning in sgi-agp.cDave Jones
drivers/char/agp/sgi-agp.c:51:10: warning: Using plain integer as NULL pointer Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] Intel-agp adjustmentsJan Beulich
Fix a call to __free_page where __free_pages(, 2) was meant, and do proper error path handling. Also remove a redundant conditional. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] Move [un]map_page_into_agp into asm/agp.hJan Beulich
Remove an arch-dependent hunk in favor of #define-ing the respective bits in asm-<arch>/agp.h (allowing easier overriding in para-virtualized environments). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] Add missing calls to global_flush_tlb() to ali-agpJan Beulich
add missing calls to global_flush_tlb(). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[AGPGART] prevent probe collision of sis-agp and amd64_agpOliver Neukum
For some vendor/id pairs the kernel will autoload both the sis-agp and the amd64_agp modules as the sis-agp module will load for all sis devices. This collision causes the bug reported in: http://bugzilla.novell.com/show_bug.cgi?id=248665 As currently sis_probe does its own matching, requesting the whole range gains nothing. The clean fix seems to me to leave the matching to the core and advertise only the devices actually supported. This patch does so. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-09[AGPGART] intel_agp: fix G965 GTT size detectWang Zhenyu
On G965, I810_PGETBL_CTL is a mmio offset, but we wrongly take it as pci config space offset in detecting GTT size. This one line patch fixs this. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-08[AGPGART] intel_agp: PCI id update for Intel 965GMWang Zhenyu
Update PCI id info for Intel 965GM chipset. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-27[AGPGART] fix compile errorsRyusuke Konishi
This fixes the following compile failures of agpgart drivers. These errors were inserted by the recent AGPGART constification patch. drivers/char/agp/uninorth-agp.c:492: error: expected '{' before 'const' drivers/char/agp/uninorth-agp.c:517: error: expected '{' before 'const' drivers/char/agp/uninorth-agp.c: In function 'agp_uninorth_probe': drivers/char/agp/uninorth-agp.c:634: error: 'u3_agp_driver' undeclared (first use in this function) drivers/char/agp/uninorth-agp.c:634: error: (Each undeclared identifier is reported only once drivers/char/agp/uninorth-agp.c:634: error: for each function it appears in.) drivers/char/agp/uninorth-agp.c:636: error: 'uninorth_agp_driver' undeclared (first use in this function) Signed-off-by: Ryusuke Konishi <ryusuke@osrg.net> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-26[PARISC] parisc-agp: Fix thinko const-ifyingKyle McMartin
Can't really blame davej for mucking this up... static-ify it while we're at it, which would have prevented this... Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
2007-02-26Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6Linus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (78 commits) [PARISC] Use symbolic last syscall in __NR_Linux_syscalls [PARISC] Add missing statfs64 and fstatfs64 syscalls Revert "[PARISC] Optimize TLB flush on SMP systems" [PARISC] Compat signal fixes for 64-bit parisc [PARISC] Reorder syscalls to match unistd.h Revert "[PATCH] make kernel/signal.c:kill_proc_info() static" [PARISC] fix sys_rt_sigqueueinfo [PARISC] fix section mismatch warnings in harmony sound driver [PARISC] do not export get_register/set_register [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code [PARISC] convert to use CONFIG_64BIT instead of __LP64__ [PARISC] use CONFIG_64BIT instead of __LP64__ [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro [PARISC] more ENTRY(), ENDPROC(), END() conversions [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc [PARISC] Fixes /proc/cpuinfo cache output on B160L [PARISC] implement standard ENTRY(), END() and ENDPROC() [PARISC] kill ENTRY_SYS_CPUS [PARISC] clean up debugging printks in smp.c [PARISC] factor syscall_restart code out of do_signal ... Fix conflict in include/linux/sched.h due to kill_proc_info() being made publicly available to PARISC again.
2007-02-22[AGPGART] Further constification.Dave Jones
Make agp_bridge_driver->aperture_sizes and ->masks const. Also agp_bridge_data->driver Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-20[AGPGART] Fix modular agpgart ia64 allmodconfigZwane Mwaikambo
My previous compat AGP patch broke modular AGPGART. Test built on; i386 CONFIG_AGP=y,m x86_64 CONFIG_AGP=y ia64 CONFIG_AGP=m Signed-off-by: Zwane Mwaikambo <zwane@infradead.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-17Merge branch 'parisc' from /home/kyle/repos/parisc-2.6.gitKyle McMartin
Conflicts: arch/parisc/hpux/sys_hpux.c arch/parisc/mm/ioremap.c
2007-02-10[AGPGART] allow drm populated agp memory types cleanupsAndrew Morton
Fix whitespace, braces, use kzalloc(). Cc: Dave Airlie <airlied@linux.ie> Cc: Thomas Hellstrom <thomas@tungstengraphics.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-06[AGPGART] intel-agp: Use ARRAY_SIZE macro when appropriateAhmed S. Darwish
use ARRAY_SIZE macro already defined in kernel.h Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-05[AGPGART] Add agp-type-to-mask-type method missing from some drivers.Thomas Hellstrom
Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-04[AGPGART] Don't try to remap i810 registers on resume.Dave Jones
We don't unmap them on the suspend path, so on resume trying to remap will fail, and then result in an oops the next time something tries to access them. Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-03[AGPGART] Allow drm-populated agp memory typesThomas Hellstrom
This patch allows drm to populate an agpgart structure with pages of its own. It's needed for the new drm memory manager which dynamically flips pages in and out of AGP. The patch modifies the generic functions as well as the intel agp driver. The intel drm driver is currently the only one supporting the new memory manager. Other agp drivers may need some minor fixing up once they have a corresponding memory manager enabled drm driver. AGP memory types >= AGP_USER_TYPES are not populated by the agpgart driver, but the drm is expected to do that, as well as taking care of cache- and tlb flushing when needed. It's not possible to request these types from user space using agpgart ioctls. The Intel driver also gets a new memory type for pages that can be bound cached to the intel GTT. Signed-off-by: Thomas Hellstrom <thomas@tungstengraphics.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-03[AGPGART] compat ioctlZwane Mwaikambo
The following video card requires the agpgart driver ioctl interface in order to detect video memory. 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03) Tested on a Thinkpad Z61t, Xorg.0.log from a 32bit debian Xorg is at; http://montezuma.homeunix.net/Xorg.0.log Signed-off-by: Zwane Mwaikambo <zwane@infradead.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-28[AGPGART] Add new IDs to VIA AGP.Dave Jones
Culled from the VIA codedrop. Also fixes up one ID used in amd64-agp to use the VIA part number instead of the board name in its ID. Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-28[AGPGART] Remove pointless assignment.Dave Jones
No point in clearing local pointers then returning. Also fix up some CodingStyle nits. Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-28[AGPGART] Remove pointless typedef in ati-agpDave Jones
This seems to exist just to save people typing 'struct' a few times, and doesn't provide any additional value. Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-28[AGPGART] Prevent (unlikely) memory leak in amd_create_gatt_pages()Dave Jones
If we fail an alloc, unwind the previous allocs that succeeded. Spotted-by: Alan Grimes <agrimes@speakeasy.net> Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-17[AGPGART] intel_agp: restore graphics device's pci space early in resumeWang Zhenyu
Currently in resuming path graphics device's pci space restore is behind host bridge, so resume function wrongly accesses graphics device's space. This makes resuming failure which crashed X. here's a patch to restore device's pci space early, which makes resuming ok with X. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>