lkml.org 
[lkml]   [2019]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/5] dma-buf: heaps: Add heap helpers
> +struct dma_buf *heap_helper_export_dmabuf(
> + struct heap_helper_buffer *helper_buffer,
> + int fd_flags)

Indentation seems odd here as it doesn't follow any of the usual schools
for multi-level prototypes. But maybe shortening some identifier would
help avoiding that problem altogether :)

> +static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer)
> +{
> + void *vaddr;
> +
> + vaddr = vmap(buffer->pages, buffer->pagecount, VM_MAP, PAGE_KERNEL);
> + if (!vaddr)
> + return ERR_PTR(-ENOMEM);
> +
> + return vaddr;
> +}

Note that a lot of systems don't have highmem at all or don't support
CMA in highmem. So for contigous allocations that aren't highmem we
could skip the vmap here altogether and just use the direct mapping.

\
 
 \ /
  Last update: 2019-07-25 14:56    [W:0.132 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site