linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dma-buf CPU access
@ 2018-02-09 21:25 Alexey Skidanov
  0 siblings, 0 replies; only message in thread
From: Alexey Skidanov @ 2018-02-09 21:25 UTC (permalink / raw)
  To: sumit.semwal, linux-media, linux-kernel; +Cc: Laura Abbott

Hi,

According to the CPU access instructions in the dma-buf.c, I understand
that on 32 bit platforms, due to the limited number of persistent kernel
mappings or limited vmalloc range, the CPU access pattern should look
like this:

dma_buf_start_cpu_access();

void *ptr = dma_buf_kmap();

/*Access the page pointed by ptr*/

dma_buf_kunmap(ptr);

dma_buf_end_cpu_access();


or


dma_buf_start_cpu_access();

void *ptr = dma_buf_vmap();

/*Access the buffer pointed by ptr*/

dma_buf_vunmap(ptr);

dma_buf_end_cpu_access();


But on 64 bit platforms, there are no such restrictions (there is no
highmem at all). So, frequently accessed buffer, may be mapped once, but
every access should be surrounded by :

dma_buf_start_cpu_access();

/*Access the buffer pointed by ptr*/

dma_buf_end_cpu_access()

Am I correct?

Thanks,
Alexey

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-09 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09 21:25 dma-buf CPU access Alexey Skidanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).