Skip to content

Commit

Permalink
drm/i915: Connect requests to rings at creation not submission
Browse files Browse the repository at this point in the history
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@Intel.com>
Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
John Harrison authored and Daniel Vetter committed Dec 3, 2014
1 parent 44cdd6d commit ff79e85
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
return ret;
}

request->ring = ring;
request->head = request_start;
request->tail = request_ring_position;

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ static int logical_ring_alloc_request(struct intel_engine_cs *ring,
}

kref_init(&request->ref);
request->ring = ring;

ret = i915_gem_get_seqno(ring->dev, &request->seqno);
if (ret) {
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/intel_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,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) {
Expand Down

0 comments on commit ff79e85

Please sign in to comment.