aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-12-01drivers/gpu/drm/i915/i915_irq.c: fix warningAndrew Morton1-1/+1
drivers/gpu/drm/i915/i915_irq.c: In function 'i915_disable_pipestat': drivers/gpu/drm/i915/i915_irq.c:101: warning: control may reach end of non-void function 'i915_pipestat' being inlined Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-01drm/i915: Fix copy'n'pasteo that broke VT switch if flushing was non-empty.Eric Anholt1-1/+1
Introduced in the "Avoid BUG_ONs on VT switch" commit. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-26drm/i915: Save/restore HWS_PGA on suspend/resumePeng Li2-0/+7
It fixes suspend/resume failure of xf86-video-intel dri2 branch. As dri2 branch doesn't call I830DRIResume() to restore hardware status page anymore, we need to preserve this register across suspend/resume. Signed-off-by: Peng Li <peng.li@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm: move drm vblank initialization/cleanup to driver load/unloadKeith Packard14-21/+44
drm vblank initialization keeps track of the changes in driver-supplied frame counts across vt switch and mode setting, but only if you let it by not tearing down the drm vblank structure. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: execbuffer pins objects, no need to ensure they're still in the GTTKeith Packard1-11/+0
Before we had the notion of pinning objects, we had a kludge around to make sure all of the objects were still resident in the GTT before we committed to executing a batch buffer. We don't need this any longer, and it sticks an error return in the middle of object domain computations that must be associated with a subsequent flush/invalidate emmission into the ring. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: Always read pipestat in irq_handlerKeith Packard1-19/+36
Because we write pipestat before iir, it's possible that a pipestat interrupt will occur between the pipestat write and the iir write. This leaves pipestat with an interrupt status not visible in iir. This may cause an interrupt flood as we never clear the pipestat event. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: Subtract total pinned bytes from available aperture sizeKeith Packard1-8/+2
The old code was wandering through the active list looking for pinned buffers; there may be other pinned buffers around. Fortunately, we keep a count of the total amount of pinned memory and can use that instead. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: Avoid BUG_ONs on VT switch with a wedged chipset.Eric Anholt1-14/+39
Instead, just warn that bad things are happening and do our best to clean up the mess without the GPU's help. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: Remove IMR masking during interrupt handler, and restart it if needed.Eric Anholt1-47/+61
The IMR masking was a technique recommended for avoiding getting stuck with no interrupts generated again in MSI mode. It kept new IIR bits from getting set between the IIR read and the IIR write, which would have otherwise prevented an MSI from ever getting generated again. However, this caused a problem for vblank as the IMR mask would keep the pipe event interrupt from getting reflected in IIR, even after the IMR mask was brought back down. Instead, just check the state of IIR after we ack the interrupts we're going to handle, and restart if we didn't get IIR all the way to zero. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm/i915: Manage PIPESTAT to control vblank interrupts instead of IMR.Keith Packard3-122/+115
The pipestat fields affect reporting of all vblank-related interrupts, so we have to reset them during the irq_handler, and while enabling vblank interrupts. Otherwise, if a pipe status field had been set to non-zero before enabling reporting, we would never see an interrupt again. This patch adds i915_enable_pipestat and i915_disable_pipestat to abstract out the steps needed to change the reported interrupts. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-11drm/i915: Move legacy breadcrumb out of the reserved status page areaKeith Packard3-11/+8
Addresses in the hardware status page below index 0x20 are reserved for use by the hardware. The legacy breadcrumb was sitting at index 5. Move it to index 0x21, and make sure everyone uses the defined value instead of hard-coded constants. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11drm/i915: Filter pci devices based on PCI_CLASS_DISPLAY_VGADave Airlie1-1/+9
This fixes hangs on 855-class hardware by avoiding double attachment of the driver due to the stub second head device having the same pci id as the real device. Other DRM drivers probably want this treatment as well, but I'm applying it just to this one for safety. But we should clean up the drm_pciids.h mess now so that each driver has its own pci id list header in its own directory. Lets do that in the next release. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-11drm/radeon: map registers at load timeDave Airlie2-7/+10
Now that the radeon driver has suspend/resume functions, it needs to map its registers at load time or it will likely crash if a suspend operation occurs before the driver has been initialized. This patch moves the register mapping code from firstopen to load and makes the mapping into a _DRM_DRIVER one so that the core won't remove it at lastclose time. Fixes (at least partially) kernel bz #11891. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11drm: Remove infrastructure for supporting i915's vblank swapping.Eric Anholt3-90/+0
It's not used in any other drivers, and doesn't look like it will be from drm.git master. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11i915: Remove racy delayed vblank swap ioctl.Eric Anholt2-378/+14
When userland detected that this ioctl was supported (by version number check), it used it in a racy way -- dispatch delayed swap, wait for vblank, continue rendering. As there was no mechanism for it to wait for the swap to finish, sometimes it would render before the swap and garbage would be displayed on the screen. By removing the ioctl and returning -EINVAL, userland returns to its previous, correct rendering path of waiting for a vblank then dispatching a swap. The only path that could have used this ioctl correctly was page flipping, which relied on only one client running and emitting wait-for-vblank-before-rendering in the command stream. That path also falls back correctly, at the performance cost of not being able to queue up rendering before the flip occurs. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11i915: Don't whine when pci_enable_msi() fails.Eric Anholt1-2/+1
This probably just means the chipset doesn't support MSI, which is fine. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11i915: Don't attempt to short-circuit object_wait_rendering by checking domains.Owen Taylor1-5/+3
This could return early when reading after writing a buffer, if somebody had already put it on the flushing list (write domains are 0, but still active), leading to glReadPixels failure. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11i915: Clean up sarea pointers on leavevtKeith Packard1-0/+3
This corresponds to the setup of the sarea pointers in DMA initialization, though neither is exactly the point at which the sarea is set up or torn down. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-11i915: Save/restore MCHBAR_RENDER_STANDBY on GM965/GM45Keith Packard3-0/+13
This register is set by the 2D driver to prevent lockups, and so it needs to be preserved across suspend/resume too. This makes my X200s work. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-11-03Merge branch 'io-mappings-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tipLinus Torvalds2-94/+83
* 'io-mappings-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: io mapping: clean up #ifdefs io mapping: improve documentation i915: use io-mapping interfaces instead of a variety of mapping kludges resources: add io-mapping functions to dynamically map large device apertures x86: add iomap_atomic*()/iounmap_atomic() on 32-bit using fixmaps
2008-11-03Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6Linus Torvalds6-14/+48
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: i915: Add GEM ioctl to get available aperture size. drm/radeon: fixup further bus mastering confusion. build fix: CONFIG_DRM_I915=y && CONFIG_ACPI=n
2008-11-03i915: Add GEM ioctl to get available aperture size.Eric Anholt3-0/+25
This will let userland know when to submit its batchbuffers, before they get too big to fit in the aperture. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-01saner FASYNC handling on file closeAl Viro1-2/+0
As it is, all instances of ->release() for files that have ->fasync() need to remember to evict file from fasync lists; forgetting that creates a hole and we actually have a bunch that *does* forget. So let's keep our lives simple - let __fput() check FASYNC in file->f_flags and call ->fasync() there if it's been set. And lose that crap in ->release() instances - leaving it there is still valid, but we don't have to bother anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-31i915: use io-mapping interfaces instead of a variety of mapping kludgesKeith Packard2-94/+83
Impact: optimize/clean-up the IO mapping implementation of the i915 DRM driver Switch the i915 device aperture mapping to the io-mapping interface, taking advantage of the cleaner API to extend it across all of the mapping uses, including both pwrite and relocation updates. This dramatically improves performance on 64-bit kernels which were using the same slow path as 32-bit non-HIGHMEM kernels prior to this patch. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-10-28drm/radeon: fixup further bus mastering confusion.Alex Deucher2-13/+14
rs400/480 are like previous chips not like rs6xx chips. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-28build fix: CONFIG_DRM_I915=y && CONFIG_ACPI=nLen Brown2-1/+9
drivers/gpu/drm/i915/i915_opregion.c:340: error: implicit declaration of function ‘register_acpi_notifier’ drivers/gpu/drm/i915/i915_opregion.c:361: error: implicit declaration of function ‘unregister_acpi_notifier’ Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6Linus Torvalds9-144/+221
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: Avoid oops in DRM_IOCTL_RM_DRAW if a bad handle is supplied. drm: Add 32-bit compatibility for DRM_IOCTL_UPDATE_DRAW. drm/i915: use pipes, not planes to label vblank data drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operations i915: Fix format string warnings on x86-64. i915: Don't dereference HWS in /proc debug files when it isn't initialized. i915: Enable IMR passthrough of vblank events before enabling it in pipestat. drm: Remove two leaks of vblank reference count in error paths. drm: fix leak of cliprects in drm_rmdraw() i915: Disable MSI on GM965 (errata says it doesn't work) drm: Set cliprects to NULL when changing drawable to having 0 cliprects. i915: Protect vblank IRQ reg access with spinlock
2008-10-23drm: Avoid oops in DRM_IOCTL_RM_DRAW if a bad handle is supplied.Eric Anholt1-0/+4
Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Michel Dänzer <michel@tungstengraphics.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm: Add 32-bit compatibility for DRM_IOCTL_UPDATE_DRAW.Eric Anholt1-0/+34
This fixes vblank support for a 32-bit X Server on a 64-bit kernel. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm/i915: use pipes, not planes to label vblank dataKeith Packard1-53/+20
vblank in the kernel is far simpler if it deals with pipes instead of planes, so we're changing both user and kernel side. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operationsKeith Packard4-60/+92
To synchronize clip lists with the X server, the DRM lock must be held while looking at drawable clip lists. To synchronize with other ring access, the ring mutex must be held while inserting commands into the ring. Failure to do the first resulted in easy visual corruption when moving windows, and the second could have corrupted the ring with DRI2. Grabbing the DRM lock involves using the DRM tasklet mechanism, grabbing the ring mutex means potentially sleeping. Deal with both of these by always running the tasklet from a work handler. Also, protect from clip list changes since the vblank request was queued by making sure the window has at least one rectangle while looking inside, preventing oopses . Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23i915: Fix format string warnings on x86-64.Linus Torvalds1-2/+2
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23i915: Don't dereference HWS in /proc debug files when it isn't initialized.Eric Anholt1-3/+12
Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23i915: Enable IMR passthrough of vblank events before enabling it in pipestat.Eric Anholt1-1/+9
Otherwise, if we lost the race, the pipestat bit would be set without being reflected in IIR, and we would never clear the pipestat bit so the pipe event would never be generated again, and all vblank waits would time out. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm: Remove two leaks of vblank reference count in error paths.Eric Anholt2-1/+5
If the failing paths were hit, the vblank IRQ would never get turned off again. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm: fix leak of cliprects in drm_rmdraw()Zhenyu Wang1-2/+5
Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23i915: Disable MSI on GM965 (errata says it doesn't work)Keith Packard1-1/+4
Current Intel errata for the GM965 says that using MSI may cause interrupts to be delayed or lost. The only workaround offered is to not use it. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23drm: Set cliprects to NULL when changing drawable to having 0 cliprects.Zhenyu Wang1-1/+3
This avoids setting the cliprects pointer to a zero-sized allocation. Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-23i915: Protect vblank IRQ reg access with spinlockKeith Packard1-29/+40
This uses the same spinlock as the user_irq code as it shares the same register, ensuring that interrupt registers are updated atomically. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-20Export tiny shmem_file_setup for DRM-GEMHugh Dickins1-1/+1
We're trying to keep the !CONFIG_SHMEM tiny-shmem.c (using ramfs without swap) in synch with CONFIG_SHMEM shmem.c (and mpm is preparing patches to combine them). I was glad to see EXPORT_SYMBOL_GPL(shmem_file_setup) go into shmem.c, but why not support DRM-GEM when !CONFIG_SHMEM too? But caution says still depend on MMU, since !CONFIG_MMU is.. different. Signed-off-by: Hugh Dickins <hugh@veritas.com> Acked-by: Matt Mackall <mpm@selenic.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20fix CONFIG_HIGHMEM compile error in drivers/gpu/drm/i915/i915_gem.cThomas Gleixner1-2/+3
commit 9b7530cc329eb036cfa589930c270e85031f554c ("i915: cleanup coding horrors in i915_gem_gtt_pwrite()") broke the i386 build for CONFIG_HIGHMEM=y. Caught by automatic testing http://www.tglx.de/autoqa-logs/000137-0006-0001.log Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [ My bad. It's the same patch I sent out earlier, nobody noticed then either.. ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20i915: cleanup coding horrors in i915_gem_gtt_pwrite()Linus Torvalds1-23/+36
Yes, this will probably be switched over to a cleaner model anyway, but in the meantime I don't want to see the 'unused variable' warnings that come from the disgusting #ifdef code. Make the special case be a nice inlien function of its own, clean up the code, and make the warning go away. I wish people didn't write code that gets (valid) warnings from the compiler, but I'll limit my fixes to code that I actually care about (in this case just because I see the warning and it annoys me). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20Fix sprintf format warnings in drm_proc.cLinus Torvalds1-2/+2
Use "%zd" for size_t, and make sure to have a space between the numbers instead of depending on the field width. I don't like warnings in my default targeted build. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-18drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)Matthias Hopf1-1/+1
Olaf Kirch noticed that the i915_set_status_page() function of the i915 kernel driver calls ioremap with an address offset that is supplied by userspace via ioctl. The function zeroes the mapped memory via memset and tells the hardware about the address. Turns out that access to that ioctl is not restricted to root so users could probably exploit that to do nasty things. We haven't tried to write actual exploit code though. It only affects the Intel G33 series and newer. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18drm: make CONFIG_DRM depend on CONFIG_SHMEM.Dave Airlie1-1/+1
This can be removed later when DRM doesn't depend on shmem. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18radeon: fix PCI bus mastering support enables.Alex Deucher2-2/+39
Someone noticed these registers moved around for later chips, so we redo the codepaths per-chip. PCIE chips don't appear to require explicit enables. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18radeon: add RS400 family support.Alex Deucher2-2/+5
This adds support for the RS400 family of IGPs for Intel CPUs. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18drm/radeon: add support for RS740 IGP chipsets.Alex Deucher2-9/+19
This adds support for the HS2100 IGP chipset. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18i915: GM45 has GM965-style MCH setup.Eric Anholt1-2/+3
Fixes tiling swizzling mode failures that manifest in glReadPixels(). Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-10-18i915: Don't run retire work handler while suspendedKeith Packard1-22/+28
At leavevt and lastclose time, cancel any pending retire work handler invocation, and keep the retire work handler from requeuing itself if it is currently running. This patch restructures i915_gem_idle to perform all of these tasks instead of having both leavevt and lastclose call a sequence of functions. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>