[Intel-gfx] [PATCH 06/17] drm/i915: Dont clear PIN_GLOBAL in the execbuf pinning fallback

2015-04-14 Thread Daniel Vetter
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 ch...@chris-wilson.co.uk
Date:   Wed Jan 14 11:20:56 2015 +

drm/i915: Fallback to using CPU relocations for large batch buffers

Cc: Chris Wilson ch...@chris-wilson.co.uk
Signed-off-by: Daniel Vetter daniel.vet...@ffwll.ch
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 48ac5608481e..a7ed9f695586 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -600,7 +600,7 @@ i915_gem_execbuffer_reserve_vma(struct i915_vma *vma,
only_mappable_for_reloc(entry-flags))
ret = i915_gem_object_pin(obj, vma-vm,
  entry-alignment,
- flags  ~(PIN_GLOBAL | PIN_MAPPABLE));
+ flags  ~PIN_MAPPABLE);
if (ret)
return ret;
 
-- 
2.1.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 06/17] drm/i915: Dont clear PIN_GLOBAL in the execbuf pinning fallback

2015-04-14 Thread Chris Wilson
On Tue, Apr 14, 2015 at 05:35:16PM +0200, Daniel Vetter wrote:
 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.

Nope. See only_mappable_for_reloc(). There is an issue here, but this is
not it.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 06/17] drm/i915: Dont clear PIN_GLOBAL in the execbuf pinning fallback

2015-04-14 Thread Chris Wilson
On Tue, Apr 14, 2015 at 04:53:24PM +0100, Chris Wilson wrote:
 On Tue, Apr 14, 2015 at 05:35:16PM +0200, Daniel Vetter wrote:
  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.
 
 Nope. See only_mappable_for_reloc(). There is an issue here, but this is
 not it.

Less cyptic, I think you want:

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index a60bfeadc4fb..8599cd87cce5 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -735,14 +735,14 @@ i915_gem_execbuffer_reserve_vma(struct i915_vma *vma,
int ret;
 
flags = 0;
+   if (entry-flags  EXEC_OBJECT_NEEDS_GTT)
+   flags |= PIN_GLOBAL;
if (!drm_mm_node_allocated(vma-node)) {
if (entry-flags  __EXEC_OBJECT_NEEDS_MAP) {
flags |= PIN_GLOBAL | PIN_MAPPABLE;
if (only_mappable_for_reloc(entry-flags))
flags |= PIN_NONBLOCK;
}
-   if (entry-flags  EXEC_OBJECT_NEEDS_GTT)
-   flags |= PIN_GLOBAL;
if (entry-flags  __EXEC_OBJECT_NEEDS_BIAS)
flags |= BATCH_OFFSET_BIAS | PIN_OFFSET_BIAS;
if (entry-flags  EXEC_OBJECT_PINNED)

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx