mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-02-21 18:54:18 +01:00
fixed perfmon creation and getting values
This commit is contained in:
parent
73e72e86e0
commit
eaf884547e
@ -596,6 +596,7 @@ uint32_t vc4_create_perfmon(int fd, uint32_t* counters, uint32_t num_counters)
|
||||
|
||||
struct drm_vc4_perfmon_create arg =
|
||||
{
|
||||
.id = 0,
|
||||
.ncounters = num_counters,
|
||||
};
|
||||
|
||||
@ -611,6 +612,13 @@ uint32_t vc4_create_perfmon(int fd, uint32_t* counters, uint32_t num_counters)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!arg.id)
|
||||
{
|
||||
fprintf(stderr, "Perfmon create failed (invalid ID): %s\n",
|
||||
strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return arg.id;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkCreateQueryPool(
|
||||
|
||||
for(uint32_t d = 0; d < ci.counterIndexCount; d += DRM_VC4_MAX_PERF_COUNTERS)
|
||||
{
|
||||
qp->queryPool[c].perfmonIDs[d] = vc4_create_perfmon(controlFd, &qp->queryPool[c].enabledCounters[d], qp->queryPool[c].numEnabledCounters > DRM_VC4_MAX_PERF_COUNTERS ? DRM_VC4_MAX_PERF_COUNTERS : qp->queryPool[c].numEnabledCounters);
|
||||
qp->queryPool[c].perfmonIDs[d / DRM_VC4_MAX_PERF_COUNTERS] = vc4_create_perfmon(controlFd, &qp->queryPool[c].enabledCounters[d], qp->queryPool[c].numEnabledCounters > DRM_VC4_MAX_PERF_COUNTERS ? DRM_VC4_MAX_PERF_COUNTERS : qp->queryPool[c].numEnabledCounters);
|
||||
memset(&qp->queryPool[c].counterValues[d][0], 0, sizeof(uint64_t) * DRM_VC4_MAX_PERF_COUNTERS);
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ VKAPI_ATTR void VKAPI_CALL rpi_vkDestroyQueryPool(
|
||||
{
|
||||
for(uint32_t d = 0; d < qp->queryPool[c].numEnabledCounters; d += DRM_VC4_MAX_PERF_COUNTERS)
|
||||
{
|
||||
vc4_destroy_perfmon(controlFd, qp->queryPool[c].perfmonIDs[d]);
|
||||
vc4_destroy_perfmon(controlFd, qp->queryPool[c].perfmonIDs[d / DRM_VC4_MAX_PERF_COUNTERS]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ VKAPI_ATTR VkResult VKAPI_CALL rpi_vkGetQueryPoolResults(
|
||||
{
|
||||
for(uint32_t d = 0; d < qp->queryPool[c].numEnabledCounters; d += DRM_VC4_MAX_PERF_COUNTERS)
|
||||
{
|
||||
vc4_perfmon_get_values(controlFd, qp->queryPool[c].perfmonIDs[d], &qp->queryPool[c].counterValues[d][0]);
|
||||
vc4_perfmon_get_values(controlFd, qp->queryPool[c].perfmonIDs[d / DRM_VC4_MAX_PERF_COUNTERS], &qp->queryPool[c].counterValues[d][0]);
|
||||
}
|
||||
|
||||
uint32_t counter = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user