hfi_msgs.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /*
  2. * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2017 Linaro Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 and
  7. * only version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __VENUS_HFI_MSGS_H__
  16. #define __VENUS_HFI_MSGS_H__
  17. /* message calls */
  18. #define HFI_MSG_SYS_INIT 0x20001
  19. #define HFI_MSG_SYS_PC_PREP 0x20002
  20. #define HFI_MSG_SYS_RELEASE_RESOURCE 0x20003
  21. #define HFI_MSG_SYS_DEBUG 0x20004
  22. #define HFI_MSG_SYS_SESSION_INIT 0x20006
  23. #define HFI_MSG_SYS_SESSION_END 0x20007
  24. #define HFI_MSG_SYS_IDLE 0x20008
  25. #define HFI_MSG_SYS_COV 0x20009
  26. #define HFI_MSG_SYS_PROPERTY_INFO 0x2000a
  27. #define HFI_MSG_EVENT_NOTIFY 0x21001
  28. #define HFI_MSG_SESSION_GET_SEQUENCE_HEADER 0x21002
  29. #define HFI_MSG_SYS_PING_ACK 0x220002
  30. #define HFI_MSG_SYS_SESSION_ABORT 0x220004
  31. #define HFI_MSG_SESSION_LOAD_RESOURCES 0x221001
  32. #define HFI_MSG_SESSION_START 0x221002
  33. #define HFI_MSG_SESSION_STOP 0x221003
  34. #define HFI_MSG_SESSION_SUSPEND 0x221004
  35. #define HFI_MSG_SESSION_RESUME 0x221005
  36. #define HFI_MSG_SESSION_FLUSH 0x221006
  37. #define HFI_MSG_SESSION_EMPTY_BUFFER 0x221007
  38. #define HFI_MSG_SESSION_FILL_BUFFER 0x221008
  39. #define HFI_MSG_SESSION_PROPERTY_INFO 0x221009
  40. #define HFI_MSG_SESSION_RELEASE_RESOURCES 0x22100a
  41. #define HFI_MSG_SESSION_PARSE_SEQUENCE_HEADER 0x22100b
  42. #define HFI_MSG_SESSION_RELEASE_BUFFERS 0x22100c
  43. #define HFI_PICTURE_I 0x00000001
  44. #define HFI_PICTURE_P 0x00000002
  45. #define HFI_PICTURE_B 0x00000004
  46. #define HFI_PICTURE_IDR 0x00000008
  47. #define HFI_FRAME_NOTCODED 0x7f002000
  48. #define HFI_FRAME_YUV 0x7f004000
  49. #define HFI_UNUSED_PICT 0x10000000
  50. /* message packets */
  51. struct hfi_msg_event_notify_pkt {
  52. struct hfi_session_hdr_pkt shdr;
  53. u32 event_id;
  54. u32 event_data1;
  55. u32 event_data2;
  56. u32 ext_event_data[1];
  57. };
  58. struct hfi_msg_event_release_buffer_ref_pkt {
  59. u32 packet_buffer;
  60. u32 extradata_buffer;
  61. u32 output_tag;
  62. };
  63. struct hfi_msg_sys_init_done_pkt {
  64. struct hfi_pkt_hdr hdr;
  65. u32 error_type;
  66. u32 num_properties;
  67. u32 data[1];
  68. };
  69. struct hfi_msg_sys_pc_prep_done_pkt {
  70. struct hfi_pkt_hdr hdr;
  71. u32 error_type;
  72. };
  73. struct hfi_msg_sys_release_resource_done_pkt {
  74. struct hfi_pkt_hdr hdr;
  75. u32 resource_handle;
  76. u32 error_type;
  77. };
  78. struct hfi_msg_session_init_done_pkt {
  79. struct hfi_session_hdr_pkt shdr;
  80. u32 error_type;
  81. u32 num_properties;
  82. u32 data[1];
  83. };
  84. struct hfi_msg_session_end_done_pkt {
  85. struct hfi_session_hdr_pkt shdr;
  86. u32 error_type;
  87. };
  88. struct hfi_msg_session_get_sequence_hdr_done_pkt {
  89. struct hfi_session_hdr_pkt shdr;
  90. u32 error_type;
  91. u32 header_len;
  92. u32 sequence_header;
  93. };
  94. struct hfi_msg_sys_session_abort_done_pkt {
  95. struct hfi_session_hdr_pkt shdr;
  96. u32 error_type;
  97. };
  98. struct hfi_msg_sys_idle_pkt {
  99. struct hfi_pkt_hdr hdr;
  100. };
  101. struct hfi_msg_sys_ping_ack_pkt {
  102. struct hfi_pkt_hdr hdr;
  103. u32 client_data;
  104. };
  105. struct hfi_msg_sys_property_info_pkt {
  106. struct hfi_pkt_hdr hdr;
  107. u32 num_properties;
  108. u32 data[1];
  109. };
  110. struct hfi_msg_session_load_resources_done_pkt {
  111. struct hfi_session_hdr_pkt shdr;
  112. u32 error_type;
  113. };
  114. struct hfi_msg_session_start_done_pkt {
  115. struct hfi_session_hdr_pkt shdr;
  116. u32 error_type;
  117. };
  118. struct hfi_msg_session_stop_done_pkt {
  119. struct hfi_session_hdr_pkt shdr;
  120. u32 error_type;
  121. };
  122. struct hfi_msg_session_suspend_done_pkt {
  123. struct hfi_session_hdr_pkt shdr;
  124. u32 error_type;
  125. };
  126. struct hfi_msg_session_resume_done_pkt {
  127. struct hfi_session_hdr_pkt shdr;
  128. u32 error_type;
  129. };
  130. struct hfi_msg_session_flush_done_pkt {
  131. struct hfi_session_hdr_pkt shdr;
  132. u32 error_type;
  133. u32 flush_type;
  134. };
  135. struct hfi_msg_session_empty_buffer_done_pkt {
  136. struct hfi_session_hdr_pkt shdr;
  137. u32 error_type;
  138. u32 offset;
  139. u32 filled_len;
  140. u32 input_tag;
  141. u32 packet_buffer;
  142. u32 extradata_buffer;
  143. u32 data[0];
  144. };
  145. struct hfi_msg_session_fbd_compressed_pkt {
  146. struct hfi_session_hdr_pkt shdr;
  147. u32 time_stamp_hi;
  148. u32 time_stamp_lo;
  149. u32 error_type;
  150. u32 flags;
  151. u32 mark_target;
  152. u32 mark_data;
  153. u32 stats;
  154. u32 offset;
  155. u32 alloc_len;
  156. u32 filled_len;
  157. u32 input_tag;
  158. u32 output_tag;
  159. u32 picture_type;
  160. u32 packet_buffer;
  161. u32 extradata_buffer;
  162. u32 data[0];
  163. };
  164. struct hfi_msg_session_fbd_uncompressed_plane0_pkt {
  165. struct hfi_session_hdr_pkt shdr;
  166. u32 stream_id;
  167. u32 view_id;
  168. u32 error_type;
  169. u32 time_stamp_hi;
  170. u32 time_stamp_lo;
  171. u32 flags;
  172. u32 mark_target;
  173. u32 mark_data;
  174. u32 stats;
  175. u32 alloc_len;
  176. u32 filled_len;
  177. u32 offset;
  178. u32 frame_width;
  179. u32 frame_height;
  180. u32 start_x_coord;
  181. u32 start_y_coord;
  182. u32 input_tag;
  183. u32 input_tag2;
  184. u32 output_tag;
  185. u32 picture_type;
  186. u32 packet_buffer;
  187. u32 extradata_buffer;
  188. u32 data[0];
  189. };
  190. struct hfi_msg_session_fbd_uncompressed_plane1_pkt {
  191. u32 flags;
  192. u32 alloc_len;
  193. u32 filled_len;
  194. u32 offset;
  195. u32 packet_buffer2;
  196. u32 data[0];
  197. };
  198. struct hfi_msg_session_fbd_uncompressed_plane2_pkt {
  199. u32 flags;
  200. u32 alloc_len;
  201. u32 filled_len;
  202. u32 offset;
  203. u32 packet_buffer3;
  204. u32 data[0];
  205. };
  206. struct hfi_msg_session_parse_sequence_header_done_pkt {
  207. struct hfi_session_hdr_pkt shdr;
  208. u32 error_type;
  209. u32 num_properties;
  210. u32 data[1];
  211. };
  212. struct hfi_msg_session_property_info_pkt {
  213. struct hfi_session_hdr_pkt shdr;
  214. u32 num_properties;
  215. u32 data[1];
  216. };
  217. struct hfi_msg_session_release_resources_done_pkt {
  218. struct hfi_session_hdr_pkt shdr;
  219. u32 error_type;
  220. };
  221. struct hfi_msg_session_release_buffers_done_pkt {
  222. struct hfi_session_hdr_pkt shdr;
  223. u32 error_type;
  224. u32 num_buffers;
  225. u32 buffer_info[1];
  226. };
  227. struct hfi_msg_sys_debug_pkt {
  228. struct hfi_pkt_hdr hdr;
  229. u32 msg_type;
  230. u32 msg_size;
  231. u32 time_stamp_hi;
  232. u32 time_stamp_lo;
  233. u8 msg_data[1];
  234. };
  235. struct hfi_msg_sys_coverage_pkt {
  236. struct hfi_pkt_hdr hdr;
  237. u32 msg_size;
  238. u32 time_stamp_hi;
  239. u32 time_stamp_lo;
  240. u8 msg_data[1];
  241. };
  242. struct venus_core;
  243. struct hfi_pkt_hdr;
  244. void hfi_process_watchdog_timeout(struct venus_core *core);
  245. u32 hfi_process_msg_packet(struct venus_core *core, struct hfi_pkt_hdr *hdr);
  246. #endif