sys/dev/drm/i915/intel_ringbuffer.c
/**
 * intel_ring_sync - sync the waiter to the signaller on seqno
 *
 * @waiter - ring that is waiting
 * @signaller - ring which has, or will signal
 * @seqno - seqno which the waiter will block on
 */
sync the waiter to the signaller on seqno
@waiter - ring that is waiting
@signaller - ring which has, or will signal
@seqno - seqno which the waiter will block on
sync the waiter to the signaller on seqno @waiter - ring that is waiting @signaller - ring which has or will signal @seqno - seqno which the waiter will block on
static int
gen8_ring_sync(struct drm_i915_gem_request *waiter_req,
	       struct intel_engine_cs *signaller,
	       u32 seqno)
{
	struct intel_engine_cs *waiter = waiter_req->engine;
	struct drm_i915_private *dev_priv = waiter_req->i915;
	u64 offset = GEN8_WAIT_OFFSET(waiter, signaller->id);
	struct i915_hw_ppgtt *ppgtt;
	int ret;
	ret = intel_ring_begin(waiter_req, 4);
	if (ret)
		return ret;
	intel_ring_emit(waiter, MI_SEMAPHORE_WAIT |
				MI_SEMAPHORE_GLOBAL_GTT |
				MI_SEMAPHORE_SAD_GTE_SDD);
	intel_ring_emit(waiter, seqno);
	intel_ring_emit(waiter, lower_32_bits(offset));
	intel_ring_emit(waiter, upper_32_bits(offset));
	intel_ring_advance(waiter);
	ppgtt = waiter_req->ctx->ppgtt;
	if (ppgtt && waiter_req->engine->id != RCS)
		ppgtt->pd_dirty_rings |= intel_engine_flag(waiter_req->engine);
	return 0;
}
static int gen8_ring_sync ( struct drm_i915_gem_request * waiter_req , struct intel_engine_cs * signaller , u32 seqno ) { struct intel_engine_cs * waiter = waiter_req -> engine ; struct drm_i915_private * dev_priv = waiter_req -> i915 ; u64 offset = GEN8_WAIT_OFFSET ( waiter , signaller -> id ) ; struct i915_hw_ppgtt * ppgtt ; int ret ; ret = intel_ring_begin ( waiter_req , 4 ) ; if ( ret ) return ret ; intel_ring_emit ( waiter , MI_SEMAPHORE_WAIT | MI_SEMAPHORE_GLOBAL_GTT | MI_SEMAPHORE_SAD_GTE_SDD ) ; intel_ring_emit ( waiter , seqno ) ; intel_ring_emit ( waiter , lower_32_bits ( offset ) ) ; intel_ring_emit ( waiter , upper_32_bits ( offset ) ) ; intel_ring_advance ( waiter ) ; ppgtt = waiter_req -> ctx -> ppgtt ; if ( ppgtt && waiter_req -> engine -> id != RCS ) ppgtt -> pd_dirty_rings |= intel_engine_flag ( waiter_req -> engine ) ; return 0 ; }
intel_ring_sync - sync the waiter to the signaller on seqno
 @waiter - ring that is waiting
 @signaller - ring which has, or will signal
 @seqno - seqno which the waiter will block on
intel_ring_sync - sync the waiter to the signaller on seqno @waiter - ring that is waiting @signaller - ring which has or will signal @seqno - seqno which the waiter will block on
/* When the !RCS engines idle waiting upon a semaphore, they lose their
	 * pagetables and we must reload them before executing the batch.
	 * We do this on the i915_switch_context() following the wait and
	 * before the dispatch.
	 */