Skip to content

Commit c063f80

Browse files
committed
Replace shims with functions calling pointers to dlsym-loaded funcs from hisi libs
VI pipe still receives nothing, venc main loop times out
1 parent ce456c5 commit c063f80

File tree

7 files changed

+48
-9
lines changed

7 files changed

+48
-9
lines changed

src/compat.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ void _MI_PRINT_GetDebugLevel(void) {}
1212
void __stdin(void) {}
1313
void _stdlib_mb_cur_max(void) {}
1414

15-
void ISP_AlgRegisterDehaze(void) {}
16-
void ISP_AlgRegisterDrc(void) {}
17-
void ISP_AlgRegisterLdci(void) {}
18-
void MPI_ISP_IrAutoRunOnce(void) {}
19-
2015
float __expf_finite(float x) { return expf(x); }
2116
int __fgetc_unlocked(FILE *stream) { return fgetc(stream); }
2217
double __log_finite(double x) { return log(x); }

src/hal/hisi/v4_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static enum ConfigError v4_parse_sensor_config(char *path, v4_config_impl *confi
462462
if (!config->videv.bayerSize.height)
463463
config->videv.bayerSize.height = config->isp.capt.height;
464464

465-
config->videv.wdrCacheLine = v4_config.isp.capt.width;
465+
config->videv.wdrCacheLine = v4_config.isp.capt.height;
466466

467467
if (!config->isp.wdr)
468468
config->isp.wdr = config->mode;

src/hal/hisi/v4_hal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ int v4_region_setbitmap(int handle, hal_bitmap *bitmap)
395395
int v4_sensor_config(void) {
396396
int fd;
397397
v4_snr_dev config;
398-
memset(&config, 0, sizeof(config));
398+
//memset(&config, 0, sizeof(config));
399399
config.device = 0;
400400
config.input = v4_config.input_mode;
401401
config.rect.width = v4_config.isp.capt.width;

src/hal/hisi/v4_isp.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
#include "v4_common.h"
44

5+
extern int (*fnISP_AlgRegisterDehaze)(int);
6+
extern int (*fnISP_AlgRegisterDrc)(int);
7+
extern int (*fnISP_AlgRegisterLdci)(int);
8+
extern int (*fnMPI_ISP_IrAutoRunOnce)(int, void*);
9+
510
typedef enum {
611
V4_ISP_DIR_NORMAL,
712
V4_ISP_DIR_MIRROR,
@@ -63,6 +68,30 @@ static int v4_isp_load(v4_isp_impl *isp_lib) {
6368
return EXIT_FAILURE;
6469
}
6570

71+
if (!(fnISP_AlgRegisterDehaze = (int(*)(int))
72+
dlsym(isp_lib->handleDehaze, "ISP_AlgRegisterDehaze"))) {
73+
fprintf(stderr, "[v4_isp] Failed to acquire symbol ISP_AlgRegisterDehaze!\n");
74+
return EXIT_FAILURE;
75+
}
76+
77+
if (!(fnISP_AlgRegisterDrc = (int(*)(int))
78+
dlsym(isp_lib->handleDrc, "ISP_AlgRegisterDrc"))) {
79+
fprintf(stderr, "[v4_isp] Failed to acquire symbol ISP_AlgRegisterDrc!\n");
80+
return EXIT_FAILURE;
81+
}
82+
83+
if (!(fnISP_AlgRegisterLdci = (int(*)(int))
84+
dlsym(isp_lib->handleLdci, "ISP_AlgRegisterLdci"))) {
85+
fprintf(stderr, "[v4_isp] Failed to acquire symbol ISP_AlgRegisterLdci!\n");
86+
return EXIT_FAILURE;
87+
}
88+
89+
if (!(fnMPI_ISP_IrAutoRunOnce = (int(*)(int, void*))
90+
dlsym(isp_lib->handleIrAuto, "MPI_ISP_IrAutoRunOnce"))) {
91+
fprintf(stderr, "[v4_isp] Failed to acquire symbol MPI_ISP_IrAutoRunOnce!\n");
92+
return EXIT_FAILURE;
93+
}
94+
6695
if (!(isp_lib->fnExit = (int(*)(int pipe))
6796
dlsym(isp_lib->handle, "HI_MPI_ISP_Exit"))) {
6897
fprintf(stderr, "[v4_isp] Failed to acquire symbol HI_MPI_ISP_Exit!\n");

src/hal/hisi/v4_quirks.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
int (*fnISP_AlgRegisterDehaze)(int);
2+
int (*fnISP_AlgRegisterDrc)(int);
3+
int (*fnISP_AlgRegisterLdci)(int);
4+
int (*fnMPI_ISP_IrAutoRunOnce)(int, void*);
5+
6+
int ISP_AlgRegisterDehaze(int pipeId) {
7+
return fnISP_AlgRegisterDehaze(pipeId);
8+
}
9+
int ISP_AlgRegisterDrc(int pipeId) {
10+
return fnISP_AlgRegisterDrc(pipeId);
11+
}
12+
int ISP_AlgRegisterLdci(int pipeId) {
13+
return fnISP_AlgRegisterLdci(pipeId);
14+
}
15+
int MPI_ISP_IrAutoRunOnce(int pipeId, void *irAttr) {
16+
return fnMPI_ISP_IrAutoRunOnce(pipeId, irAttr);
17+
}

src/hal/hisi/v4_snr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ typedef struct {
150150
int (*pfnRegisterCallback)(int pipe, v4_isp_alg *aeLibrary, v4_isp_alg *awbLibrary);
151151
int (*pfnUnRegisterCallback)(int pipe, v4_isp_alg *aeLibrary, v4_isp_alg *awbLibrary);
152152
int (*pfnSetBusInfo)(int pipe, v4_snr_bus unSNSBusInfo);
153-
int (*pfnSetBusExInfo)(int pipe, char *address);
154153
void (*pfnStandby)(int pipe);
155154
void (*pfnRestart)(int pipe);
156155
void (*pfnMirrorFlip)(int pipe, v4_isp_dir mode);

src/video.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ int start_sdk() {
233233
}
234234
pthread_attr_destroy(&thread_attr);
235235
}
236-
usleep(1000);
237236

238237
if (app_config.mp4_enable) {
239238
int index = take_next_free_channel(true);

0 commit comments

Comments
 (0)