msmb_pproc.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef __MSMB_PPROC_H
  2. #define __MSMB_PPROC_H
  3. #ifdef MSM_CAMERA_BIONIC
  4. #include <sys/types.h>
  5. #endif
  6. #include <linux/videodev2.h>
  7. #include <linux/types.h>
  8. /* Should be same as VIDEO_MAX_PLANES in videodev2.h */
  9. #define MAX_PLANES VIDEO_MAX_PLANES
  10. #define MAX_NUM_CPP_STRIPS 8
  11. #define MSM_CPP_MAX_NUM_PLANES 3
  12. #define MSM_CPP_MAX_FW_NAME_LEN 32
  13. #define MSM_CPP_MIN_FRAME_LENGTH 13
  14. #define MSM_CPP_MAX_FRAME_LENGTH 2048
  15. enum msm_cpp_frame_type {
  16. MSM_CPP_OFFLINE_FRAME,
  17. MSM_CPP_REALTIME_FRAME,
  18. };
  19. struct msm_cpp_frame_strip_info {
  20. int scale_v_en;
  21. int scale_h_en;
  22. int upscale_v_en;
  23. int upscale_h_en;
  24. int src_start_x;
  25. int src_end_x;
  26. int src_start_y;
  27. int src_end_y;
  28. /* Padding is required for upscaler because it does not
  29. * pad internally like other blocks, also needed for rotation
  30. * rotation expects all the blocks in the stripe to be the same size
  31. * Padding is done such that all the extra padded pixels
  32. * are on the right and bottom
  33. */
  34. int pad_bottom;
  35. int pad_top;
  36. int pad_right;
  37. int pad_left;
  38. int v_init_phase;
  39. int h_init_phase;
  40. int h_phase_step;
  41. int v_phase_step;
  42. int prescale_crop_width_first_pixel;
  43. int prescale_crop_width_last_pixel;
  44. int prescale_crop_height_first_line;
  45. int prescale_crop_height_last_line;
  46. int postscale_crop_height_first_line;
  47. int postscale_crop_height_last_line;
  48. int postscale_crop_width_first_pixel;
  49. int postscale_crop_width_last_pixel;
  50. int dst_start_x;
  51. int dst_end_x;
  52. int dst_start_y;
  53. int dst_end_y;
  54. int bytes_per_pixel;
  55. unsigned int source_address;
  56. unsigned int destination_address;
  57. unsigned int compl_destination_address;
  58. unsigned int src_stride;
  59. unsigned int dst_stride;
  60. int rotate_270;
  61. int horizontal_flip;
  62. int vertical_flip;
  63. int scale_output_width;
  64. int scale_output_height;
  65. int prescale_crop_en;
  66. int postscale_crop_en;
  67. };
  68. struct msm_cpp_buffer_info_t {
  69. int fd;
  70. uint32_t index;
  71. uint32_t offset;
  72. uint8_t native_buff;
  73. uint8_t processed_divert;
  74. };
  75. struct msm_cpp_stream_buff_info_t {
  76. uint32_t identity;
  77. uint32_t num_buffs;
  78. struct msm_cpp_buffer_info_t *buffer_info;
  79. };
  80. struct msm_cpp_frame_info_t {
  81. int32_t frame_id;
  82. struct timeval timestamp;
  83. uint32_t inst_id;
  84. uint32_t identity;
  85. uint32_t client_id;
  86. enum msm_cpp_frame_type frame_type;
  87. uint32_t num_strips;
  88. struct msm_cpp_frame_strip_info *strip_info;
  89. uint32_t msg_len;
  90. uint32_t *cpp_cmd_msg;
  91. int src_fd;
  92. int dst_fd;
  93. struct ion_handle *src_ion_handle;
  94. struct ion_handle *dest_ion_handle;
  95. struct timeval in_time, out_time;
  96. void *cookie;
  97. int32_t *status;
  98. int32_t duplicate_output;
  99. uint32_t duplicate_identity;
  100. struct msm_cpp_buffer_info_t input_buffer_info;
  101. struct msm_cpp_buffer_info_t output_buffer_info[2];
  102. };
  103. struct cpp_hw_info {
  104. uint32_t cpp_hw_version;
  105. uint32_t cpp_hw_caps;
  106. };
  107. #define VIDIOC_MSM_CPP_CFG \
  108. _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
  109. #define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
  110. _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
  111. #define VIDIOC_MSM_CPP_GET_INST_INFO \
  112. _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
  113. #define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
  114. _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
  115. #define VIDIOC_MSM_CPP_GET_HW_INFO \
  116. _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
  117. #define VIDIOC_MSM_CPP_FLUSH_QUEUE \
  118. _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
  119. #define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
  120. _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
  121. #define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
  122. _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
  123. #define VIDIOC_MSM_CPP_APPEND_STREAM_BUFF_INFO \
  124. _IOWR('V', BASE_VIDIOC_PRIVATE + 15, struct msm_camera_v4l2_ioctl_t)
  125. #define VIDIOC_MSM_CPP_SET_CLOCK \
  126. _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_camera_v4l2_ioctl_t)
  127. #define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
  128. #define V4L2_EVENT_COMPANION_IRQ_IN (V4L2_EVENT_PRIVATE_START + 1)
  129. struct msm_camera_v4l2_ioctl_t {
  130. uint32_t id;
  131. uint32_t len;
  132. int32_t trans_code;
  133. void __user *ioctl_ptr;
  134. };
  135. #endif /* __MSMB_PPROC_H */