From bb6ff229c80f3e98f2899f620f279d16119268d7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 17 Mar 2011 10:24:14 +0000 Subject: [PATCH] drm/i915: Reorder pipelined fence flush Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34584 --- drivers/gpu/drm/i915/i915_gem.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3a2fd66..054e26e 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2581,7 +2581,12 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj, if (!obj->fenced_gpu_access && !obj->last_fenced_seqno) pipelined = NULL; - if (!pipelined) { + if (obj->last_fenced_ring && + obj->last_fenced_ring != pipelined) { + ret = i915_gem_object_flush_fence(obj, pipelined); + if (ret) + return ret; + } else if (!pipelined) { if (reg->setup_seqno) { if (!ring_passed_seqno(obj->last_fenced_ring, reg->setup_seqno)) { @@ -2593,11 +2598,6 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj, reg->setup_seqno = 0; } - } else if (obj->last_fenced_ring && - obj->last_fenced_ring != pipelined) { - ret = i915_gem_object_flush_fence(obj, pipelined); - if (ret) - return ret; } else if (obj->tiling_changed) { if (obj->fenced_gpu_access) { if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) { -- 1.7.2.3