Browse Source

Linux_SDK_V1.0.3

thead_admin 1 year ago
parent
commit
0ca78af0f7
3 changed files with 61 additions and 97 deletions
  1. 3 2
      src/include/csi_dsp_post_process_defs.h
  2. 16 84
      src/include/csi_dsp_task_defs.h
  3. 42 11
      src/include/dsp_ps_ns.h

+ 3 - 2
src/include/csi_dsp_post_process_defs.h

@@ -78,9 +78,10 @@ struct csi_dsp_plane {
 };
 
 typedef enum csi_dsp_buf_type {
-	CSI_DSP_BUF_TYPE_DMA_BUF,		// memory allocated via dma-buf
+	CSI_DSP_BUF_TYPE_DMA_BUF_IMPORT,		// memory allocated via dma-buf from extern
+    CSI_DSP_BUF_TYPE_DMA_BUF_EXPORT,     // memory allocated via dma-buf from internal
 	CSI_DSP_BUF_ALLOC_APP,	// memory allocated via APP malloc
-    CSI_DSP_BUF_ALLOC_DRV,  // memory allocated via DSP Driver
+    CSI_DSP_BUF_ALLOC_DRV,  // memory allocated via DSP Drvier
     CSI_DSP_BUF_ALLOC_FM,   // memory will auto acquire by DSP FM
 } csi_dsp_buf_type_e;
 

+ 16 - 84
src/include/csi_dsp_task_defs.h

@@ -34,9 +34,11 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
+
 #define  MAX_REPORT_SIZE  256
+
 #define  CSI_DSP_HW_TASK_EXTRA_BUF_START_INDEX  2
-typedef struct {
+typedef struct _sisp_config_par{
 	uint16_t id;
 	uint16_t hor;
 	uint16_t ver;
@@ -50,7 +52,7 @@ typedef struct {
 typedef   sisp_config_par spost_isp_config_par;
 // typedef   sisp_config_par svipre_config_par;
 typedef  struct vipre_config_par{
-	uint8_t  id;
+    uint8_t  id;
 	uint8_t  act_channel;
 	uint8_t  data_fmt;
 	uint8_t  buffer_num;
@@ -62,23 +64,7 @@ typedef  struct vipre_config_par{
 	uint64_t buffer_addr[12];
 }vipre_config_par_t;
 
-typedef struct {
-	uint16_t algo_id;
-	float gamma;  // float鍙傛暟
-	float coef1;
-	float coef2;
-	float coef3;
-	float coef4;
-	short beta;			// short鍨嬪弬鏁�
-	short beta1;
-	short beta2;
-	short beta3;
-	short beta4;
-}salgo_config_par;
-
-
-
-typedef enum{
+typedef enum csi_dsp_report{
   CSI_DSP_REPORT_NORMAL,
   CSI_DSP_REPORT_RESULT,
   CSI_DSP_REPORT_RESULT_WITH_EXRA_PARAM,
@@ -99,19 +85,13 @@ typedef enum{
   CSI_DSP_REPORT_MAX
 }csi_dsp_report_e;
 
-typedef struct dsp_frame{
-  uint64_t p_frame_buff[3];
-  uint32_t frame_buff_size[3];
-  int32_t  frame_width;
-  int32_t  frame_height;
-  int32_t  frame_pitch;
-  uint8_t  pixel_res;
-  uint8_t  num_channels;
-  int8_t   fmt;
-}dsp_frame_t;
-
-
-
+typedef struct csi_dsp_report_item{
+    csi_dsp_report_e type;
+    union{
+        char data[MAX_REPORT_SIZE];
+        struct csi_dsp_buffer buf;
+    };
+}csi_dsp_report_item_t;
 typedef enum csi_dsp_task_mode{
     CSI_DSP_TASK_SW_TO_SW =0x1<<0,  /*SW Queue to handle in / data/exception  */
     CSI_DSP_TASK_SW_TO_HW =0x1<<1,  /*SW Queue to handle in and exception / Report handlere exception,HW handl out*/
@@ -124,40 +104,6 @@ typedef enum csi_dsp_task_mode{
 //#define  CSI_DSP_TASK_SW  (CSI_DSP_TASK_SW_TO_HW|CSI_DSP_TASK_SW_TO_SW)
 //#define  CSI_DSP_TASK_HW  (CSI_DSP_TASK_HW_TO_SW|CSI_DSP_TASK_HW_TO_HW)
 
-typedef enum csi_dsp_status{
-    CSI_DSP_ERR_ILLEGAL_PARAM = -100,
-    CSI_DSP_TASK_NOT_VALID,
-    CSI_DSP_TASK_ALLOC_FAIL,
-    CSI_DSP_TASK_ADD_TO_SCHEDULER_FAIL,
-    CSI_DSP_TASK_ALREADY_RUNNING,
-    CSI_DSP_TASK_START_FAIL,
-    CSI_DSP_REPORTER_NOT_INIT,
-    CSI_DSP_FE_NOT_VALID,
-    CSI_DSP_FE_CONFIG_FAIL,
-    CSI_DSP_BE_CONFIG_FAIL,
-    CSI_DSP_BE_NOT_VALID,
-    CSI_DSP_ALGO_INVALID,
-    CSI_DSP_ALGO_ERR,
-    CSI_DSP_FE_ERR,
-    CSI_DSP_BE_ERR,
-    CSI_DSP_BUF_TYPE_ERR,
-    CSI_DSP_ALGO_LOAD_FAIL,
-    CSI_DSP_MALLO_FAIL,
-    CSI_DSP_ALGO_BUF_FAIL,
-    CSI_DSP_FAIL,
-    CSI_DSP_OK = 0,
-}csi_dsp_status_e;
-
-struct csi_dsp_task_create_req{
-    csi_dsp_task_mode_e type;
-    int priority;
-};
-
-
-
-struct csi_dsp_task_comm_resp{
-    csi_dsp_status_e status;
-};
 enum csi_dsp_fe_type{
     CSI_DSP_FE_TYPE_CPU,
     CSI_DSP_FE_TYPE_ISP,
@@ -178,21 +124,21 @@ enum csi_dsp_task_cfg{
 
 };
 
-struct csi_dsp_task_fe_para{
+typedef struct csi_dsp_task_fe_para{
     enum csi_dsp_fe_type frontend_type;
     int task_id;
     union{
             sisp_config_par isp_param;
             vipre_config_par_t vipre_param;
     };
-};
+}csi_dsp_task_fe_para_t;
 typedef struct _sw_be_config_par{
     int num_buf;
     struct csi_dsp_buffer bufs[1];
 
 }sw_be_config_par;
 
-struct csi_dsp_task_be_para{
+typedef struct csi_dsp_task_be_para{
     enum csi_dsp_be_type backend_type;
     int task_id;
     union{
@@ -200,15 +146,8 @@ struct csi_dsp_task_be_para{
             sw_be_config_par sw_param;
     };
 
-};
+}csi_dsp_task_be_para_t;
 
-typedef struct csi_dsp_report_item{
-	csi_dsp_report_e type;
-    union{
-        char data[MAX_REPORT_SIZE];
-        struct csi_dsp_buffer buf;
-    };
-}csi_dsp_report_item_t;
 
 typedef struct csi_dsp_algo_load_req{
 	uint16_t  algo_id;
@@ -216,13 +155,6 @@ typedef struct csi_dsp_algo_load_req{
     uint64_t  algo_ptr;
 }csi_dsp_algo_load_req_t;
 
-typedef struct csi_dsp_algo_load_resp{
-	csi_dsp_status_e status;
-	uint16_t  algo_id;
-	uint16_t  buf_desc_num;
-	uint16_t  info_prop_des_num;
-	uint16_t  set_prop_des_num;
-}csi_dsp_algo_load_resp_t;
 
 
 #ifdef __cplusplus

+ 42 - 11
src/include/dsp_ps_ns.h

@@ -15,9 +15,8 @@
  * limitations under the License.
  *
  */
-
 /*!
- * \file
+ * \file 
  * \brief This section defines DSP and host shared data and strcut.
  *
  * General  properties:
@@ -111,6 +110,47 @@ struct csi_dsp_task_start_req{
     char task_ns[TASK_NAME_LINE];
 };
 
+typedef enum csi_dsp_status{
+    CSI_DSP_ERR_ILLEGAL_PARAM = -100,
+    CSI_DSP_TASK_NOT_VALID,
+    CSI_DSP_TASK_ALLOC_FAIL,
+    CSI_DSP_TASK_ADD_TO_SCHEDULER_FAIL,
+    CSI_DSP_TASK_ALREADY_RUNNING,
+    CSI_DSP_TASK_START_FAIL,
+    CSI_DSP_REPORTER_NOT_INIT,
+    CSI_DSP_FE_NOT_VALID,
+    CSI_DSP_FE_CONFIG_FAIL,
+    CSI_DSP_BE_CONFIG_FAIL,
+    CSI_DSP_BE_NOT_VALID,
+    CSI_DSP_ALGO_INVALID,
+    CSI_DSP_ALGO_ERR,
+    CSI_DSP_FE_ERR,
+    CSI_DSP_BE_ERR,
+    CSI_DSP_BUF_TYPE_ERR,
+    CSI_DSP_ALGO_LOAD_FAIL,
+    CSI_DSP_MALLO_FAIL,
+    CSI_DSP_ALGO_BUF_FAIL,
+    CSI_DSP_FAIL,
+    CSI_DSP_OK = 0,
+}csi_dsp_status_e;
+
+struct csi_dsp_task_create_req{
+    csi_dsp_task_mode_e type;
+    int priority;
+};
+
+typedef struct csi_dsp_algo_load_resp{
+	csi_dsp_status_e status;
+	uint16_t  algo_id;
+	uint16_t  buf_desc_num;
+	uint16_t  info_prop_des_num;
+	uint16_t  set_prop_des_num;
+}csi_dsp_algo_load_resp_t;
+
+struct csi_dsp_task_comm_resp{
+    csi_dsp_status_e status;
+};
+
 struct csi_dsp_task_create_resp{
 
     csi_dsp_status_e status;
@@ -130,15 +170,6 @@ struct csi_dsp_ip_test_par{
     int  result_buf_size;
 };
 
-//  struct csi_dsp_algo_config_par{
-// 	uint16_t algo_id;
-//     char* algo;
-//     union
-//     {
-//         float  gam_coef[4];
-//         short  beta_coef[4];
-//     };
-// };
 #ifdef __cplusplus
 }
 #endif