Home
last modified time | relevance | path

Searched refs:mem_bkend (Results 1 – 15 of 15) sorted by relevance

/OK3568_Linux_fs/kernel/drivers/gpu/arm/mali400/mali/linux/
H A Dmali_memory_swap_alloc.c149 static mali_bool mali_memory_swap_backend_in_swapped_pool(mali_mem_backend *mem_bkend) in mali_memory_swap_backend_in_swapped_pool() argument
151 MALI_DEBUG_ASSERT_POINTER(mem_bkend); in mali_memory_swap_backend_in_swapped_pool()
153 return !list_empty(&mem_bkend->list); in mali_memory_swap_backend_in_swapped_pool()
156 void mali_memory_swap_list_backend_delete(mali_mem_backend *mem_bkend) in mali_memory_swap_list_backend_delete() argument
158 MALI_DEBUG_ASSERT_POINTER(mem_bkend); in mali_memory_swap_list_backend_delete()
161 mutex_lock(&mem_bkend->mutex); in mali_memory_swap_list_backend_delete()
163 if (MALI_FALSE == mali_memory_swap_backend_in_swapped_pool(mem_bkend)) { in mali_memory_swap_list_backend_delete()
164 mutex_unlock(&mem_bkend->mutex); in mali_memory_swap_list_backend_delete()
169 MALI_DEBUG_ASSERT(!list_empty(&mem_bkend->list)); in mali_memory_swap_list_backend_delete()
171 list_del_init(&mem_bkend->list); in mali_memory_swap_list_backend_delete()
[all …]
H A Dmali_memory_util.c47 mali_mem_backend *mem_bkend = NULL; in _mali_free_allocation_mem() local
57 mem_bkend = idr_find(&mali_backend_idr, mali_alloc->backend_handle); in _mali_free_allocation_mem()
59 MALI_DEBUG_ASSERT(NULL != mem_bkend); in _mali_free_allocation_mem()
61 switch (mem_bkend->type) { in _mali_free_allocation_mem()
63 free_pages_nr = mali_mem_os_release(mem_bkend); in _mali_free_allocation_mem()
68 mali_mem_unbind_ump_buf(mem_bkend); in _mali_free_allocation_mem()
69 atomic_sub(mem_bkend->size / MALI_MMU_PAGE_SIZE, &session->mali_mem_array[mem_bkend->type]); in _mali_free_allocation_mem()
76 mali_mem_unbind_dma_buf(mem_bkend); in _mali_free_allocation_mem()
77 atomic_sub(mem_bkend->size / MALI_MMU_PAGE_SIZE, &session->mali_mem_array[mem_bkend->type]); in _mali_free_allocation_mem()
83 mali_mem_unbind_ext_buf(mem_bkend); in _mali_free_allocation_mem()
[all …]
H A Dmali_memory.c64 mali_mem_backend *mem_bkend = NULL; in mali_mem_vma_fault() local
74 if (!(mem_bkend = idr_find(&mali_backend_idr, alloc->backend_handle))) { in mali_mem_vma_fault()
80 MALI_DEBUG_ASSERT(mem_bkend->type == alloc->type); in mali_mem_vma_fault()
82 if ((mem_bkend->type == MALI_MEM_COW && (MALI_MEM_BACKEND_FLAG_SWAP_COWED != in mali_mem_vma_fault()
83 (mem_bkend->flags & MALI_MEM_BACKEND_FLAG_SWAP_COWED))) && in mali_mem_vma_fault()
84 (mem_bkend->flags & MALI_MEM_BACKEND_FLAG_COW_CPU_NO_WRITE)) { in mali_mem_vma_fault()
87 mutex_lock(&mem_bkend->mutex); in mali_mem_vma_fault()
88 ret = mali_mem_cow_allocate_on_demand(mem_bkend, in mali_mem_vma_fault()
90 mutex_unlock(&mem_bkend->mutex); in mali_mem_vma_fault()
100 mutex_lock(&mem_bkend->mutex); in mali_mem_vma_fault()
[all …]
H A Dmali_memory_defer_bind.c113 mali_mem_backend *mem_bkend = NULL; in mali_mem_defer_bind_allocation_prepare() local
121 if (!(mem_bkend = idr_find(&mali_backend_idr, alloc->backend_handle))) { in mali_mem_defer_bind_allocation_prepare()
130 if (mem_bkend->os_mem.count > 0) { in mali_mem_defer_bind_allocation_prepare()
137 INIT_LIST_HEAD(&mem_bkend->os_mem.pages); in mali_mem_defer_bind_allocation_prepare()
139 bk_list->bkend = mem_bkend; in mali_mem_defer_bind_allocation_prepare()
142 bk_list->page_num = mem_bkend->size / _MALI_OSK_MALI_PAGE_SIZE; in mali_mem_defer_bind_allocation_prepare()
143 *required_varying_memsize += mem_bkend->size; in mali_mem_defer_bind_allocation_prepare()
144 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_OS); in mali_mem_defer_bind_allocation_prepare()
160 mali_mem_backend *mem_bkend = bk_node->bkend; in mali_mem_defer_bind_allocation() local
161 …_bind_allocation, bind bkend = %x page num=0x%x vaddr=%x session=%x\n", mem_bkend, bk_node->page_n… in mali_mem_defer_bind_allocation()
[all …]
H A Dmali_memory_cow.c485 int mali_mem_cow_mali_map(mali_mem_backend *mem_bkend, u32 range_start, u32 range_size) in mali_mem_cow_mali_map() argument
493 cow_alloc = mem_bkend->mali_allocation; in mali_mem_cow_mali_map()
497 MALI_DEBUG_ASSERT_POINTER(mem_bkend); in mali_mem_cow_mali_map()
498 MALI_DEBUG_ASSERT(MALI_MEM_COW == mem_bkend->type); in mali_mem_cow_mali_map()
504 list_for_each_entry(m_page, &mem_bkend->cow_mem.pages, list) { in mali_mem_cow_mali_map()
522 int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) in mali_mem_cow_cpu_map() argument
524 mali_mem_cow *cow = &mem_bkend->cow_mem; in mali_mem_cow_cpu_map()
528 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_COW); in mali_mem_cow_cpu_map()
553 _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bkend, in mali_mem_cow_cpu_map_pages_locked() argument
558 mali_mem_cow *cow = &mem_bkend->cow_mem; in mali_mem_cow_cpu_map_pages_locked()
[all …]
H A Dmali_memory_secure.c107 int mali_mem_secure_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) in mali_mem_secure_cpu_map() argument
112 mali_mem_secure *secure_mem = &mem_bkend->secure_mem; in mali_mem_secure_cpu_map()
116 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_SECURE); in mali_mem_secure_cpu_map()
146 u32 mali_mem_secure_release(mali_mem_backend *mem_bkend) in mali_mem_secure_release() argument
149 mali_mem_allocation *alloc = mem_bkend->mali_allocation; in mali_mem_secure_release()
151 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_SECURE); in mali_mem_secure_release()
153 mem = &mem_bkend->secure_mem; in mali_mem_secure_release()
159 mutex_lock(&mem_bkend->mutex); in mali_mem_secure_release()
163 mutex_unlock(&mem_bkend->mutex); in mali_mem_secure_release()
H A Dmali_memory_swap_alloc.h35 void mali_mem_swap_unlock_single_mem_backend(mali_mem_backend *mem_bkend);
40 void mali_memory_swap_list_backend_delete(mali_mem_backend *mem_bkend);
45 void mali_memory_swap_list_backend_add(mali_mem_backend *mem_bkend);
84 u32 mali_mem_swap_release(mali_mem_backend *mem_bkend, mali_bool is_mali_mapped);
110 int mali_mem_swap_allocate_page_on_demand(mali_mem_backend *mem_bkend, u32 offset, struct page **pa…
115 int mali_mem_swap_cow_page_on_demand(mali_mem_backend *mem_bkend, u32 offset, struct page **pagep);
H A Dmali_memory_cow.h18 int mali_mem_cow_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma);
19 _mali_osk_errcode_t mali_mem_cow_cpu_map_pages_locked(mali_mem_backend *mem_bkend,
44 int mali_mem_cow_mali_map(mali_mem_backend *mem_bkend, u32 range_start, u32 range_size);
45 u32 mali_mem_cow_release(mali_mem_backend *mem_bkend, mali_bool is_mali_mapped);
46 _mali_osk_errcode_t mali_mem_cow_allocate_on_demand(mali_mem_backend *mem_bkend, u32 offset_page);
H A Dmali_memory_dma_buf.c160 mali_mem_backend *mem_bkend = NULL; in mali_dma_buf_map_job() local
182 mem_bkend = idr_find(&mali_backend_idr, mali_alloc->backend_handle); in mali_dma_buf_map_job()
184 MALI_DEBUG_ASSERT(NULL != mem_bkend); in mali_dma_buf_map_job()
186 mem = mem_bkend->dma_buf.attachment; in mali_dma_buf_map_job()
191 err = mali_dma_buf_map(mem_bkend); in mali_dma_buf_map_job()
209 mali_mem_backend *mem_bkend = NULL; in mali_dma_buf_unmap_job() local
231 mem_bkend = idr_find(&mali_backend_idr, mali_alloc->backend_handle); in mali_dma_buf_unmap_job()
233 MALI_DEBUG_ASSERT(NULL != mem_bkend); in mali_dma_buf_unmap_job()
235 mem = mem_bkend->dma_buf.attachment; in mali_dma_buf_unmap_job()
239 mali_dma_buf_unmap(mem_bkend->mali_allocation, mem); in mali_dma_buf_unmap_job()
H A Dmali_memory_os_alloc.c353 int mali_mem_os_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) in mali_mem_os_cpu_map() argument
355 mali_mem_os_mem *os_mem = &mem_bkend->os_mem; in mali_mem_os_cpu_map()
360 MALI_DEBUG_ASSERT(MALI_MEM_OS == mem_bkend->type); in mali_mem_os_cpu_map()
379 _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bkend, struct vm_area_s… in mali_mem_os_resize_cpu_map_locked() argument
381 mali_mem_os_mem *os_mem = &mem_bkend->os_mem; in mali_mem_os_resize_cpu_map_locked()
390 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_OS); in mali_mem_os_resize_cpu_map_locked()
449 u32 mali_mem_os_release(mali_mem_backend *mem_bkend) in mali_mem_os_release() argument
455 MALI_DEBUG_ASSERT_POINTER(mem_bkend); in mali_mem_os_release()
456 MALI_DEBUG_ASSERT(MALI_MEM_OS == mem_bkend->type); in mali_mem_os_release()
458 alloc = mem_bkend->mali_allocation; in mali_mem_os_release()
[all …]
H A Dmali_memory_block_alloc.c130 u32 mali_mem_block_release(mali_mem_backend *mem_bkend) in mali_mem_block_release() argument
132 mali_mem_allocation *alloc = mem_bkend->mali_allocation; in mali_mem_block_release()
134 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_BLOCK); in mali_mem_block_release()
138 mutex_lock(&mem_bkend->mutex); in mali_mem_block_release()
139 free_pages_nr = mali_mem_block_free(&mem_bkend->block_mem); in mali_mem_block_release()
140 mutex_unlock(&mem_bkend->mutex); in mali_mem_block_release()
302 int mali_mem_block_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma) in mali_mem_block_cpu_map() argument
305 mali_mem_block_mem *block_mem = &mem_bkend->block_mem; in mali_mem_block_cpu_map()
308 MALI_DEBUG_ASSERT(mem_bkend->type == MALI_MEM_BLOCK); in mali_mem_block_cpu_map()
H A Dmali_memory_os_alloc.h24 u32 mali_mem_os_release(mali_mem_backend *mem_bkend);
50 int mali_mem_os_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma);
52 _mali_osk_errcode_t mali_mem_os_resize_cpu_map_locked(mali_mem_backend *mem_bkend, struct vm_area_s…
H A Dmali_memory_secure.h26 int mali_mem_secure_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma);
28 u32 mali_mem_secure_release(mali_mem_backend *mem_bkend);
H A Dmali_memory_block_alloc.h43 u32 mali_mem_block_release(mali_mem_backend *mem_bkend);
48 int mali_mem_block_cpu_map(mali_mem_backend *mem_bkend, struct vm_area_struct *vma);
H A Dmali_memory_manager.c190 mali_mem_backend *mem_bkend = NULL; in mali_mem_backend_struct_search() local
201 mem_bkend = idr_find(&mali_backend_idr, mali_alloc->backend_handle); in mali_mem_backend_struct_search()
203 MALI_DEBUG_ASSERT(NULL != mem_bkend); in mali_mem_backend_struct_search()
204 return mem_bkend; in mali_mem_backend_struct_search()