Skip to content

Commit

Permalink
drm/i915: Remove the now obsolete 'outstanding_lazy_request'
Browse files Browse the repository at this point in the history
The outstanding_lazy_request is no longer used anywhere in the driver.
Everything that was looking at it now has a request explicitly passed in from on
high. Everything that was relying upon it behind the scenes is now explicitly
creating/passing/submitting its own private request. Thus the OLR can be
removed.

For: VIZ-5115
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
John Harrison authored and Daniel Vetter committed Jun 23, 2015
1 parent 59c35a4 commit bccca49
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 30 deletions.
16 changes: 2 additions & 14 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,6 @@ i915_gem_check_olr(struct drm_i915_gem_request *req)
{
WARN_ON(!mutex_is_locked(&req->ring->dev->struct_mutex));

if (req == req->ring->outstanding_lazy_request)
i915_add_request(req);

return 0;
}

Expand Down Expand Up @@ -2488,8 +2485,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
dev_priv = ring->dev->dev_private;
ringbuf = request->ringbuf;

WARN_ON(request != ring->outstanding_lazy_request);

/*
* To ensure that this call will not fail, space for its emissions
* should already have been reserved in the ring buffer. Let the ring
Expand Down Expand Up @@ -2558,7 +2553,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
}

trace_i915_gem_request_add(request);
ring->outstanding_lazy_request = NULL;

i915_queue_hangcheck(ring->dev);

Expand Down Expand Up @@ -2647,8 +2641,7 @@ int i915_gem_request_alloc(struct intel_engine_cs *ring,
if (!req_out)
return -EINVAL;

if ((*req_out = ring->outstanding_lazy_request) != NULL)
return 0;
*req_out = NULL;

req = kmem_cache_zalloc(dev_priv->requests, GFP_KERNEL);
if (req == NULL)
Expand Down Expand Up @@ -2694,7 +2687,7 @@ int i915_gem_request_alloc(struct intel_engine_cs *ring,
return ret;
}

*req_out = ring->outstanding_lazy_request = req;
*req_out = req;
return 0;

err:
Expand Down Expand Up @@ -2791,9 +2784,6 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,

i915_gem_request_retire(request);
}

/* This may not have been flushed before the reset, so clean it now */
i915_gem_request_assign(&ring->outstanding_lazy_request, NULL);
}

void i915_gem_restore_fences(struct drm_device *dev)
Expand Down Expand Up @@ -3344,8 +3334,6 @@ int i915_gpu_idle(struct drm_device *dev)
i915_add_request_no_flush(req);
}

WARN_ON(ring->outstanding_lazy_request);

ret = intel_ring_idle(ring);
if (ret)
return ret;
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/i915/i915_gem_execbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1655,10 +1655,8 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
* must be freed again. If it was submitted then it is being tracked
* on the active request list and no clean up is required here.
*/
if (ret && params->request) {
if (ret && params->request)
i915_gem_request_cancel(params->request);
ring->outstanding_lazy_request = NULL;
}

mutex_unlock(&dev->struct_mutex);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,6 @@ void intel_logical_ring_cleanup(struct intel_engine_cs *ring)

intel_logical_ring_stop(ring);
WARN_ON((I915_READ_MODE(ring) & MODE_IDLE) == 0);
i915_gem_request_assign(&ring->outstanding_lazy_request, NULL);

if (ring->cleanup)
ring->cleanup(ring);
Expand Down
8 changes: 0 additions & 8 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,6 @@ void intel_cleanup_ring_buffer(struct intel_engine_cs *ring)

intel_unpin_ringbuffer_obj(ringbuf);
intel_destroy_ringbuffer_obj(ringbuf);
i915_gem_request_assign(&ring->outstanding_lazy_request, NULL);

if (ring->cleanup)
ring->cleanup(ring);
Expand Down Expand Up @@ -2176,11 +2175,6 @@ int intel_ring_idle(struct intel_engine_cs *ring)
{
struct drm_i915_gem_request *req;

/* We need to add any requests required to flush the objects and ring */
WARN_ON(ring->outstanding_lazy_request);
if (ring->outstanding_lazy_request)
i915_add_request(ring->outstanding_lazy_request);

/* Wait upon the last request to be completed */
if (list_empty(&ring->request_list))
return 0;
Expand Down Expand Up @@ -2339,8 +2333,6 @@ void intel_ring_init_seqno(struct intel_engine_cs *ring, u32 seqno)
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;

BUG_ON(ring->outstanding_lazy_request);

if (INTEL_INFO(dev)->gen == 6 || INTEL_INFO(dev)->gen == 7) {
I915_WRITE(RING_SYNC_0(ring->mmio_base), 0);
I915_WRITE(RING_SYNC_1(ring->mmio_base), 0);
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/intel_ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,6 @@ struct intel_engine_cs {
*/
struct list_head request_list;

/**
* Do we have some not yet emitted requests outstanding?
*/
struct drm_i915_gem_request *outstanding_lazy_request;
bool gpu_caches_dirty;

wait_queue_head_t irq_queue;
Expand Down

0 comments on commit bccca49

Please sign in to comment.