drm/i915: Update ring->signal() to take a request structure
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>
This commit is contained in:
parent
599d924c6b
commit
f71696876a
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue