Hi Rob,
On Tue, Sep 13, 2011 at 9:29 AM, Sumit Semwal <sumit.semwal@ti.com> wrote:I guess you don't need to pass both 'struct dma_buf' and 'struct
> +struct dma_buf_ops {
> + void (*attach)(struct dma_buf *, struct device *,
> + struct dma_buf_attachment *);
> +
> + void (*detach)(struct dma_buf *, struct dma_buf_attachment *);
> +
> + struct scatterlist * (*get_scatterlist)(struct dma_buf *,
> + struct dma_buf_attachment *,
> + enum dma_buf_optype,
> + enum dma_buf_attr_flags);
dma_buf_attachment'.. the 'struct dma_buf_attachment' can have the
'struct dma_buf' ptr. This somehow seems a bit more logical and
cleaner to me.
Also, I'm not sure about dma_buf_attr_flags. I think we could add
whatever is needed to 'struct device_dma_parameters'
(dev->dma_params).
BR,
-R
> + void (*put_scatterlist)(struct dma_buf *, struct dma_buf_attachment *,
> + struct scatterlist *);
> +
> + /* allow mmap optionally for devices that need it */
> + int (*mmap)(struct dma_buf *, struct vm_area_struct *);
> + /* after final dma_buf_put() */
> + void (*release)(struct dma_buf *);
> +
> + /* allow allocator to take care of cache ops */
> + void (*sync_sg_for_cpu) (struct dma_buf *, struct device *);
> + void (*sync_sg_for_device)(struct dma_buf *, struct device *);
> +};
> +
Thanks and regards,
Sumit Semwal
Linaro Kernel Engineer - Graphics working group
Linaro.org │ Open source software for ARM SoCs