summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_gem.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-08-29 01:34:44 -0700
committerChad Versace <[email protected]>2017-10-17 11:08:26 -0700
commitb5dc551014f45daba07339f884e89f87c1be923e (patch)
treec0eb69dad64510daac762a1bda43ceed9ee7e6db /src/intel/vulkan/anv_gem.c
parenteb69a61806a6bee22f2306420314ac712f4c6e1e (diff)
anv: Add func anv_gem_get_tiling()
Will use in VK_ANDROID_native_buffer. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_gem.c')
-rw-r--r--src/intel/vulkan/anv_gem.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_gem.c b/src/intel/vulkan/anv_gem.c
index 3994c6b66c2..34c09891086 100644
--- a/src/intel/vulkan/anv_gem.c
+++ b/src/intel/vulkan/anv_gem.c
@@ -192,6 +192,22 @@ anv_gem_execbuffer(struct anv_device *device,
return anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf);
}
+/** Return -1 on error. */
+int
+anv_gem_get_tiling(struct anv_device *device, uint32_t gem_handle)
+{
+ struct drm_i915_gem_get_tiling get_tiling = {
+ .handle = gem_handle,
+ };
+
+ if (anv_ioctl(device->fd, DRM_IOCTL_I915_GEM_GET_TILING, &get_tiling)) {
+ assert(!"Failed to get BO tiling");
+ return -1;
+ }
+
+ return get_tiling.tiling_mode;
+}
+
int
anv_gem_set_tiling(struct anv_device *device,
uint32_t gem_handle, uint32_t stride, uint32_t tiling)