From 1a652ad988612dab1cc61ac7aff14673f5ee907f Mon Sep 17 00:00:00 2001 From: "Kenneth R. Crudup" Date: Wed, 15 Nov 2017 15:50:58 -0800 Subject: [PATCH] Revert "drm/i915: First try the previous execbuffer location" This reverts commit 616d9cee4fdc4a377c03be8fd6efa5df4fcd0d81. Fixes the garbled display issue on ee3 (et al.) Conflicts: drivers/gpu/drm/i915/i915_gem_execbuffer.c --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++------- drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ------ drivers/gpu/drm/i915/i915_gem_gtt.h | 1 - 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 83876a1..4df5dab 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -352,12 +352,8 @@ static int eb_create(struct i915_execbuffer *eb) unsigned int exec_flags = *vma->exec_flags; u64 pin_flags; - if (vma->node.size) - pin_flags = vma->node.start; - else - pin_flags = entry->offset & PIN_OFFSET_MASK; - - pin_flags |= PIN_USER | PIN_NOEVICT | PIN_OFFSET_FIXED; + pin_flags = vma->node.start; + pin_flags |= PIN_USER | PIN_NONBLOCK | PIN_OFFSET_FIXED; if (unlikely(exec_flags & EXEC_OBJECT_NEEDS_GTT)) pin_flags |= PIN_GLOBAL; @@ -488,7 +484,7 @@ static inline void __eb_unreserve_vma(struct i915_vma *vma, unsigned int flags) vma->exec_flags = &eb->flags[i]; err = 0; - if (eb_pin_vma(eb, entry, vma)) { + if (vma->node.size && eb_pin_vma(eb, entry, vma)) { if (entry->offset != vma->node.start) { entry->offset = vma->node.start | UPDATE; eb->args->flags |= __EXEC_HAS_RELOC; diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index ad524cb..ec55870 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -3410,9 +3410,6 @@ int i915_gem_gtt_reserve(struct i915_address_space *vm, if (err != -ENOSPC) return err; - if (flags & PIN_NOEVICT) - return -ENOSPC; - err = i915_gem_evict_for_node(vm, node, flags); if (err == 0) err = drm_mm_reserve_node(&vm->mm, node); @@ -3527,9 +3524,6 @@ int i915_gem_gtt_insert(struct i915_address_space *vm, if (err != -ENOSPC) return err; - if (flags & PIN_NOEVICT) - return -ENOSPC; - /* No free space, pick a slot at random. * * There is a pathological case here using a GTT shared between diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h index b4e3aa7..636dea8 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -588,7 +588,6 @@ int i915_gem_gtt_insert(struct i915_address_space *vm, #define PIN_MAPPABLE BIT(1) #define PIN_ZONE_4G BIT(2) #define PIN_NONFAULT BIT(3) -#define PIN_NOEVICT BIT(4) #define PIN_MBZ BIT(5) /* I915_VMA_PIN_OVERFLOW */ #define PIN_GLOBAL BIT(6) /* I915_VMA_GLOBAL_BIND */ -- 1.9.1