Re: [PATCH v4 2/2] videobuf2-dma-sg: Replace vb2_dma_sg_desc with sg_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

On 2014-01-03 16:51, Ricardo Ribalda Delgado wrote:
Hello Hans

What if we move the dma_map_sg and dma_unmap_sg to the vb2 interface,
and there do something like:

n_sg= dma_map_sg()
if (n_sg=-ENOMEM){
    split_table() //Breaks down the sg_table into monopages sg
    n_sg= dma_map_sg()
}
if (n_sg=-ENOMEM)
   return -ENOMEM

dma_map_sg/dma_unmap_sg should be moved to vb2-dma-sg memory allocator. The best place for calling them is buf_prepare() and buf_finish() callbacks. I think that I've already pointed this some time ago, but unfortunately I didn't find enough time to convert existing code.

For solving the problem described by Hans, I think that vb2-dma-sg memory allocator should check dma mask of the client device and add appropriate GFP_DMA or GFP_DMA32 flags to alloc_pages(). This should fix the issues with failed dma_map_sg due to lack of bouncing buffers.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux