diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index f419d475a7b..d451ee3e17c 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1499,6 +1499,8 @@ anv_device_alloc_bo(struct anv_device *device, .has_implicit_ccs = ccs_size > 0 || (device->info->verx10 >= 125 && !(alloc_flags & ANV_BO_ALLOC_NO_LOCAL_MEM)), .map_wc = alloc_flags & ANV_BO_ALLOC_WRITE_COMBINE, + .vram_only = nregions == 1 && + regions[0] == device->physical->vram_non_mappable.region, }; if (alloc_flags & ANV_BO_ALLOC_MAPPED) { diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 1c0bb0a2a11..d98cf8d8f8a 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -538,6 +538,9 @@ struct anv_bo { /** True if this BO should be mapped with Write Combine enabled */ bool map_wc:1; + + /** True if this BO can only live in VRAM */ + bool vram_only:1; }; static inline struct anv_bo * diff --git a/src/intel/vulkan/i915/anv_batch_chain.c b/src/intel/vulkan/i915/anv_batch_chain.c index 155b3004ddf..fd8fb6c929c 100644 --- a/src/intel/vulkan/i915/anv_batch_chain.c +++ b/src/intel/vulkan/i915/anv_batch_chain.c @@ -553,23 +553,27 @@ anv_queue_exec_utrace_locked(struct anv_queue *queue, static void anv_i915_debug_submit(const struct anv_execbuf *execbuf) { - uint32_t total_size_kb = 0; + uint32_t total_size_kb = 0, total_vram_only_size_kb = 0; for (uint32_t i = 0; i < execbuf->bo_count; i++) { const struct anv_bo *bo = execbuf->bos[i]; total_size_kb += bo->size / 1024; + if (bo->vram_only) + total_vram_only_size_kb += bo->size / 1024; } - fprintf(stderr, "Batch offset=0x%x len=0x%x on queue 0 (%.1fMb aperture)\n", + fprintf(stderr, "Batch offset=0x%x len=0x%x on queue 0 (aperture: %.1fMb, %.1fMb VRAM only)\n", execbuf->execbuf.batch_start_offset, execbuf->execbuf.batch_len, - (float)total_size_kb / 1024.0f); + (float)total_size_kb / 1024.0f, + (float)total_vram_only_size_kb / 1024.0f); for (uint32_t i = 0; i < execbuf->bo_count; i++) { const struct anv_bo *bo = execbuf->bos[i]; uint64_t size = bo->size + bo->_ccs_size; fprintf(stderr, " BO: addr=0x%016"PRIx64"-0x%016"PRIx64" size=%7"PRIu64 - "KB handle=%05u capture=%u name=%s\n", + "KB handle=%05u capture=%u vram_only=%u name=%s\n", bo->offset, bo->offset + size - 1, size / 1024, bo->gem_handle, - (bo->flags & EXEC_OBJECT_CAPTURE) != 0, bo->name); + (bo->flags & EXEC_OBJECT_CAPTURE) != 0, + bo->vram_only, bo->name); } }