anv: Do relocations in userspace before execbuf ioctl

Graphics / Mesa 3D Graphics Library / Mesa - Kristian Høgsberg Kristensen [intel.com] - 9 November 2016 13:31 UTC

Since our surface state buffer is shared by all batches, the kernel does a full stall and sync with the CPU between batches every time we call execbuf2 because it refuses to do relocations on an active buffer. Doing them in userspace and passing the NO_RELOC flag to the kernel allows us to perform the relocations without stalling.

This improves the performance of Dota 2 by around 30% on a Sky Lake GT2.

v2 (Jason Ekstrand):- Better comments (Chris Wilson)- Fixed write_reloc for correct canonical form (Chris Wilson)

v3 (Jason Ekstrand):- Skip relocations which aren't needed- Provide an environment variable to always use the kernel- More comments about correctness (Chris Wilson)

v4 (Jason Ekstrand):- More comments (Chris Wilson)

v5 (Jason Ekstrand):- Rebase on top of moving execbuf2 setup go QueueSubmit

b3a29f2 anv: Do relocations in userspace before execbuf ioctl
src/intel/vulkan/anv_batch_chain.c | 151 ++++++++++++++++++++++++++++++++++--
src/intel/vulkan/anv_device.c | 8 +-
2 files changed, 150 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org


  • Share