aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2011-12-16 01:39:20 -0500
committerSteve French <sfrench@us.ibm.com>2011-12-16 01:39:20 -0500
commitaaf015890754d58dcb71a4aa44ed246bb082bcf6 (patch)
tree17b51ff707fd1b3efec3a3ab872f0d7a7416aca5 /drivers/gpu/drm/i915/i915_gem.c
parent9c32c63bb70b2fafc3b18bee29959c3bf245ceba (diff)
parent8def5f51b012efb00e77ba2d04696cc0aadd0609 (diff)
Merge branch 'master' of git+ssh://git.samba.org/data/git/sfrench/cifs-2.6
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 6651c36b6e8a..60ff1b63b568 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1396,7 +1396,7 @@ i915_gem_mmap_gtt(struct drm_file *file,
1396 1396
1397 if (obj->base.size > dev_priv->mm.gtt_mappable_end) { 1397 if (obj->base.size > dev_priv->mm.gtt_mappable_end) {
1398 ret = -E2BIG; 1398 ret = -E2BIG;
1399 goto unlock; 1399 goto out;
1400 } 1400 }
1401 1401
1402 if (obj->madv != I915_MADV_WILLNEED) { 1402 if (obj->madv != I915_MADV_WILLNEED) {
@@ -1745,7 +1745,7 @@ static void i915_gem_reset_fences(struct drm_device *dev)
1745 struct drm_i915_private *dev_priv = dev->dev_private; 1745 struct drm_i915_private *dev_priv = dev->dev_private;
1746 int i; 1746 int i;
1747 1747
1748 for (i = 0; i < 16; i++) { 1748 for (i = 0; i < dev_priv->num_fence_regs; i++) {
1749 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i]; 1749 struct drm_i915_fence_reg *reg = &dev_priv->fence_regs[i];
1750 struct drm_i915_gem_object *obj = reg->obj; 1750 struct drm_i915_gem_object *obj = reg->obj;
1751 1751
@@ -2026,8 +2026,13 @@ i915_wait_request(struct intel_ring_buffer *ring,
2026 * to handle this, the waiter on a request often wants an associated 2026 * to handle this, the waiter on a request often wants an associated
2027 * buffer to have made it to the inactive list, and we would need 2027 * buffer to have made it to the inactive list, and we would need
2028 * a separate wait queue to handle that. 2028 * a separate wait queue to handle that.
2029 *
2030 * To avoid a recursion with the ilk VT-d workaround (that calls
2031 * gpu_idle when unbinding objects with interruptible==false) don't
2032 * retire requests in that case (because it might call unbind if the
2033 * active list holds the last reference to the object).
2029 */ 2034 */
2030 if (ret == 0) 2035 if (ret == 0 && dev_priv->mm.interruptible)
2031 i915_gem_retire_requests_ring(ring); 2036 i915_gem_retire_requests_ring(ring);
2032 2037
2033 return ret; 2038 return ret;
@@ -3512,9 +3517,11 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
3512 * so emit a request to do so. 3517 * so emit a request to do so.
3513 */ 3518 */
3514 request = kzalloc(sizeof(*request), GFP_KERNEL); 3519 request = kzalloc(sizeof(*request), GFP_KERNEL);
3515 if (request) 3520 if (request) {
3516 ret = i915_add_request(obj->ring, NULL, request); 3521 ret = i915_add_request(obj->ring, NULL, request);
3517 else 3522 if (ret)
3523 kfree(request);
3524 } else
3518 ret = -ENOMEM; 3525 ret = -ENOMEM;
3519 } 3526 }
3520 3527
@@ -3613,7 +3620,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
3613 obj->base.write_domain = I915_GEM_DOMAIN_CPU; 3620 obj->base.write_domain = I915_GEM_DOMAIN_CPU;
3614 obj->base.read_domains = I915_GEM_DOMAIN_CPU; 3621 obj->base.read_domains = I915_GEM_DOMAIN_CPU;
3615 3622
3616 if (IS_GEN6(dev)) { 3623 if (IS_GEN6(dev) || IS_GEN7(dev)) {
3617 /* On Gen6, we can have the GPU use the LLC (the CPU 3624 /* On Gen6, we can have the GPU use the LLC (the CPU
3618 * cache) for about a 10% performance improvement 3625 * cache) for about a 10% performance improvement
3619 * compared to uncached. Graphics requests other than 3626 * compared to uncached. Graphics requests other than
@@ -3877,7 +3884,7 @@ i915_gem_load(struct drm_device *dev)
3877 INIT_LIST_HEAD(&dev_priv->mm.gtt_list); 3884 INIT_LIST_HEAD(&dev_priv->mm.gtt_list);
3878 for (i = 0; i < I915_NUM_RINGS; i++) 3885 for (i = 0; i < I915_NUM_RINGS; i++)
3879 init_ring_lists(&dev_priv->ring[i]); 3886 init_ring_lists(&dev_priv->ring[i]);
3880 for (i = 0; i < 16; i++) 3887 for (i = 0; i < I915_MAX_NUM_FENCES; i++)
3881 INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list); 3888 INIT_LIST_HEAD(&dev_priv->fence_regs[i].lru_list);
3882 INIT_DELAYED_WORK(&dev_priv->mm.retire_work, 3889 INIT_DELAYED_WORK(&dev_priv->mm.retire_work,
3883 i915_gem_retire_work_handler); 3890 i915_gem_retire_work_handler);