From: Muralidharan Karicheri <m-kariche...@ti.com>

If a USERPTR address that is not aligned to page boundary is passed to the
videobuf_dma_contig_user_get() function, it saves a page aligned address to
the dma_handle. This is not correct. This issue is observed when using USERPTR
IO machism for buffer exchange.

Signed-off-by: Muralidharan Karicheri <m-kariche...@ti.com>
---
Applies to V4L-DVB linux-next branch
 drivers/media/video/videobuf-dma-contig.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/videobuf-dma-contig.c 
b/drivers/media/video/videobuf-dma-contig.c
index d25f284..928dfa1 100644
--- a/drivers/media/video/videobuf-dma-contig.c
+++ b/drivers/media/video/videobuf-dma-contig.c
@@ -166,7 +166,8 @@ static int videobuf_dma_contig_user_get(struct 
videobuf_dma_contig_memory *mem,
                        break;
 
                if (pages_done == 0)
-                       mem->dma_handle = this_pfn << PAGE_SHIFT;
+                       mem->dma_handle = (this_pfn << PAGE_SHIFT) +
+                                               (vb->baddr & ~PAGE_MASK);
                else if (this_pfn != (prev_pfn + 1))
                        ret = -EFAULT;
 
-- 
1.6.0.4

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to