Re: [PATCHv3 8/8] videobuf2: handle non-contiguous DMA allocations

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

 



On (21/07/22 19:26), Dafna Hirschfeld wrote:
> >   /*********************************************/
> > @@ -139,17 +175,63 @@ static void vb2_dc_put(void *buf_priv)
> >   		sg_free_table(buf->sgt_base);
> >   		kfree(buf->sgt_base);
> >   	}
> > -	dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr,
> > -		       buf->attrs);
> > +
> > +	if (buf->coherent_mem) {
> > +		dma_free_attrs(buf->dev, buf->size, buf->cookie,
> > +			       buf->dma_addr, buf->attrs);
> > +	} else {
> > +		if (buf->vaddr)
> > +			dma_vunmap_noncontiguous(buf->dev, buf->vaddr);
> > +		dma_free_noncontiguous(buf->dev, buf->size,
> > +				       buf->dma_sgt, buf->dma_addr);
> 
> The last argument for dma_free_noncontiguous should be dma_dir.
> Also, the 'cookie' cb returns buf->dma_addr which is not initialized for
> the noncontiguous api. So it is not clear how drivers should use the new api.

Done. Thank you Dafna.



[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