summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2015-12-04 12:52:43 -0800
committerKristian Høgsberg Kristensen <[email protected]>2015-12-04 12:53:27 -0800
commitf1f78a371e194459699228253dd5dcb97347753b (patch)
tree248280f026ba70501d26a50b424ae9ee54f9b0ba /src
parent8f722c2fa3d651a73cb9de2d4578b09a1b686bd0 (diff)
vk: gem handles are uint32_t
No functional difference, but lets be consistent with the kernel API.
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/anv_allocator.c2
-rw-r--r--src/vulkan/anv_gem.c17
-rw-r--r--src/vulkan/anv_private.h19
3 files changed, 19 insertions, 19 deletions
diff --git a/src/vulkan/anv_allocator.c b/src/vulkan/anv_allocator.c
index e8129c6d909..4cff84131aa 100644
--- a/src/vulkan/anv_allocator.c
+++ b/src/vulkan/anv_allocator.c
@@ -328,7 +328,7 @@ anv_block_pool_grow(struct anv_block_pool *pool, struct anv_block_state *state)
{
size_t size;
void *map;
- int gem_handle;
+ uint32_t gem_handle;
struct anv_mmap_cleanup *cleanup;
pthread_mutex_lock(&pool->device->mutex);
diff --git a/src/vulkan/anv_gem.c b/src/vulkan/anv_gem.c
index 429f4a29fad..b815f97ed69 100644
--- a/src/vulkan/anv_gem.c
+++ b/src/vulkan/anv_gem.c
@@ -70,7 +70,7 @@ anv_gem_create(struct anv_device *device, size_t size)
}
void
-anv_gem_close(struct anv_device *device, int gem_handle)
+anv_gem_close(struct anv_device *device, uint32_t gem_handle)
{
struct drm_gem_close close;
@@ -116,7 +116,7 @@ anv_gem_munmap(void *p, uint64_t size)
munmap(p, size);
}
-int
+uint32_t
anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
{
struct drm_i915_gem_userptr userptr;
@@ -135,7 +135,8 @@ anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
}
int
-anv_gem_set_caching(struct anv_device *device, int gem_handle, uint32_t caching)
+anv_gem_set_caching(struct anv_device *device,
+ uint32_t gem_handle, uint32_t caching)
{
struct drm_i915_gem_caching gem_caching;
@@ -147,7 +148,7 @@ anv_gem_set_caching(struct anv_device *device, int gem_handle, uint32_t caching)
}
int
-anv_gem_set_domain(struct anv_device *device, int gem_handle,
+anv_gem_set_domain(struct anv_device *device, uint32_t gem_handle,
uint32_t read_domains, uint32_t write_domain)
{
struct drm_i915_gem_set_domain gem_set_domain;
@@ -164,7 +165,7 @@ anv_gem_set_domain(struct anv_device *device, int gem_handle,
* On error, \a timeout_ns holds the remaining time.
*/
int
-anv_gem_wait(struct anv_device *device, int gem_handle, int64_t *timeout_ns)
+anv_gem_wait(struct anv_device *device, uint32_t gem_handle, int64_t *timeout_ns)
{
struct drm_i915_gem_wait wait;
int ret;
@@ -189,7 +190,7 @@ anv_gem_execbuffer(struct anv_device *device,
int
anv_gem_set_tiling(struct anv_device *device,
- int gem_handle, uint32_t stride, uint32_t tiling)
+ uint32_t gem_handle, uint32_t stride, uint32_t tiling)
{
struct drm_i915_gem_set_tiling set_tiling;
int ret;
@@ -269,7 +270,7 @@ anv_gem_get_aperture(int fd, uint64_t *size)
}
int
-anv_gem_handle_to_fd(struct anv_device *device, int gem_handle)
+anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle)
{
struct drm_prime_handle args;
int ret;
@@ -285,7 +286,7 @@ anv_gem_handle_to_fd(struct anv_device *device, int gem_handle)
return args.fd;
}
-int
+uint32_t
anv_gem_fd_to_handle(struct anv_device *device, int fd)
{
struct drm_prime_handle args;
diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h
index cc0281a0d9a..c1b777e5973 100644
--- a/src/vulkan/anv_private.h
+++ b/src/vulkan/anv_private.h
@@ -266,7 +266,7 @@ anv_vector_finish(struct anv_vector *queue)
__anv_vector_offset += (queue)->element_size)
struct anv_bo {
- int gem_handle;
+ uint32_t gem_handle;
/* Index into the current validation list. This is used by the
* validation list building alrogithm to track which buffers are already
@@ -600,22 +600,21 @@ void* anv_gem_mmap(struct anv_device *device,
uint32_t gem_handle, uint64_t offset, uint64_t size, uint32_t flags);
void anv_gem_munmap(void *p, uint64_t size);
uint32_t anv_gem_create(struct anv_device *device, size_t size);
-void anv_gem_close(struct anv_device *device, int gem_handle);
-int anv_gem_userptr(struct anv_device *device, void *mem, size_t size);
-int anv_gem_wait(struct anv_device *device, int gem_handle, int64_t *timeout_ns);
+void anv_gem_close(struct anv_device *device, uint32_t gem_handle);
+uint32_t anv_gem_userptr(struct anv_device *device, void *mem, size_t size);
+int anv_gem_wait(struct anv_device *device, uint32_t gem_handle, int64_t *timeout_ns);
int anv_gem_execbuffer(struct anv_device *device,
struct drm_i915_gem_execbuffer2 *execbuf);
-int anv_gem_set_tiling(struct anv_device *device, int gem_handle,
+int anv_gem_set_tiling(struct anv_device *device, uint32_t gem_handle,
uint32_t stride, uint32_t tiling);
int anv_gem_create_context(struct anv_device *device);
int anv_gem_destroy_context(struct anv_device *device, int context);
int anv_gem_get_param(int fd, uint32_t param);
int anv_gem_get_aperture(int fd, uint64_t *size);
-int anv_gem_handle_to_fd(struct anv_device *device, int gem_handle);
-int anv_gem_fd_to_handle(struct anv_device *device, int fd);
-int anv_gem_userptr(struct anv_device *device, void *mem, size_t size);
-int anv_gem_set_caching(struct anv_device *device, int gem_handle, uint32_t caching);
-int anv_gem_set_domain(struct anv_device *device, int gem_handle,
+int anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle);
+uint32_t anv_gem_fd_to_handle(struct anv_device *device, int fd);
+int anv_gem_set_caching(struct anv_device *device, uint32_t gem_handle, uint32_t caching);
+int anv_gem_set_domain(struct anv_device *device, uint32_t gem_handle,
uint32_t read_domains, uint32_t write_domain);
VkResult anv_bo_init_new(struct anv_bo *bo, struct anv_device *device, uint64_t size);