anv/blorp: Flush the texture cache in UpdateBuffer

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 939337e49f)
[Andres Gomez: replace anv_state_flush with anv_state_clflush]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/anv_blorp.c

Squashed with commit:

anv: blorp: flush memory after copy

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d71efbe5f2)
[Andres Gomez: replace anv_state_flush with anv_state_clflush]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/intel/vulkan/anv_blorp.c
This commit is contained in:
Jason Ekstrand 2017-03-31 15:33:51 -07:00 committed by Andres Gomez
parent a6a42a84cf
commit c09f729d93

View file

@ -683,6 +683,11 @@ void anv_CmdUpdateBuffer(
assert(max_update_size < MAX_SURFACE_DIM * 4);
/* We're about to read data that was written from the CPU. Flush the
* texture cache so we don't get anything stale.
*/
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
while (dataSize) {
const uint32_t copy_size = MIN2(dataSize, max_update_size);
@ -691,6 +696,9 @@ void anv_CmdUpdateBuffer(
memcpy(tmp_data.map, pData, copy_size);
if (!cmd_buffer->device->info.has_llc)
anv_state_clflush(tmp_data);
int bs = 16;
bs = gcd_pow2_u64(bs, dstOffset);
bs = gcd_pow2_u64(bs, copy_size);