anv: Take a device parameter in anv_state_flush

This allows the helper to check for llc instead of having to do it
manually at all the call sites.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand
2017-02-20 11:04:12 -08:00
parent f408971deb
commit f31ed6d0cd
9 changed files with 32 additions and 52 deletions

View File

@@ -587,8 +587,7 @@ anv_cmd_buffer_emit_dynamic(struct anv_cmd_buffer *cmd_buffer,
state = anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, size, alignment);
memcpy(state.map, data, size);
if (!cmd_buffer->device->info.has_llc)
anv_state_flush(state);
anv_state_flush(cmd_buffer->device, state);
VG(VALGRIND_CHECK_MEM_IS_DEFINED(state.map, size));
@@ -609,8 +608,7 @@ anv_cmd_buffer_merge_dynamic(struct anv_cmd_buffer *cmd_buffer,
for (uint32_t i = 0; i < dwords; i++)
p[i] = a[i] | b[i];
if (!cmd_buffer->device->info.has_llc)
anv_state_flush(state);
anv_state_flush(cmd_buffer->device, state);
VG(VALGRIND_CHECK_MEM_IS_DEFINED(p, dwords * 4));
@@ -646,8 +644,7 @@ anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer,
u32_map[i] = *(uint32_t *)((uint8_t *)data + offset);
}
if (!cmd_buffer->device->info.has_llc)
anv_state_flush(state);
anv_state_flush(cmd_buffer->device, state);
return state;
}
@@ -706,8 +703,7 @@ anv_cmd_buffer_cs_push_constants(struct anv_cmd_buffer *cmd_buffer)
}
}
if (!cmd_buffer->device->info.has_llc)
anv_state_flush(state);
anv_state_flush(cmd_buffer->device, state);
return state;
}