[Intel-gfx] [PATCH] drm/i915: Rings are always flushed
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Thu Jun 20 16:26:04 UTC 2019
On 19/06/2019 21:35, Chris Wilson wrote:
> Our intel_rings are always flushed as they are continually used to submit
> commands to the GPU, and so do not need to be flushed on unpinning. This
> avoids pulling in the flush_ggtt_writes locking intou our context
> unpin, which we want to allow from atomic context (for simplicity).
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/gt/intel_ringbuffer.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> index 12010e798868..8b1da57c3764 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ringbuffer.c
> @@ -1219,6 +1219,7 @@ void intel_ring_unpin(struct intel_ring *ring)
> intel_ring_reset(ring, ring->tail);
>
> GEM_BUG_ON(!ring->vma);
> + i915_vma_unset_ggtt_write(ring->vma);
> if (i915_vma_is_map_and_fenceable(ring->vma))
> i915_vma_unpin_iomap(ring->vma);
> else
>
Safe but for documentation purposes I would prefer something like:
i915_vma_pin_iomap(vma, flags = ..._FLAG_DIRECT/ASYNC/IKNOWBETTER)
{
...
if (!(flags & FLAG_DIRECT))
i915_vma_set_ggtt_write(vma);
...
}
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Regards,
Tvrtko
More information about the Intel-gfx
mailing list