On 11/18/14 10:55, Pawel Osciak wrote: > On Mon, Nov 10, 2014 at 8:49 PM, Hans Verkuil <hverkuil@xxxxxxxxx> wrote: >> From: Hans Verkuil <hans.verkuil@xxxxxxxxx> >> >> By default dma_map_sg syncs the mapped buffer to the device. But >> buf_prepare expects a buffer syncs for the cpu and the buffer >> will be synced to the device in the prepare memop. >> >> The reverse is true for dma_unmap_sg, buf_finish and the finish >> memop. >> >> To prevent unnecessary syncs we ask dma_(un)map_sg to skip the >> sync. >> >> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> >> --- >> drivers/media/v4l2-core/videobuf2-dma-contig.c | 29 +++++++++++++++++----- >> drivers/media/v4l2-core/videobuf2-dma-sg.c | 33 +++++++++++++++++++++----- >> 2 files changed, 50 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c >> index c4305bf..27f5926 100644 >> --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c >> +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c >> @@ -317,8 +317,9 @@ static struct sg_table *vb2_dc_dmabuf_ops_map( >> attach->dma_dir = DMA_NONE; >> } >> >> - /* mapping to the client with new direction */ >> - ret = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents, dma_dir); >> + /* Mapping to the client with new direction */ >> + ret = dma_map_sg(db_attach->dev, sgt->sgl, sgt->orig_nents, >> + dma_dir); > > Do we need this chunk? > I'll drop it. Regards, Hans -- 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