aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
Commit message (Collapse)AuthorAge
* drm/i915: Keep refs on the object over the lifetime of vmas for GTT mmap.Jesse Barnes2009-02-19
| | | | | | | | | | | This fixes potential fault at fault time if the object was unreferenced while the mapping still existed. Now, while the mmap_offset only lives for the lifetime of the object, the object also stays alive while a vma exists that needs it. 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/i915: take struct mutex around fb unrefJesse Barnes2009-02-19
| | | | | | | | Need to do this in case the unref ends up doing a free. 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: Use spread spectrum when the bios tells us it's ok.Kristian Høgsberg2009-02-19
| | | | | | | | Lifted from the DDX modesetting. 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: Collapse identical i8xx_clock() and i9xx_clock().Kristian Høgsberg2009-02-19
| | | | | | | | They used to be different. Now they're identical. 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: Bring PLL limits in sync with DDX values.Kristian Høgsberg2009-02-19
| | | | | | 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 locking around cursor gem operations.Kristian Høgsberg2009-02-19
| | | | | | | | | We need to hold the struct_mutex around pinning and the phys object operations. 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: Propagate failure from setting crtc base.Chris Wilson2009-02-19
| | | | | | | | | Check the error paths within intel_pipe_set_base() to first cleanup and then report back the error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Cleanup the hws on ringbuffer constrution failure.Chris Wilson2009-02-19
| | | | | | | | | If we fail to create the ringbuffer, then we need to cleanup the allocated hws. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Don't add panel_fixed_mode to the probed modes list at LVDS init.Steve Aarnio2009-02-19
| | | | | | | | | | | | | | | | | | | In the case where no EDID data is read from the device, adding the panel_fixed_mode pointer to the probed modes list causes data corruption. If the panel_fixed_mode pointer is added to the probed modes list at init time, a copy of the mode is added again at drm_get_modes() request time. Then, the panel_fixed_mode pointer is freed because it is seen as a duplicate mode. Unfortunately, this pointer is still stored and used in mode_fixup(). Because the panel_fixed_mode data is copied and returned at drm_get_modes() time, it is unnecessary to add this information at init time. Signed-off-by: Steve Aarnio <steve.j.aarnio@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Unpin the fb on error during construction.Chris Wilson2009-02-19
| | | | | | | | If we fail whilst constructing the fb, then we need to unpin it as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Unpin the hws if we fail to kmap.Chris Wilson2009-02-19
| | | | | | | | A missing unpin on the error path. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Unpin the ringbuffer if we fail to ioremap it.Chris Wilson2009-02-19
| | | | | | | | A missing unpin on the error path. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: unpin for an invalid memory domain.Chris Wilson2009-02-19
| | | | | | | | | A missing unreference and unpin after rejecting the relocation for an invalid memory domain. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Release and unlock on mmap_gtt error path.Chris Wilson2009-02-19
| | | | | | | | We failed to unlock the mutex after failing to create the mmap offset. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Set framebuffer alignment based upon the fence constraints.Chris Wilson2009-02-19
| | | | | | | | | | | | | | Set the request alignment to 0, and leave it up to i915_gem_object_pin() to set the appropriate alignment to match the fence covering the object. Eric Anholt mentioned that the pinning code is meant to choose the maximum of the request alignment and that of the fence covering the object... However currently, the pinning code will only apply the fence constraints if the supplied alignment is 0. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Fix potential AB-BA deadlock in i915_gem_execbuffer()Roland Dreier2009-02-19
| | | | | | | | | | | | | | | | | | | | | | | Lockdep warns that i915_gem_execbuffer() can trigger a page fault (which takes mmap_sem) while holding dev->struct_mutex, while drm_vm_open() (which is called with mmap_sem already held) takes dev->struct_mutex. So this is a potential AB-BA deadlock. The way that i915_gem_execbuffer() triggers a page fault is by doing copy_to_user() when returning new buffer offsets back to userspace; however there is no reason to hold the struct_mutex when doing this copy, since what is being copied is the contents of an array private to i915_gem_execbuffer() anyway. So we can fix the potential deadlock (and get rid of the lockdep warning) by simply moving the copy_to_user() outside of where struct_mutex is held. This fixes <http://bugzilla.kernel.org/show_bug.cgi?id=12491>. Reported-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: refleak along pin() error path.Chris Wilson2009-02-19
| | | | | | | | | A missing unreference if the user calls pin() a second time on a pinned buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: hold mutex for unreference() in i915_gem_tiling.cChris Wilson2009-02-19
| | | | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Cleanup trivial leak on execbuffer error path.Chris Wilson2009-02-19
| | | | | | | | Also spotted by Owain Ainsworth. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Storage class should be before const qualifierTobias Klauser2009-02-19
| | | | | | | | | | | | The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* i915: Fix more size_t format string warningsLinus Torvalds2009-02-09
| | | | | | | The DRI people seem to have a hard time getting these right (see also commit aeb565dfc3ac4c8b47c5049085b4c7bfb2c7d5d7). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/i915: add get_vblank_counter function for GM45Jesse Barnes2009-02-08
| | | | | | | | | | | As discussed in the long thread about vblank related timeouts, it turns out GM45 has different frame count registers than previous chips. This patch adds support for them, which prevents us from waiting on really stale sequence values in drm_wait_vblank (which rather than returning immediately ends up timing out or getting interrupted). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Unlock mutex on i915_gem_fault() error pathChris Wilson2009-02-08
| | | | | | | | | If we failed to allocate a new fence register we would return VM_FAULT_SIGBUS without relinquishing the lock. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Quiet the message on get/setparam ioctl with an unknown value.Eric Anholt2009-02-08
| | | | | | | | | | Getting an unknown get/setparam used to be more significant back when they didn't change much. However, now that we're in the git world we're using them instead of a monotonic version number to signal feature availability, so clients ask about unknown params on older kernels more often. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: skip LVDS initialization on Apple Mac MiniPaul Collins2009-02-08
| | | | | | | | | | The Apple Mac Mini falsely reports LVDS. Use DMI to check whether we are running on a Mac Mini, and skip LVDS initialization if that proves to be the case. Signed-off-by: Paul Collins <paul@ondioline.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: sync SDVO code with stable userland modesetting driverJesse Barnes2009-02-08
| | | | | | | | | Pull in an update from the 2D driver (hopefully the last one, future work should be done here and pulled back into xf86-video-intel as needed). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Unref the object after failing to set tiling mode.Chris Wilson2009-02-08
| | | | | | | | Cleanup the object reference on the error paths. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: add fence register management to execbufJesse Barnes2009-02-08
| | | | | | | | | | | | Adds code to set up fence registers at execbuf time on pre-965 chips as necessary. Also fixes up a few bugs in the pre-965 tile register support (get_order != ffs). The number of fences available to the kernel defaults to the hw limit minus 3 (for legacy X front/back/depth), but a new parameter allows userspace to override that as needed. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Return error from i915_gem_object_get_fence_reg() when failing.Eric Anholt2009-02-08
| | | | | | | | | | Previously, the caller would continue along without knowing that the function failed, resulting in potential mis-rendering. Right now vm_fault just returns SIGBUS in that case, and we may need to disable signal handling to avoid that happening. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Set up an MTRR covering the GTT at driver load.Eric Anholt2009-02-08
| | | | | | | | | We'd love to just be using PAT, but even on chips with PAT it gets disabled sometimes due to an errata. It would probably be better to have pat_enabled exported and only bother with this when !pat_enabled. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Skip SDVO/HDMI init when the chipset tells us it's not present.Eric Anholt2009-02-08
| | | | | | | This saves startup time from probing SDVO, and saves setting up HDMI outputs on G4X devices that don't have them. Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: Suppress GEM teardown on X Server exit in KMS mode.Eric Anholt2009-02-08
| | | | | | | Fixes hangs when starting X for the second time. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* i915: fix unneeded locking in i915 LVDS get modes code.Dave Airlie2009-02-03
| | | | | | | This code is always called under the lock from the higher layers, so need to go locking it here. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drivers/gpu/drm/i915/intel_lvds.c: fix locking snafuAndrew Morton2009-01-29
| | | | | | | | | | | | | s/unlock/lock/ Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12575 Reported-by: Daniel Vetter <daniel@ffwll.ch> Cc: Dave Airlie <airlied@linux.ie> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6Linus Torvalds2009-01-26
|\ | | | | | | | | | | | | | | | | | | | | | | | | * 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Warn on deprecated binding model use eeprom: More consistent symbol names eeprom: Move 93cx6 eeprom driver to /drivers/misc/eeprom spi: Move at25 (for SPI eeproms) to /drivers/misc/eeprom i2c: Move old eeprom driver to /drivers/misc/eeprom i2c: Move at24 to drivers/misc/eeprom i2c: Quilt tree has moved i2c: Delete many unused adapter IDs i2c: Delete 10 unused driver IDs
| * i2c: Delete many unused adapter IDsJean Delvare2009-01-26
| | | | | | | | Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | Merge branch 'drm-fixes' of ↵Linus Torvalds2009-01-26
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/i915: Fix cursor physical address choice to match the 2D driver. drm: stash AGP include under the do-we-have-AGP ifdef drm: don't whine about not reading EDID data drm/i915: hook up LVDS DPMS property drm/i915: remove unnecessary debug output in KMS init i915: fix freeing path for gem phys objects. drm: create mode_config idr lock drm: fix leak of device mappings since multi-master changes.
| * | drm/i915: Fix cursor physical address choice to match the 2D driver.Jesse Barnes2009-01-22
| | | | | | | | | | | | | | | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net>
| * | drm/i915: hook up LVDS DPMS propertyJesse Barnes2009-01-22
| | | | | | | | | | | | | | | | | | | | | | | | The LVDS output supports DPMS calls, but we never hooked up the property code, so set property calls didn't actually do anything. Implement a set_property callback for the LVDS output so that the right thing happens. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
| * | drm/i915: remove unnecessary debug output in KMS initJesse Barnes2009-01-22
| | | | | | | | | | | | | | | | | | | | | We don't really need to print out the FB BAR... Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
| * | i915: fix freeing path for gem phys objects.Dave Airlie2009-01-22
| |/ | | | | | | | | | | This off-by-one was pointed out by Jesse Barnes. Signed-off-by: Dave Airlie <airlied@redhat.com>
* / Fix annoying DRM_ERROR() string warningLinus Torvalds2009-01-26
|/ | | | | | | Use '%zu' to print out a size_t variable, not '%d'. Another case of the "let's keep at least Linus' defconfig compile warningless" rule. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/i915: lock correct mutex around object unreference.Dave Airlie2009-01-16
| | | | | | This makes sure the mutex is held around the unreference. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: add support for physical memory objectsDave Airlie2009-01-16
| | | | | | | | | | | | | | This is an initial patch to do support for objects which needs physical contiguous main ram, cursors and overlay registers on older chipsets. These objects are bound on cursor bin, like pinning, and we copy the data to/from the backing store object into the real one on attach/detach. notes: possible over the top in attach/detach operations. no overlay support yet. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: make LVDS fixed mode a preferred modeJesse Barnes2009-01-16
| | | | | | | | | The detected fixed panel mode really is preferred, so mark it as such and add it to the LVDS connector mode list. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: handle depth & bpp changes correctlyJesse Barnes2009-01-16
| | | | | | Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: setup sarea properly in master_privDave Airlie2009-01-12
| | | | | | | | | If we are running DRI1 userspace, we really need to set the sarea up properly. thanks to Richard for finding/testing this. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: don't enable vblanks on disabled pipesJesse Barnes2009-01-10
| | | | | | | | | | In some cases userland may be confused and try to wait on vblank events from pipes that aren't actually enabled. We shouldn't allow this, so return -EINVAL if the pipe isn't on. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* trivial: replace last usages of __FUNCTION__ in kernelHarvey Harrison2009-01-07
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/i915: Respect the other stolen memory sizes we know of.Eric Anholt2009-01-06
| | | | | | | fd.o bug #19336. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@linux.ie>