csi_dsp_task_defs.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * Copyright (c) 2021 Alibaba Group. All rights reserved.
  3. * License-Identifier: Apache-2.0
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  6. * not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. */
  18. /*!
  19. * \file
  20. * \brief This section defines DSP shared strcut for CPU&DSP&APP.
  21. *
  22. * General properties:
  23. * 1. Post porcess define data and strcut, visiable for APP
  24. * 2. user define data shared bedtween DSP ans host
  25. */
  26. #ifndef _CSI_DSP_TASK_DEFS_H
  27. #define _CSI_DSP_TASK_DEFS_H
  28. #include <string.h>
  29. #include <stdint.h>
  30. #include "csi_dsp_post_process_defs.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #define MAX_REPORT_SIZE 256
  35. #define CSI_DSP_HW_TASK_EXTRA_BUF_START_INDEX 2
  36. typedef struct _sisp_config_par{
  37. uint16_t id;
  38. uint16_t hor;
  39. uint16_t ver;
  40. uint16_t data_fmt;
  41. uint16_t line_in_entry;
  42. uint16_t line_stride;
  43. uint32_t buffer_size;
  44. uint64_t buffer_addr;
  45. }sisp_config_par;
  46. typedef sisp_config_par spost_isp_config_par;
  47. // typedef sisp_config_par svipre_config_par;
  48. typedef struct vipre_config_par{
  49. uint8_t id;
  50. uint8_t act_channel;
  51. uint8_t data_fmt;
  52. uint8_t buffer_num;
  53. uint16_t line_num;
  54. uint16_t hor;
  55. uint16_t ver;
  56. uint16_t line_stride;
  57. uint32_t buffer_size;
  58. uint64_t buffer_addr[12];
  59. }vipre_config_par_t;
  60. typedef enum csi_dsp_report{
  61. CSI_DSP_REPORT_NORMAL,
  62. CSI_DSP_REPORT_RESULT,
  63. CSI_DSP_REPORT_RESULT_WITH_EXRA_PARAM,
  64. CSI_DSP_REPORT_ALGO_ERR,
  65. CSI_DSP_REPORT_PS_ERR,
  66. CSI_DSP_REPORT_ISP_ERR,
  67. CSI_DSP_REPORT_RY_ERR,
  68. CSI_DSP_REPORT_VI_PRE_ERR,
  69. CSI_DSP_REPORT_NO_BUF,
  70. CSI_DSP_REPORT_HEARTBEAT_ERR,
  71. CSI_DSP_HW_FRAME_DROP,
  72. CSI_DSP_REPORT_EXRA_PARAM,
  73. CSI_DSP_REPORT_HW_ERROR,
  74. CSI_DSP_REPORT_HW_VIPRE_NM_OVERFLOW_FLOW,
  75. CSI_DSP_REPORT_HW_VIPRE_FIFO_ERROR,
  76. CSI_DSP_REPORT_HW_VIPRE_BUS_ERROR,
  77. CSI_DSP_REPORT_HW_ERROR_END,
  78. CSI_DSP_REPORT_MAX
  79. }csi_dsp_report_e;
  80. typedef struct csi_dsp_report_item{
  81. csi_dsp_report_e type;
  82. union{
  83. char data[MAX_REPORT_SIZE];
  84. struct csi_dsp_buffer buf;
  85. };
  86. }csi_dsp_report_item_t;
  87. typedef enum csi_dsp_task_mode{
  88. CSI_DSP_TASK_SW_TO_SW =0x1<<0, /*SW Queue to handle in / data/exception */
  89. CSI_DSP_TASK_SW_TO_HW =0x1<<1, /*SW Queue to handle in and exception / Report handlere exception,HW handl out*/
  90. CSI_DSP_TASK_HW_TO_SW =0x1<<2, /* HW send handle in, Report handler out and exception*/
  91. CSI_DSP_TASK_HW_TO_HW =0x01<<3, /* Hw handler in&out Report handler exception*/
  92. CSI_DSP_TASK_SW = (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW),
  93. CSI_DSP_TASK_HW = (CSI_DSP_TASK_HW_TO_SW|CSI_DSP_TASK_HW_TO_HW),
  94. }csi_dsp_task_mode_e;
  95. //#define CSI_DSP_TASK_SW (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW)
  96. //#define CSI_DSP_TASK_HW (CSI_DSP_TASK_HW_TO_SW|CSI_DSP_TASK_HW_TO_HW)
  97. enum csi_dsp_fe_type{
  98. CSI_DSP_FE_TYPE_CPU,
  99. CSI_DSP_FE_TYPE_ISP,
  100. CSI_DSP_FE_TYPE_VIPRE,
  101. CSI_DSP_FE_TYPE_INVALID,
  102. };
  103. enum csi_dsp_be_type{
  104. CSI_DSP_BE_TYPE_HOST,
  105. CSI_DSP_BE_TYPE_POST_ISP,
  106. CSI_DSP_BE_TYPE_INVALID,
  107. };
  108. enum csi_dsp_task_cfg{
  109. CSI_DSP_TASK_IDLE,
  110. CSI_DSP_TASK_START,
  111. CSI_DSP_TASK_STOP,
  112. };
  113. typedef struct csi_dsp_task_fe_para{
  114. enum csi_dsp_fe_type frontend_type;
  115. int task_id;
  116. union{
  117. sisp_config_par isp_param;
  118. vipre_config_par_t vipre_param;
  119. };
  120. }csi_dsp_task_fe_para_t;
  121. typedef struct _sw_be_config_par{
  122. int num_buf;
  123. struct csi_dsp_buffer bufs[1];
  124. }sw_be_config_par;
  125. typedef struct csi_dsp_task_be_para{
  126. enum csi_dsp_be_type backend_type;
  127. int task_id;
  128. union{
  129. sisp_config_par post_isp_param;
  130. sw_be_config_par sw_param;
  131. };
  132. }csi_dsp_task_be_para_t;
  133. typedef struct csi_dsp_algo_load_req{
  134. uint16_t algo_id;
  135. int task_id;
  136. uint64_t algo_ptr;
  137. }csi_dsp_algo_load_req_t;
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif