{"id":25391,"url":"https://patchwork.libcamera.org/api/1.1/patches/25391/?format=json","web_url":"https://patchwork.libcamera.org/patch/25391/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251209180954.332392-3-isaac.scott@ideasonboard.com>","date":"2025-12-09T18:09:50","name":"[RFC,2/6] ipa: rkisp1: Let all controls be optional","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"37a8b3ae99acb7cb2961af7802b7d897aabc0bbc","submitter":{"id":215,"url":"https://patchwork.libcamera.org/api/1.1/people/215/?format=json","name":"Isaac Scott","email":"isaac.scott@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25391/mbox/","series":[{"id":5643,"url":"https://patchwork.libcamera.org/api/1.1/series/5643/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5643","date":"2025-12-09T18:09:48","name":"rkisp1: Add support for YUV bypass","version":1,"mbox":"https://patchwork.libcamera.org/series/5643/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25391/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25391/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D0F3CBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Dec 2025 18:10:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E40BA6142D;\n\tTue,  9 Dec 2025 19:10:08 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52B4E61418\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Dec 2025 19:10:05 +0100 (CET)","from isaac-ThinkPad-T16-Gen-2.infra.iob\n\t(cpc90716-aztw32-2-0-cust408.18-1.cable.virginm.net [86.26.101.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8744163B;\n\tTue,  9 Dec 2025 19:10:04 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RJpoGrBd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765303804;\n\tbh=v4OEVzqe3atiP1slGBUgV57ioCK4aFm197YFbG2eKHw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=RJpoGrBd6QUnfXt0dsoStPlmx4jv3T5hIFNjqFRCgZzZYAMCfLYwfadPijci3X1kt\n\t7duSpKN3bD66vmq5FssPCVugscDXZAB4n13G8X/uLdhXP+eebn4jD5Bp77x7XtJBiZ\n\tDSha1bLnGBogbKDnlIQaOG4Ok/KPnlUqb4tw/42M=","From":"Isaac Scott <isaac.scott@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Isaac Scott <isaac.scott@ideasonboard.com>","Subject":"[RFC PATCH 2/6] ipa: rkisp1: Let all controls be optional","Date":"Tue,  9 Dec 2025 18:09:50 +0000","Message-ID":"<20251209180954.332392-3-isaac.scott@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20251209180954.332392-1-isaac.scott@ideasonboard.com>","References":"<20251209180954.332392-1-isaac.scott@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Some sensors do not have support for controls such as exposure and gain.\nThese are represented by the new camera_sensor_basic class. To allow\nthese sensors to be compatible with the rkisp1 pipeline handler, we must\nallow the rkisp1 IPA to be able to initialise with these controls not\nbeing required.\n\nCheck the list of controls supported by the sensor before attempting to\nuse them during IPA initialisation.\n\nSigned-off-by: Isaac Scott <isaac.scott@ideasonboard.com>\n---\n src/ipa/rkisp1/rkisp1.cpp | 30 ++++++++++++++++++++++++------\n 1 file changed, 24 insertions(+), 6 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 61d3d1f6f..9fee33de2 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -227,15 +227,24 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n \t\t\t const std::map<uint32_t, IPAStream> &streamConfig,\n \t\t\t ControlInfoMap *ipaControls)\n {\n+\tint32_t minExposure = 0;\n+\tint32_t minGain = 0;\n+\tint32_t maxExposure = 0;\n+\tint32_t maxGain = 0;\n+\n \tsensorControls_ = ipaConfig.sensorControls;\n \n \tconst auto itExp = sensorControls_.find(V4L2_CID_EXPOSURE);\n-\tint32_t minExposure = itExp->second.min().get<int32_t>();\n-\tint32_t maxExposure = itExp->second.max().get<int32_t>();\n+\tif (itExp != sensorControls_.end()) {\n+\t\tminExposure = itExp->second.min().get<int32_t>();\n+\t\tmaxExposure = itExp->second.max().get<int32_t>();\n+\t}\n \n \tconst auto itGain = sensorControls_.find(V4L2_CID_ANALOGUE_GAIN);\n-\tint32_t minGain = itGain->second.min().get<int32_t>();\n-\tint32_t maxGain = itGain->second.max().get<int32_t>();\n+\tif (itGain != sensorControls_.end()) {\n+\t\tminGain = itGain->second.min().get<int32_t>();\n+\t\tmaxGain = itGain->second.max().get<int32_t>();\n+\t}\n \n \tLOG(IPARkISP1, Debug)\n \t\t<< \"Exposure: [\" << minExposure << \", \" << maxExposure\n@@ -249,8 +258,11 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n \tcontext_.configuration.paramFormat = ipaConfig.paramFormat;\n \n \tconst IPACameraSensorInfo &info = ipaConfig.sensorInfo;\n-\tconst ControlInfo vBlank = sensorControls_.find(V4L2_CID_VBLANK)->second;\n-\tcontext_.configuration.sensor.defVBlank = vBlank.def().get<int32_t>();\n+\tif (sensorControls_.idmap().find(V4L2_CID_VBLANK) != sensorControls_.idmap().end()) {\n+\t\tconst ControlInfo vBlank = sensorControls_.find(V4L2_CID_VBLANK)->second;\n+\t\tcontext_.configuration.sensor.defVBlank = vBlank.def().get<int32_t>();\n+\t}\n+\n \tcontext_.configuration.sensor.size = info.outputSize;\n \tcontext_.configuration.sensor.lineDuration = info.minLineLength * 1.0s / info.pixelRate;\n \n@@ -392,6 +404,12 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,\n {\n \tControlInfoMap::Map ctrlMap = rkisp1Controls;\n \n+\tif (sensorControls.idmap().find(V4L2_CID_EXPOSURE) == sensorControls.idmap().end()) {\n+\t\tLOG(IPARkISP1, Debug) << \"Sensor does not support V4L2_CID_EXPOSURE,\"\n+\t\t\t\t      << \" cannot compute exposure time limits\";\n+\t\treturn;\n+\t}\n+\n \t/*\n \t * Compute exposure time limits from the V4L2_CID_EXPOSURE control\n \t * limits and the line duration.\n","prefixes":["RFC","2/6"]}