Skip to content

Commit ff79e85

Browse files
johnharr-inteldanvet
authored andcommitted
drm/i915: Connect requests to rings at creation not submission
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>
1 parent 44cdd6d commit ff79e85

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,6 @@ int __i915_add_request(struct intel_engine_cs *ring,
24632463
return ret;
24642464
}
24652465

2466-
request->ring = ring;
24672466
request->head = request_start;
24682467
request->tail = request_ring_position;
24692468

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static int logical_ring_alloc_request(struct intel_engine_cs *ring,
898898
}
899899

900900
kref_init(&request->ref);
901+
request->ring = ring;
901902

902903
ret = i915_gem_get_seqno(ring->dev, &request->seqno);
903904
if (ret) {

drivers/gpu/drm/i915/intel_ringbuffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring)
20442044
return -ENOMEM;
20452045

20462046
kref_init(&request->ref);
2047+
request->ring = ring;
20472048

20482049
ret = i915_gem_get_seqno(ring->dev, &request->seqno);
20492050
if (ret) {

0 commit comments

Comments
 (0)