anv/batch_chain: Don't start a new BO just for BATCH_BUFFER_START
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 2 Oct 2018 22:19:32 +0000 (17:19 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 3 Oct 2018 14:03:12 +0000 (09:03 -0500)
commitf5bab06428fc7ca6116cf0daf1c237eb86202e7a
treeec255cd01a21bd1e4ef9ecada5276ef911c2fc23
parent7a89a0d9edae638e68e4b4ee8e0cbb34baa9c080
anv/batch_chain: Don't start a new BO just for BATCH_BUFFER_START

Previously, we just went ahead and emitted MI_BATCH_BUFFER_START as
normal.  If we are near enough to the end, this can cause us to start a
new BO just for the MI_BATCH_BUFFER_START which messes up chaining.  We
always reserve enough space at the end for an MI_BATCH_BUFFER_START so
we can just increment cmd_buffer->batch.end prior to emitting the
command.

Fixes: a0b133286a3 "anv/batch_chain: Simplify secondary batch return..."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107926
Tested-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_batch_chain.c