[PATCH v7 3/5] dma-buf: Add ioctls to allow userspace to flush

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Feb 11 18:08:42 UTC 2016


On Thu, Feb 11, 2016 at 03:54:38PM -0200, Tiago Vignatti wrote:
> 
> Thanks for reviewing, David. Please take a look in my comments in-line.
> 
> 
> On 02/09/2016 07:26 AM, David Herrmann wrote:
> >
> > On Tue, Dec 22, 2015 at 10:36 PM, Tiago Vignatti
> > <tiago.vignatti at intel.com> wrote:
> >> From: Daniel Vetter <daniel.vetter at ffwll.ch>
<snip>
> >> +
> >> +#define DMA_BUF_SYNC_READ      (1 << 0)
> >> +#define DMA_BUF_SYNC_WRITE     (2 << 0)
> >> +#define DMA_BUF_SYNC_RW        (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
> >> +#define DMA_BUF_SYNC_START     (0 << 2)
> >> +#define DMA_BUF_SYNC_END       (1 << 2)
> >> +#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
> >> +       (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
> >> +
> >> +#define DMA_BUF_BASE           'b'
> >> +#define DMA_BUF_IOCTL_SYNC     _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
> >
> > Why _IOW? A read-only ioctl should be able to call DMA_BUF_SYNC_READ, right?
> 
> yup. I've changed it to _IOWR now.

AFAICS the ioctl only does copy_from_user() so _IOW seemed perfectly
correct to me.

-- 
Ville Syrjälä
Intel OTC


More information about the dri-devel mailing list