Mesa (master): anv: pass context to reset stats helper
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 28 18:34:22 UTC 2021
Module: Mesa
Branch: master
Commit: 34721e2af488eb68ef65c6e2465aa8c0bcd79dee
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=34721e2af488eb68ef65c6e2465aa8c0bcd79dee
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Fri Dec 11 15:36:40 2020 +0200
anv: pass context to reset stats helper
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>
---
src/intel/vulkan/anv_device.c | 3 ++-
src/intel/vulkan/anv_gem.c | 8 ++++----
src/intel/vulkan/anv_gem_stubs.c | 4 ++--
src/intel/vulkan/anv_private.h | 4 ++--
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 3804785c9a9..566d5dbe7b3 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -3347,7 +3347,8 @@ anv_device_query_status(struct anv_device *device)
return VK_ERROR_DEVICE_LOST;
uint32_t active, pending;
- int ret = anv_gem_gpu_get_reset_stats(device, &active, &pending);
+ int ret = anv_gem_context_get_reset_stats(device->fd, device->context_id,
+ &active, &pending);
if (ret == -1) {
/* We don't know the real error. */
return anv_device_set_lost(device, "get_reset_stats failed: %m");
diff --git a/src/intel/vulkan/anv_gem.c b/src/intel/vulkan/anv_gem.c
index 4c43f5f77b4..7cd37d60e27 100644
--- a/src/intel/vulkan/anv_gem.c
+++ b/src/intel/vulkan/anv_gem.c
@@ -416,14 +416,14 @@ anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t *value)
}
int
-anv_gem_gpu_get_reset_stats(struct anv_device *device,
- uint32_t *active, uint32_t *pending)
+anv_gem_context_get_reset_stats(int fd, int context,
+ uint32_t *active, uint32_t *pending)
{
struct drm_i915_reset_stats stats = {
- .ctx_id = device->context_id,
+ .ctx_id = context,
};
- int ret = gen_ioctl(device->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
+ int ret = gen_ioctl(fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
if (ret == 0) {
*active = stats.batch_active;
*pending = stats.batch_pending;
diff --git a/src/intel/vulkan/anv_gem_stubs.c b/src/intel/vulkan/anv_gem_stubs.c
index 35285c08d71..699502ad618 100644
--- a/src/intel/vulkan/anv_gem_stubs.c
+++ b/src/intel/vulkan/anv_gem_stubs.c
@@ -172,8 +172,8 @@ anv_gem_has_context_priority(int fd)
}
int
-anv_gem_gpu_get_reset_stats(struct anv_device *device,
- uint32_t *active, uint32_t *pending)
+anv_gem_context_get_reset_stats(int fd, int context,
+ uint32_t *active, uint32_t *pending)
{
unreachable("Unused");
}
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 0d258b6973b..005f458da03 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1606,8 +1606,8 @@ int anv_gem_get_param(int fd, uint32_t param);
uint64_t anv_gem_get_drm_cap(int fd, uint32_t capability);
int anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle);
bool anv_gem_get_bit6_swizzle(int fd, uint32_t tiling);
-int anv_gem_gpu_get_reset_stats(struct anv_device *device,
- uint32_t *active, uint32_t *pending);
+int anv_gem_context_get_reset_stats(int fd, int context,
+ uint32_t *active, uint32_t *pending);
int anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle);
int anv_gem_reg_read(int fd, uint32_t offset, uint64_t *result);
uint32_t anv_gem_fd_to_handle(struct anv_device *device, int fd);
More information about the mesa-commit
mailing list