diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-10 15:40:02 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-11-10 15:41:16 -0500 |
commit | 5d97eb69bd4767ce9973360881fa6ad161510fb0 (patch) | |
tree | 82a8ce1f8a7bd77c3775819e389a6299690d0002 /drivers/gpu/drm/i915/i915_gem.c | |
parent | 33d2323711059d14fd675fa7def317e560fa787e (diff) |
drm/i915: Only add the lazy request if we end up waiting for it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 7c91bf2bbdfd..52f5c194c50f 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1664,9 +1664,7 @@ i915_gem_next_request_seqno(struct drm_device *dev, | |||
1664 | struct intel_ring_buffer *ring) | 1664 | struct intel_ring_buffer *ring) |
1665 | { | 1665 | { |
1666 | drm_i915_private_t *dev_priv = dev->dev_private; | 1666 | drm_i915_private_t *dev_priv = dev->dev_private; |
1667 | 1667 | return ring->outstanding_lazy_request = dev_priv->next_seqno; | |
1668 | ring->outstanding_lazy_request = true; | ||
1669 | return dev_priv->next_seqno; | ||
1670 | } | 1668 | } |
1671 | 1669 | ||
1672 | static void | 1670 | static void |
@@ -2072,7 +2070,7 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, | |||
2072 | if (atomic_read(&dev_priv->mm.wedged)) | 2070 | if (atomic_read(&dev_priv->mm.wedged)) |
2073 | return -EAGAIN; | 2071 | return -EAGAIN; |
2074 | 2072 | ||
2075 | if (ring->outstanding_lazy_request) { | 2073 | if (seqno == ring->outstanding_lazy_request) { |
2076 | struct drm_i915_gem_request *request; | 2074 | struct drm_i915_gem_request *request; |
2077 | 2075 | ||
2078 | request = kzalloc(sizeof(*request), GFP_KERNEL); | 2076 | request = kzalloc(sizeof(*request), GFP_KERNEL); |
@@ -2087,7 +2085,6 @@ i915_do_wait_request(struct drm_device *dev, uint32_t seqno, | |||
2087 | 2085 | ||
2088 | seqno = request->seqno; | 2086 | seqno = request->seqno; |
2089 | } | 2087 | } |
2090 | BUG_ON(seqno == dev_priv->next_seqno); | ||
2091 | 2088 | ||
2092 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { | 2089 | if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { |
2093 | if (HAS_PCH_SPLIT(dev)) | 2090 | if (HAS_PCH_SPLIT(dev)) |
@@ -3973,7 +3970,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
3973 | i915_retire_commands(dev, ring); | 3970 | i915_retire_commands(dev, ring); |
3974 | 3971 | ||
3975 | if (i915_add_request(dev, file, request, ring)) | 3972 | if (i915_add_request(dev, file, request, ring)) |
3976 | ring->outstanding_lazy_request = true; | 3973 | i915_gem_next_request_seqno(dev, ring); |
3977 | else | 3974 | else |
3978 | request = NULL; | 3975 | request = NULL; |
3979 | 3976 | ||