turnip: Replace fd_bo with tu_bo
[mesa.git] / src / freedreno / vulkan / tu_private.h
index 5fafcacf9e238f1eefae46c62d8a9879d44eec08..ccd768e02309ccba057bf0428050084bcfbed6b4 100644 (file)
@@ -440,9 +440,25 @@ struct tu_device
    struct tu_bo_list bo_list;
 };
 
+struct tu_bo
+{
+   uint32_t gem_handle;
+   uint64_t size;
+   uint64_t offset;
+   uint64_t iova;
+   void *map;
+};
+
+VkResult
+tu_bo_init_new(struct tu_device *dev, struct tu_bo *bo, uint64_t size);
+void
+tu_bo_finish(struct tu_device *dev, struct tu_bo *bo);
+VkResult
+tu_bo_map(struct tu_device *dev, struct tu_bo *bo);
+
 struct tu_device_memory
 {
-   struct fd_bo *bo;
+   struct tu_bo bo;
    VkDeviceSize size;
 
    /* for dedicated allocations */
@@ -1169,6 +1185,15 @@ struct tu_nir_compiler_options;
 
 struct radeon_winsys_sem;
 
+uint32_t
+tu_gem_new(struct tu_device *dev, uint64_t size, uint32_t flags);
+void
+tu_gem_close(struct tu_device *dev, uint32_t gem_handle);
+uint64_t
+tu_gem_info_offset(struct tu_device *dev, uint32_t gem_handle);
+uint64_t
+tu_gem_info_iova(struct tu_device *dev, uint32_t gem_handle);
+
 #define TU_DEFINE_HANDLE_CASTS(__tu_type, __VkType)                          \
                                                                                \
    static inline struct __tu_type *__tu_type##_from_handle(__VkType _handle) \