-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hao Yao <hao.yao@intel.com>
- Loading branch information
Showing
223 changed files
with
139,762 additions
and
25,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
|
||
jobs: | ||
build-ipu6-on-ubuntu-2204: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build on Ubuntu 22.04 | ||
run: | | ||
sudo su | ||
echo "APT::Get::Always-Include-Phased-Updates True;" | tee -a /etc/apt/apt.conf | ||
apt-get update -q | ||
apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes | ||
git clone https://github.com/hao-yao/ipu6-camera-bins -b main --depth 1 | ||
cp -rv ipu6-camera-bins/include/* /usr/include/ | ||
cp -rv ipu6-camera-bins/lib/* /usr/lib/ | ||
rm -fr ipu6-camera-bins | ||
cd .. | ||
git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api --depth 1 | ||
cp ./ipu6-camera-hal/build.sh . | ||
./build.sh | ||
cp -rv ./out/install/include/* /usr/include | ||
cp -rv ./out/install/lib/* /usr/lib | ||
cp -rv ./out/install/share/* /usr/share | ||
build-ipu6-on-ubuntu-2004: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build on Ubuntu 20.04 | ||
run: | | ||
sudo su | ||
apt-get update -q | ||
apt-get install git cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev --yes | ||
git clone https://github.com/hao-yao/ipu6-camera-bins -b main --depth 1 | ||
cp -rv ipu6-camera-bins/include/* /usr/include/ | ||
cp -rv ipu6-camera-bins/lib/* /usr/lib/ | ||
rm -fr ipu6-camera-bins | ||
cd .. | ||
git clone https://github.com/intel/icamerasrc.git -b icamerasrc_slim_api --depth 1 | ||
cp ./ipu6-camera-hal/build.sh . | ||
./build.sh | ||
cp -rv ./out/install/include/* /usr/include | ||
cp -rv ./out/install/lib/* /usr/lib | ||
cp -rv ./out/install/share/* /usr/share |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,41 @@ | ||
# ipu6-camera-hal | ||
|
||
This repository supports MIPI cameras through the IPU6 on Intel Alder Lake, Raptor Lake and Meteor Lake platforms. There are 4 repositories that provide the complete setup: | ||
|
||
- https://github.com/intel/ipu6-drivers (branch:ccg_plat_adlp) - kernel drivers for the IPU and sensors | ||
- https://github.com/intel/ipu6-camera-hal (branch:ccg_plat_adlp) - HAL for processing of images in userspace | ||
- https://github.com/intel/ipu6-camera-bins (branch:ccg_plat_adlp) - IPU firmware and proprietary image processing libraries | ||
- https://github.com/intel/icamerasrc (branch:icamerasrc_slim_api) - Gstreamer src plugin | ||
This repository supports MIPI cameras through the IPU6 on Intel Tiger Lake, Alder Lake, Raptor Lake and Meteor Lake platforms. | ||
There are 4 repositories that provide the complete setup: | ||
|
||
- https://github.com/intel/ipu6-drivers - kernel drivers for the IPU and sensors | ||
- https://github.com/intel/ipu6-camera-bins - IPU firmware and proprietary image processing libraries | ||
- https://github.com/intel/ipu6-camera-hal - HAL for processing of images in userspace | ||
- https://github.com/intel/icamerasrc/tree/icamerasrc_slim_api (branch:icamerasrc_slim_api) - Gstreamer src plugin | ||
|
||
## Content of this repository: | ||
- IPU6 HAL | ||
|
||
## Build instructions: | ||
- Dependencies: ipu6-camera-bins | ||
Please follow https://github.com/intel/ipu6-camera-bins README to install. | ||
|
||
- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||
|
||
- Build and install: | ||
Recommend to build together with icamerasrc and using `build.sh` in this repo. | ||
1. Put ipu6-camera-hal, icameasrc and build.sh parallel as below: | ||
``` | ||
cp build.sh .. && cd .. | ||
# work | ||
# ├── build.sh | ||
# ├── icamerasrc | ||
# ├── ipu6-camera-hal | ||
# └── out | ||
``` | ||
|
||
2. In `work` folder, run `./build.sh`. Output binaries will be in `out/install`. (RPM build is not implemented yet) | ||
|
||
1. Set IPU6 version and product name for build | ||
|
||
- For Alder Lake and Raptor Lake, set: | ||
```shell | ||
IPU6_VER=ipu6ep | ||
PRODUCTION_NAME=ccg_platform | ||
``` | ||
|
||
- For Meteor Lake, set: | ||
```shell | ||
IPU6_VER=ipu6epmtl | ||
PRODUCTION_NAME=mtl-ubuntu | ||
``` | ||
|
||
2. Then continue: | ||
```shell | ||
cd ipu6-camera-hal | ||
mkdir -p ./build/out/install/usr && cd ./build/ | ||
cmake -DCMAKE_BUILD_TYPE=Release \ | ||
-DIPU_VER=${IPU6_VER} \ | ||
-DPRODUCTION_NAME=${PRODUCTION_NAME} \ | ||
-DUSE_PG_LITE_PIPE=ON \ | ||
-DUSE_STATIC_GRAPH=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=/usr .. | ||
# if don't want install to /usr, use: | ||
# -DCMAKE_INSTALL_PREFIX=./out/install/usr and | ||
# export PKG_CONFIG_PATH="$workdir/build/out/install/usr/lib/pkgconfig" | ||
make -j`nproc` | ||
sudo make install | ||
3. Install contents in `out/install` to your `/usr`: | ||
```sh | ||
sudo cp -r ./out/install/include/* /usr/include | ||
sudo cp -r ./out/install/lib/* /usr/lib | ||
sudo cp -r ./out/install/share/* /usr/share | ||
``` | ||
|
||
For more building details please reference the `build.sh`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
#!/bin/bash | ||
|
||
function check_result() { | ||
local res=$1 | ||
local func=$2 | ||
|
||
if [ $res -eq 0 ] ; then | ||
echo "###############" " $func OK " "#############" | ||
else | ||
echo "###############" " $func FAIL " "#############" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function parse_argument() { | ||
export SOURCE_DIR=${PWD} | ||
export INSTALL_DIR=${PWD}/out | ||
export BOARD_LIST="ipu_tgl ipu_adl ipu_mtl" | ||
export BUILD_RPM=ON | ||
|
||
while true; do | ||
case $1 in | ||
-s|--source) | ||
export SOURCE_DIR=$2 | ||
echo "$2" | ||
shift | ||
;; | ||
-i|--install) | ||
export INSTALL_DIR=$2 | ||
echo "$2" | ||
shift | ||
;; | ||
--no-rpm) | ||
export BUILD_RPM=OFF | ||
;; | ||
--board) | ||
shift | ||
export BOARD_LIST=$@ | ||
echo "$$" | ||
break | ||
;; | ||
-?*) | ||
echo "WARNING: not supported option: $1" | ||
;; | ||
*) | ||
break | ||
esac | ||
|
||
shift | ||
done | ||
|
||
echo "=========================== Build Config ============================" | ||
echo "SOURCE_DIR: $SOURCE_DIR" | ||
echo "INSTALL_DIR: $INSTALL_DIR" | ||
echo "BUILD_RPM: $BUILD_RPM" | ||
echo "BOARD_LIST: $BOARD_LIST" | ||
echo "=====================================================================" | ||
} | ||
|
||
function print_helper() { | ||
echo | ||
echo "========================= Command Helper ============================" | ||
echo "./build_release.sh -s source_dir -i install_dir --board target1 targert2 ..." | ||
echo "=====================================================================" | ||
echo | ||
} | ||
|
||
standardize_pkg_config_path(){ | ||
if [[ ! -f $1 ]]; then echo "file $1 not exsist."; exit 0; fi | ||
sed -i '1c prefix=\/usr' $* | ||
} | ||
|
||
function build_target() { | ||
rm -fr build && mkdir -p build && cd build | ||
|
||
local target=$1 | ||
export IPU_VERSION= | ||
if [ "$target" = "ipu_tgl" ]; then | ||
IPU_VERSION=ipu6 | ||
elif [ "$target" = "ipu_adl" ]; then | ||
IPU_VERSION=ipu6ep | ||
elif [ "$target" = "ipu_mtl" ]; then | ||
IPU_VERSION=ipu6epmtl | ||
else | ||
echo "Error: unsupport the target name : $target" | ||
exit -1 | ||
fi | ||
|
||
# indicate the install folder of binary package | ||
# export PKG_CONFIG_PATH=~/work/linux/camera_submit/camera/out/install/lib/$target/pkgconfig:$PKG_CONFIG_PATH | ||
export PKG_CONFIG_PATH=/usr/lib/$target/pkgconfig:$PKG_CONFIG_PATH | ||
|
||
command cmake -DCMAKE_BUILD_TYPE=Release \ | ||
-DIPU_VER=$IPU_VERSION \ | ||
-DBUILD_CAMHAL_TESTS=OFF \ | ||
-DUSE_PG_LITE_PIPE=ON \ | ||
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/install \ | ||
-DCMAKE_INSTALL_SUB_PATH=$target .. | ||
|
||
# make and install | ||
make -j | ||
check_result $? "$FUNCNAME: $target" | ||
|
||
make install | ||
check_result $? "$FUNCNAME: $target" | ||
standardize_pkg_config_path ${INSTALL_DIR}/install/lib/${target}/pkgconfig/libcamhal.pc | ||
cd .. | ||
} | ||
|
||
function build_hal() { | ||
cd $SOURCE_DIR/ipu6-camera-hal | ||
|
||
for target in $BOARD_LIST | ||
do | ||
build_target $target | ||
done | ||
} | ||
|
||
function build_hal_adaptor() { | ||
cd $SOURCE_DIR/ipu6-camera-hal/src/hal/hal_adaptor | ||
rm -fr build && mkdir -p build && cd build | ||
|
||
command cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/install ../ | ||
|
||
# make and install | ||
make -j | ||
check_result $? $FUNCNAME | ||
|
||
make install | ||
check_result $? $FUNCNAME | ||
standardize_pkg_config_path ${INSTALL_DIR}/install/lib/pkgconfig/hal_adaptor.pc | ||
} | ||
|
||
function build_icamerasrc() { | ||
cd $SOURCE_DIR/icamerasrc/ | ||
|
||
export CAMHAL_LIBS="-L$INSTALL_DIR/install/lib -lhal_adaptor" | ||
export CAMHAL_CFLAGS="-I$INSTALL_DIR/install/include/hal_adaptor \ | ||
-I$INSTALL_DIR/install/include/hal_adaptor/api \ | ||
-I$INSTALL_DIR/install/include/hal_adaptor/utils \ | ||
-I$INSTALL_DIR/install/include/hal_adaptor/linux" | ||
export CHROME_SLIM_CAMHAL=ON | ||
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" | ||
|
||
rm -fr config.h.in autom4te.cache/ aclocal.m4 *-libtool config.guess compile \ | ||
config.sub configure depcomp install-sh ltmain.sh m4 | ||
autoreconf --install | ||
CFLAGS="-O2" CXXFLAGS="-O2" ./configure --with-haladaptor=yes ${CONFIGURE_FLAGS} \ | ||
--prefix=$INSTALL_DIR/install DEFAULT_CAMERA=0 | ||
check_result $? $FUNCNAME | ||
|
||
make clean | ||
make -j | ||
check_result $? $FUNCNAME | ||
|
||
make install | ||
check_result $? $FUNCNAME | ||
find $INSTALL_DIR/install/ -name "*.la" -exec rm -f "{}" \; | ||
standardize_pkg_config_path ${INSTALL_DIR}/install/lib/pkgconfig/libgsticamerasrc.pc | ||
} | ||
|
||
function main () { | ||
parse_argument $@ | ||
if [ -z "$SOURCE_DIR" ] || [ -z "$INSTALL_DIR" ] || [ -z "$BOARD_LIST" ]; then | ||
print_helper | ||
exit 1 | ||
fi | ||
rm -fr $INSTALL_DIR/install $INSTALL_DIR/rpm && mkdir -p $INSTALL_DIR/install $INSTALL_DIR/rpm | ||
build_hal | ||
build_hal_adaptor | ||
build_icamerasrc | ||
|
||
# TODO: Generate the RPM for hal, hal_adaptor and icamerasrc together | ||
} | ||
|
||
main $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.