Re: no mmu on videobuf2

2011-06-16 Thread Scott Jiang
2011/6/16 Marek Szyprowski m.szyprow...@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 RD 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
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: no mmu on videobuf2

2011-06-16 Thread Kassey Lee
2011/6/16 Scott Jiang scott.jiang.li...@gmail.com:
 2011/6/16 Marek Szyprowski m.szyprow...@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 RD 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 majord...@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.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: no mmu on videobuf2

2011-06-16 Thread Scott Jiang
Hi Kassey,

2011/6/16 Kassey Lee kassey1...@gmail.com:
 2011/6/16 Scott Jiang scott.jiang.li...@gmail.com:
 2011/6/16 Marek Szyprowski m.szyprow...@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 RD 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
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: no mmu on videobuf2

2011-06-16 Thread Marek Szyprowski
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 RD Center


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: no mmu on videobuf2

2011-06-16 Thread Laurent Pinchart
Hi Scott,

On Thursday 16 June 2011 09:57:05 Scott Jiang wrote:
 2011/6/16 Kassey Lee kassey1...@gmail.com:
  2011/6/16 Scott Jiang scott.jiang.li...@gmail.com:
  2011/6/16 Marek Szyprowski m.szyprow...@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
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: no mmu on videobuf2

2011-06-15 Thread Marek Szyprowski
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 RD Center


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html