Merge remote-tracking branch 'origin/jh7110-devel' into jh7110-mm-devel
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script is used by ispsdk to enable the daemon script of stf_isp_ctrl.
|
||||
#
|
||||
|
||||
DAEMON="isp_ctrl_daemon.sh"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
# Support sensors (imx219mipi\ov4689mipi\sc2235dvp)
|
||||
DAEMON_SENSOR_ARGS="imx219mipi"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- start $DAEMON_SENSOR_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/$DAEMON stop
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
ISP_CTRL_NAME=/root/ISP/stf_isp_ctrl
|
||||
|
||||
# Default sensor
|
||||
SENSOR_CFG="imx219mipi -a 1"
|
||||
|
||||
USAGE="Usage:
|
||||
isp_ctrl_daemon.sh [start/stop] [imx219mipi/ov4689mipi/sc2235dvp] &"
|
||||
|
||||
if [ "$1" = "start" ];then
|
||||
echo "Start ${ISP_CTRL_NAME}"
|
||||
elif [ "$1" = "stop" ];then
|
||||
# Only kill the stf_isp_ctrl here, should be called by start-stop-daemon to kill this script.
|
||||
killall -9 stf_isp_ctrl
|
||||
exit 0
|
||||
else
|
||||
echo "$USAGE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$2" in
|
||||
imx219mipi)
|
||||
SENSOR_CFG="imx219mipi -a 1"
|
||||
echo "Select sensor imx219"
|
||||
;;
|
||||
ov4689mipi)
|
||||
SENSOR_CFG="ov4689mipi -a 1"
|
||||
echo "Select sensor ov4689"
|
||||
;;
|
||||
sc2235dvp)
|
||||
SENSOR_CFG="sc2235dvp -a 0"
|
||||
echo "Select sensor sc2235"
|
||||
;;
|
||||
*)
|
||||
echo "$USAGE"
|
||||
exit 0
|
||||
esac
|
||||
|
||||
while true ; do
|
||||
|
||||
# Get the running stf_isp_ctrl number
|
||||
NUM=`ps aux | grep ${ISP_CTRL_NAME} | grep -v grep |wc -l`
|
||||
|
||||
# If there are less than 1 stf_isp_ctrl, start one.
|
||||
if [ "${NUM}" -lt "1" ];then
|
||||
${ISP_CTRL_NAME} -m ${SENSOR_CFG} -j 0 &
|
||||
|
||||
# If there are more than 1 stf_isp_ctrl, kill all of them and restart one.
|
||||
elif [ "${NUM}" -gt "1" ];then
|
||||
echo "more than 1 ${ISP_CTRL_NAME},killall & restart ${ISP_CTRL_NAME}"
|
||||
killall -9 $ISP_CTRL_NAME
|
||||
${ISP_CTRL_NAME} -m ${SENSOR_CFG} -j 0 &
|
||||
fi
|
||||
|
||||
# Kill the zombie stf_isp_ctrl
|
||||
NUM_STAT=`ps aux | grep ${ISP_CTRL_NAME} | grep T | grep -v grep | wc -l`
|
||||
if [ "${NUM_STAT}" -gt "0" ];then
|
||||
killall -9 ${ISP_CTRL_NAME}
|
||||
${ISP_CTRL_NAME} -m ${SENSOR_CFG} -j 0 &
|
||||
fi
|
||||
|
||||
sleep 5;
|
||||
|
||||
done
|
||||
|
||||
# Never reach
|
||||
exit 0
|
||||
|
||||
@@ -11,6 +11,13 @@ ISPSDK_SITE_METHOD = local
|
||||
ISPSDK_SUPPORTS_IN_SOURCE_BUILD = NO
|
||||
ISPSDK_DEPENDENCIES = jpeg libv4l libdrm
|
||||
|
||||
define ISPSDK_INSTALL_TARGET_CMDS
|
||||
install -m 0755 -D package/starfive/ispsdk/isp_ctrl_daemon.sh \
|
||||
$(TARGET_DIR)/usr/bin/isp_ctrl_daemon.sh
|
||||
install -m 0755 -D package/starfive/ispsdk/S70isp-ctrl \
|
||||
$(TARGET_DIR)/etc/init.d/S70isp-ctrl
|
||||
endef
|
||||
|
||||
# default CMAKE_INSTALL_PREFIX is $(TARGET_DIR)/usr, change to below
|
||||
# note: not have -DCROSS_COMPILE
|
||||
ISPSDK_CONF_OPTS = -DRUN_PLATFORM="RISCV" \
|
||||
|
||||
Reference in New Issue
Block a user