[Intel-gfx] [PATCH v2 19/28] drm/i915: Connect requests to rings at creation not submission
John.C.Harrison at Intel.com
John.C.Harrison at Intel.com
Fri Nov 14 13:19:10 CET 2014
From: John Harrison <John.C.Harrison at Intel.com>
It makes a lot more sense (and makes future seqno -> request conversion patches
simpler) to fill in the 'ring' field of the request structure at the point of
creation rather than submission. Given that the request structure is assigned by
ring specific code and thus is locked to a ring from the start, there really is
no reason to defer this assignment.
For: VIZ-4377
Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 1 -
drivers/gpu/drm/i915/intel_lrc.c | 1 +
drivers/gpu/drm/i915/intel_ringbuffer.c | 1 +
3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 30fb486..49dfb63 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2465,7 +2465,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
return ret;
}
- request->ring = ring;
request->head = request_start;
request->tail = request_ring_position;
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index b2ec8ab..a583cf3 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -805,6 +805,7 @@ static int logical_ring_alloc_request(struct intel_engine_cs *ring,
return -ENOMEM;
kref_init(&request->ref);
+ request->ring = ring;
ret = i915_gem_get_seqno(ring->dev, &request->seqno);
if (ret) {
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index f86275d..f29c31e 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2042,6 +2042,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring)
return -ENOMEM;
kref_init(&request->ref);
+ request->ring = ring;
ret = i915_gem_get_seqno(ring->dev, &request->seqno);
if (ret) {
--
1.7.9.5
More information about the Intel-gfx
mailing list