From f167239b3ecf242ae081767892cb0a4c54bad496 Mon Sep 17 00:00:00 2001 From: Arun T Date: Thu, 2 Jul 2026 06:19:35 +0530 Subject: [PATCH] Enable ov08x40 CVS for support upstream cvs driver Linux 7.2 wires the Intel CVS (Computer Vision Sensing) controller into the IPU media graph as a bridge entity named "Intel CVS" that sits between the sensor and the IPU CSI2 receiver (ipu-bridge commit c6b1b34b5090, in-tree driver drivers/media/i2c/cvs). Teach MediaControl to route the sensor -> CSI2 link through that entity when it is present, and to find the sensor's I2C bus through it. Kernels without the entity are unaffected. Upstream: https://github.com/intel/ipu7-camera-hal/commit/f167239b3ecf242ae081767892cb0a4c54bad496 (only the src/ part; the ipu8 config changes are not needed for ipu75xa) --- src/v4l2/MediaControl.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/v4l2/MediaControl.cpp b/src/v4l2/MediaControl.cpp index 0b2cc33..807d4f4 100644 --- a/src/v4l2/MediaControl.cpp +++ b/src/v4l2/MediaControl.cpp @@ -63,6 +63,7 @@ struct MediaEntity { char devname[32]; }; +static const string icvsName = "Intel CVS"; MediaControl* MediaControl::sInstance = nullptr; Mutex MediaControl::sLock; @@ -983,6 +984,33 @@ int MediaControl::mediaCtlSetup(int cameraId, MediaCtlConf* mc, int width, int h } } + MediaEntity* icvs = getEntityByName(icvsName.c_str()); + if (icvs) { + for (uint32_t i = 0; i < icvs->numLinks; ++i) { + if (icvs->links[i].sink->entity == icvs) { + MediaEntity* sensor = icvs->links[i].source->entity; + int sensor_entity_id = sensor->info.id; + LOG1("@%s, found %s -> %s", __func__, sensor->info.name, icvsName.c_str()); + for (McLink& link : mc->links) { + if (link.srcEntity == sensor_entity_id && link.sinkEntity != static_cast(icvs->info.id)) { + LOG1("@%s, skip %s, link %s -> %s", __func__, link.srcEntityName.c_str(), + icvsName.c_str(), link.sinkEntityName.c_str()); + link.srcEntity = icvs->info.id; + link.srcEntityName = icvsName; + for (uint32_t j = 0; j < icvs->info.pads; ++j) { + if (icvs->pads[j].flags & MEDIA_PAD_FL_SOURCE) { + link.srcPad = j; + break; + } + } + break; + } + } + break; + } + } + } + /* Set link in format Configuration */ ret = setMediaMcLink(mc->links); CheckAndLogError(ret != OK, ret, "set MediaCtlConf McLink failed: ret = %d", ret); @@ -1127,6 +1155,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, icvsName.c_str()) == 0) { + return getI2CBusAddress(sensorEntityName, icvsName, i2cBus); + } break; } } -- 2.55.0