All of lore.kernel.org
 help / color / mirror / Atom feed
* no mmu on videobuf2
@ 2011-06-16  5:31 Scott Jiang
  2011-06-16  5:42 ` Marek Szyprowski
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Jiang @ 2011-06-16  5:31 UTC (permalink / raw)
  To: m.szyprowski, hans.verkuil, laurent.pinchart; +Cc: linux-media

Hi Marek and Laurent,

I am working on v4l2 drivers for blackfin which is a no mmu soc.
I found videobuf allocate memory in mmap not reqbuf, so I turn to videobuf2.
But __setup_offsets() use plane offset to fill m.offset, which is
always 0 for single-planar buffer.
So pgoff in get_unmapped_area callback equals 0.
I only found uvc handled get_unmapped_area for no mmu system, but it
manages buffers itself.
I really want videobuf2 to manage buffers. Please give me some advice.

Thanks.
Regards,
Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: no mmu on videobuf2
  2011-06-16  5:31 no mmu on videobuf2 Scott Jiang
@ 2011-06-16  5:42 ` Marek Szyprowski
  2011-06-16  6:38   ` Scott Jiang
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Szyprowski @ 2011-06-16  5:42 UTC (permalink / raw)
  To: 'Scott Jiang', hans.verkuil, laurent.pinchart; +Cc: linux-media

Hello Scott,

> Hi Marek and Laurent,
> 
> I am working on v4l2 drivers for blackfin which is a no mmu soc.
> I found videobuf allocate memory in mmap not reqbuf, so I turn to videobuf2.
> But __setup_offsets() use plane offset to fill m.offset, which is
> always 0 for single-planar buffer.
> So pgoff in get_unmapped_area callback equals 0.
> I only found uvc handled get_unmapped_area for no mmu system, but it
> manages buffers itself.
> I really want videobuf2 to manage buffers. Please give me some advice.

I'm not really sure if I know the differences between mmu and no-mmu
systems (from the device driver perspective). I assume that you are using
videobuf2-vmalloc allocator. Note that memory allocators/managers are well
separated from the videobuf2 logic. If it the current one doesn't serve you
well you can make your own no-mmu allocator. Later once we identify all
differences it might be merged with the standard one or left alone if the
merge is not really possible or easy.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no mmu on videobuf2
  2011-06-16  5:42 ` Marek Szyprowski
@ 2011-06-16  6:38   ` Scott Jiang
  2011-06-16  7:19     ` Kassey Lee
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Jiang @ 2011-06-16  6:38 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: hans.verkuil, laurent.pinchart, linux-media, uclinux-dist-devel

2011/6/16 Marek Szyprowski <m.szyprowski@samsung.com>:
> Hello Scott,
>
>> Hi Marek and Laurent,
>>
>> I am working on v4l2 drivers for blackfin which is a no mmu soc.
>> I found videobuf allocate memory in mmap not reqbuf, so I turn to videobuf2.
>> But __setup_offsets() use plane offset to fill m.offset, which is
>> always 0 for single-planar buffer.
>> So pgoff in get_unmapped_area callback equals 0.
>> I only found uvc handled get_unmapped_area for no mmu system, but it
>> manages buffers itself.
>> I really want videobuf2 to manage buffers. Please give me some advice.
>
> I'm not really sure if I know the differences between mmu and no-mmu
> systems (from the device driver perspective). I assume that you are using
> videobuf2-vmalloc allocator. Note that memory allocators/managers are well
> separated from the videobuf2 logic. If it the current one doesn't serve you
> well you can make your own no-mmu allocator. Later once we identify all
> differences it might be merged with the standard one or left alone if the
> merge is not really possible or easy.
>
> Best regards
> --
> Marek Szyprowski
> Samsung Poland R&D Center
>
>
>

Hi Marek,

I used dma-contig allocator. I mean if offset is 0, I must get actual
addr from this offset.
__find_plane_by_offset can do this. But it is an internal function.
I think there should be a function called vb2_get_unmapped_area to do
this in framework side.

Regards,
Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no mmu on videobuf2
  2011-06-16  6:38   ` Scott Jiang
@ 2011-06-16  7:19     ` Kassey Lee
  2011-06-16  7:57       ` Scott Jiang
  0 siblings, 1 reply; 7+ messages in thread
From: Kassey Lee @ 2011-06-16  7:19 UTC (permalink / raw)
  To: Scott Jiang
  Cc: Marek Szyprowski, hans.verkuil, laurent.pinchart, linux-media,
	uclinux-dist-devel

2011/6/16 Scott Jiang <scott.jiang.linux@gmail.com>:
> 2011/6/16 Marek Szyprowski <m.szyprowski@samsung.com>:
>> Hello Scott,
>>
>>> Hi Marek and Laurent,
>>>
>>> I am working on v4l2 drivers for blackfin which is a no mmu soc.
>>> I found videobuf allocate memory in mmap not reqbuf, so I turn to videobuf2.
>>> But __setup_offsets() use plane offset to fill m.offset, which is
>>> always 0 for single-planar buffer.
>>> So pgoff in get_unmapped_area callback equals 0.
>>> I only found uvc handled get_unmapped_area for no mmu system, but it
>>> manages buffers itself.
>>> I really want videobuf2 to manage buffers. Please give me some advice.
>>
>> I'm not really sure if I know the differences between mmu and no-mmu
>> systems (from the device driver perspective). I assume that you are using
>> videobuf2-vmalloc allocator. Note that memory allocators/managers are well
>> separated from the videobuf2 logic. If it the current one doesn't serve you
>> well you can make your own no-mmu allocator. Later once we identify all
>> differences it might be merged with the standard one or left alone if the
>> merge is not really possible or easy.
>>
>> Best regards
>> --
>> Marek Szyprowski
>> Samsung Poland R&D Center
>>
>>
>>
>
> Hi Marek,
>
> I used dma-contig allocator. I mean if offset is 0, I must get actual
> addr from this offset.
hi, Scott

if it is single plane, surely the offset is 0 for plane 0
what do you mean the actual addr ?


> __find_plane_by_offset can do this. But it is an internal function.
> I think there should be a function called vb2_get_unmapped_area to do
> this in framework side.
are you using soc_camera ?
you can add your get_unmapped_area  in soc_camera.
if not, you can add it in your v4l2_file_operations ops, while still
using videbuf2 to management your buffer.
>
> Regards,
> Scott
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Best regards
Kassey
Application Processor Systems Engineering, Marvell Technology Group Ltd.
Shanghai, China.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no mmu on videobuf2
  2011-06-16  7:19     ` Kassey Lee
@ 2011-06-16  7:57       ` Scott Jiang
  2011-06-16  8:49         ` Marek Szyprowski
  2011-06-16  8:50         ` Laurent Pinchart
  0 siblings, 2 replies; 7+ messages in thread
From: Scott Jiang @ 2011-06-16  7:57 UTC (permalink / raw)
  To: Kassey Lee
  Cc: Marek Szyprowski, hans.verkuil, laurent.pinchart, linux-media,
	uclinux-dist-devel

Hi Kassey,

2011/6/16 Kassey Lee <kassey1216@gmail.com>:
> 2011/6/16 Scott Jiang <scott.jiang.linux@gmail.com>:
>> 2011/6/16 Marek Szyprowski <m.szyprowski@samsung.com>:
>>> Hello Scott,
>>>
>>>> Hi Marek and Laurent,
>>>>
>>>> I am working on v4l2 drivers for blackfin which is a no mmu soc.
>>>> I found videobuf allocate memory in mmap not reqbuf, so I turn to videobuf2.
>>>> But __setup_offsets() use plane offset to fill m.offset, which is
>>>> always 0 for single-planar buffer.
>>>> So pgoff in get_unmapped_area callback equals 0.
>>>> I only found uvc handled get_unmapped_area for no mmu system, but it
>>>> manages buffers itself.
>>>> I really want videobuf2 to manage buffers. Please give me some advice.
>>>
>>> I'm not really sure if I know the differences between mmu and no-mmu
>>> systems (from the device driver perspective). I assume that you are using
>>> videobuf2-vmalloc allocator. Note that memory allocators/managers are well
>>> separated from the videobuf2 logic. If it the current one doesn't serve you
>>> well you can make your own no-mmu allocator. Later once we identify all
>>> differences it might be merged with the standard one or left alone if the
>>> merge is not really possible or easy.
>>>
>>> Best regards
>>> --
>>> Marek Szyprowski
>>> Samsung Poland R&D Center
>>>
>>>
>>>
>>
>> Hi Marek,
>>
>> I used dma-contig allocator. I mean if offset is 0, I must get actual
>> addr from this offset.
> hi, Scott
>
> if it is single plane, surely the offset is 0 for plane 0
yes, it is absolutely right.

> what do you mean the actual addr ?
I should return virtual address of the buffer in get_unmapped_area callback.

>
>
>> __find_plane_by_offset can do this. But it is an internal function.
>> I think there should be a function called vb2_get_unmapped_area to do
>> this in framework side.
> are you using soc_camera ?
> you can add your get_unmapped_area  in soc_camera.
> if not, you can add it in your v4l2_file_operations ops, while still
> using videbuf2 to management your buffer.
yes, I have added this method, just copy __find_plane_by_offset code.
But it is ugly, it should have a vb2_get_unmapped_area like vb2_mmap.
These two operations are called by one system call, so they should
have a uniform looks.

Regards,
Scott

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: no mmu on videobuf2
  2011-06-16  7:57       ` Scott Jiang
@ 2011-06-16  8:49         ` Marek Szyprowski
  2011-06-16  8:50         ` Laurent Pinchart
  1 sibling, 0 replies; 7+ messages in thread
From: Marek Szyprowski @ 2011-06-16  8:49 UTC (permalink / raw)
  To: 'Scott Jiang', 'Kassey Lee'
  Cc: hans.verkuil, laurent.pinchart, linux-media, uclinux-dist-devel

Hello,

On Thursday, June 16, 2011 9:57 AM Scott Jiang wrote:

(snipped)

> >> I used dma-contig allocator. I mean if offset is 0, I must get actual
> >> addr from this offset.
> > hi, Scott
> >
> > if it is single plane, surely the offset is 0 for plane 0
> yes, it is absolutely right.
> 
> > what do you mean the actual addr ?
> I should return virtual address of the buffer in get_unmapped_area callback.
> 
> >
> >
> >> __find_plane_by_offset can do this. But it is an internal function.
> >> I think there should be a function called vb2_get_unmapped_area to do
> >> this in framework side.
> > are you using soc_camera ?
> > you can add your get_unmapped_area  in soc_camera.
> > if not, you can add it in your v4l2_file_operations ops, while still
> > using videbuf2 to management your buffer.
> yes, I have added this method, just copy __find_plane_by_offset code.
> But it is ugly, it should have a vb2_get_unmapped_area like vb2_mmap.
> These two operations are called by one system call, so they should
> have a uniform looks.

If videobuf2-core and its memory allocator interface lacks some operations
that are essential for no-mmu systems, please just add them. Frankly I have
no experience with Linux no-mmu systems, so I might have missed something
that is required for no-mmu case.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: no mmu on videobuf2
  2011-06-16  7:57       ` Scott Jiang
  2011-06-16  8:49         ` Marek Szyprowski
@ 2011-06-16  8:50         ` Laurent Pinchart
  1 sibling, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2011-06-16  8:50 UTC (permalink / raw)
  To: Scott Jiang
  Cc: Kassey Lee, Marek Szyprowski, hans.verkuil, linux-media,
	uclinux-dist-devel

Hi Scott,

On Thursday 16 June 2011 09:57:05 Scott Jiang wrote:
> 2011/6/16 Kassey Lee <kassey1216@gmail.com>:
> > 2011/6/16 Scott Jiang <scott.jiang.linux@gmail.com>:
> >> 2011/6/16 Marek Szyprowski <m.szyprowski@samsung.com>:
> >>>> Hi Marek and Laurent,
> >>>> 
> >>>> I am working on v4l2 drivers for blackfin which is a no mmu soc.
> >>>> I found videobuf allocate memory in mmap not reqbuf, so I turn to
> >>>> videobuf2. But __setup_offsets() use plane offset to fill m.offset,
> >>>> which is always 0 for single-planar buffer.
> >>>> So pgoff in get_unmapped_area callback equals 0.
> >>>> I only found uvc handled get_unmapped_area for no mmu system, but it
> >>>> manages buffers itself.
> >>>> I really want videobuf2 to manage buffers. Please give me some advice.
> >>> 
> >>> I'm not really sure if I know the differences between mmu and no-mmu
> >>> systems (from the device driver perspective). I assume that you are
> >>> using videobuf2-vmalloc allocator. Note that memory
> >>> allocators/managers are well separated from the videobuf2 logic. If it
> >>> the current one doesn't serve you well you can make your own no-mmu
> >>> allocator. Later once we identify all differences it might be merged
> >>> with the standard one or left alone if the merge is not really
> >>> possible or easy.
> >> 
> >> I used dma-contig allocator. I mean if offset is 0, I must get actual
> >> addr from this offset.
> > 
> > if it is single plane, surely the offset is 0 for plane 0
> 
> yes, it is absolutely right.
> 
> > what do you mean the actual addr ?
> 
> I should return virtual address of the buffer in get_unmapped_area
> callback.
> 
> >> __find_plane_by_offset can do this. But it is an internal function.
> >> I think there should be a function called vb2_get_unmapped_area to do
> >> this in framework side.
> > 
> > are you using soc_camera ?
> > you can add your get_unmapped_area  in soc_camera.
> > if not, you can add it in your v4l2_file_operations ops, while still
> > using videbuf2 to management your buffer.
> 
> yes, I have added this method, just copy __find_plane_by_offset code.
> But it is ugly, it should have a vb2_get_unmapped_area like vb2_mmap.
> These two operations are called by one system call, so they should
> have a uniform looks.

I agree with that. get_unmapped_area is a file operation and should be 
implemented using a videobuf2 helper, like vb2_mmap.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-16  8:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-16  5:31 no mmu on videobuf2 Scott Jiang
2011-06-16  5:42 ` Marek Szyprowski
2011-06-16  6:38   ` Scott Jiang
2011-06-16  7:19     ` Kassey Lee
2011-06-16  7:57       ` Scott Jiang
2011-06-16  8:49         ` Marek Szyprowski
2011-06-16  8:50         ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.