Lines Matching refs:bo
45 int (*alloc_pages)(struct ivpu_bo *bo);
46 void (*free_pages)(struct ivpu_bo *bo);
47 int (*map_pages)(struct ivpu_bo *bo);
48 void (*unmap_pages)(struct ivpu_bo *bo);
51 int ivpu_bo_pin(struct ivpu_bo *bo);
58 void ivpu_bo_free_internal(struct ivpu_bo *bo);
60 void ivpu_bo_unmap_sgt_and_remove_from_context(struct ivpu_bo *bo);
71 static inline struct page *ivpu_bo_get_page(struct ivpu_bo *bo, u64 offset)
73 if (offset > bo->base.size || !bo->pages)
76 return bo->pages[offset / PAGE_SIZE];
79 static inline u32 ivpu_bo_cache_mode(struct ivpu_bo *bo)
81 return bo->flags & DRM_IVPU_BO_CACHE_MASK;
84 static inline bool ivpu_bo_is_snooped(struct ivpu_bo *bo)
86 return ivpu_bo_cache_mode(bo) == DRM_IVPU_BO_CACHED;
89 static inline pgprot_t ivpu_bo_pgprot(struct ivpu_bo *bo, pgprot_t prot)
91 if (bo->flags & DRM_IVPU_BO_WC)
94 if (bo->flags & DRM_IVPU_BO_UNCACHED)
100 static inline struct ivpu_device *ivpu_bo_to_vdev(struct ivpu_bo *bo)
102 return to_ivpu_device(bo->base.dev);
105 static inline void *ivpu_to_cpu_addr(struct ivpu_bo *bo, u32 vpu_addr)
107 if (vpu_addr < bo->vpu_addr)
110 if (vpu_addr >= (bo->vpu_addr + bo->base.size))
113 return bo->kvaddr + (vpu_addr - bo->vpu_addr);
116 static inline u32 cpu_to_vpu_addr(struct ivpu_bo *bo, void *cpu_addr)
118 if (cpu_addr < bo->kvaddr)
121 if (cpu_addr >= (bo->kvaddr + bo->base.size))
124 return bo->vpu_addr + (cpu_addr - bo->kvaddr);