mdp-subdev.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. */
  13. #ifndef _WFD_MDP_SUBDEV_
  14. #define _WFD_MDP_SUBDEV_
  15. #include <linux/videodev2.h>
  16. #include <media/v4l2-subdev.h>
  17. #define MDP_MAGIC_IOCTL 'M'
  18. struct mdp_buf_info {
  19. void *inst;
  20. void *cookie;
  21. u32 fd;
  22. u32 offset;
  23. u32 kvaddr;
  24. u32 paddr;
  25. };
  26. struct mdp_prop {
  27. void *inst;
  28. u32 height;
  29. u32 width;
  30. };
  31. struct mdp_msg_ops {
  32. void *cookie;
  33. bool secure;
  34. bool iommu_split_domain;
  35. };
  36. static inline bool mdp_buf_info_equals(struct mdp_buf_info *a,
  37. struct mdp_buf_info *b)
  38. {
  39. return a->inst == b->inst
  40. && a->fd == b->fd
  41. && a->offset == b->offset
  42. && a->kvaddr == b->kvaddr
  43. && a->paddr == b->paddr;
  44. }
  45. #define MDP_Q_BUFFER _IOW(MDP_MAGIC_IOCTL, 1, struct mdp_buf_info *)
  46. #define MDP_DQ_BUFFER _IOR(MDP_MAGIC_IOCTL, 2, struct mdp_out_buf *)
  47. #define MDP_OPEN _IOR(MDP_MAGIC_IOCTL, 3, void **)
  48. #define MDP_SET_PROP _IOW(MDP_MAGIC_IOCTL, 4, struct mdp_prop *)
  49. #define MDP_CLOSE _IOR(MDP_MAGIC_IOCTL, 5, void *)
  50. #define MDP_START _IOR(MDP_MAGIC_IOCTL, 6, void *)
  51. #define MDP_STOP _IOR(MDP_MAGIC_IOCTL, 7, void *)
  52. #define MDP_MMAP _IOR(MDP_MAGIC_IOCTL, 8, struct mem_region_map *)
  53. #define MDP_MUNMAP _IOR(MDP_MAGIC_IOCTL, 9, struct mem_region_map *)
  54. #define MDP_SECURE _IO(MDP_MAGIC_IOCTL, 9)
  55. extern int mdp_init(struct v4l2_subdev *sd, u32 val);
  56. extern long mdp_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
  57. #endif /* _WFD_MDP_SUBDEV_ */