Skip to content

Commit

Permalink
Release on 2024-04-09
Browse files Browse the repository at this point in the history
Signed-off-by: Hao Yao <hao.yao@intel.com>
  • Loading branch information
hao-yao committed Apr 11, 2024
1 parent 29b7800 commit 28c6d21
Show file tree
Hide file tree
Showing 199 changed files with 44,208 additions and 6,334 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
apt-get update -q
export TZ=Asia/Shanghai
echo "" | apt-get install -qy tzdata
echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev --yes
echo "" | apt-get install git build-essential cmake libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev libdrm-dev --yes
git clone https://github.com/intel/ipu6-camera-bins -b main --depth 1
cp -rv ipu6-camera-bins/include/"${PLATFORM}" /usr/include/
cp -rv ipu6-camera-bins/lib/"${PLATFORM}" /usr/lib/
Expand Down
44 changes: 32 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2017-2023 Intel Corporation
# Copyright (C) 2017-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -67,6 +67,12 @@ endif()

message(STATUS "install prefix: " ${CMAKE_INSTALL_PREFIX})

if (UPSTREAM_CODE)
add_compile_definitions(IPU6_UPSTREAM=1)
else()
add_compile_definitions(IPU6_UPSTREAM=0)
endif()

#------------------------- Compilation settings -------------------------

include(GNUInstallDirs)
Expand All @@ -84,6 +90,7 @@ set (CMAKE_CXX_STANDARD 11)
add_compile_options(-Wall -Werror
-fstack-protector
-fPIE -fPIC
-U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=2
-DDCHECK_ALWAYS_ON
-Wformat -Wformat-security
Expand Down Expand Up @@ -151,7 +158,7 @@ include_directories(include
src/image_process
)

set(LIBCAMHAL_LD_FLAGS "-fPIE -fPIC -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wl,-z,relro -Wl,-z,now")
set(LIBCAMHAL_LD_FLAGS "-fPIE -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wl,-z,relro -Wl,-z,now")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LIBCAMHAL_LD_FLAGS}")

add_subdirectory(src)
Expand Down Expand Up @@ -183,7 +190,7 @@ if (CAL_BUILD)
include_directories(include include/api include/utils include/linux
${USR_INCLUDE_HEADER}/android/system/core/include/
${USR_INCLUDE_HEADER}/ia_imaging
${USR_INCLUDE_HEADER}/lib${IPU_VER}
${USR_INCLUDE_HEADER}/usr/lib${IPU_VER}
${USR_INCLUDE_HEADER}/android/hardware/libhardware/include/
aal aal/chrome src/iutils src/jpeg
modules/memory modules/memory/chrome
Expand Down Expand Up @@ -251,6 +258,8 @@ if (${CMAKE_VERSION} VERSION_LESS 3.11)
else()
add_library(camhal SHARED $<TARGET_OBJECTS:camhal_static>)
endif()
set_target_properties(camhal PROPERTIES SOVERSION 0)
set_target_properties(camhal PROPERTIES VERSION "0.0.0")

add_library(camhal_static STATIC ${LIBCAMHAL_SRCS})

Expand Down Expand Up @@ -300,6 +309,13 @@ else()
target_link_libraries(camhal_static ${LIBIACSS_LIBS})
endif()

# DUMP_DMA_BUF_FOR_DRM_PRIME_S
find_package(LIBDRM)
include_directories(${LIBDRM_INCLUDE_DIRS})
target_link_libraries(camhal ${LIBDRM_LIBS})
target_link_libraries(camhal_static ${LIBDRM_LIBS})
# DUMP_DMA_BUF_FOR_DRM_PRIME_E

# Include libipu(4) headers
find_package(LIBIPU)
include_directories(${LIBIPU_INCLUDE_DIRS})
Expand Down Expand Up @@ -383,36 +399,40 @@ endif() #ENABLE_SANDBOXING
if (NOT CAL_BUILD)
# Install headers
if ("${CMAKE_INSTALL_SUB_PATH}" STREQUAL "")
install(DIRECTORY include/ DESTINATION include/libcamhal)
install(DIRECTORY include/ DESTINATION usr/include/libcamhal)
if (SUPPORT_LIVE_TUNING)
install(FILES modules/livetune/LiveTuning.h DESTINATION include/libcamhal/api)
install(FILES modules/livetune/LiveTuning.h DESTINATION usr/include/libcamhal/api)
endif() #SUPPORT_LIVE_TUNING
endif()

# Install configure files, by default ipu4 is used
if(("${IPU_VER}" STREQUAL "") OR ("${IPU_VER}" STREQUAL "ipu4"))
message("Install camera configure files for ipu4")
install(DIRECTORY config/linux/ipu4/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH})
install(DIRECTORY config/linux/ipu4/ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/camera/${CMAKE_INSTALL_SUB_PATH})
else()
message("Install camera configure files for" ${IPU_VER})
install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION share/defaults/etc/camera/${CMAKE_INSTALL_SUB_PATH})
message("Install camera configure files for " ${IPU_VER})
if (UPSTREAM_CODE)
install(DIRECTORY config/linux/${IPU_VER}_upstream/ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/camera/${CMAKE_INSTALL_SUB_PATH})
else()
install(DIRECTORY config/linux/${IPU_VER}/ DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/camera/${CMAKE_INSTALL_SUB_PATH})
endif()
endif()

# Install libraries
if (${CMAKE_VERSION} VERSION_LESS 3.11)
install(TARGETS camhal camhal_static
LIBRARY DESTINATION lib/${CMAKE_INSTALL_SUB_PATH}
ARCHIVE DESTINATION lib/${CMAKE_INSTALL_SUB_PATH}
LIBRARY DESTINATION usr/lib/${CMAKE_INSTALL_SUB_PATH}
ARCHIVE DESTINATION usr/lib/${CMAKE_INSTALL_SUB_PATH}
)
else()
install(TARGETS camhal camhal_static DESTINATION lib/${CMAKE_INSTALL_SUB_PATH})
install(TARGETS camhal camhal_static DESTINATION usr/lib/${CMAKE_INSTALL_SUB_PATH})
endif()

# Install package config file
configure_file(${PROJECT_SOURCE_DIR}/cmake/libcamhal.pc.cmakein
${PROJECT_SOURCE_DIR}/libcamhal.pc @ONLY)
install(FILES libcamhal.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${CMAKE_INSTALL_SUB_PATH}/pkgconfig)
DESTINATION usr/${CMAKE_INSTALL_LIBDIR}/${CMAKE_INSTALL_SUB_PATH}/pkgconfig)

endif() #NOT CAL_BUILD

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There are 4 repositories that provide the complete setup:
- 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
- Dependencies: libexpat-dev automake libtool libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libdrm-dev

- Build and install:
Recommend to build together with icamerasrc and using `build.sh` in this repo.
Expand All @@ -33,9 +33,10 @@ There are 4 repositories that provide the complete setup:

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
sudo cp -r ./out/install/etc/* /etc/
sudo cp -r ./out/install/include/* /usr/include/
sudo cp -r ./out/install/lib/* /usr/lib/
sudo cp -r ./out/install/usr/* /usr/
```

For more building details please reference the `build.sh`.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function build_target() {

make install
check_result $? "$FUNCNAME: $target"
standardize_pkg_config_path ${INSTALL_DIR}/install/lib/${target}/pkgconfig/libcamhal.pc
standardize_pkg_config_path ${INSTALL_DIR}/install/usr/lib/${target}/pkgconfig/libcamhal.pc
cd ..
}

Expand Down
39 changes: 39 additions & 0 deletions cmake/FindLIBDRM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#
# Copyright (C) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Get include and lib paths for LIBDRM from pkgconfig
include(FindPackageHandleStandardArgs)

find_package(PkgConfig)
pkg_check_modules(LIBDRM libdrm)
if(NOT LIBDRM_FOUND)
message(SEND_ERROR "LIBDRM not found")
endif()

set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${LIBDRM_LIBRARY_DIRS})

# Libraries
find_library(DRM_LIB drm)
set(LIBDRM_LIBS ${DRM_LIB})

# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
find_package_handle_standard_args(LIBDRM REQUIRED_VARS LIBDRM_INCLUDE_DIRS LIBDRM_LIBS)

if(NOT LIBDRM_FOUND)
message(SEND_ERROR "LIBDRM not found")
endif()

Binary file modified config/linux/ipu6/AR0234_TGL_10bits.aiqb
Binary file not shown.
Binary file modified config/linux/ipu6ep/AR0234_TGL_10bits.aiqb
Binary file not shown.
Binary file modified config/linux/ipu6epmtl/AR0234_TGL_10bits.aiqb
Binary file not shown.
Binary file modified config/linux/ipu6epmtl/OV02E10_ASG202N3_MTL.aiqb
Binary file not shown.
Loading

0 comments on commit 28c6d21

Please sign in to comment.