turnip/kgsl: support VK_KHR_performance_query
Signed-off-by: Hyunjun Ko <zzoon@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6808>
This commit is contained in:
parent
3d90909837
commit
19a7a915ca
|
@ -30,6 +30,7 @@
|
|||
#include <sys/mman.h>
|
||||
|
||||
#include "msm_kgsl.h"
|
||||
#include "vk_util.h"
|
||||
|
||||
struct tu_syncobj {
|
||||
struct vk_object_base base;
|
||||
|
@ -336,10 +337,16 @@ tu_QueueSubmit(VkQueue _queue,
|
|||
for (uint32_t i = 0; i < submitCount; ++i) {
|
||||
const VkSubmitInfo *submit = pSubmits + i;
|
||||
|
||||
const VkPerformanceQuerySubmitInfoKHR *perf_info =
|
||||
vk_find_struct_const(pSubmits[i].pNext,
|
||||
PERFORMANCE_QUERY_SUBMIT_INFO_KHR);
|
||||
|
||||
uint32_t entry_count = 0;
|
||||
for (uint32_t j = 0; j < submit->commandBufferCount; ++j) {
|
||||
TU_FROM_HANDLE(tu_cmd_buffer, cmdbuf, submit->pCommandBuffers[j]);
|
||||
entry_count += cmdbuf->cs.entry_count;
|
||||
if (perf_info)
|
||||
entry_count++;
|
||||
}
|
||||
|
||||
max_entry_count = MAX2(max_entry_count, entry_count);
|
||||
|
@ -355,10 +362,28 @@ tu_QueueSubmit(VkQueue _queue,
|
|||
for (uint32_t i = 0; i < submitCount; ++i) {
|
||||
const VkSubmitInfo *submit = pSubmits + i;
|
||||
uint32_t entry_idx = 0;
|
||||
const VkPerformanceQuerySubmitInfoKHR *perf_info =
|
||||
vk_find_struct_const(pSubmits[i].pNext,
|
||||
PERFORMANCE_QUERY_SUBMIT_INFO_KHR);
|
||||
|
||||
|
||||
for (uint32_t j = 0; j < submit->commandBufferCount; j++) {
|
||||
TU_FROM_HANDLE(tu_cmd_buffer, cmdbuf, submit->pCommandBuffers[j]);
|
||||
struct tu_cs *cs = &cmdbuf->cs;
|
||||
|
||||
if (perf_info) {
|
||||
struct tu_cs_entry *perf_cs_entry =
|
||||
&cmdbuf->device->perfcntrs_pass_cs_entries[perf_info->counterPassIndex];
|
||||
|
||||
cmds[entry_idx++] = (struct kgsl_command_object) {
|
||||
.offset = perf_cs_entry->offset,
|
||||
.gpuaddr = perf_cs_entry->bo->iova,
|
||||
.size = perf_cs_entry->size,
|
||||
.flags = KGSL_CMDLIST_IB,
|
||||
.id = perf_cs_entry->bo->gem_handle,
|
||||
};
|
||||
}
|
||||
|
||||
for (unsigned k = 0; k < cs->entry_count; k++) {
|
||||
cmds[entry_idx++] = (struct kgsl_command_object) {
|
||||
.offset = cs->entries[k].offset,
|
||||
|
|
Loading…
Reference in New Issue