Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libraries/sensor/hi3516ev200/sony_imx307/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
LIB_NAME := libsns_imx307

override CFLAGS += -DSDK_CODE=$(SDK_CODE) -fPIC -I$(CURDIR)/../../../../include
# -ldl: imx307_is_2lane_mode() uses dladdr() to read its own .so basename
# and flip between 4-lane and 2-lane register sequences. libsns_imx307_2L.so
# is shipped as a symlink to this binary.
override LDLIBS += -ldl

SRCS := $(wildcard *.c)
OBJS := $(SRCS:%.c=%.o) $(ASM_SRCS:%.S=%.o)

all: $(LIB_NAME).so $(LIB_NAME).a

$(LIB_NAME).so: $(OBJS)
$(CC) -shared -o $@ $(OBJS)
$(CC) -shared -o $@ $(OBJS) $(LDLIBS)

$(LIB_NAME).a: $(OBJS)
$(AR) -rcs $(LIB_NAME).a $(OBJS)
Expand Down
16 changes: 15 additions & 1 deletion libraries/sensor/hi3516ev200/sony_imx307/imx307_cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ extern int imx307_read_register(VI_PIPE ViPipe, int addr);
(1) /* make real fps less than stand fps because NVR require */

#define IMX307_VMAX_1080P30_LINEAR (1125 + IMX307_INCREASE_LINES)
#define IMX307_VMAX_1080P60TO30_WDR (1220 + IMX307_INCREASE_LINES) // 10bit
/* 2-lane and 4-lane WDR runs differ in VMAX baseline (datasheet pp.56/62):
* 4-lane → 1220, 2-lane → 1125. Picked at runtime by .so basename. */
extern int imx307_is_2lane_mode(void);
static inline GK_U32 imx307_vmax_1080p60to30_wdr(void)
{
return (imx307_is_2lane_mode() ? 1125 : 1220) + IMX307_INCREASE_LINES;
}
#define IMX307_VMAX_1080P60TO30_WDR (imx307_vmax_1080p60to30_wdr()) // 10bit
#define IMX307_VMAX_720P60_LINEAR (750)

// sensor fps mode
Expand Down Expand Up @@ -1599,6 +1606,13 @@ ISP_SNS_OBJ_S stSnsImx307Obj = {
.pfnSetInit = sensor_set_init
};

/* 2-lane build (libsns_imx307_2L.so) is a symlink to the 4-lane .so;
* streamers that dlsym this name resolve to the same registration object.
* Per-mode register sequences branch internally via imx307_is_2lane_mode(),
* which reads dli_fname through dladdr(). */
extern ISP_SNS_OBJ_S stSnsImx307_2l_Obj
__attribute__((alias("stSnsImx307Obj")));

#ifdef __cplusplus
#if __cplusplus
}
Expand Down
Loading
Loading