summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'drm-next' of ↵Linus Torvalds2008-10-239-144/+221
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * '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
| * drm: Avoid oops in DRM_IOCTL_RM_DRAW if a bad handle is supplied.Eric Anholt2008-10-231-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>
| * drm: Add 32-bit compatibility for DRM_IOCTL_UPDATE_DRAW.Eric Anholt2008-10-231-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>
| * drm/i915: use pipes, not planes to label vblank dataKeith Packard2008-10-231-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>
| * drm/i915: hold dev->struct_mutex and DRM lock during vblank ring operationsKeith Packard2008-10-234-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>
| * i915: Fix format string warnings on x86-64.Linus Torvalds2008-10-231-2/+2
| | | | | | | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * i915: Don't dereference HWS in /proc debug files when it isn't initialized.Eric Anholt2008-10-231-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>
| * i915: Enable IMR passthrough of vblank events before enabling it in pipestat.Eric Anholt2008-10-231-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>
| * drm: Remove two leaks of vblank reference count in error paths.Eric Anholt2008-10-232-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>
| * drm: fix leak of cliprects in drm_rmdraw()Zhenyu Wang2008-10-231-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>
| * i915: Disable MSI on GM965 (errata says it doesn't work)Keith Packard2008-10-231-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>
| * drm: Set cliprects to NULL when changing drawable to having 0 cliprects.Zhenyu Wang2008-10-231-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>
| * i915: Protect vblank IRQ reg access with spinlockKeith Packard2008-10-231-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>
* | Export tiny shmem_file_setup for DRM-GEMHugh Dickins2008-10-201-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>
* | fix CONFIG_HIGHMEM compile error in drivers/gpu/drm/i915/i915_gem.cThomas Gleixner2008-10-201-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>
* | i915: cleanup coding horrors in i915_gem_gtt_pwrite()Linus Torvalds2008-10-201-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>
* | Fix sprintf format warnings in drm_proc.cLinus Torvalds2008-10-201-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>
* drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)Matthias Hopf2008-10-181-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>
* drm: make CONFIG_DRM depend on CONFIG_SHMEM.Dave Airlie2008-10-181-1/+1
| | | | | | This can be removed later when DRM doesn't depend on shmem. Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: fix PCI bus mastering support enables.Alex Deucher2008-10-182-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>
* radeon: add RS400 family support.Alex Deucher2008-10-182-2/+5
| | | | | | This adds support for the RS400 family of IGPs for Intel CPUs. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add support for RS740 IGP chipsets.Alex Deucher2008-10-182-9/+19
| | | | | | This adds support for the HS2100 IGP chipset. Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: GM45 has GM965-style MCH setup.Eric Anholt2008-10-181-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>
* i915: Don't run retire work handler while suspendedKeith Packard2008-10-181-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>
* i915: Map status page cached for chips with GTT-based HWS location.Keith Packard2008-10-183-15/+21
| | | | | | | | | | | This should improve performance by avoiding uncached reads by the CPU (the point of having a status page), and may improve stability. This patch only affects G33, GM45 and G45 chips as those are the only ones using GTT-based HWS mappings. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: Fix up ring initialization to cover G45 odditiesKeith Packard2008-10-181-2/+35
| | | | | | | | | | | G45 appears quite sensitive to ring initialization register writes, sometimes leaving the HEAD register with the START register contents. Check to make sure HEAD is reset correctly when START is written, and fix it up, screaming loudly. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: Use non-reserved status page index for breadcrumbKeith Packard2008-10-181-6/+8
| | | | | | | | | Dwords 0 through 0x1f are reserved for use by the hardware. Move the GEM breadcrumb from 0x10 to 0x20 to keep out of this area. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Increment dev_priv->irq_received so i915_gem_interrupts count works.Eric Anholt2008-10-181-0/+2
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: kill drm_device->irqJesse Barnes2008-10-187-14/+6
| | | | | | | | | Like the last patch but adds a macro to get at the irq value instead of dereferencing pdev directly. Should make things easier for the BSD guys and if we ever support non-PCI devices. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: wbinvd is cache coherent.Dave Airlie2008-10-181-9/+2
| | | | | | doing an ipi for the wbinvd case isn't necessary. Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: add missing return in error path.Dave Airlie2008-10-181-0/+1
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: fixup permissions on gem ioctls.Dave Airlie2008-10-181-3/+3
| | | | | | init/entervt/leavevt should be root-only master ioctls. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Clean up many sparse warnings in i915.Eric Anholt2008-10-183-29/+32
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Use ioremap_wc in i915_driver instead of ioremap, since we always want WC.Eric Anholt2008-10-181-6/+9
| | | | | | | | Fixes failure to map the ringbuffer when PAT tells us we don't get to do uncached on something that's already mapped WC, or something along those lines. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: G33-class hardware has a newer 965-style MCH (no DCC register).Eric Anholt2008-10-181-1/+1
| | | | | | | | Fixes bad software fallback rendering in Mesa in dual-channel configurations. d9a2470012588dc5313a5ac8bb2f03575af00e99 Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Avoid oops in GEM execbuffers with bad arguments.Eric Anholt2008-10-181-0/+4
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: Return -EBADF on bad object in flink, and return curent name if it exists.Eric Anholt2008-10-181-2/+3
| | | | | Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915 gem: install and uninstall irq handler in entervt and leavevt ioctls.Kristian Høgsberg2008-10-181-0/+5
| | | | | | Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: Make use of sarea_priv conditional.Kristian Høgsberg2008-10-182-15/+31
| | | | | | | | We fail ioctls that depend on the sarea_priv with EINVAL. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: Use struct_mutex to protect ring in GEM mode.Eric Anholt2008-10-184-10/+63
| | | | | | | | | | | In the conversion for GEM, we had stopped using the hardware lock to protect ring usage, since it was all internal to the DRM now. However, some paths weren't converted to using struct_mutex to prevent multiple threads from concurrently working on the ring, in particular between the vblank swap handler and ioctls. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: Add chip set ID param.Kristian Høgsberg2008-10-181-0/+3
| | | | | | Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Add GEM ("graphics execution manager") to i915 driver.Eric Anholt2008-10-1820-62/+4318
| | | | | | | | | | | | | | | | GEM allows the creation of persistent buffer objects accessible by the graphics device through new ioctls for managing execution of commands on the device. The userland API is almost entirely driver-specific to ensure that any driver building on this model can easily map the interface to individual driver requirements. GEM is used by the 2d driver for managing its internal state allocations and will be used for pixmap storage to reduce memory consumption and enable zero-copy GLX_EXT_texture_from_pixmap, and in the 3d driver is used to enable GL_EXT_framebuffer_object and GL_ARB_pixel_buffer_object. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Rework vblank-wait handling to allow interrupt reduction.Jesse Barnes2008-10-1819-462/+1095
| | | | | | | | | | | | | | | Previously, drivers supporting vblank interrupt waits would run the interrupt all the time, or all the time that any 3d client was running, preventing the CPU from sleeping for long when the system was otherwise idle. Now, interrupts are disabled any time that no client is waiting on a vblank event. The new method uses vblank counters on the chipsets when the interrupts are turned off, rather than counting interrupts, so that we can continue to present accurate vblank numbers. Co-author: Michel Dänzer <michel@tungstengraphics.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/cred: wrap task credential accesses in the drm driver.David Howells2008-10-181-1/+1
| | | | | | | | | | | | | | | | Wrap access to task credentials so that they can be separated more easily from the task_struct during the introduction of COW creds. Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id(). Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more sense to use RCU directly rather than a convenient wrapper; these will be addressed by later patches. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: David Airlie <airlied@redhat.com>
* new chip name is GM45Jesse Barnes2008-10-182-4/+4
| | | | | | | | | | Author: Zhenyu Wang <zhenyu.z.wang@intel.com> i915: official name for GM45 chipset Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* separate i915 suspend/resume functions into their own fileJesse Barnes2008-10-184-461/+524
| | | | | | | | | | | | | [Patch against drm-next. Consider this a trial balloon for our new Linux development model.] This is a big chunk of code. Separating it out makes it easier to change without churn on the main i915_drv.c file (and there will be churn as we fix bugs and add things like kernel mode setting). Also makes it easier to share this file with BSD. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: fix writeback across suspend/resume.Dave Airlie2008-10-181-2/+3
| | | | | | Make writeback not get disabled on resume. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: fix sysfs error path.Dave Airlie2008-10-181-1/+1
| | | | | | Pointed out by Roel Kluin on dri-devel. Signed-off-by: Dave Airlie <airlied@redhat.com>
* FB_SIS=m, DRM_SIS=y is not a legal configuration.Adrian Bunk2008-10-181-0/+1
| | | | | | Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Add Intel ACPI IGD OpRegion supportMatthew Garrett2008-10-187-9/+415
| | | | | | | | | This adds the support necessary for allowing ACPI backlight control to work on some newer Intel-based graphics systems. Tested on Thinkpad T61 and HP 2510p hardware. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
OpenPOWER on IntegriCloud