Google
  Web www.spinics.net

videobuf_iolock function fails for USERPTR?

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


Hi,

If I understand correctly, the videobuf_iolock function is responsible for 
mapping user pages to kernel. This works fine as long as user application allocates 
memory/buffer using some standard API (malloc/memalign).

But it fails where; user application has allocated memory/buffer using ioremap 
from another driver. The use case scenario is something -

	- Open V4L2 device (which supports scatter gather DMA)
	- Configure the parameters (especially .memory=V4L2_MEMORY_USERPTR)
	- Request and query the buffer
	- open another device which will be responsible for allocating memory
		Either using ioremap/dma_alloc_coherent/get_free_pages
	- Queue the buffers with buffer address received from previous step

Here it internally calls drv_prepare function, which call videobuf_iolock API for mapping the user pages to kernel and will create scatter-gather (dma->sglist) list. But this API returns from videobuf_dma_init_user_locked with -EFAULT.

I found the get_user_pages returns due to flag VM_IO and VM_PFNMAP for the corresponding vma.

Any suggestions on how can I achieve this?

Thanks,
Vaibhav Hiremath
Senior Software Engg.
Platform Support Products
Texas Instruments Inc
Ph: +91-80-25099927


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[Home]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Video Technology]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Plasma TVs]     [Video Projectors]     [PDAs]     [Xorg]     [Util Linux NG]     [Xfree86]     [Devices]     [Big List of Linux Books]     [Free Photo Albums]     [LCD TVs]     [Fedora Users]     [Webcams]     [Fedora Women]     [HDTV]     [ALSA Users]     [ALSA Devel]     [Stuff]     [SSH]     [DVB Maintainers]     [Linux USB]

Add to Google Powered by Linux