liyujie
2025-08-28 d9927380ed7c8366f762049be9f3fee225860833
android/hardware/aw/camera/3_4/allwinnertech/libAWIspApi/libisp_new/isp.c
....@@ -54,6 +54,8 @@
5454
5555 #define MEDIA_DEVICE "/dev/media0"
5656
57
+unsigned int isp_lib_log_param = 0;
58
+
5759 struct hw_isp_media_dev media_params;
5860 struct isp_lib_context isp_ctx[HW_ISP_DEVICE_NUM] = {
5961 [0] = {
....@@ -414,6 +416,13 @@
414416 struct isp_lib_context *isp_gen = isp_dev_get_ctx(isp);
415417 HW_S32 iso_qmenu[] = { 100, 200, 400, 800, 1600, 3200, 6400};
416418 HW_S32 exp_bias_qmenu[] = { -4, -3, -2, -1, 0, 1, 2, 3, 4, };
419
+
420
+#if (ISP_VERSION == 522)
421
+ if (isp->id && isp_gen->sensor_info.sensor_width > 4000 &&
422
+ isp_gen->sensor_info.sensor_height > 3000) {
423
+ isp_gen = &isp_ctx[0];
424
+ }
425
+#endif
417426
418427 if (isp_gen == NULL)
419428 return;
....@@ -1120,8 +1129,7 @@
11201129 *i3a_length =
11211130 sizeof(ae_result_t) + sizeof(ae_param_t)+ sizeof(struct isp_ae_stats_s) // ae info
11221131 + sizeof(awb_result_t)+ sizeof(awb_param_t)+ sizeof(struct isp_awb_stats_s) // awb info
1123
- + sizeof(af_result_t)+ sizeof(af_param_t)+ sizeof(struct isp_af_stats_s) // af info
1124
- ;
1132
+ + sizeof(af_result_t)+ sizeof(af_param_t)+ sizeof(struct isp_af_stats_s); // af info
11251133
11261134 *debug_length =
11271135 sizeof(iso_result_t)
....@@ -1131,11 +1139,12 @@
11311139 +16*16*3*sizeof(unsigned short) // msc tbl
11321140 +4*2*sizeof(unsigned short); // wb otp data
11331141
1142
+ data_len = *i3a_length + *debug_length;
11341143 ISP_PRINT("i3a_length:%d, debug_length:%d.\n", *i3a_length, *debug_length);
11351144 ISP_PRINT("af_result_t:%d, af_param_t:%d, isp_af_stats_s:%d.\n", sizeof(ae_result_t), sizeof(ae_param_t), sizeof(struct isp_ae_stats_s));
11361145 ISP_PRINT("af_result_t:%d, af_param_t:%d, isp_af_stats_s:%d.\n", sizeof(awb_result_t), sizeof(awb_param_t), sizeof(struct isp_awb_stats_s));
11371146 ISP_PRINT("af_result_t:%d, af_param_t:%d, isp_af_stats_s:%d.\n", sizeof(af_result_t), sizeof(af_param_t), sizeof(struct isp_af_stats_s));
1138
- return 0;
1147
+ return data_len;
11391148 }
11401149
11411150
....@@ -1157,6 +1166,7 @@
11571166 return -1;
11581167
11591168 void * ptr = params;
1169
+ int isp_3a_size = 0;
11601170 // ae info
11611171 memcpy(ptr, &(isp_gen->ae_entity_ctx.ae_result), sizeof(ae_result_t));
11621172 ptr += sizeof(ae_result_t);
....@@ -1187,8 +1197,14 @@
11871197 memcpy(ptr, isp_gen->af_entity_ctx.af_stats.af_stats, sizeof(struct isp_af_stats_s));
11881198 ptr += sizeof(struct isp_af_stats_s);
11891199
1200
+ isp_3a_size = sizeof(ae_result_t) + sizeof(ae_param_t) +
1201
+ sizeof(struct isp_ae_stats_s) + sizeof(awb_result_t) +
1202
+ sizeof(awb_param_t) + sizeof(struct isp_awb_stats_s) +
1203
+ sizeof(af_result_t) + sizeof(af_param_t) +
1204
+ sizeof(struct isp_af_stats_s);
1205
+
11901206 ptr = NULL;
1191
- return 0;
1207
+ return isp_3a_size;
11921208 }
11931209
11941210 HW_S32 isp_get_debug_msg(int dev_id, void* msg)
....@@ -1207,6 +1223,7 @@
12071223 return -1;
12081224
12091225 void * ptr = msg;
1226
+ int isp_debug_msg_size = 0;
12101227 memcpy(ptr, &(isp_gen->iso_entity_ctx.iso_result), sizeof(iso_result_t));
12111228 ptr += sizeof(iso_result_t);
12121229
....@@ -1227,8 +1244,15 @@
12271244 memcpy(ptr, isp_gen->pwb_table, 4*2*sizeof(unsigned short));
12281245 ptr += 4*2*sizeof(unsigned short);
12291246
1247
+ isp_debug_msg_size = sizeof(iso_result_t) +
1248
+ sizeof(iso_param_t) +
1249
+ sizeof(struct isp_module_config) +
1250
+ sizeof(int) +
1251
+ 16*16*3*sizeof(unsigned short) +
1252
+ 4*2*sizeof(unsigned short);
1253
+
12301254 ptr = NULL;
1231
- return 0;
1255
+ return isp_debug_msg_size;
12321256 }
12331257
12341258 /*******************get isp version*********************/