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

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

 



> 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-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux