return anv_multialloc_alloc(ma, alloc ? alloc : parent_alloc, scope);
}
-/* Extra ANV-defined BO flags which won't be passed to the kernel */
-#define ANV_BO_EXTERNAL (1ull << 31)
-#define ANV_BO_FLAG_MASK (1ull << 31)
-
struct anv_bo {
uint32_t gem_handle;
/** Flags to pass to the kernel through drm_i915_exec_object2::flags */
uint32_t flags;
+
+ /** True if this BO may be shared with other processes */
+ bool is_external:1;
};
static inline void
bo->size = size;
bo->map = NULL;
bo->flags = 0;
+ bo->is_external = false;
}
/* Represents a lock-free linked list of "free" things. This is used by
VkResult anv_bo_cache_alloc(struct anv_device *device,
struct anv_bo_cache *cache,
uint64_t size, uint64_t bo_flags,
+ bool is_external,
struct anv_bo **bo);
VkResult anv_bo_cache_import_host_ptr(struct anv_device *device,
struct anv_bo_cache *cache,
static inline uint32_t
anv_mocs_for_bo(const struct anv_device *device, const struct anv_bo *bo)
{
- if (bo->flags & ANV_BO_EXTERNAL)
+ if (bo->is_external)
return device->external_mocs;
else
return device->default_mocs;