From 4c293619c43b491e266725d4c3e4d4a1f2f67b53 Mon Sep 17 00:00:00 2001 From: Arun T Date: Thu, 2 Jul 2026 06:19:35 +0530 Subject: [PATCH] Enable ov08x40 CVS media path for IPU8 Add ov08x40-uf-0 to the available sensor list and update the ov08x40-uf IPU8 sensor topology to include the Intel CVS entity between the ov08x40 sensor and the Intel IPU7 CSI2 receiver. Update MediaControl I2C bus resolution to walk upstream through intermediate bridge entities, so the $I2CBUS placeholder resolves to the ov08x40 sensor entity suffix instead of the Intel CVS entity suffix. The media format remains SGRBG10 3856x2176, but the link graph now matches the actual hardware path: ov08x40 -> Intel CVS -> Intel IPU7 CSI2 -> Intel IPU7 ISYS Capture This allows Camera HAL/GStreamer to configure the correct media pipeline for ov08x40-uf on the CVS board. Signed-off-by: Arun T --- config/linux/ipu8/libcamhal_configs.json | 1 + config/linux/ipu8/sensors/ov08x40-uf.json | 14 +++++++- src/v4l2/MediaControl.cpp | 43 +++++++++++++++-------- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/config/linux/ipu8/libcamhal_configs.json b/config/linux/ipu8/libcamhal_configs.json index 76b5864..8138483 100644 --- a/config/linux/ipu8/libcamhal_configs.json +++ b/config/linux/ipu8/libcamhal_configs.json @@ -23,6 +23,7 @@ "availableSensors": [ "ov13b10-wf-0", "ov13b10-uf-2", + "ov08x40-uf-0", "lt6911gxd-1-0", "lt6911gxd-2-2", "isx031-1-0", diff --git a/config/linux/ipu8/sensors/ov08x40-uf.json b/config/linux/ipu8/sensors/ov08x40-uf.json index c3696df..c7db459 100644 --- a/config/linux/ipu8/sensors/ov08x40-uf.json +++ b/config/linux/ipu8/sensors/ov08x40-uf.json @@ -31,6 +31,14 @@ "name": "ov08x40 $I2CBUS", "pad": 0, "width": 3856, "height": 2176, "format": "V4L2_MBUS_FMT_SGRBG10_1X10" }, + { + "name": "Intel CVS", "pad": 0, "width": 3856, "height": 2176, + "format": "V4L2_MBUS_FMT_SGRBG10_1X10" + }, + { + "name": "Intel CVS", "pad": 1, "width": 3856, "height": 2176, + "format": "V4L2_MBUS_FMT_SGRBG10_1X10" + }, { "name": "Intel IPU7 CSI2 $CSI_PORT", "pad": 0, "width": 3856, "height": 2176, "format": "V4L2_MBUS_FMT_SGRBG10_1X10" @@ -38,7 +46,11 @@ ], "link": [ { - "srcName": "ov08x40 $I2CBUS", "srcPad": 0, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", + "srcName": "ov08x40 $I2CBUS", "srcPad": 0, "sinkName": "Intel CVS", + "sinkPad": 0, "enable": true + }, + { + "srcName": "Intel CVS", "srcPad": 1, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", "sinkPad": 0, "enable": true }, { diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 0b2cc33..f360c92 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -1119,24 +1119,39 @@ int MediaControl::getI2CBusAddress(const string& sensorEntityName, const string& sinkEntityName.c_str()); CheckAndLogError(!i2cBus, UNKNOWN_ERROR, "i2cBus is nullptr"); + const std::string sensorEntityNamePrefix = sensorEntityName + " "; + const size_t sensorEntityNamePrefixLen = sensorEntityNamePrefix.length(); + + MediaEntity* sink = nullptr; for (auto& entity : mEntities) { - int linksCount = entity.info.links; - MediaLink* links = entity.links; - char* entityName = nullptr; - size_t sensorEntityNameLen = sensorEntityName.length(); - for (int i = 0; i < linksCount; i++) { - if (strcmp(links[i].sink->entity->info.name, sinkEntityName.c_str()) == 0) { - entityName = entity.info.name; - break; - } + if (strcmp(sinkEntityName.c_str(), entity.info.name) == 0) { + sink = &entity; + break; } + } - // entityName example: "imx319 10-0010", sensorEntityName example: "imx319" - if (entityName && (strlen(entityName) > (sensorEntityNameLen + 1U))) { - *i2cBus = entityName + sensorEntityNameLen + 1; - LOG1("i2cBus is %s", i2cBus->c_str()); - return OK; + while (sink) { + MediaEntity* nextSink = nullptr; + for (unsigned int i = 0U; i < sink->numLinks; ++i) { + if (sink->links[i].sink->entity != sink) { + continue; + } + + MediaEntity* source = sink->links[i].source->entity; + const char* sourceName = source->info.name; + if ((strncmp(sensorEntityNamePrefix.c_str(), sourceName, sensorEntityNamePrefixLen) == 0) && + (strlen(sourceName) > sensorEntityNamePrefixLen)) { + *i2cBus = sourceName + sensorEntityNamePrefixLen; + LOG1("i2cBus is %s", i2cBus->c_str()); + return OK; + } + + if (!isMediaSourceEntity(source)) { + nextSink = source; + break; + } } + sink = nextSink; } return UNKNOWN_ERROR;