diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 1 |
4 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index ba0f5b690291..239a382c8b55 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -2156,8 +2156,9 @@ struct drm_i915_gem_request { | |||
2156 | /** Position in the ringbuffer of the end of the whole request */ | 2156 | /** Position in the ringbuffer of the end of the whole request */ |
2157 | u32 tail; | 2157 | u32 tail; |
2158 | 2158 | ||
2159 | /** Context related to this request */ | 2159 | /** Context and ring buffer related to this request */ |
2160 | struct intel_context *ctx; | 2160 | struct intel_context *ctx; |
2161 | struct intel_ringbuffer *ringbuf; | ||
2161 | 2162 | ||
2162 | /** Batch buffer related to this request if any */ | 2163 | /** Batch buffer related to this request if any */ |
2163 | struct drm_i915_gem_object *batch_obj; | 2164 | struct drm_i915_gem_object *batch_obj; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f28f0dea6c96..14ca4cd5e6d7 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2763,7 +2763,6 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring) | |||
2763 | 2763 | ||
2764 | while (!list_empty(&ring->request_list)) { | 2764 | while (!list_empty(&ring->request_list)) { |
2765 | struct drm_i915_gem_request *request; | 2765 | struct drm_i915_gem_request *request; |
2766 | struct intel_ringbuffer *ringbuf; | ||
2767 | 2766 | ||
2768 | request = list_first_entry(&ring->request_list, | 2767 | request = list_first_entry(&ring->request_list, |
2769 | struct drm_i915_gem_request, | 2768 | struct drm_i915_gem_request, |
@@ -2774,23 +2773,12 @@ i915_gem_retire_requests_ring(struct intel_engine_cs *ring) | |||
2774 | 2773 | ||
2775 | trace_i915_gem_request_retire(request); | 2774 | trace_i915_gem_request_retire(request); |
2776 | 2775 | ||
2777 | /* This is one of the few common intersection points | ||
2778 | * between legacy ringbuffer submission and execlists: | ||
2779 | * we need to tell them apart in order to find the correct | ||
2780 | * ringbuffer to which the request belongs to. | ||
2781 | */ | ||
2782 | if (i915.enable_execlists) { | ||
2783 | struct intel_context *ctx = request->ctx; | ||
2784 | ringbuf = ctx->engine[ring->id].ringbuf; | ||
2785 | } else | ||
2786 | ringbuf = ring->buffer; | ||
2787 | |||
2788 | /* We know the GPU must have read the request to have | 2776 | /* We know the GPU must have read the request to have |
2789 | * sent us the seqno + interrupt, so use the position | 2777 | * sent us the seqno + interrupt, so use the position |
2790 | * of tail of the request to update the last known position | 2778 | * of tail of the request to update the last known position |
2791 | * of the GPU head. | 2779 | * of the GPU head. |
2792 | */ | 2780 | */ |
2793 | ringbuf->last_retired_head = request->postfix; | 2781 | request->ringbuf->last_retired_head = request->postfix; |
2794 | 2782 | ||
2795 | i915_gem_free_request(request); | 2783 | i915_gem_free_request(request); |
2796 | } | 2784 | } |
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 09af288da6d4..a1a2a61118ba 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -888,12 +888,9 @@ static int logical_ring_alloc_request(struct intel_engine_cs *ring, | |||
888 | return ret; | 888 | return ret; |
889 | } | 889 | } |
890 | 890 | ||
891 | /* Hold a reference to the context this request belongs to | ||
892 | * (we will need it when the time comes to emit/retire the | ||
893 | * request). | ||
894 | */ | ||
895 | request->ctx = ctx; | 891 | request->ctx = ctx; |
896 | i915_gem_context_reference(request->ctx); | 892 | i915_gem_context_reference(request->ctx); |
893 | request->ringbuf = ctx->engine[ring->id].ringbuf; | ||
897 | 894 | ||
898 | ring->outstanding_lazy_request = request; | 895 | ring->outstanding_lazy_request = request; |
899 | return 0; | 896 | return 0; |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 4a4a7aec0fc3..94dc98b44adc 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -2230,6 +2230,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring) | |||
2230 | 2230 | ||
2231 | kref_init(&request->ref); | 2231 | kref_init(&request->ref); |
2232 | request->ring = ring; | 2232 | request->ring = ring; |
2233 | request->ringbuf = ring->buffer; | ||
2233 | request->uniq = dev_private->request_uniq++; | 2234 | request->uniq = dev_private->request_uniq++; |
2234 | 2235 | ||
2235 | ret = i915_gem_get_seqno(ring->dev, &request->seqno); | 2236 | ret = i915_gem_get_seqno(ring->dev, &request->seqno); |