anv: Add anv_device_perf_close()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31026>
This commit is contained in:
@@ -94,6 +94,16 @@ anv_device_perf_init(struct anv_device *device)
|
|||||||
device->perf_fd = -1;
|
device->perf_fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
anv_device_perf_close(struct anv_device *device)
|
||||||
|
{
|
||||||
|
if (device->perf_fd == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
close(device->perf_fd);
|
||||||
|
device->perf_fd = -1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
anv_device_perf_open(struct anv_device *device, uint64_t metric_id)
|
anv_device_perf_open(struct anv_device *device, uint64_t metric_id)
|
||||||
{
|
{
|
||||||
@@ -245,10 +255,7 @@ void anv_UninitializePerformanceApiINTEL(
|
|||||||
{
|
{
|
||||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
ANV_FROM_HANDLE(anv_device, device, _device);
|
||||||
|
|
||||||
if (device->perf_fd >= 0) {
|
anv_device_perf_close(device);
|
||||||
close(device->perf_fd);
|
|
||||||
device->perf_fd = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* VK_KHR_performance_query */
|
/* VK_KHR_performance_query */
|
||||||
@@ -381,11 +388,7 @@ void anv_ReleaseProfilingLockKHR(
|
|||||||
{
|
{
|
||||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
ANV_FROM_HANDLE(anv_device, device, _device);
|
||||||
|
|
||||||
if (!INTEL_DEBUG(DEBUG_NO_OACONFIG)) {
|
anv_device_perf_close(device);
|
||||||
assert(device->perf_fd >= 0);
|
|
||||||
close(device->perf_fd);
|
|
||||||
}
|
|
||||||
device->perf_fd = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -6173,6 +6173,7 @@ struct anv_performance_configuration_intel {
|
|||||||
void anv_physical_device_init_va_ranges(struct anv_physical_device *device);
|
void anv_physical_device_init_va_ranges(struct anv_physical_device *device);
|
||||||
void anv_physical_device_init_perf(struct anv_physical_device *device, int fd);
|
void anv_physical_device_init_perf(struct anv_physical_device *device, int fd);
|
||||||
void anv_device_perf_init(struct anv_device *device);
|
void anv_device_perf_init(struct anv_device *device);
|
||||||
|
void anv_device_perf_close(struct anv_device *device);
|
||||||
void anv_perf_write_pass_results(struct intel_perf_config *perf,
|
void anv_perf_write_pass_results(struct intel_perf_config *perf,
|
||||||
struct anv_query_pool *pool, uint32_t pass,
|
struct anv_query_pool *pool, uint32_t pass,
|
||||||
const struct intel_perf_query_result *accumulated_results,
|
const struct intel_perf_query_result *accumulated_results,
|
||||||
|
Reference in New Issue
Block a user