Browse Source

Linux_SDK_V1.0.3

thead_admin 1 year ago
parent
commit
496326e34f

+ 0 - 28
driver/xrp-user/dsp-ps/csi_dsp_helper.c

@@ -84,34 +84,6 @@ int csi_dsp_disable_heartbeat_check()
     return setitimer(ITIMER_REAL,&val,NULL);
 
 }
-void isp_algo_result_handler(void *context,void *data)
-{
-    s_cmd_t *msg=(s_cmd_t *)data;
-    printf("report recived:%x\n",msg->cmd);
-    switch(msg->cmd)
-    {
-        case CSI_DSP_REPORT_ISP_ERR:
-                printf("ISP error:%d\n",msg->data[0]);
-            break;
-        case CSI_DSP_REPORT_RY_ERR:
-                printf("Post ISP error\n",msg->data[0]);
-            break;
-        case CSI_DSP_REPORT_ALGO_ERR:
-                printf("algo err\n");
-            break;
-        case CSI_DSP_REPORT_VI_PRE_ERR:
-            break;
-        case  CSI_DSP_REPORT_RESULT:
-            break;
-        case CSI_DSP_REPORT_HEARTBEAT_ERR:
-                 printf("heartbeat not detect\n");
-            break;
-        default:
-            break;
-           
-    }
-
-}
 
 
 int csi_dsp_buf_flush( struct xrp_device *device,struct csi_dsp_buffer *buffers)

+ 2 - 5
driver/xrp-user/include/csi_dsp_post_process_defs.h

@@ -21,7 +21,7 @@
  *
  * General  properties:
  * 1. Post porcess define data and strcut, visiable for APP
- * 2. user define data shared bedtween DSP ans host
+ * 2. user define data shared between DSP and host
  */
 
 #ifndef _CSI_DSP_POST_DEFS_H
@@ -37,8 +37,6 @@ extern "C" {
 #define CSI_DSP_MAX_BUFFER   8
 typedef uint8_t dsp_id_t;
 
-
-
 typedef enum csi_dsp_img_fmt{
 	CSI_DSP_IMG_FMT_RAW8 =0,
 	CSI_DSP_IMG_FMT_RAW10_UNALGIN,
@@ -72,7 +70,6 @@ enum buffer_property{
 };
 
 struct csi_dsp_plane {
-
 	int      fd;
     uint32_t stride;         /* if buffer type is image */
 	uint32_t size;
@@ -99,7 +96,7 @@ struct csi_dsp_buffer {
 	struct csi_dsp_plane planes[3];
 };
  struct csi_dsp_algo_config_par{
-	int16_t  algo_id;
+	int16_t   algo_id;
     int       task_id;
     uint64_t  algo_ptr;
     uint64_t  sett_ptr;

+ 13 - 85
driver/xrp-user/include/csi_dsp_task_defs.h

@@ -38,7 +38,7 @@ extern "C" {
 #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;
@@ -64,22 +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,
@@ -100,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*/
@@ -125,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,
@@ -179,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{
@@ -201,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;
@@ -217,16 +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;
-
-
-void isp_algo_result_handler(void *context,void *data);
 
 #ifdef __cplusplus
 }

+ 41 - 9
driver/xrp-user/include/dsp_ps_ns.h

@@ -110,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;
@@ -129,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

+ 28 - 0
test/vi_test/test_dsp_vi.c

@@ -14,6 +14,34 @@ struct message{
 	char message[PAYLOAD_SIZE];
 };
 
+static void isp_algo_result_handler(void *context,void *data)
+{
+    csi_dsp_report_item_t *msg=(csi_dsp_report_item_t *)data;
+    printf("report recived:%x\n",msg->type);
+    switch(msg->type)
+    {
+        case CSI_DSP_REPORT_ISP_ERR:
+                printf("ISP error:%d\n",msg->data[0]);
+            break;
+        case CSI_DSP_REPORT_RY_ERR:
+                printf("Post ISP error\n",msg->data[0]);
+            break;
+        case CSI_DSP_REPORT_ALGO_ERR:
+                printf("algo err\n");
+            break;
+        case CSI_DSP_REPORT_VI_PRE_ERR:
+            break;
+        case  CSI_DSP_REPORT_RESULT:
+            break;
+        case CSI_DSP_REPORT_HEARTBEAT_ERR:
+                 printf("heartbeat not detect\n");
+            break;
+        default:
+            break;
+           
+    }
+
+}
 // void vi_callback( void *context,void * data)
 // {}
 int main(int argc, char *argv[])