]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Update ring->signal() to take a request structure
authorJohn Harrison <John.C.Harrison@Intel.com>
Fri, 29 May 2015 16:44:05 +0000 (17:44 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 23 Jun 2015 12:02:27 +0000 (14:02 +0200)
Updated the various ring->signal() implementations to take a request instead of
a ring. This removes their reliance on the OLR to obtain the seqno value that
should be used for the signal.

For: VIZ-5115
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index eb436a03fae95cb6b1490714e3a87b6d4a91e102..e6ef8d79631115c8c5e86ea3f7bc1a83127146eb 100644 (file)
@@ -1171,10 +1171,11 @@ static void render_ring_cleanup(struct intel_engine_cs *ring)
        intel_fini_pipe_control(ring);
 }
 
-static int gen8_rcs_signal(struct intel_engine_cs *signaller,
+static int gen8_rcs_signal(struct drm_i915_gem_request *signaller_req,
                           unsigned int num_dwords)
 {
 #define MBOX_UPDATE_DWORDS 8
+       struct intel_engine_cs *signaller = signaller_req->ring;
        struct drm_device *dev = signaller->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_engine_cs *waiter;
@@ -1194,8 +1195,7 @@ static int gen8_rcs_signal(struct intel_engine_cs *signaller,
                if (gtt_offset == MI_SEMAPHORE_SYNC_INVALID)
                        continue;
 
-               seqno = i915_gem_request_get_seqno(
-                                          signaller->outstanding_lazy_request);
+               seqno = i915_gem_request_get_seqno(signaller_req);
                intel_ring_emit(signaller, GFX_OP_PIPE_CONTROL(6));
                intel_ring_emit(signaller, PIPE_CONTROL_GLOBAL_GTT_IVB |
                                           PIPE_CONTROL_QW_WRITE |
@@ -1212,10 +1212,11 @@ static int gen8_rcs_signal(struct intel_engine_cs *signaller,
        return 0;
 }
 
-static int gen8_xcs_signal(struct intel_engine_cs *signaller,
+static int gen8_xcs_signal(struct drm_i915_gem_request *signaller_req,
                           unsigned int num_dwords)
 {
 #define MBOX_UPDATE_DWORDS 6
+       struct intel_engine_cs *signaller = signaller_req->ring;
        struct drm_device *dev = signaller->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_engine_cs *waiter;
@@ -1235,8 +1236,7 @@ static int gen8_xcs_signal(struct intel_engine_cs *signaller,
                if (gtt_offset == MI_SEMAPHORE_SYNC_INVALID)
                        continue;
 
-               seqno = i915_gem_request_get_seqno(
-                                          signaller->outstanding_lazy_request);
+               seqno = i915_gem_request_get_seqno(signaller_req);
                intel_ring_emit(signaller, (MI_FLUSH_DW + 1) |
                                           MI_FLUSH_DW_OP_STOREDW);
                intel_ring_emit(signaller, lower_32_bits(gtt_offset) |
@@ -1251,9 +1251,10 @@ static int gen8_xcs_signal(struct intel_engine_cs *signaller,
        return 0;
 }
 
-static int gen6_signal(struct intel_engine_cs *signaller,
+static int gen6_signal(struct drm_i915_gem_request *signaller_req,
                       unsigned int num_dwords)
 {
+       struct intel_engine_cs *signaller = signaller_req->ring;
        struct drm_device *dev = signaller->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_engine_cs *useless;
@@ -1271,8 +1272,7 @@ static int gen6_signal(struct intel_engine_cs *signaller,
        for_each_ring(useless, dev_priv, i) {
                u32 mbox_reg = signaller->semaphore.mbox.signal[i];
                if (mbox_reg != GEN6_NOSYNC) {
-                       u32 seqno = i915_gem_request_get_seqno(
-                                          signaller->outstanding_lazy_request);
+                       u32 seqno = i915_gem_request_get_seqno(signaller_req);
                        intel_ring_emit(signaller, MI_LOAD_REGISTER_IMM(1));
                        intel_ring_emit(signaller, mbox_reg);
                        intel_ring_emit(signaller, seqno);
@@ -1301,7 +1301,7 @@ gen6_add_request(struct drm_i915_gem_request *req)
        int ret;
 
        if (ring->semaphore.signal)
-               ret = ring->semaphore.signal(ring, 4);
+               ret = ring->semaphore.signal(req, 4);
        else
                ret = intel_ring_begin(ring, 4);
 
index 6853f8f0ee2994e58d981b77e7373826f526ecc5..ca04f3f587571aaf2c490edf9b11dc326363e98c 100644 (file)
@@ -255,7 +255,7 @@ struct  intel_engine_cs {
                int     (*sync_to)(struct drm_i915_gem_request *to_req,
                                   struct intel_engine_cs *from,
                                   u32 seqno);
-               int     (*signal)(struct intel_engine_cs *signaller,
+               int     (*signal)(struct drm_i915_gem_request *signaller_req,
                                  /* num_dwords needed by caller */
                                  unsigned int num_dwords);
        } semaphore;