• Home
  • Raw
  • Download

Lines Matching refs:buffer

90 	struct system_heap_buffer *buffer = dmabuf->priv;  in system_heap_attach()  local
98 table = dup_sg_table(&buffer->sg_table); in system_heap_attach()
108 a->uncached = buffer->uncached; in system_heap_attach()
111 mutex_lock(&buffer->lock); in system_heap_attach()
112 list_add(&a->list, &buffer->attachments); in system_heap_attach()
113 mutex_unlock(&buffer->lock); in system_heap_attach()
121 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_detach() local
124 mutex_lock(&buffer->lock); in system_heap_detach()
126 mutex_unlock(&buffer->lock); in system_heap_detach()
168 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_begin_cpu_access() local
171 mutex_lock(&buffer->lock); in system_heap_dma_buf_begin_cpu_access()
173 if (buffer->vmap_cnt) in system_heap_dma_buf_begin_cpu_access()
174 invalidate_kernel_vmap_range(buffer->vaddr, buffer->len); in system_heap_dma_buf_begin_cpu_access()
176 if (!buffer->uncached) { in system_heap_dma_buf_begin_cpu_access()
177 list_for_each_entry(a, &buffer->attachments, list) { in system_heap_dma_buf_begin_cpu_access()
183 mutex_unlock(&buffer->lock); in system_heap_dma_buf_begin_cpu_access()
191 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_end_cpu_access() local
194 mutex_lock(&buffer->lock); in system_heap_dma_buf_end_cpu_access()
196 if (buffer->vmap_cnt) in system_heap_dma_buf_end_cpu_access()
197 flush_kernel_vmap_range(buffer->vaddr, buffer->len); in system_heap_dma_buf_end_cpu_access()
199 if (!buffer->uncached) { in system_heap_dma_buf_end_cpu_access()
200 list_for_each_entry(a, &buffer->attachments, list) { in system_heap_dma_buf_end_cpu_access()
206 mutex_unlock(&buffer->lock); in system_heap_dma_buf_end_cpu_access()
213 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_mmap() local
214 struct sg_table *table = &buffer->sg_table; in system_heap_mmap()
219 if (buffer->uncached) in system_heap_mmap()
236 static void *system_heap_do_vmap(struct system_heap_buffer *buffer) in system_heap_do_vmap() argument
238 struct sg_table *table = &buffer->sg_table; in system_heap_do_vmap()
239 int npages = PAGE_ALIGN(buffer->len) / PAGE_SIZE; in system_heap_do_vmap()
249 if (buffer->uncached) in system_heap_do_vmap()
268 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_vmap() local
272 mutex_lock(&buffer->lock); in system_heap_vmap()
273 if (buffer->vmap_cnt) { in system_heap_vmap()
274 buffer->vmap_cnt++; in system_heap_vmap()
275 iosys_map_set_vaddr(map, buffer->vaddr); in system_heap_vmap()
279 vaddr = system_heap_do_vmap(buffer); in system_heap_vmap()
285 buffer->vaddr = vaddr; in system_heap_vmap()
286 buffer->vmap_cnt++; in system_heap_vmap()
287 iosys_map_set_vaddr(map, buffer->vaddr); in system_heap_vmap()
289 mutex_unlock(&buffer->lock); in system_heap_vmap()
296 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_vunmap() local
298 mutex_lock(&buffer->lock); in system_heap_vunmap()
299 if (!--buffer->vmap_cnt) { in system_heap_vunmap()
300 vunmap(buffer->vaddr); in system_heap_vunmap()
301 buffer->vaddr = NULL; in system_heap_vunmap()
303 mutex_unlock(&buffer->lock); in system_heap_vunmap()
309 struct system_heap_buffer *buffer = dmabuf->priv; in system_heap_dma_buf_release() local
314 table = &buffer->sg_table; in system_heap_dma_buf_release()
321 kfree(buffer); in system_heap_dma_buf_release()
363 struct system_heap_buffer *buffer; in system_heap_do_allocate() local
374 buffer = kzalloc(sizeof(*buffer), GFP_KERNEL); in system_heap_do_allocate()
375 if (!buffer) in system_heap_do_allocate()
378 INIT_LIST_HEAD(&buffer->attachments); in system_heap_do_allocate()
379 mutex_init(&buffer->lock); in system_heap_do_allocate()
380 buffer->heap = heap; in system_heap_do_allocate()
381 buffer->len = len; in system_heap_do_allocate()
382 buffer->uncached = uncached; in system_heap_do_allocate()
406 table = &buffer->sg_table; in system_heap_do_allocate()
420 exp_info.size = buffer->len; in system_heap_do_allocate()
422 exp_info.priv = buffer; in system_heap_do_allocate()
435 if (buffer->uncached) { in system_heap_do_allocate()
452 kfree(buffer); in system_heap_do_allocate()