msm_vidc_vb2.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021,, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _MSM_VIDC_VB2_H_
  6. #define _MSM_VIDC_VB2_H_
  7. #include <media/videobuf2-core.h>
  8. #include <media/videobuf2-v4l2.h>
  9. #include "msm_vidc_inst.h"
  10. struct vb2_queue *msm_vidc_get_vb2q(struct msm_vidc_inst *inst,
  11. u32 type, const char *func);
  12. /* vb2_mem_ops */
  13. void *msm_vb2_get_userptr(struct device *dev, unsigned long vaddr,
  14. unsigned long size, enum dma_data_direction dma_dir);
  15. void msm_vb2_put_userptr(void *buf_priv);
  16. void* msm_vb2_attach_dmabuf(struct device* dev, struct dma_buf* dbuf,
  17. unsigned long size, enum dma_data_direction dma_dir);
  18. void msm_vb2_detach_dmabuf(void* buf_priv);
  19. int msm_vb2_map_dmabuf(void* buf_priv);
  20. void msm_vb2_unmap_dmabuf(void* buf_priv);
  21. /* vb2_ops */
  22. int msm_vidc_queue_setup(struct vb2_queue *q,
  23. unsigned int *num_buffers, unsigned int *num_planes,
  24. unsigned int sizes[], struct device *alloc_devs[]);
  25. int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count);
  26. void msm_vidc_stop_streaming(struct vb2_queue *q);
  27. void msm_vidc_buf_queue(struct vb2_buffer *vb2);
  28. void msm_vidc_buf_cleanup(struct vb2_buffer *vb);
  29. #endif // _MSM_VIDC_VB2_H_