Skip to contentSkip to conversation

videobuf-dma-contig: remove sync operation

PATCH In review Magnus Damm 3 participants 3 messages Apr 28, 2009 – May 5, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 videobuf-dma-contig: remove sync operation

From: Magnus Damm <[email protected]>

Remove the videobuf-dma-contig sync operation. Sync is only needed for noncoherent buffers, and since videobuf-dma-contig is built on coherent memory allocators the memory is by definition always in sync.

---

Thanks to Mattieu, Paul and Paulius for all the help! Tested on SH7722 Migo-R with CEU and ov7725.

 drivers/media/video/videobuf-dma-contig.c |   14 --------------
 1 file changed, 14 deletions(-)
drivers/media/video/videobuf-dma-contig.c +0 -14
@@ -182,19 +182,6 @@ static int __videobuf_iolock(struct vide
 	return 0;
 }
 
-static int __videobuf_sync(struct videobuf_queue *q,
-			   struct videobuf_buffer *buf)
-{
-	struct videobuf_dma_contig_memory *mem = buf->priv;
-
-	BUG_ON(!mem);
-	MAGIC_CHECK(mem->magic, MAGIC_DC_MEM);
-
-	dma_sync_single_for_cpu(q->dev, mem->dma_handle, mem->size,
-				DMA_FROM_DEVICE);
-	return 0;
-}
-
 static int __videobuf_mmap_free(struct videobuf_queue *q)
 {
 	unsigned int i;
@@ -356,7 +343,6 @@ static struct videobuf_qtype_ops qops = 
 
 	.alloc        = __videobuf_alloc,
 	.iolock       = __videobuf_iolock,
-	.sync         = __videobuf_sync,
 	.mmap_free    = __videobuf_mmap_free,
 	.mmap_mapper  = __videobuf_mmap_mapper,
 	.video_copy_to_user = __videobuf_copy_to_user,
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the videobuf-dma-contig sync operation. Sync is only needed for noncoherent buffers, and since videobuf-dma-contig is built on coherent memory allocators the memory is by definition always in sync.

Note that this also fixes a bogus oops, which is what caused this to be brought up in the first place..

Quoted 10 lines

---

Thanks to Mattieu, Paul and Paulius for all the help! Tested on SH7722 Migo-R with CEU and ov7725.

 drivers/media/video/videobuf-dma-contig.c |   14 --------------
 1 file changed, 14 deletions(-)
#2 lore raw
Quoted 14 lines · Paul Mundt
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Remove the videobuf-dma-contig sync operation. Sync is only needed for noncoherent buffers, and since videobuf-dma-contig is built on coherent memory allocators the memory is by definition always in sync.

Note that this also fixes a bogus oops, which is what caused this to be brought up in the first place..

Quoted 4 lines

---

Quoted 7 lines
Quoted 6 lines

Thanks to Mattieu, Paul and Paulius for all the help! Tested on SH7722 Migo-R with CEU and ov7725.

 drivers/media/video/videobuf-dma-contig.c |   14 --------------
 1 file changed, 14 deletions(-)

Well I backport it on a older kernel (2.6.27), but the result should be the same.