Commit 9b3826bf authored by Chris Wilson's avatar Chris Wilson

drm/i915: Ignore fenced commands for gpu access on gen4

Userspace should not have been declaring that it needed fenced GPU
access with gen4+ as those GPUs have no fenced commands, but to be on
the safe side it is easier to ignore userspace in case they did.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent e3c4e5dd
...@@ -432,6 +432,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, ...@@ -432,6 +432,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct drm_i915_gem_exec_object2 *entry; struct drm_i915_gem_exec_object2 *entry;
int ret, retry; int ret, retry;
bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4;
/* Attempt to pin all of the buffers into the GTT. /* Attempt to pin all of the buffers into the GTT.
* This is done in 3 phases: * This is done in 3 phases:
...@@ -460,6 +461,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, ...@@ -460,6 +461,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
} }
need_fence = need_fence =
has_fenced_gpu_access &&
entry->flags & EXEC_OBJECT_NEEDS_FENCE && entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
obj->tiling_mode != I915_TILING_NONE; obj->tiling_mode != I915_TILING_NONE;
need_mappable = need_mappable =
...@@ -484,6 +486,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, ...@@ -484,6 +486,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
bool need_fence; bool need_fence;
need_fence = need_fence =
has_fenced_gpu_access &&
entry->flags & EXEC_OBJECT_NEEDS_FENCE && entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
obj->tiling_mode != I915_TILING_NONE; obj->tiling_mode != I915_TILING_NONE;
...@@ -498,18 +501,20 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, ...@@ -498,18 +501,20 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
break; break;
} }
if (need_fence) { if (has_fenced_gpu_access) {
ret = i915_gem_object_get_fence(obj, ring, 1); if (need_fence) {
if (ret) ret = i915_gem_object_get_fence(obj, ring, 1);
break; if (ret)
} else if (entry->flags & EXEC_OBJECT_NEEDS_FENCE && break;
obj->tiling_mode == I915_TILING_NONE) { } else if (entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
/* XXX pipelined! */ obj->tiling_mode == I915_TILING_NONE) {
ret = i915_gem_object_put_fence(obj); /* XXX pipelined! */
if (ret) ret = i915_gem_object_put_fence(obj);
break; if (ret)
break;
}
obj->pending_fenced_gpu_access = need_fence;
} }
obj->pending_fenced_gpu_access = need_fence;
entry->offset = obj->gtt_offset; entry->offset = obj->gtt_offset;
entry++; entry++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment