lkml.org 
[lkml]   [2012]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] videobuf2-dma-streaming: new videobuf2 memory allocator
Date
> On Thursday, September 13, 2012 3:53 PM Federico Vaga wrote:
> > Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
>
> A few words explaining why this memory handling module is required or
> beneficial will definitely improve the commit :)

ok, I will write some lines

> > +static void *vb2_dma_streaming_cookie(void *buf_priv)
> > +{
> > + struct vb2_streaming_buf *buf = buf_priv;
> > +
> > + return (void *)buf->dma_handle;
> > +}
>
> Please change this function to:
>
> static void *vb2_dma_streaming_cookie(void *buf_priv)
> {
> struct vb2_streaming_buf *buf = buf_priv;
> return &buf->dma_handle;
> }
>
> and add a following static inline to
> include/media/videobuf2-dma-streaming.h:
>
> static inline dma_addr_t
> vb2_dma_streaming_plane_paddr(struct vb2_buffer *vb, unsigned int
> plane_no) {
> dma_addr_t *dma_addr = vb2_plane_cookie(vb, plane_no);
> return *dma_addr;
> }
>
> Do not use 'cookie' callback directly in the driver, the driver should
> use the above proxy.
>
> The &buf->dma_handle workaround is required for some possible
> configurations with 64bit dma addresses, see commit 472af2b05bdefc.

ACK.

--
Federico Vaga


\
 
 \ /
  Last update: 2012-09-13 18:41    [W:0.075 / U:21.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site