aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_execbuffer.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-04-14 13:01:54 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-04-20 11:59:50 -0400
commit0229da324d23de67fa4af585b4ef134f721adc84 (patch)
tree7dba2e33525593c13af7e8b8e3638c3377a8a29b /drivers/gpu/drm/i915/i915_gem_execbuffer.c
parentf329f5f6eb4fad8f2e9c62fe37ec01ae5ce0f212 (diff)
drm/i915: Dont clear PIN_GLOBAL in the execbuf pinning fallback
PIN_GLOBAL is set only when userspace asked for it, and that is only the case for the gen6 PIPE_CONTROL workaround. We're not allowed to just clear this. The important part of the fallback is to drop the restriction to the mappable range. This issue has been introduced in commit edf4427b8055dc93eb5222d8174b07a75ba24fb5 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Jan 14 11:20:56 2015 +0000 drm/i915: Fallback to using CPU relocations for large batch buffers v2: Chris pointed out that we also miss to set PIN_GLOBAL when the buffer is already bound. Fix this up too. Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 48ac5608481e..564425fce1a7 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -586,11 +586,12 @@ i915_gem_execbuffer_reserve_vma(struct i915_vma *vma,
586 int ret; 586 int ret;
587 587
588 flags = 0; 588 flags = 0;
589 if (entry->flags & EXEC_OBJECT_NEEDS_GTT)
590 flags |= PIN_GLOBAL;
591
589 if (!drm_mm_node_allocated(&vma->node)) { 592 if (!drm_mm_node_allocated(&vma->node)) {
590 if (entry->flags & __EXEC_OBJECT_NEEDS_MAP) 593 if (entry->flags & __EXEC_OBJECT_NEEDS_MAP)
591 flags |= PIN_GLOBAL | PIN_MAPPABLE; 594 flags |= PIN_GLOBAL | PIN_MAPPABLE;
592 if (entry->flags & EXEC_OBJECT_NEEDS_GTT)
593 flags |= PIN_GLOBAL;
594 if (entry->flags & __EXEC_OBJECT_NEEDS_BIAS) 595 if (entry->flags & __EXEC_OBJECT_NEEDS_BIAS)
595 flags |= BATCH_OFFSET_BIAS | PIN_OFFSET_BIAS; 596 flags |= BATCH_OFFSET_BIAS | PIN_OFFSET_BIAS;
596 } 597 }
@@ -600,7 +601,7 @@ i915_gem_execbuffer_reserve_vma(struct i915_vma *vma,
600 only_mappable_for_reloc(entry->flags)) 601 only_mappable_for_reloc(entry->flags))
601 ret = i915_gem_object_pin(obj, vma->vm, 602 ret = i915_gem_object_pin(obj, vma->vm,
602 entry->alignment, 603 entry->alignment,
603 flags & ~(PIN_GLOBAL | PIN_MAPPABLE)); 604 flags & ~PIN_MAPPABLE);
604 if (ret) 605 if (ret)
605 return ret; 606 return ret;
606 607