From d7a196e3f4723a0198b37a805db0ba7a463d8b27 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Tue, 31 Oct 2023 16:24:46 +0800 Subject: [PATCH 1/3] MediaControl: Auto link IVSC media device Signed-off-by: Hao Yao --- src/v4l2/MediaControl.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 55f960d5..26a8ecdb 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -63,6 +63,7 @@ struct MediaEntity { char devname[32]; }; +static const string ivscName = "Intel IVSC CSI"; MediaControl* MediaControl::sInstance = nullptr; Mutex MediaControl::sLock; @@ -868,6 +869,29 @@ int MediaControl::mediaCtlSetup(int cameraId, MediaCtlConf* mc, int width, int h } } + MediaEntity* ivsc = getEntityByName(ivscName.c_str()); + if (ivsc) { + for (uint32_t i = 0; i < ivsc->numLinks; ++i) { + if (ivsc->links[i].sink->entity == ivsc) { + MediaEntity* sensor = ivsc->links[i].source->entity; + int sensor_entity_id = sensor->info.id; + LOG1("@%s, found %s -> %s", __func__, + sensor->info.name, ivscName.c_str()); + for (McLink& link : mc->links) { + if (link.srcEntity == sensor_entity_id) { + LOG1("@%s, skip %s, link %s -> %s", + __func__, link.srcEntityName.c_str(), + ivscName.c_str(), link.sinkEntityName.c_str()); + link.srcEntity = ivsc->info.id; + link.srcEntityName = ivscName; + break; + } + } + break; + } + } + } + /* Set link in format Configuration */ ret = setMediaMcLink(mc->links); CheckAndLogError(ret != OK, ret, "set MediaCtlConf McLink failed: ret = %d", ret); @@ -938,7 +962,8 @@ bool MediaControl::checkAvailableSensor(const std::string& sensorEntityName, int linksCount = entity.info.links; MediaLink* links = entity.links; for (int i = 0; i < linksCount; i++) { - if (strcmp(links[i].sink->entity->info.name, sinkEntityName.c_str()) == 0) { + if (strcmp(links[i].sink->entity->info.name, sinkEntityName.c_str()) == 0 || + strcmp(links[i].sink->entity->info.name, ivscName.c_str()) == 0) { char* entityName = entity.info.name; if (strncmp(entityName, sensorEntityNameTmp.c_str(), nameLen) == 0) { return true; @@ -965,6 +990,9 @@ int MediaControl::getI2CBusAddress(const string& sensorEntityName, const string& for (int i = 0; i < linksCount; i++) { if (strcmp(links[i].sink->entity->info.name, sinkEntityName.c_str()) == 0) { entityName = entity.info.name; + if (strcmp(entityName, ivscName.c_str()) == 0) { + return getI2CBusAddress(sensorEntityName, ivscName, i2cBus); + } break; } } From 32a4400711a5e65acfdd19f088f7ebf613ce8225 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Thu, 21 Mar 2024 14:35:27 +0800 Subject: [PATCH 2/3] Fix build warnings with GCC 13 Signed-off-by: Hao Yao --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2b298ae..4003a459 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,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 @@ -151,7 +152,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) From 5517ff9e2e71412f0aa976e6958848f2222dd358 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Thu, 11 Apr 2024 10:40:44 +0800 Subject: [PATCH 3/3] Remove privacy mode on ipu6epmtl Signed-off-by: Hao Yao --- config/linux/ipu6epmtl/sensors/ov01a1s-uf.xml | 2 +- config/linux/ipu6epmtl/sensors/ov02c10-uf.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/linux/ipu6epmtl/sensors/ov01a1s-uf.xml b/config/linux/ipu6epmtl/sensors/ov01a1s-uf.xml index 38918069..02de85e1 100644 --- a/config/linux/ipu6epmtl/sensors/ov01a1s-uf.xml +++ b/config/linux/ipu6epmtl/sensors/ov01a1s-uf.xml @@ -178,7 +178,7 @@ - + diff --git a/config/linux/ipu6epmtl/sensors/ov02c10-uf.xml b/config/linux/ipu6epmtl/sensors/ov02c10-uf.xml index bd7604f8..72a7703c 100644 --- a/config/linux/ipu6epmtl/sensors/ov02c10-uf.xml +++ b/config/linux/ipu6epmtl/sensors/ov02c10-uf.xml @@ -80,7 +80,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -214,7 +214,7 @@ - +