summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
AgeCommit message (Collapse)AuthorFilesLines
2008-04-06fix IS_I9XX macro in i915 DRM driverJesse Barnes1-2/+2
Now that we're mapping registers in the DRM driver at load time, the driver actually checks the PCI ID, so we need to make sure the macros have all the right bits (and longer term use the DRM headers as the sole copy of the PCI & register definitions). This patch adds 945GME support to the DRM headers, fixing a regression reported in http://bugzilla.kernel.org/show_bug.cgi?id=10395. Tested-by: Alexander Oltu <alexander@all-2.com> Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-30drm: fix for non-coherent DMA PowerPCBenjamin Herrenschmidt3-6/+31
This patch fixes bits of the DRM so to make the radeon DRI work on non-cache coherent PCI DMA variants of the PowerPC processors. It moves the few places that needs change to wrappers to that other architectures with similar issues can easily add their own changes to those wrappers, at least until we have more useful generic kernel API. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-03-30drm: radeon: fix sparse integer as NULL pointer warnings in radeon_mem.cHarvey Harrison1-4/+4
drivers/char/drm/radeon_mem.c:91:23: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:116:28: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:124:28: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:177:26: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:177:53: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-03-30drm/i915: fix oops on agp=offDave Airlie1-0/+3
From Kernel BZ 10289 - not sure why anyone would boot an intel with no agp but it shouldn't crash. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-03-30drm/r300: fix bug in r300 userspace hardware wait emissionDave Airlie2-12/+54
This interface was originally designed wrong, confusing bit-fields and integers, major brown paper bag going back many years... But userspace only ever used 4 values so fix the interface for new users and fix the implementation to deal with the 4 values userspace has ever emitted (0x1, 0x2, 0x3, 0x6). Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-03-28drivers/char/drm/ati_pcigart.c: fix printk warningAndrew Morton1-2/+3
drivers/char/drm/ati_pcigart.c: In function 'drm_ati_pcigart_init': drivers/char/drm/ati_pcigart.c:125: warning: format '%08X' expects type 'unsigned int', but argument 3 has type 'dma_addr_t' Cc: Dave Airlie <airlied@linux.ie> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-17drm/ati_pcigart: fix the PCIGART to use drm_pci to allocate GART table.Dave Airlie4-69/+27
This fixes a problem on 64-bit with 4GB with ATI RS690 chipsets. It makes sure the pcigart table is allocated in coherent memory for DMA operations. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-03-17drm/radeon: fixup RV550 chip familyAlex Deucher1-3/+4
This fixes up the RV550 chips which are based on RV515, not RV530. It also adds another RS690 PCI ID. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-03-17drm/via: attempt again to stabilise the AGP DMA command submission.Thomas Hellstrom2-7/+54
It's worth remembering that all new bright ideas on how to make this command reader work properly and according to docs will probably fail :( Bring in some old code. Also allow a larger SG-DMA download stride, and remove unnecessary waits for command regulators pauses. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-03-17drm: Fix race that can lockup the kernelMike Isely2-17/+25
The i915_vblank_swap() function schedules an automatic buffer swap upon receipt of the vertical sync interrupt. Such an operation is lengthy so it can't be allowed to happen in normal interrupt context, thus the DRM implements this by scheduling the work in a kernel softirq-scheduled tasklet. In order for the buffer swap to work safely, the DRM's central lock must be taken, via a call to drm_lock_take() located in drivers/char/drm/drm_irq.c within the function drm_locked_tasklet_func(). The lock-taking logic uses a non-interrupt-blocking spinlock to implement the manipulations needed to take the lock. This semantic would be safe if all attempts to use the spinlock only happen from process context. However this buffer swap happens from softirq context which is really a form of interrupt context. Thus we have an unsafe situation, in that drm_locked_tasklet_func() can block on a spinlock already taken by a thread in process context which will never get scheduled again because of the blocked softirq tasklet. This wedges the kernel hard. To trigger this bug, run a dual-head cloned mode configuration which uses the i915 drm, then execute an opengl application which synchronizes buffer swaps against the vertical sync interrupt. In my testing, a lockup always results after running anywhere from 5 minutes to an hour and a half. I believe dual-head is needed to really trigger the problem because then the vertical sync interrupt handling is no longer predictable (due to being interrupt-sourced from two different heads running at different speeds). This raises the probability of the tasklet trying to run while the userspace DRI is doing things to the GPU (and manipulating the DRM lock). The fix is to change the relevant spinlock semantics to be the interrupt-blocking form. After this change I am no longer able to trigger the lockup; the longest test run so far was 20 hours (test stopped after that point). Note: I have examined the places where this spinlock is being employed; all are reasonably short bounded sequences and should be suitable for interrupts being blocked without impacting overall kernel interrupt response latency. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-22i915: fix AR register restore.Jesse Barnes1-0/+1
Make sure the restoration correctly restores the AR registers by flipping the ARX register into index mode before doing anything. Without this, some people have had the text mode restore all green. Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-20drm/sis: add pciid for SiS 662/671 chipsetChaoyu Chen1-0/+1
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm: add new rv380 pciidMirko1-0/+1
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm: add support for passing state into the suspend hooks.Dave Airlie3-6/+11
fix i915 driver to use state for hibernate save avoidance. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm/i915: Fix hibernate save/restore of VGA attribute regsJesse Barnes1-0/+2
In hibernate, we may end up calling the VGA save regs function twice, so we need to make sure it's idempotent. That means leaving ARX in index mode after the first save operation. Fixes hibernate on 965. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm/i915 more registers for S3 (DSPCLK_GATE_D, CACHE_MODE_0, MI_ARB_STATE)Keith Packard2-0/+28
Failing to preserve the MI_ARB_STATE register was causing FIFO underruns on the VGA output on my HP 2510p after resume. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm/i915: restore pipeconf regs unconditionallyJesse Barnes1-7/+4
On many chipsets, the checks for DPLL enable or VGA mode will prevent the pipeconf regs from being restored, which could result in a blank display or X failing to come back after resume. So restore them unconditionally along with actually restoring pipe B's palette correctly. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-20drm/i915: save/restore interrupt stateJesse Barnes2-0/+12
On resume, if the interrupt state isn't restored correctly, we may end up with a flood of unexpected or ill-timed interrupts, which could cause the kernel to disable the interrupt or vblank events to happen at the wrong time. So save/restore them properly. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-20drm: convert drm from nopage to fault.Nick Piggin1-70/+55
Remove redundant vma range checks. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-20i915: wrap chipset types requiring hw status set ioctlZhenyu Wang2-1/+6
Also applys to recent added new chipset. Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-20drm/radeon: add initial rs690 support to drm.Maciej Cencora3-0/+120
This adds support for configuring the RS690 GART. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-13Final removal of FASTCALL()/fastcallHarvey Harrison1-1/+1
All users are gone, remove definitions and comments referring to them. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-07i915: Fix GR register array size off-by-one bugJesse Barnes1-1/+1
Make sure we have enough room for all the GR registers or we'll end up clobbering the AR index register (which should actually be harmless unless the BIOS is making an assumption about it). Noticed-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-07drm: add initial r500 drm supportDave Airlie6-59/+240
This adds CP support for the r500 series of chips, and allows accel 2D support on these chips with a new radeon driver. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-07radeon: setup the ring buffer fetcher to be less agressive.Roland Scheidegger2-3/+62
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: fixup some of the ioctl function exit pathsDave Airlie1-5/+7
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: the drm really should call pci_set_master..Dave Airlie1-0/+1
perhaps bonghits could turn on my bus-mastering because the drm certainly never bothered doing it before. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07i915: Add chipset id for Intel Integrated Graphics DeviceZhenyu Wang3-3/+7
This adds new chipset id in drm. Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-07drm: cleanup DRM_DEBUG() parametersMárton Németh28-145/+122
As DRM_DEBUG macro already prints out the __FUNCTION__ string (see drivers/char/drm/drmP.h), it is not worth doing this again. At some other places the ending "\n" was added. airlied:- I cleaned up a few that this patch missed also Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm/i915: add support for E7221 chipsetCarlos Martín1-1/+1
E7221 chipset is a server version of the i915. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: don't cast a pointer to pointer of list_headLi Zefan1-1/+1
The casting is safe only when the list_head member is the first member of the structure. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07mga_dma: return 'err' not just zero from mga_do_cleanup_dma()Jesper Juhl1-1/+1
While reading some code I stumbled across the use of 'err' in drivers/char/drm/mga_dma.c::mga_do_cleanup_dma() and I think there's a small problem. The variable is only used inside #if __OS_HAS_AGP which is fine, but all that ever happens is an assignment to the variable - it is never actually used for anything. The variable is nicely initialized to zero which is also what the return statement at the end of function returns (always at the moment). It looks to me like that function should be returning 'err' instead of always just returning 0. Here's a patch to do that. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: add _DRM_DRIVER flag, and re-order unload.Dave Airlie3-8/+11
Allow drivers to addmaps that won't be removed by lastclose or unload. The unload needs to be re-ordered to avoid removing the hashs before the driver has removed the final maps. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: enable udev node creationDave Airlie1-6/+1
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: Make DRM_IOCTL_GET_CLIENT return EINVAL when it can't find client #idx.Eric Anholt1-14/+11
Fixes the getclient test and dritest -c. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: move drm_mem_init to proper place in startup sequenceDave Airlie1-2/+2
For TTM this needs to be called later. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: call driver load function after initialising AGPDave Airlie1-4/+4
needed to intel chipset flushing Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: Fix ioc32 compat layerIan Romanick1-1/+5
Previously any ioctls that weren't explicitly listed in the compat ioctl table would fail with ENOTTY. If the incoming ioctl number is outside the range of the table, assume that it Just Works, and pass it off to drm_ioctl. This make the fence related ioctls work on 64-bit PowerPC. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: fd.o bug #11895: Only add the AGP base to map offset if the caller didn't.Eric Anholt1-4/+10
The i830 and newer intel 2D code adds the AGP base to map offsets already, because it wasn't doing the AGP enable which used to set dev->agp->base. Credit goes to Zhenyu for finding the issue. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07i915: add suspend/resume supportJesse Barnes4-57/+1309
Add suspend/resume support to the i915 driver. Moves some of the initialization into the driver load routine, and fixes up places where we assumed no dev_private existed in some of the cleanup paths. This allows us to suspend/resume properly even if X isn't running. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: update DRM sysfs supportJesse Barnes4-62/+117
Make DRM devices use real Linux devices instead of class devices, which are going away. While we're at it, clean up some of the interfaces to take struct drm_device * or struct device * and use the global drm_class where needed instead of passing it around. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: Initialize the AGP structure's base address at init rather than enable.Eric Anholt2-3/+2
Not all drivers call enable (intel), but they would still like to use this member in driver code. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: move two function extern into the correct blockDave Airlie1-3/+2
2008-02-07drm: run cleanfile across drm treeDave Airlie43-375/+362
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: some minor cleanups and changes to make memory manager merging easier.Dave Airlie2-28/+28
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-04Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds2-2/+2
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (79 commits) Jesper Juhl is the new trivial patches maintainer Documentation: mention email-clients.txt in SubmittingPatches fs/binfmt_elf.c: spello fix do_invalidatepage() comment typo fix Documentation/filesystems/porting fixes typo fixes in net/core/net_namespace.c typo fix in net/rfkill/rfkill.c typo fixes in net/sctp/sm_statefuns.c lib/: Spelling fixes kernel/: Spelling fixes include/scsi/: Spelling fixes include/linux/: Spelling fixes include/asm-m68knommu/: Spelling fixes include/asm-frv/: Spelling fixes fs/: Spelling fixes drivers/watchdog/: Spelling fixes drivers/video/: Spelling fixes drivers/ssb/: Spelling fixes drivers/serial/: Spelling fixes drivers/scsi/: Spelling fixes ...
2008-02-04vm audit: add VM_DONTEXPAND to mmap for drivers that need itNick Piggin1-0/+2
Drivers that register a ->fault handler, but do not range-check the offset argument, must set VM_DONTEXPAND in the vm_flags in order to prevent an expanding mremap from overflowing the resource. I've audited the tree and attempted to fix these problems (usually by adding VM_DONTEXPAND where it is not obvious). Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-03drivers/char/: Spelling fixesJoe Perches2-2/+2
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2008-01-23drm/i915: add support for E7221 chipsetCarlos Martín1-0/+1
E7221 chipset is a server version of the i915. Signed-off-by: Dave Airlie <airlied@linux.ie> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-06drm: DRM: fix memset size errorLi Zefan1-1/+1
The size passing to memset is wrong. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Dave Airlie <airlied@redhat.com>