dma-buf.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Framework for buffer objects that can be shared across devices/subsystems.
  3. *
  4. * Copyright(C) 2015 Intel Ltd
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _DMA_BUF_UAPI_H_
  19. #define _DMA_BUF_UAPI_H_
  20. #include <linux/types.h>
  21. /* begin/end dma-buf functions used for userspace mmap. */
  22. struct dma_buf_sync {
  23. __u64 flags;
  24. };
  25. #define DMA_BUF_SYNC_READ (1 << 0)
  26. #define DMA_BUF_SYNC_WRITE (2 << 0)
  27. #define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
  28. #define DMA_BUF_SYNC_START (0 << 2)
  29. #define DMA_BUF_SYNC_END (1 << 2)
  30. #define DMA_BUF_SYNC_VALID_FLAGS_MASK \
  31. (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
  32. #define DMA_BUF_BASE 'b'
  33. #define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
  34. #endif