Re: [PATCH 3/4] videobuf2-dma-streaming: new videobuf2 memory allocator

From: Federico Vaga
Date: Thu Sep 13 2012 - 11:42:41 EST


> On Thursday, September 13, 2012 3:53 PM Federico Vaga wrote:
> > Signed-off-by: Federico Vaga <federico.vaga@xxxxxxxxx>
>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/