sys/dev/drm/i915/intel_ringbuffer.c
/* Align the ring tail to a cacheline boundary */
Align the ring tail to a cacheline boundary
Align the ring tail to a cacheline boundary
int intel_ring_cacheline_align(struct drm_i915_gem_request *req)
{
	struct intel_engine_cs *engine = req->engine;
	int num_dwords = (engine->buffer->tail & (CACHELINE_BYTES - 1)) / sizeof(uint32_t);
	int ret;
	if (num_dwords == 0)
		return 0;
	num_dwords = CACHELINE_BYTES / sizeof(uint32_t) - num_dwords;
	ret = intel_ring_begin(req, num_dwords);
	if (ret)
		return ret;
	while (num_dwords--)
		intel_ring_emit(engine, MI_NOOP);
	intel_ring_advance(engine);
	return 0;
}
int intel_ring_cacheline_align ( struct drm_i915_gem_request * req ) { struct intel_engine_cs * engine = req -> engine ; int num_dwords = ( engine -> buffer -> tail & ( CACHELINE_BYTES - 1 ) ) / sizeof ( uint32_t ) ; int ret ; if ( num_dwords == 0 ) return 0 ; num_dwords = CACHELINE_BYTES / sizeof ( uint32_t ) - num_dwords ; ret = intel_ring_begin ( req , num_dwords ) ; if ( ret ) return ret ; while ( num_dwords -- ) intel_ring_emit ( engine , MI_NOOP ) ; intel_ring_advance ( engine ) ; return 0 ; }
Align the ring tail to a cacheline boundary
Align the ring tail to a cacheline boundary