Re: [RFCv2 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-01-26 Thread Sumit Semwal
Hi Russell! On 21 January 2015 at 23:01, Russell King - ARM Linux wrote: > On Wed, Jan 21, 2015 at 09:46:47AM +0530, Sumit Semwal wrote: >> +static int calc_constraints(struct device *dev, >> + struct dma_buf_constraints *calc_cons) >> +{ >> + struct dma_buf_constraint

Re: [RFCv2 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-01-21 Thread Russell King - ARM Linux
On Wed, Jan 21, 2015 at 09:46:47AM +0530, Sumit Semwal wrote: > +static int calc_constraints(struct device *dev, > + struct dma_buf_constraints *calc_cons) > +{ > + struct dma_buf_constraints cons = *calc_cons; > + > + cons.dma_mask &= dma_get_mask(dev); I don't thi

[RFCv2 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-01-20 Thread Sumit Semwal
Add some helpers to share the constraints of devices while attaching to the dmabuf buffer. At each attach, the constraints are calculated based on the following: - dma_mask, coherent_dma_mask from struct device, - max_segment_size, max_segment_count, segment_boundary_mask from device_dma_parame