diff options
author | Eric Engestrom <eric.engestrom@intel.com> | 2019-01-08 12:50:49 +0000 |
---|---|---|
committer | Eric Engestrom <eric.engestrom@intel.com> | 2019-01-25 09:45:27 +0000 |
commit | 9af77fcf98bd8084ff117ebbd9abfc1b695397d2 (patch) | |
tree | 805307a31e408636cbe9d8f1aa435b9790ec3e7a /src/intel/vulkan | |
parent | f2ece26601adda221ce5ae69c984f8b79a9cb0d0 (diff) |
anv: drop always-successful VkResult
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 758de3d96d2..f44b046cf5d 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -60,8 +60,8 @@ compiler_perf_log(void *data, const char *fmt, ...) va_end(args); } -static VkResult -anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size) +static uint64_t +anv_compute_heap_size(int fd, uint64_t gtt_size) { /* Query the total ram from the system */ struct sysinfo info; @@ -83,9 +83,7 @@ anv_compute_heap_size(int fd, uint64_t gtt_size, uint64_t *heap_size) */ uint64_t available_gtt = gtt_size * 3 / 4; - *heap_size = MIN2(available_ram, available_gtt); - - return VK_SUCCESS; + return MIN2(available_ram, available_gtt); } static VkResult @@ -109,10 +107,7 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd) device->supports_48bit_addresses = (device->info.gen >= 8) && gtt_size > (4ULL << 30 /* GiB */); - uint64_t heap_size = 0; - VkResult result = anv_compute_heap_size(fd, gtt_size, &heap_size); - if (result != VK_SUCCESS) - return result; + uint64_t heap_size = anv_compute_heap_size(fd, gtt_size); if (heap_size > (2ull << 30) && !device->supports_48bit_addresses) { /* When running with an overridden PCI ID, we may get a GTT size from |