]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/i915: Connect requests to rings at creation not submission
authorJohn Harrison <John.C.Harrison@Intel.com>
Mon, 24 Nov 2014 18:49:41 +0000 (18:49 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 3 Dec 2014 08:35:22 +0000 (09:35 +0100)
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>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c

index e79815531e1a8ee66e70c484e032c5d9a1b17f63..8285c08d78c1ac8a62bb0d1494542fbd292ba247 100644 (file)
@@ -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;
 
index 1ed25a120159c35a18f74723243c9e8a4015c0b9..b13221b86b05bbabb103351bd4d8c100d9bfc931 100644 (file)
@@ -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) {
index abdaafd73c77dc07beb7aabe852c22b7ed2406a9..788e1b6648ac0dd9f18f912c0a24ae3b48d22076 100644 (file)
@@ -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) {