anv: Support i915 query (DRM_IOCTL_I915_QUERY) from Linux v4.17
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8667>
This commit is contained in:
parent
8d07f71918
commit
c0d07c838a
|
@ -660,3 +660,24 @@ anv_gem_syncobj_timeline_query(struct anv_device *device,
|
|||
|
||||
return gen_ioctl(device->fd, DRM_IOCTL_SYNCOBJ_QUERY, &args);
|
||||
}
|
||||
|
||||
int
|
||||
anv_i915_query(int fd, uint64_t query_id, void *buffer,
|
||||
int32_t *buffer_len)
|
||||
{
|
||||
struct drm_i915_query_item item = {
|
||||
.query_id = query_id,
|
||||
.length = *buffer_len,
|
||||
.data_ptr = (uintptr_t)buffer,
|
||||
};
|
||||
|
||||
struct drm_i915_query args = {
|
||||
.num_items = 1,
|
||||
.flags = 0,
|
||||
.items_ptr = (uintptr_t)&item,
|
||||
};
|
||||
|
||||
int ret = gen_ioctl(fd, DRM_IOCTL_I915_QUERY, &args);
|
||||
*buffer_len = item.length;
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -245,6 +245,13 @@ anv_gem_supports_syncobj_wait(int fd)
|
|||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
anv_i915_query(int fd, uint64_t query_id, void *buffer,
|
||||
int32_t *buffer_len)
|
||||
{
|
||||
unreachable("Unused");
|
||||
}
|
||||
|
||||
int
|
||||
anv_gem_syncobj_wait(struct anv_device *device,
|
||||
const uint32_t *handles, uint32_t num_handles,
|
||||
|
|
|
@ -1660,6 +1660,8 @@ int anv_gem_syncobj_timeline_signal(struct anv_device *device,
|
|||
int anv_gem_syncobj_timeline_query(struct anv_device *device,
|
||||
const uint32_t *handles, uint64_t *points,
|
||||
uint32_t num_items);
|
||||
int anv_i915_query(int fd, uint64_t query_id, void *buffer,
|
||||
int32_t *buffer_len);
|
||||
|
||||
uint64_t anv_vma_alloc(struct anv_device *device,
|
||||
uint64_t size, uint64_t align,
|
||||
|
|
Loading…
Reference in New Issue