diff options
author | David Vrabel <david.vrabel@csr.com> | 2009-01-07 10:45:25 +0000 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2009-01-07 10:45:25 +0000 |
commit | a23e66f3b8cfdedec14541e71ef29a754870a20c (patch) | |
tree | f8ac23572982e92e6f8ae09c4039db627bdf53ee /drivers/gpu/drm/i915/i915_gem.c | |
parent | 04c470adb01c62bb9bd663cfc4875cf0a4eb01ab (diff) | |
parent | ede6f5aea054d3fb67c78857f7abdee602302043 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index cc2ca5561fe..14afc23a0e2 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1623,6 +1623,8 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment) struct drm_mm_node *free_space; int page_count, ret; + if (dev_priv->mm.suspended) + return -EBUSY; if (alignment == 0) alignment = PAGE_SIZE; if (alignment & (PAGE_SIZE - 1)) { @@ -2641,7 +2643,7 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment) if (obj_priv->gtt_space == NULL) { ret = i915_gem_object_bind_to_gtt(obj, alignment); if (ret != 0) { - if (ret != -ERESTARTSYS) + if (ret != -EBUSY && ret != -ERESTARTSYS) DRM_ERROR("Failure to bind: %d", ret); return ret; } @@ -3219,20 +3221,21 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, dev_priv->mm.wedged = 0; } - ret = i915_gem_init_ringbuffer(dev); - if (ret != 0) - return ret; - dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base, dev->agp->agp_info.aper_size * 1024 * 1024); mutex_lock(&dev->struct_mutex); + dev_priv->mm.suspended = 0; + + ret = i915_gem_init_ringbuffer(dev); + if (ret != 0) + return ret; + BUG_ON(!list_empty(&dev_priv->mm.active_list)); BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); BUG_ON(!list_empty(&dev_priv->mm.inactive_list)); BUG_ON(!list_empty(&dev_priv->mm.request_list)); - dev_priv->mm.suspended = 0; mutex_unlock(&dev->struct_mutex); drm_irq_install(dev); |