[Intel-gfx] [PATCH v2] drm/i915: use a separate context for gpu relocs

Chris Wilson chris at chris-wilson.co.uk
Tue Aug 27 19:49:25 UTC 2019


Quoting Daniele Ceraolo Spurio (2019-08-27 19:58:05)
> The CS pre-parser can pre-fetch commands across memory sync points and
> starting from gen12 it is able to pre-fetch across BB_START and BB_END
> boundaries as well, so when we emit gpu relocs the pre-parser might
> fetch the target location of the reloc before the memory write lands.
> 
> The parser can't pre-fetch across the ctx switch, so we use a separate
> context to guarantee that the memory is synchronized before the parser
> can get to it.
> 
> Note that there is no risk of the CS doing a lite restore from the reloc
> context to the user context, even if the two have the same hw_id,
> because since gen11 the CS also checks the LRCA when deciding if it can
> lite-restore.
> 
> v2: limit new context to gen12+, release in eb_destroy, add a comment
>     in emit_fini_breadcrumb (Chris).
> 
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>

Looks solid and the big explanatory reminders are very welcome. (I will
shift it to gen11_fini_breadcrumbs I think, so it's closer to the gen12
divide.) Subtle changes in behaviour are easily forgotten.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list