obj = i915_gem_object_create_lmem(i915, size, I915_BO_ALLOC_VOLATILE |
I915_BO_ALLOC_PM_VOLATILE); if (IS_ERR(obj) && i915_ggtt_has_aperture(ggtt) && !HAS_LLC(i915))
obj = i915_gem_object_create_stolen(i915, size); if (IS_ERR(obj))
obj = i915_gem_object_create_internal(i915, size); if (IS_ERR(obj)) return ERR_CAST(obj);
/* * Mark ring buffers as read-only from GPU side (so no stray overwrites) * if supported by the platform's GGTT.
*/ if (vm->has_read_only)
i915_gem_object_set_readonly(obj);
vma = i915_vma_instance(obj, vm, NULL); if (IS_ERR(vma)) goto err;
/* * Workaround an erratum on the i830 which causes a hang if * the TAIL pointer points to within the last 2 cachelines * of the buffer.
*/
ring->effective_size = size; if (IS_I830(i915) || IS_I845G(i915))
ring->effective_size -= 2 * CACHELINE_BYTES;
if (bytes > remain_usable) { /* * Not enough space for the basic request. So need to * flush out the remainder and then wait for * base + reserved.
*/
total_bytes += remain_actual;
need_wrap = remain_actual | 1;
} else { /* * The base request will fit but the reserved space * falls off the end. So we don't need an immediate * wrap and only need to effectively wait for the * reserved size from the start of ringbuffer.
*/
total_bytes = rq->reserved_space + remain_actual;
}
}
if (unlikely(total_bytes > ring->space)) { int ret;
/* * Space is reserved in the ringbuffer for finalising the * request, as that cannot be allowed to fail. During request * finalisation, reserved_space is set to 0 to stop the * overallocation and the assumption is that then we never need * to wait (which has the risk of failing with EINTR). * * See also i915_request_alloc() and i915_request_add().
*/
GEM_BUG_ON(!rq->reserved_space);
ret = wait_for_space(ring,
i915_request_timeline(rq),
total_bytes); if (unlikely(ret)) return ERR_PTR(ret);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.