From patchwork Thu Oct 27 22:41:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17702 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 50222BDB16 for ; Thu, 27 Oct 2022 22:41:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA6FF62FB3; Fri, 28 Oct 2022 00:41:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910506; bh=KWL/Gsut2winiwjuDaIMQfAIE6R+nge1tS6vEQwVGqw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=d8cZicGMYl0KT9o6pTmI/PKpcvxEvHfqcYllFuToyfHbU7C5kHLpl3Fyi0Nw6tcXt PI9sINJ35Euff2hHdxC8XPtgMMvcAteIkEDB1fiMhFVNKk03D935BR3GEacpZSb+bW GA3OZf2jQsTGsmlw21mPT0tDTLhtnYzIgbzRj2pXWYNUFFoqNLmIHhYVG/3FGcPsPF BKdodx57xloE9A/4565GMDx0I4ZWckbO/bY+N4SwjzOX/nGbBc2GDoRz56YaiX1JxT is4xcufRx63okOrU0QUBNcfFEHZLlhSjyKfSEDTqI3tQdbrazk34X5WszuJLj9UeQR v65nGTNKv9Adg== Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AED7562FA0 for ; Fri, 28 Oct 2022 00:41:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="RO17LY5J"; dkim-atps=neutral Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-13b103a3e5dso4315376fac.2 for ; Thu, 27 Oct 2022 15:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=uDW5dvSvOk67QVcuydLzLD48wSWjb/FyOIOUWFCTpuM=; b=RO17LY5J+MsUYZk5CUIOWWO1GMQvzXFjDdhuKbH75gADWGdNM1fejI47MZW0ZeNn7X Q/BMvmdH5gsW8Zo0bQO6FxgT+FXA+TC9bovIrHzgzRntDTvB9zTX5zFZ3Etzvox1wwsk +qbUs/BGNr+YWG+nfRk4Rn7NGJXcU+MKnZJisK/zS1RYaZPT8zA1nBaDRGOLfoM3BbF1 Qrd9aWNK0nzgIa1ayZA9qB6MJxsWkGu0ZtdAV5vEtQgR6LqRm/qy7HxmwaefHgjz8Ej3 ndQKyln39cmV+yagNBW1qa9eobcDwV+/P/1K9uXH+9P7+R/Yf2srFbglkZgK6nDmMZRt 8ziQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uDW5dvSvOk67QVcuydLzLD48wSWjb/FyOIOUWFCTpuM=; b=AnH1FNkA0MgEo8kPzCVYFj/HxQlxfFhVb6q8vu6zPTaMqa6tHPx5FMJ7L0pgaY0/va Vpx7nKE2t7vv/e/pghLOME6lA/tpEYhjSW/v+stQ0FFDNV6vwsvoAeUdgR0SEoMfRnSp 5Jlu7WIL3ZCtJ497clPzIhROB0IH+JUOPj9LoR4crzgBoj5rtq/erqc/rr2octClSyJL pf4zWGFxfk00JT5z0JcTtoFBFf2z4YB2cDt8bsInKKX+d/ZZpYLjAgsnnGaFaQVYN9dQ EyFM0qT/TASWYfHRvcKTT41alwNCBs2v03gXEzUOfddMXEjk8oSfTAZvMkbc2nhta2aB 0tBA== X-Gm-Message-State: ACrzQf0kMPakCBne6DNODQRjBEqh6xp1ZE/cqZuInxXDxSHbGS6iq2Ij sAZfU/ujMAH3PRjbgiaE+w1oR314GdA8hMbG X-Google-Smtp-Source: AMsMyM7xsMlYcmEtvlblhITYO4TjwC9ZtlZf5pKInXLQXv37Zjs7d9VfjLVwi9D4UF7t/g5VhvHjSA== X-Received: by 2002:a05:6870:2417:b0:127:be13:2d1 with SMTP id n23-20020a056870241700b00127be1302d1mr7002288oap.268.1666910500835; Thu, 27 Oct 2022 15:41:40 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:40 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:26 -0500 Message-Id: <20221027224135.348115-2-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 01/10] ipa: workaround libcxx duration limitation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth A bug in libcxx [0] used by clang version 11.0.2 is prevalent when building libcamera for Android SDK30. This has been fixed and integrated upstream with [1]. As a workaround, directly cast libcamera::utils::Duration objects to std::chrono::duration when dividing. Alternatives evaluated: Considered: Enable public inheritance of std::chrono::duration and override operator/ in the class. Outcome: Does not fix the original compiler error. Considered: Enable public inheritance of std::chrono::duration and override operator/ in the libcamera namespace. Outcome: new compiler error: ld.lld: error: duplicate symbol: libcamera::operator/ (libcamera::utils::Duration const&, libcamera::utils::Duration const&) Considered: Use private inheritance of std::chrono::duration and re-implement a pass-through version of each std::chrono::duration operator within libcamera::utils::Duration and use template metaprogramming to fix the division operator. Outcome: Testing shows that this would introduce substantial limitations, i.e. requring the Duration object to be on the LHS of any arithmetic operation with other numeric types. This also substantially increases implementation complexity. Considered: Extract double values from libcamera::utils::Duration objects and use those to divide. Outcome: This creates substantial readability and unit-safety issues. [0] https://github.com/llvm/llvm-project/issues/40475 [1] https://github.com/llvm/llvm-project/commit/efa6d803c624f9251d0ab7881122501bb9d27368 Bug: https://bugs.libcamera.org/show_bug.cgi?id=156 Signed-off-by: Nicholas Roth --- src/ipa/ipu3/algorithms/agc.cpp | 16 ++++++++++------ src/ipa/raspberrypi/cam_helper.cpp | 6 +++--- src/ipa/raspberrypi/cam_helper_imx296.cpp | 3 ++- src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp | Bin 0 -> 45056 bytes src/ipa/raspberrypi/controller/rpi/agc.cpp | 12 ++++++++---- src/ipa/raspberrypi/controller/rpi/lux.cpp | 3 ++- src/ipa/rkisp1/algorithms/agc.cpp | 12 ++++++++---- 7 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index a1a3c38f..f1650468 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -100,7 +100,8 @@ int Agc::configure(IPAContext &context, /* Configure the default exposure and gain. */ activeState.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain); - activeState.agc.exposure = 10ms / configuration.sensor.lineDuration; + activeState.agc.exposure = 10ms / + std::chrono::duration(configuration.sensor.lineDuration); frameCount_ = 0; return 0; @@ -240,17 +241,20 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, * increase the gain. */ utils::Duration shutterTime = - std::clamp(exposureValue / minAnalogueGain_, - minShutterSpeed_, maxShutterSpeed_); - double stepGain = std::clamp(exposureValue / shutterTime, - minAnalogueGain_, maxAnalogueGain_); + std::clamp(std::chrono::duration(exposureValue) / + minAnalogueGain_, + minShutterSpeed_, maxShutterSpeed_); + double stepGain = std::clamp(std::chrono::duration(exposureValue) / + std::chrono::duration(shutterTime), + minAnalogueGain_, maxAnalogueGain_); LOG(IPU3Agc, Debug) << "Divided up shutter and gain are " << shutterTime << " and " << stepGain; IPAActiveState &activeState = context.activeState; /* Update the estimated exposure and gain. */ - activeState.agc.exposure = shutterTime / configuration.sensor.lineDuration; + activeState.agc.exposure = std::chrono::duration(shutterTime) / + std::chrono::duration(configuration.sensor.lineDuration); activeState.agc.gain = stepGain; } diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index d90ac1de..48a8a068 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -63,7 +63,7 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats, uint32_t CamHelper::exposureLines(const Duration exposure, const Duration lineLength) const { - return exposure / lineLength; + return std::chrono::duration(exposure) / std::chrono::duration(lineLength); } Duration CamHelper::exposure(uint32_t exposureLines, const Duration lineLength) const @@ -85,8 +85,8 @@ std::pair CamHelper::getBlanking(Duration &exposure, * frameLengthMax gets calculated on the smallest line length as we do * not want to extend that unless absolutely necessary. */ - frameLengthMin = minFrameDuration / mode_.minLineLength; - frameLengthMax = maxFrameDuration / mode_.minLineLength; + frameLengthMin = std::chrono::duration(minFrameDuration) / std::chrono::duration(mode_.minLineLength); + frameLengthMax = std::chrono::duration(maxFrameDuration) / std::chrono::duration(mode_.minLineLength); /* * Watch out for (exposureLines + frameIntegrationDiff_) overflowing a diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp index ecb845e7..c5180de5 100644 --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp @@ -57,7 +57,8 @@ double CamHelperImx296::gain(uint32_t gainCode) const uint32_t CamHelperImx296::exposureLines(const Duration exposure, [[maybe_unused]] const Duration lineLength) const { - return std::max(minExposureLines, (exposure - 14.26us) / timePerLine); + return std::max(minExposureLines, std::chrono::duration(exposure - 14.26us) / + std::chrono::duration(timePerLine)); } Duration CamHelperImx296::exposure(uint32_t exposureLines, diff --git a/src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp b/src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..7b26d5511f7338b4cd3f28246243c9110c39aab0 GIT binary patch literal 45056 zcmeI536xw{dFMN9rT}9CHiWP}w{5vv>aLdLC3b7^X-O?vi6jfPY$3}!#p|lq-4E5~ zdQ~kovLS#68xzI^90m>v8Eg&=Gi+f8*qi}|Ng#wZW*IXB%1 z%~isB)D9<;c4abdg_G?tY0X9L_HrwptTY>)cC%KC+LLX*h6|NarPVrB<*WBsDe!NZ z0^QF1#3iSXT(EJ&dLhF(qh|+?d+e3}mMOB@_f-n4Qec$=s}xwJz$yh+DX>a`RSNu@ zqd=!s7dKipow z#(sXk=YGLnFWb*Ow!yCaN7(D3{roRI_a9=f&)LsMJ=px=-nU;ze$(D>^xU_XS3g!M zuu6ed3anCKl>)02Sf#)!1y(7rN`X}htWsc=0{>4^AgqpzoJ-4JD)ut*e`o)H_KcB{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}*|9DJCdfg6|swV2&dB1M_csuWnw!RFlK zGlLVbJYXi6p+#CVJ9?D0+)rAo-H}VwSAT<+sH%nVp$idMw+pjf4p}2+#t%+7Glw}Y zkE*%LP7|t;?0+pse@Q|-A=os`D~|M#=BR8jyBpC4suALW>{hl+a2AG3`!)2ET|#tF zw>>2_(Wv3(n)rjXNP>(U%N?1+n57LUMiM5jVz`K(sG%9P;w_?(Q59QkQfNw35L2cp z_UDeQ_EN=#pzS3`H?>gRK_^;_dcA8L2hP+pQ?}Dy7CA?`hB_J1rI$G&3fG6EK%y!vGKUd>dNvy+129SjSO%)4vE`o-nm>VaZGuddL zx(u0^xnm9J>nTn{u;MEBmTImxBm03JhTtFE+qccdRwXn{bzL`ERoFcM!M1`>qt9ZW z+Of|s^nT9ZgZ{7dsAhqT={t#E`jPwbm;!l&Lsuk`Q~7mly8pKWCBB7u7FJKsgmE$B(KB!^_nrk=ej$Pb zQq|50bHgFKnXu?L!@_jg&Nscr#d|4Hjri{5AN>NO6 zW94ST%6jQZoVwYuBX(gtsOwa!33`IkXn{H-MS&Ugain[stage] * shutterTime >= exposureValue) { - analogueGain = exposureValue / shutterTime; + analogueGain = std::chrono::duration(exposureValue) / + std::chrono::duration(shutterTime); break; } analogueGain = exposureMode_->gain[stage]; @@ -838,10 +840,12 @@ void Agc::divideUpExposure() */ if (!status_.fixedShutter && !status_.fixedAnalogueGain && status_.flickerPeriod) { - int flickerPeriods = shutterTime / status_.flickerPeriod; + int flickerPeriods = std::chrono::duration(shutterTime) / + std::chrono::duration(status_.flickerPeriod); if (flickerPeriods) { Duration newShutterTime = flickerPeriods * status_.flickerPeriod; - analogueGain *= shutterTime / newShutterTime; + analogueGain *= std::chrono::duration(shutterTime) / + std::chrono::duration(newShutterTime); /* * We should still not allow the ag to go over the * largest value in the exposure mode. Note that this diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp index 9759186a..410f6f44 100644 --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp @@ -94,7 +94,8 @@ void Lux::process(StatisticsPtr &stats, Metadata *imageMetadata) double currentY = sum / (double)num + .5; double gainRatio = referenceGain_ / currentGain; double shutterSpeedRatio = - referenceShutterSpeed_ / deviceStatus.shutterSpeed; + std::chrono::duration(referenceShutterSpeed_) / + std::chrono::duration(deviceStatus.shutterSpeed); double apertureRatio = referenceAperture_ / currentAperture; double yRatio = currentY * (65536 / numBins) / referenceY_; double estimatedLux = shutterSpeedRatio * gainRatio * diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 04062a36..bb874356 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -74,7 +74,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) { /* Configure the default exposure and gain. */ context.activeState.agc.gain = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain); - context.activeState.agc.exposure = 10ms / context.configuration.sensor.lineDuration; + context.activeState.agc.exposure = 10ms / + std::chrono::duration(context.configuration.sensor.lineDuration); /* * According to the RkISP1 documentation: @@ -212,16 +213,19 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, * Push the shutter time up to the maximum first, and only then * increase the gain. */ - utils::Duration shutterTime = std::clamp(exposureValue / minAnalogueGain, + utils::Duration shutterTime = std::clamp(std::chrono::duration(exposureValue) / + minAnalogueGain, minShutterSpeed, maxShutterSpeed); - double stepGain = std::clamp(exposureValue / shutterTime, + double stepGain = std::clamp(std::chrono::duration(exposureValue) / + std::chrono::duration(shutterTime), minAnalogueGain, maxAnalogueGain); LOG(RkISP1Agc, Debug) << "Divided up shutter and gain are " << shutterTime << " and " << stepGain; /* Update the estimated exposure and gain. */ - activeState.agc.exposure = shutterTime / configuration.sensor.lineDuration; + activeState.agc.exposure = std::chrono::duration(shutterTime) / + std::chrono::duration(configuration.sensor.lineDuration); activeState.agc.gain = stepGain; } From patchwork Thu Oct 27 22:41:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17703 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0E386BDB16 for ; Thu, 27 Oct 2022 22:41:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3626362FB8; Fri, 28 Oct 2022 00:41:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910507; bh=17Ukq0I3hqoas+gx0WV6KuuhC12XYREv+g1mUc9xNoQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TGffDJ2cd8n2aqPuGY6/IdD2lVSIkc2KYoKyUQWkzkKjxb6L6aKdC2U7HVLn7+v79 MqPEUqMmVRNMTQPGHoNdUy/DgEHSZ79/g+n60yBSW051riiJlB/5C9HZuu/3Zpa0p8 BYaOrQ92YbZjsL+wBU9/+NGOJ7azBEnf4CU6nFLeBTFdcwgh+bdmvKOh2Zg0besW1d Ut5W2izVFZLqI+ZADbS/eGpx8ANQiBBzWf7zE583p67Zu/Ovnw3KxmcRORST84E7JP FETCAeKAR82nja5zfV1CpkJZxu0om56rWK/qb8Gp8WTudHrym3ki1zQMPAVdmeH+JS i0Wu1WgrFx67A== Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D82662FA8 for ; Fri, 28 Oct 2022 00:41:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="c9iPnv3W"; dkim-atps=neutral Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-13bef14ea06so4322320fac.3 for ; Thu, 27 Oct 2022 15:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=1mfxtU8lTzXIpkx/hUjfyntGA0NGDWGeGZDezQGJzxA=; b=c9iPnv3WYXQFSPA33nYoivkAtOyZkZjHh4QDF3SqBgaiWbkSJYjQO9pUxPSTcUajy0 x44adP9J4+xaHSskrIcSKJUwqgeI3caZ3EN60s7bIGI/tEbq34V4hMs+6QJw7D1shISC KIBpCCu0CzuJ9gKsAfpacaoPRKWLI0Fxd4vdO1qbeAI4XbOr0XsdKkrnV1PE24axXvt8 MCiA2GEuI5y2E7adMZ/nIXMTYEhE3yx0USZbN8b+AGX9J3+zZCDFPAhnLZwJiOGDnTbh DOtb+IX4qLZD0kaTqBWEWnnBDbbf8UE8SvKGZpnXv6a1Iivi8aJvU0VWHyu4AbNR/dBG eAzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1mfxtU8lTzXIpkx/hUjfyntGA0NGDWGeGZDezQGJzxA=; b=4JpUKoUQhMyEB5/x3K7mVBo5zwJU8602IMM5PfIueCxW49v4jm0vbK1qKfyJfDf8sL zvK5bWfPRMCb1zD0bH6LliFV6vQ6dgVFmQcSvDmeCEObzjpdmR5rxQjXCsiMP7J0dbNv SIuLAB+UwxbWruV7l05xPtreDrNwWLmOis7N451iWcGpCpRfrET6hDJq1ICKBlK+6yIL gYqdqtDWUY2Ajn97HIJbdDlL8l+HQz5Q+QCojb/ZwxBA3oWa3k6dvSeFvTb5sos6iFvj Bes/PrFypS884Hp4baiIaDnLEUxwhXN94xoYLcKKAoVY9F1fq38bsqJDzMbZutZLnX9l G6Rg== X-Gm-Message-State: ACrzQf20IUuxM2REwZNi8KFAcxcVApeVOylkzh1ZBnd0QjFTndZGmn4c esT+tycF5o8Rj/S+NpFc69qew99LElYGg6hw X-Google-Smtp-Source: AMsMyM6gmCMXwHt27z0L480YZF3uBN9Ce4tj/vVy8c1PECe9cHcGcXYeiZc25YvkFRbcZmnaqgRI0w== X-Received: by 2002:a05:6871:1d3:b0:136:b0e6:de65 with SMTP id q19-20020a05687101d300b00136b0e6de65mr7169331oad.41.1666910501524; Thu, 27 Oct 2022 15:41:41 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:41 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:27 -0500 Message-Id: <20221027224135.348115-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 02/10] ipa: add missing thread-safety annotations X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth The raspberrypi IPA is missing thread-safety annotations, which breaks the build. Add required thread-safety annotations. ../src/ipa/raspberrypi/controller/metadata.h:108:31: error: mutex 'mutex_' is still held at the end of function [-Werror,-Wthread-safety-analysis] void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:108:23: note: mutex acquired here void lock() { mutex_.lock(); } ^ ../src/ipa/raspberrypi/controller/metadata.h:109:25: error: releasing mutex 'mutex_' that was not held [-Werror,-Wthread-safety-analysis] void unlock() { mutex_.unlock(); } ^ Signed-off-by: Nicholas Roth --- src/ipa/raspberrypi/controller/metadata.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ipa/raspberrypi/controller/metadata.h b/src/ipa/raspberrypi/controller/metadata.h index 0f7ebfaf..870b6e26 100644 --- a/src/ipa/raspberrypi/controller/metadata.h +++ b/src/ipa/raspberrypi/controller/metadata.h @@ -13,9 +13,11 @@ #include #include +#include + namespace RPiController { -class Metadata +class LIBCAMERA_TSA_CAPABILITY("mutex") Metadata { public: Metadata() = default; @@ -103,8 +105,8 @@ public: * locks with the standard lock classes. * e.g. std::lock_guard lock(metadata) */ - void lock() { mutex_.lock(); } - void unlock() { mutex_.unlock(); } + void lock() LIBCAMERA_TSA_ACQUIRE() { mutex_.lock(); } + void unlock() LIBCAMERA_TSA_RELEASE() { mutex_.unlock(); } private: mutable std::mutex mutex_; From patchwork Thu Oct 27 22:41:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17704 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 86BCBBDB16 for ; Thu, 27 Oct 2022 22:41:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 65C6D62FAD; Fri, 28 Oct 2022 00:41:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910508; bh=UbWy7JpRGfzsvWhGg3mEk+TUTZy4PwMeQO3JXefUuvw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=1SSsAKx7y96XTJ+5+tAha4DMmLFqpbvuzpaykJhVESlAaNwGId7LdhzCO+wcG5UNJ SkVZ0DGb5h4nqzVWgfr1y309Ewy6vefe35gSWDtADZZrDj/UbU20Mx0X/QWNY+T3hZ OcyvGqEQ8Kd3WQWRtBkpeyPn2V2E1nkUNsPgCGdfknXhg61JObeV894+gwCMnw8GDL Zc9n6rJTlfuty6Ve7T3DpZSjdIA2MTtP/0fbyEGdEnzHUS8CQ3dqYdStOLpR6umY0R VHtZJy0dU3ndLFIdQkTOh4bedKXwK/6fvL4U07RhG0J3ZLLGjZR+jbTBFzfiBVHugc tIz+qAbTabRCg== Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C23462FA3 for ; Fri, 28 Oct 2022 00:41:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="nzj+if/P"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1322d768ba7so4314548fac.5 for ; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=IrPtoDDjdotdllMEiEG1VWBuowiqd4YRxRwcBEjf694=; b=nzj+if/P9JkTW4jdJROiXzluNSBaO3QTXp1tyxfzRTsLuU7+K3xJm85rZTqn+2bH5c b2E5EY5W9qk5Hv93/EnMQPVfi2zXH0OUW9HVmppZz3E3m8cicgr/3ly8H4ssXeuNLIcr 9ErROzYh8sXVVCEUEhrQErD8qH7j8Vqpp8Aht9ilL/dOQRegZovU1OSXSekMblcuSq5V gOavWT2pvru6XwjjsaNbIy8Ot+SrK4ioi1WLys+mUA2coa6PykkVznSBH2g68zDvUa1y sRBnv2iAUXatknjHBWjK80IHX6QCbXbq3Es7IInJ46b5I7f0qQWMqCzfUFb5FptzZv5a jKcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IrPtoDDjdotdllMEiEG1VWBuowiqd4YRxRwcBEjf694=; b=kCy95wuqRcIq9kJO1Gg8oHCvmY4F4P9YMnKEDSiXKPBCN/L7qyFibXrdmUjynB9FRr taZNGfZaYUtiBfOxLjnrXlk8WUF+hUFP4c0o2fPGyR/OMx7e2th58O3zLGjUTpmKMk4X wlccKjODTOXc3wGQFh9K5Gpg1PU9l0j12vIu/00oVEodKONVqjqYu52A9d1rx2AKggyW MXUne8RksZ77kU8ExikWGFxyrdwGrc8GKTIPm3IEnF2Pwy18W1frxhXTb55wQwpKND22 Q9sYWI3i2GqqufQW1tkD+ybDxgWYkIhs4DAS109pDVxZkTOwMhNjn/h0i7P6dHIsXVy+ S12Q== X-Gm-Message-State: ACrzQf3GS/EX0N8tp800Z5F6/BzPFYW2iDLr5vhRH3wDWprERhcJpXyh tZ1wOdkgmIt2oueWgKpgMIRBwa9FkbctAqPj X-Google-Smtp-Source: AMsMyM4BXO0npF3mjClHHZ/AkzIb5Q7TWQYYggJ8+vJ6+dxeHwsBvxuOt6HaRWhUkuyYnMwmeua95g== X-Received: by 2002:a05:6870:c34a:b0:13b:b9e7:e730 with SMTP id e10-20020a056870c34a00b0013bb9e7e730mr7163115oak.202.1666910502268; Thu, 27 Oct 2022 15:41:42 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:41 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:28 -0500 Message-Id: <20221027224135.348115-4-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 03/10] ipa: add rkisp1 metadata to fix Android HAL X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, the Android HAL does not work on rkisp1-based devices because required FrameDurationLimits metadata is missing from the ISP implementation. This change introduces sensible defaults for FrameDurationLimits that should generally work most of the time. In theory, it should be possible to implement more sophisticated logic to detect frame durations. The appropriate API hooks for doing so exist and are used in IPAIPU3::updateControls(), although the implementation may be suspect. This is left as future work. Signed-off-by: Nicholas Roth --- src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp | Bin 45056 -> 0 bytes src/ipa/rkisp1/rkisp1.cpp | 6 ++++++ 2 files changed, 6 insertions(+) delete mode 100644 src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp diff --git a/src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp b/src/ipa/raspberrypi/controller/rpi/.agc.cpp.swp deleted file mode 100644 index 7b26d5511f7338b4cd3f28246243c9110c39aab0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 45056 zcmeI536xw{dFMN9rT}9CHiWP}w{5vv>aLdLC3b7^X-O?vi6jfPY$3}!#p|lq-4E5~ zdQ~kovLS#68xzI^90m>v8Eg&=Gi+f8*qi}|Ng#wZW*IXB%1 z%~isB)D9<;c4abdg_G?tY0X9L_HrwptTY>)cC%KC+LLX*h6|NarPVrB<*WBsDe!NZ z0^QF1#3iSXT(EJ&dLhF(qh|+?d+e3}mMOB@_f-n4Qec$=s}xwJz$yh+DX>a`RSNu@ zqd=!s7dKipow z#(sXk=YGLnFWb*Ow!yCaN7(D3{roRI_a9=f&)LsMJ=px=-nU;ze$(D>^xU_XS3g!M zuu6ed3anCKl>)02Sf#)!1y(7rN`X}htWsc=0{>4^AgqpzoJ-4JD)ut*e`o)H_KcB{ zPk}dr*MsMRli=AP0#|_EQ2A z9~rp^d=UHv_)p*s-~f0!cr17fxaUzLBYy^Ba0na(vtToLH2Cf#M@GI1J^|hi-U{9V zZU?Ug{}EgVHi7~;4cv><;Ge)Z!8^gNpbZwlesBeNDky;aa6tSR{0Mvn{5`k_{0Vq9 zSOiDFZt!!Q8J`B90qeVK3hvd3nce%Yn%={ecs?ket+&TU3i`?O zuCQy%i}C2u5|wPOHoJ4RXlv1wx~KU7N)5Z6X3$@BtvRUZxn{RfrEvY6?X=^@La=2^ zFnZAFo849`YD3imqufa5o9%kht0Q~XzZf;DygpJ;exdn7B=5dAf_l}` z*?W3xadebAPmaJ>c`lopQg%|Z1ZhUn)YRdyUb|xMSy81EtTF5{=JVpoVEuS7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qt9ZW z+Of|s^nT9ZgZ{7dsAhqT={t#E`jPwbm;!l&Lsuk`Q~7mly8pKWCBB7u7FJKsgmE$B(KB!^_nrk=ej$Pb zQq|50bHgFKnXu?L!@_jg&Nscr#d|4Hjri{5AN>NO6 zW94ST%6jQZoVwYuBX(gtsOwa!33`IkXn{H-MS&U X-Patchwork-Id: 17706 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7356ABDB16 for ; Thu, 27 Oct 2022 22:41:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA5C262FC4; Fri, 28 Oct 2022 00:41:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910510; bh=daE6WY54HAjKlN885/mrlKW4bKHReC2Ox9JTDd8H68w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y0EVYu0Dl1XWGH8FfZdynSp3kCb6jBHG1ixz1LdRL++U+YObkOU04B+aIQ11pOW5V ckF0N5gOzxrfPT+YDG7pnEBJTjHKoporkzZSJv9X5btwHfMrVde/wQjWqtycre7A2S j3xWcWTOb48zulxrWO/ibDmy69SZeY65b46GrZffGvxh0K+MRGOJo/djx6qWEnF5V6 FFg24yrNKg15HDDOaK7rKRD99LTpf0XKkpRvHE+joz6YPdViAO1j3lNPKSolm26W7e nLiveN/0elg17HwsFjv3yIIy0h7N1ItpnXL7Gq9HiNRUsYRUI86/LKmX9ELRGCjQ37 4IbflmcIWHj3g== Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D1C4462FA0 for ; Fri, 28 Oct 2022 00:41:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="rVB+ZD6H"; dkim-atps=neutral Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-12c8312131fso4315392fac.4 for ; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Nx/vHY66gELOXMwShEVVfeaHqV/OVGT2Ylh4eoO+CP8=; b=rVB+ZD6H/Nt57SFsAK95bhsBqgJNZpNTIrIFoKM8fPv5BSCVExWfxzhDxjMHZOYiTP 8cVk9jsCVXo7Oj8A6BjbhOQG2fzZo+IE2luhbA7vWsm67suW5Gyc+XIgGtfpdcsBRsli +IZ5cGOfdKHiXxk8C7/mpPXSnPkNFO4cq/7k3ranfbakdT36xjtvzec2SZ7u+de2QRg2 xozsWXJP2POV7r6lnoM0xsX6VG4/622qtS/605Zdfb786Nugmg7KCbWftMJNg0luF8Ok mSxsQSGgM+YgyrwhLTbZfEE/xqZDK5sZx//STidyQwA1NjWD1OlNKoyMPQt3VDLFCP+Q Vwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Nx/vHY66gELOXMwShEVVfeaHqV/OVGT2Ylh4eoO+CP8=; b=BPueyZHSY5k58cjcI4Sj6BaAcXKVX7TIy1fxF8nfbulnUgW+AvOWMcVd5z+RjaBr3r rUYyWnOtbiKAfo3D6g8+W/iswZgrsBrc+/OiwJgFddCisANFO5hSdGGMVp3l3IODWolB 64rfiCoH7KaJp9YoTTHdydvchguox26WFzHEGml0VCGMyiN0UKUp+AArEDcRBS2jeneG HoE/gvESwvS2rAWI935AV9AmV75MAvSl/6Q1Qbuz9NlESSe99Jr1aDiOS28ugqa+xiWF 3aIRCFtVNTdwNo6uGKcvPYgTB30NbFmSBFnTPc+YAbAEAwunzGIhkvOVEsO9KglZ7gDj UQoQ== X-Gm-Message-State: ACrzQf34ylsivrXPjcP3ukpPy1R8L4rzLusfa3y1fKngozQSwr4ZaH7x msjHVeVtP0V4FZnKlmAhF9v8ZuykAATk30xl X-Google-Smtp-Source: AMsMyM5wpO2WJUi6LNpnTfgqfE9bfRcVy9pvrHwKX8JhwlYzUxSBohuzFelcNk+sZAEUDb8QUSFWsw== X-Received: by 2002:a05:6870:3409:b0:13b:5dee:40d with SMTP id g9-20020a056870340900b0013b5dee040dmr7173622oah.121.1666910502834; Thu, 27 Oct 2022 15:41:42 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:42 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:29 -0500 Message-Id: <20221027224135.348115-5-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 04/10] ipa: libcamera: add support for ov8858 sensor X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, libcamera does not have information for the ov8858 sensor used in the PinePhone Pro, a phone designed to run Linux. This commit adds metadata, especially that sensor gain is reported and set in 1/16 discrete increments. For more information, see "5.8 manual exposure compensation/ manual gain compensation" in [0] and the driver in [1]. [0] http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf [1] https://github.com/megous/linux/blob/orange-pi-5.19/drivers/media/i2c/ov8858.c Signed-off-by: Nicholas Roth --- src/ipa/libipa/camera_sensor_helper.cpp | 11 +++++++++++ src/libcamera/camera_sensor_properties.cpp | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 35056bec..f2040cbd 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -476,6 +476,17 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693) +class CameraSensorHelperOv8858 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv8858() + { + gainType_ = AnalogueGainLinear; + gainConstants_.linear = { 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("m00_f_ov8858", CameraSensorHelperOv8858) + class CameraSensorHelperOv8865 : public CameraSensorHelper { public: diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp index e5f27f06..d0757c15 100644 --- a/src/libcamera/camera_sensor_properties.cpp +++ b/src/libcamera/camera_sensor_properties.cpp @@ -146,6 +146,20 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen */ }, } }, + { "m00_f_ov8858", { + .unitCellSize = { 1200, 1200 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + /* + * No best corresponding test pattern for: + * 1: "Vertical Color Bar Type 1", + * 2: "Vertical Color Bar Type 2", + * 3: "Vertical Color Bar Type 3", + * 4: "Vertical Color Bar Type 4" + */ + }, + } }, { "ov8865", { .unitCellSize = { 1400, 1400 }, .testPatternModes = { From patchwork Thu Oct 27 22:41:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17707 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 69FE5C3286 for ; Thu, 27 Oct 2022 22:41:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F195C62FBD; Fri, 28 Oct 2022 00:41:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910512; bh=mEKe8DObtbMqMeq0QJ40bRzbuB1kkOYMwsT2S+BAfQ8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cgvEuKn1SnXleOdySAWDK8FgQENKgspURVWMVxnSx7dmmumplhrGZttez6hebLM81 RP8b5Ix57fYn3y2dwYxw2skL2hlruvFjgWMNGz9Fr4fZYK2FVIpuS+HsJySzAbKJ7j 2IilmklhxYPVbEBN+TwXsIaGYGDSoey2KyJ8R5bpwabOjwXstUfWHFSb8sTlILLFwv 2yd2JI3UjUN+ikByWE7ko7SLwCNGefUm+2zE1Fq8JHZug4kvEje4kjf2krYm7GAZgp /tJ93+fvvHyFU4V4KlOo33VKofIeSa77iUIrK0fr4Y1RGdn6XPTV9gYo8M+q0/0ZaH SxJntTwsh7sIg== Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A60A62FAF for ; Fri, 28 Oct 2022 00:41:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="ETeviXuF"; dkim-atps=neutral Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-13ae8117023so4284217fac.9 for ; Thu, 27 Oct 2022 15:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=qBhDf4OV6leDFFlgV+VCdce9GMxAf96qbwkaTsSXnsg=; b=ETeviXuFhfv7Lwelcv33NjG7NpQ0Ewzl6Umg+I6UOv7Pb2kPMYyx8s6aq0LZKrSAmV vQ1W6GDSBWXEFpM+s1zVVS0iEsx6gmyritk+IMQ75b6hWbnhFHcRTvpy4EsRoYfLoZeO W1wysqHi7pH4KPwhp3PTNei28x+x1W2HvHvilcnXPSgtK8bhACtkFwyNQYu5SKgv+OCv PV0IPFQIZK6S2xg5FoF0hs2QjkqDH8gplHmDcSKCP3dH1JMKMPYz1tqM7XMFObSLbpa0 ZmnyRFXu0OxjCfB6oUgrJsb63yKfmHqLDo10/FucUu29bq1s8Rnh/71eLgDB/Ia6JPca uC/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qBhDf4OV6leDFFlgV+VCdce9GMxAf96qbwkaTsSXnsg=; b=Dc6uAN2JOZ3R3YTPqmKfI99bcuUxQTJgI2Hu9/XlSMXDppglvOEQluYTq9k7WVY9h5 YZwt/npFbCkr7qWdqjX6LbzOzsYbYiuGf0WRaj8joZymSnzrbymcdXd4v9advlSGLQJL czM3jVyRxMYSrTziiKwa1qcaNIK7aZONbu2zjWpjKPCIPOV8/+JfwRfs9cnXXMK8AyMC NKGByuN8g/CpTX+P3v3bIPSdQ2sX0NGzEK+C90CD7Z3iO7eIVaJxFDs7H4aC2UIU8hTZ snlYsTpsfiT3EzTagqq9SRk7AoFwOLA0+3HMdhYCl3/wcjmqPbXZ8F/JvlbMNqAq2nUS Voww== X-Gm-Message-State: ACrzQf3nh538o/30an/ZkOY0cpViYlFCfvg0le2hOUlPuyaE6gq5vXO+ sl9TXhqI7Uy96io1NbaJkrBbkiI1RoGP21x4 X-Google-Smtp-Source: AMsMyM4NfmVmYPvJRhw9zJCJt3VWr5OAZ58XLzI6F5ROeeuWPBpW5oP4+wn9MQS4MX8ISs01Bblp6w== X-Received: by 2002:a05:6870:d14f:b0:13c:673d:6799 with SMTP id f15-20020a056870d14f00b0013c673d6799mr1785508oac.149.1666910503548; Thu, 27 Oct 2022 15:41:43 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:43 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:30 -0500 Message-Id: <20221027224135.348115-6-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 05/10] android: remove references to std::filesystem X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Android 11's toolchain does not support std::filesystem, but camera_hal_config.cpp currently uses it. Remove references to std::filesystem in order to support Android <= 11. This adds a very small difference in behaviour, as File::exist() will return true for special files (pipes, character or block devices, ...) while std::filesystem::is_regular_file() doesn't, but I consider this to be a corner case that doesn't matter much. Signed-off-by: Nicholas Roth --- src/android/.camera_hal_config.cpp.swp | Bin 0 -> 16384 bytes src/android/camera_hal_config.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 src/android/.camera_hal_config.cpp.swp diff --git a/src/android/.camera_hal_config.cpp.swp b/src/android/.camera_hal_config.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..e6b7220ae345f309242d3d97dd369fe783e65ed6 GIT binary patch literal 16384 zcmeI3TWlOx8OMjVp)92r1zy@baI!}3uI0VhQLAcVTe8<{XVs1E_!2dw)@pX@r)RYPYR0O1|Patvof9IUp z8SmQ81(1-Km44pc*>nA$bG|v>cgFSN@yb#5Kz>xi>n=@u_m-39o45Vr<}cp8Pjfss zSflG#d5Ltnwt1CgT49}Awowqt3saTZYGrQap+d`cxY6XUU*L}h+;fZ;F4awAoqI;X z_soLfSe|QJ1$n8qX0&Ri>on|U-fXw8R%h~iqClbm6zBwv+yl33hek(=q{l$|Ap7|K zl|-6Efkc5sfkc5sfkc5sfkc5sfkc7-BL#x?P1UqCeeb?3dQ$4?{ zugP1YK%zjRK%zjRK%zjRK%zjRK%zjRK%zjRK%&6^paO=aX}6+XTND7m`G4sD|MX5x zdlP&Id<$@3fGIEua^L{C2mJL8P5Tx2C3pcm56*)xfk!|a90LpB6JS61!|j^(d+-i; z3;Z0M180E`2EnC|Y1)^;d2j+82PS)CVqs z*T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ku%h1HhZTAZXtO_T-p zDt`T=OB!~^0abPCE!(7;s+B3VCz>vos*{W5+QQ0IwNlFTj3?b}%ogV4uDdyyV_9r$ z@2=~rQcc5-w>Dj#smzsYrOD;;?EK=1Xa|hFQOBoEk%L*}w+)kHMW|=J(ewe^FH+)`bxlJl9s;lRB zn(N!E!`h;qTs#jZH?nO{rc7G=0d+Kl%q1+LG(7R&@bEgzDV4=K$7I3Hu>;FOUI;aV zts4#=jrULhl~Horo1WcV3s|OkzqFLx=kdkIA&ghZNM&RX<_=IT-7#Vtaz?s zaVM}FHurQ^on5HrM)M;%*UPnFZ#-%m`Tq~XXPt+iOa6a&zW+P;^}hwb0lx+p!6{G# ze}e!19{3)36>NYGsDUG(2tI)S{w}x--UiQuC%`elzLiYskO){iG|UfPOF7r1UxhuM!%Oih(uW2 zH$A%!f7^D1A5N}s|CTu2%_bcecCU!J%k6aqF7#d@cN+nZZY-mg=Z_ufu5;?HujGsScf~z}?3uq^@CDa}&ZB zl_mm!gh9;-9qiCBUE2rmQE#$n5MW!*+pnZ*XQx^sB7_=meJJpMQ&L0PHR)e zMPt3mmFMQm;@m>6I;l+D+tk^^X)$xQb@So0Se^~H<5*&*^>k0ppLpY>s4_I0nn4$Y zFDt@|B%TmHK0UhCjk739v28Cb&VQ;kd$)6 zF-DkFOr7MhWrWx;xqIDi3e|03tPI5eSiKVn1;k_|H@sVh5Oj|+$gFkCp`45A_>sZC z_dBM^eSa81L5DZt^KWn_h8hh*1O)$i&%HA?j=7MJ#&{2#$nYQX@;nq?J+lL!`h;WE PK!gP7+;cZs4r~7c$v(c4 literal 0 HcmV?d00001 diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index bacfe4b9..0e7cde63 100644 --- a/src/android/camera_hal_config.cpp +++ b/src/android/camera_hal_config.cpp @@ -6,7 +6,6 @@ */ #include "camera_hal_config.h" -#include #include #include @@ -160,15 +159,15 @@ CameraHalConfig::CameraHalConfig() */ int CameraHalConfig::parseConfigurationFile() { - std::filesystem::path filePath = LIBCAMERA_SYSCONF_DIR; - filePath /= "camera_hal.yaml"; - if (!std::filesystem::is_regular_file(filePath)) { + std::string filePath = LIBCAMERA_SYSCONF_DIR "/camera_hal.yaml"; + + File file(filePath); + if (!file.exists()) { LOG(HALConfig, Debug) << "Configuration file: \"" << filePath << "\" not found"; return -ENOENT; } - File file(filePath); if (!file.open(File::OpenModeFlag::ReadOnly)) { int ret = file.error(); LOG(HALConfig, Error) << "Failed to open configuration file " From patchwork Thu Oct 27 22:41:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17705 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A3D05C3285 for ; Thu, 27 Oct 2022 22:41:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C1CA62FB5; Fri, 28 Oct 2022 00:41:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910510; bh=3SsAYU1JMVdyMQ/zKyB1Y/Gfebk17k1NLKqdg6/vOfI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JK+/lwHM4LsoYMVGdK/EciTAzWE7gSm5GKPJSGHl64N51FeoU+F1DMBEL2tlvSo/R 2nq2Hx9ISOwsdcVd82Xxdia5TW0fsTo87Qmuuor5hIeGx4WgSQvle5hpwmZPq+7XYk 9KMj8w9bBb6+GU+pcJEfPxy+0F3c38t02CTe1DmglbyZVzKni5zxbHvnD0TfHXco0O GfjIvozYOMRR22nzZds6u7wRizRBUr90X7cupv6oLjl4kObRcVmcZEkXkuVTn3vSaq C+FmHN1GJir/avXeA58v/MNztA05yVIh2CBM1uf7iYhuAZYqtk9VApFm2CMEl3gXHC hJccRL5WCAWsQ== Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C744F62FAB for ; Fri, 28 Oct 2022 00:41:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="0MhM2v8T"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1322d768ba7so4314628fac.5 for ; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=RPptAfrtD7k2o7VEK6frv0lekwlYg6ZLNrxS93bfFPA=; b=0MhM2v8TAfRmtn2vOniLGNGEMvY38mode8Q3Hlg6qinP2mvKAujcHfUTak/TqGytz5 ab+aLikr3lfH9iUUsrcI4nvloOdQiq3GcJyUqrqbHG3PvfByRNblJo79/2ylMIBHplax 3TV7pXfNf4aIViGeCPtux1n4U7qkCPLi2g2AGGetid/f+uDtKe6uMblc4zq89puuRXXX 1ik4/xKS0ZlWsDkZY9MzdJwRnaYWvx+/2MoAiN9zd1OPi0WsfnMen9QRb3NKqjyFGTW8 WIZdhEZFxnY7iiQ/Kr550tTYjj+3Osh759MzEYKR+ZsrwB4QCDiHh4KpXMQdPuMqmk/+ SkHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RPptAfrtD7k2o7VEK6frv0lekwlYg6ZLNrxS93bfFPA=; b=eTa/1Mm20rSylivaLRP0EbxfAgDxafJjbAeCLeFqkjfQpgeWG7v9swm3Q6iE0qFl1r sO0xsru1MwfJevIgFUPI4zPPaC0sa+5lU9vG5vgHNcUMTt/dMuYILIE4yTWQvubb+0mR zafeNlvGe9CdfbexSyI7Ny6W9oqwpOvNQhDl+VRxm/nNPAjrtZgUPiGxIrmPkfsbYbh1 EtuJP+vNGHhCU8vKe305w+SyZDI3KdAs+T2KoUelSh0FuBetOlooesWyBVVIqJnSDgut sgbExfCBgOWK+6clW1bXseSAVcvlLUaN+8AbnUA4Nb49zJ9NCpQLdGjYRi9eKL6AVcyR yCuQ== X-Gm-Message-State: ACrzQf2kDZ2+7mR0SA+YH1J7N3oYQ3FX6b8xLKekJmLand5tgZHZSZn1 sxU89Tnd9u/8wJ2alxj0uGM5lR3RiwPAteie X-Google-Smtp-Source: AMsMyM76cmhi7yJSt28cZlYREOVbq0joiiSzhjw0qGOsIJxwD41vfqWSf65r5sQp+riItjcrE3VeLg== X-Received: by 2002:a05:6870:630f:b0:132:8af2:c8f2 with SMTP id s15-20020a056870630f00b001328af2c8f2mr7183365oao.284.1666910504054; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:43 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:31 -0500 Message-Id: <20221027224135.348115-7-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 06/10] ipa: raspberry: replace abs() with std::abs() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth pwl.cpp uses abs() instead of std::abs(), which causes unexpected behavior in the Clang compiler used for Android. Replace with C++-standard absolute value function std::abs(), which supports double-precision absolute values in a standard way. Signed-off-by: Nicholas Roth --- src/ipa/raspberrypi/controller/pwl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/controller/pwl.cpp b/src/ipa/raspberrypi/controller/pwl.cpp index c59f5fa1..70c2e24b 100644 --- a/src/ipa/raspberrypi/controller/pwl.cpp +++ b/src/ipa/raspberrypi/controller/pwl.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include "pwl.h" @@ -168,7 +169,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const while (thisSpan != (int)points_.size() - 1) { double dx = points_[thisSpan + 1].x - points_[thisSpan].x, dy = points_[thisSpan + 1].y - points_[thisSpan].y; - if (abs(dy) > eps && + if (std::abs(dy) > eps && otherSpan + 1 < (int)other.points_.size() && points_[thisSpan + 1].y >= other.points_[otherSpan + 1].x + eps) { @@ -181,7 +182,7 @@ Pwl Pwl::compose(Pwl const &other, const double eps) const points_[thisSpan].y) * dx / dy; thisY = other.points_[++otherSpan].x; - } else if (abs(dy) > eps && otherSpan > 0 && + } else if (std::abs(dy) > eps && otherSpan > 0 && points_[thisSpan + 1].y <= other.points_[otherSpan - 1].x - eps) { /* From patchwork Thu Oct 27 22:41:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17708 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 94B91C3285 for ; Thu, 27 Oct 2022 22:41:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4105962FC7; Fri, 28 Oct 2022 00:41:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910514; bh=DdOeO4Y73eQfxf8oqth1QoKEXEDG56YIYNMB+7UXQco=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=sxwqL9OL4tVILrBD5ev3B1bpLnpGuti20LInaPeCTerU5X3FVeqfdFqbU53oaRIEr moLL8ki+ZMZoJDpaFPJ4DuEl+B/TcANJh6cz+4IWvoXFLojCfQMXgZpBfzUq9cv67W UmBwtk3D11rgsXyu3c/W7jg6k+FXxONVAS2Jb+Pea9QbVTQdU3iDwjtkofe9Nl5VNV gu8rnqbgotlHbor+82AQr8psswywqRDTdGSovdXRV6hgQTfhk6KOVDyOnrhklc/Hdp UmGjKKjWhY7BObwsxedQkYqH93ejj5wtgE7QyXG/3NH8USFJ1GLy2pV4t/7qaEu8B4 lnTVTa6icdecQ== Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A6DE962FA3 for ; Fri, 28 Oct 2022 00:41:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="moDM8UQo"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-13c569e5ff5so3924659fac.6 for ; Thu, 27 Oct 2022 15:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=53GjDLX02zSG1mRkq78FTX8/GBMkyCcDPMdpbL8fvGw=; b=moDM8UQooQl5RToLF+Kk+v6jlK4on+MCD28ZFa/OJ5CC2uSKgBzfSuAcPtHnZPESKF +crceF2AVQbedBgiFRWiqt6MAYJhtcYh+lbX/D1fD2sDnGdMffc8WNVR+9uDLStvDOGK WtKT5CXZu+aaj4shMvRWJCHbpXg+WokAFlgkxZIdYn09oUiTJ9jWC4TkDK5XTBP6C/wt TOvpRlOi2n/jEQTWwHBDsubUhHq+N6RVQvHoXjvTKguu5kgVek7nXyPNhqjisV6aLNN2 RtZxQJUy9xf6pgWzDMqAvOsKA9jVL8+V4YCcUt8eI6pHo/a2qx1DDUd2NiSQw0cDAufZ Px1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=53GjDLX02zSG1mRkq78FTX8/GBMkyCcDPMdpbL8fvGw=; b=2kJm/9tYmT5Km+mzR9/XnqHHtOjPLxykdbFEZSdJT5Wei40p3CQhE+FTRvJXmlWvw+ gE5mvYQ38ZdZYjrRwmEQ6HHL5oVhuL86IVVWA7H0zkw1cL0hOC93eIXfz79ljqNqRQ/x ppmEjxb7ratJcYaJMB5+1C2qEJfrDNz7xmw2Wj5uEH/BOCxo4/y/8vfZ1Dso4Q1TAAu1 jrGkYkI/kU2Q66Hs7F9/PUqVhnJInaiM0h42eAKzqUbGXrB6r8a0FEZHszBXckelca26 d89Nv2At7vj9OW20kfJUEqHod1yDZp4yAKKJVaSt2BWA0Ctpgg4KsUZmEbsKFI4T2G7U 1yZw== X-Gm-Message-State: ACrzQf2xzjUXEA4/zo1iAkWOrBN0384rXV9Wyna9q0tLWKx07u2mMxSE HNiAQU+nzg4GhlPXfkcjrmeCvKYdaQl6xkKC X-Google-Smtp-Source: AMsMyM67RqVI+1tYEIQrW9p3xTW62YizYxx9blcCPc04vSHy4cKyotoursw1Rqp6+MR+ikk3aFynHw== X-Received: by 2002:a05:6870:c105:b0:12c:8f0c:e23c with SMTP id f5-20020a056870c10500b0012c8f0ce23cmr6808412oad.42.1666910504871; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:44 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:32 -0500 Message-Id: <20221027224135.348115-8-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 07/10] libcamera: make libdl optional when provided X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, libdl is always required. Sometimes, the C++ runtime includes a dynamic loader, which is the case for Android. Additionally, Android 11 does not have libdl. This fix allows libcamera to build on Android. Signed-off-by: Nicholas Roth --- src/libcamera/meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 5f39d2e2..0494e808 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -65,7 +65,12 @@ subdir('ipa') subdir('pipeline') subdir('proxy') -libdl = cc.find_library('dl') +null_dep = dependency('', required : false) + +libdl = null_dep +if not cc.has_function('dlopen') + libdl = cc.find_library('dl') +endif libudev = dependency('libudev', required : false) libyaml = dependency('yaml-0.1', required : false) From patchwork Thu Oct 27 22:41:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17709 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8E42BBDB16 for ; Thu, 27 Oct 2022 22:41:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 16E7662FA5; Fri, 28 Oct 2022 00:41:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910515; bh=uYdZd5ooHVKC5fykrTFeNa3vGKYdFi9HN0ca8IDJYbQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=xF3nEfk8FquvSRAkYvF2uoEXtb6kg1k2psn9WOKG/3ca0+fJgaPCQzLTtZr6zi1vM Qw+A8DDKQD7wZGvc3qYfSTWuTLC5QJrNQcLbG8gpeHxNqq2rZZIV640vo2QeOJkBfd aodUIBgfxJy0xYWW/o3XZI3Un+n8/a4aIuhrBwN89Llzo5fn+V0iVDmJvdocUnjmyT h2G0+Q9xJpGgSxrHb7t8uNRXdjtQTrcVbtANC8F0lSHVql0mrNAzmjIMYmW3UkP82S +EfaW9iJ7afbYAP06HESZCG1b9pHwnkI8rkGyQUhEchbG5TLu09S3kIw9zfN+Cdejl 9z3WqXkc6PZsw== Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3266862FB7 for ; Fri, 28 Oct 2022 00:41:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="fyu7ZpZr"; dkim-atps=neutral Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-13b6c1c89bdso4265871fac.13 for ; Thu, 27 Oct 2022 15:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=OrR17ZcndUu6E8+nQhvZfP/G7yO3m+iusFv1/hMho8o=; b=fyu7ZpZrV6qBrdECnuk9etbBmRbAGdyEKtJsmnmrWsF3aP71JWcUZGnC++39X8+Pzk e4m7/goUXJ5QM/iY9CI1+SIzlJe0/x88CFAjvT4xVMYvlix9TzcB0yy/+qHWpVBo4iqf zdiaWN2YvHqLUud3RR78l9FNRL9WXiu5lHI5gIIt5Aw7v74pAJuhll3O6GHQHK0xwVjG yiaND0CzjnGVXDdRNU60F9VN6vxY5eBsgLYbV5zquQ406IvjFicxGqxKhwKyoMvJxMoZ jCw8Sk3vZ9KITwLNYvXcf5XHpJjXSrZbayYIO/55Nn+w2PSg74qF6vIGZHOsTX6Rnvbm R85Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OrR17ZcndUu6E8+nQhvZfP/G7yO3m+iusFv1/hMho8o=; b=pH2E4oBb73PMETRB18keyuOtrdGTyVcHsGDs6Q/fz/cDohmpOCPVsRXXtGzMl7uNfd BFGLyVJUaRKqxlYO5o/K9eZscXLNIyHlorXe3eQ5/mn52GZ6FXmT/NlPUSC5psc1b3Nz ULAjGN6xn+PaiE/+I+YjQj8xZUjQdBpiEBnj71tsKO7BPQeSOOBm+MTLCjLq7cyHpwgd KLGj1mQuiocoxbWL6sUij+PZWVU5Q+H7aUBz5rFCRNUtj3w5qx5l45/8dp8uj0oq0cH3 i0XcPrM5I1ii8Na0LFGP8TSnVpwOldxXO2SFe4uaJ/mtRUebnEMJ4G4/k+roYWox2tpI Z2OA== X-Gm-Message-State: ACrzQf0VMXNgiUFUw82BT0gv9dFhuqdU1Xs/aaAtZlsBIblnclDYWDkQ KK4T/B7j43JIhMFeLipyNAajSQw8Hglwr+u9 X-Google-Smtp-Source: AMsMyM5IgxU23/MFkUlTd6y8q/Ux3Lrz0XHs1V4KyJppW0cpOSAdWNJcBc+u7Q77GoRqtW9FvcPCZg== X-Received: by 2002:a05:6870:e990:b0:13a:eda9:d12d with SMTP id r16-20020a056870e99000b0013aeda9d12dmr6966232oao.128.1666910505338; Thu, 27 Oct 2022 15:41:45 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:45 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:33 -0500 Message-Id: <20221027224135.348115-9-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 08/10] android: add makefiles to build inline with AOSP X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, while libcamera advertises Android support, there is no easy way to integrate libcamera into an Android distribution. This commit adds makefiles that allow libcamera to build inline with AOSP, with one example of how to do so documented in [0]. Note that meson_cross.mk is adapted from the Mesa project [1]. As Android support matures, it will be useful to document how to integrate libcamera for distribution owners [Bug]. [0] https://docs.google.com/document/d/1Sly_VH3w6wFIdE72WXijQegoHZh8IxEnJ9m0hH7GodU/edit [1] https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/android/mesa3d_cross.mk Bug https://bugs.libcamera.org/show_bug.cgi?id=164 Signed-off-by: Nichoals Roth --- android/Android.mk | 86 ++++++++++++ android/meson_cross.mk | 298 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+) create mode 100644 android/Android.mk create mode 100644 android/meson_cross.mk diff --git a/android/Android.mk b/android/Android.mk new file mode 100644 index 00000000..ff0d1472 --- /dev/null +++ b/android/Android.mk @@ -0,0 +1,86 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2021, GlobalLogic Ukraine +# Copyright (C) 2021, Roman Stratiienko (r.stratiienko@gmail.com) +# +# Android.mk - Android makefile +# + +ifneq ($(filter true, $(BOARD_LIBCAMERA_USES_MESON_BUILD)),) + +LOCAL_PATH := $(call my-dir) +LIBCAMERA_TOP := $(dir $(LOCAL_PATH)) +LIBCAMERA_MESON_VERSION := .0.0.1 + +include $(CLEAR_VARS) + +LOCAL_SHARED_LIBRARIES := libc libexif libjpeg libyuv_chromium libdl libyaml +MESON_GEN_PKGCONFIGS := libexif libjpeg yaml-0.1 libyuv dl + +ifeq ($(TARGET_IS_64_BIT),true) +LOCAL_MULTILIB := 64 +else +LOCAL_MULTILIB := 32 +endif +include $(LOCAL_PATH)/meson_cross.mk + +ifdef TARGET_2ND_ARCH +LOCAL_MULTILIB := 32 +include $(LOCAL_PATH)/meson_cross.mk +endif + +#------------------------------------------------------------------------------- + +define libcamera-lib +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_MODULE := $1 +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_RELATIVE_PATH := $2 +ifdef TARGET_2ND_ARCH +LOCAL_SRC_FILES_$(TARGET_ARCH) := $(call relative_top_path,$(LOCAL_PATH))$($3) +LOCAL_SRC_FILES_$(TARGET_2ND_ARCH) := $(call relative_top_path,$(LOCAL_PATH))$(2ND_$3) +LOCAL_MULTILIB := both +else +LOCAL_SRC_FILES := $(call relative_top_path,$(LOCAL_PATH))$($3) +endif +LOCAL_CHECK_ELF_FILES := false +LOCAL_MODULE_SUFFIX := .so$(${4}) +include $(BUILD_PREBUILT) +include $(CLEAR_VARS) +endef + +__MY_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES) +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := $(__MY_SHARED_LIBRARIES) + +# Modules 'libcamera', produces '/vendor/lib{64}/libcamera.so' +$(eval $(call libcamera-lib,libcamera,,LIBCAMERA_BIN,LIBCAMERA_MESON_VERSION)) +# Modules 'libcamera-base', produces '/vendor/lib{64}/libcamera-base.so' +$(eval $(call libcamera-lib,libcamera-base,,LIBCAMERA_BASE_BIN,LIBCAMERA_MESON_VERSION)) +# Modules 'ipa_rkisp1', produces '/vendor/lib{64}/ipa_rkisp1.so' +$(eval $(call libcamera-lib,ipa_rkisp1,,LIBCAMERA_IPA_RKISP1_BIN,)) +# Modules 'ipa_rkisp1', produces '/vendor/lib{64}/ipa_rpi.so' +$(eval $(call libcamera-lib,ipa_rpi,,LIBCAMERA_IPA_RASPBERRYPI_BIN,)) +# Modules 'ipa_rkisp1', produces '/vendor/lib{64}/ipa_ipu3.so' +$(eval $(call libcamera-lib,ipa_ipu3,,LIBCAMERA_IPA_IPU3_BIN,)) +# Modules 'ipa_rkisp1', produces '/vendor/lib{64}/ipa_vimc.so' +$(eval $(call libcamera-lib,ipa_vimc,,LIBCAMERA_IPA_VIMC_BIN,)) + +# Modules 'camera.libcamera', produces '/vendor/lib{64}/hw/camera.libcamera.so' HAL +$(eval $(call libcamera-lib,camera.libcamera,hw,LIBCAMERA_HAL_BIN,)) + +LOCAL_SHARED_LIBRARIES += libcamera libcamera-base ipa_rkisp1 ipa_rpi ipa_ipu3 ipa_vimc +LOCAL_REQUIRED_MODULES := libcamera libcamera-base ipa_rkisp1 ipa_rpi ipa_ipu3 ipa_vimc + +$(shell mkdir -p $(TARGET_OUT_VENDOR_ETC)/rkisp1/) +$(shell mkdir -p $(TARGET_OUT_VENDOR_ETC)/rpi/) +$(shell mkdir -p $(TARGET_OUT_VENDOR_ETC)/ipu3/) +$(shell mkdir -p $(TARGET_OUT_VENDOR_ETC)/vimc/) +$(shell cp $(LIBCAMERA_IPA_RKISP1_CONFIGS)/* $(TARGET_OUT_VENDOR_ETC)/rkisp1/) +$(shell cp $(LIBCAMERA_IPA_RASPBERRYPI_CONFIGS)/* $(TARGET_OUT_VENDOR_ETC)/rpi/) +$(shell cp $(LIBCAMERA_IPA_IPU3_CONFIGS)/* $(TARGET_OUT_VENDOR_ETC)/ipu3/) +$(shell cp $(LIBCAMERA_IPA_VIMC_CONFIGS)/* $(TARGET_OUT_VENDOR_ETC)/vimc/) + +#------------------------------------------------------------------------------- + +endif diff --git a/android/meson_cross.mk b/android/meson_cross.mk new file mode 100644 index 00000000..7a222f9c --- /dev/null +++ b/android/meson_cross.mk @@ -0,0 +1,298 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2021, GlobalLogic Ukraine +# Copyright (C) 2021, Roman Stratiienko (r.stratiienko@gmail.com) +# +# meson_cross.mk - Android makefile +# + +# Turn "dir1/dir2/dir3/dir4" into "../../../../" +define relative_top_path +$(eval __s:=) \ +$(foreach tmp,$(subst /,$(space),$1),$(eval __s:=$(__s)../)) \ +$(__s) +endef + +MY_PATH := $(call my-dir) + +AOSP_ABSOLUTE_PATH := $(realpath .) + +libcam_m_dummy_$(LOCAL_MULTILIB) := $(TARGET_OUT_INTERMEDIATES)/LIBCAM_DUMMY_$(LOCAL_MULTILIB)/dummy.c + +$(libcam_m_dummy_$(LOCAL_MULTILIB)): + mkdir -p $(dir $@) + touch $@ + +LOCAL_SRC_FILES := $(call relative_top_path,$(MY_PATH))$(libcam_m_dummy_$(LOCAL_MULTILIB)) +LOCAL_VENDOR_MODULE := true +LOCAL_MODULE := libcam.dummy.$(LOCAL_MULTILIB) + +# Prepare intermediate variables by AOSP make/core internals +include $(BUILD_SHARED_LIBRARY) + +LOCAL_PATH := $(MY_PATH) + +link_deps := \ + $(built_static_libraries) \ + $(built_shared_libraries) \ + $(built_whole_libraries) \ + $(strip $(all_objects)) \ + $(my_target_libatomic) \ + $(my_target_libcrt_builtins) \ + $(my_target_crtbegin_so_o) \ + $(my_target_crtend_so_o) + +# Build using intermediate variables provided by AOSP make/core internals +M_TARGET_PREFIX := $(my_2nd_arch_prefix) + +LIBCAMERA_LIB_DIR := lib$(subst 32,,$(LOCAL_MULTILIB)) + +MESON_OUT_DIR := $($(M_TARGET_PREFIX)TARGET_OUT_INTERMEDIATES)/MESON_LIBCAMERA +MESON_GEN_DIR := $(MESON_OUT_DIR)_GEN +MESON_GEN_FILES_TARGET := $(MESON_GEN_DIR)/.timestamp + +$(M_TARGET_PREFIX)LIBCAMERA_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera.so +$(M_TARGET_PREFIX)LIBCAMERA_HAL_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera-hal.so +$(M_TARGET_PREFIX)LIBCAMERA_BASE_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera-base.so +$(M_TARGET_PREFIX)LIBCAMERA_IPA_RKISP1_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera/ipa_rkisp1.so +$(M_TARGET_PREFIX)LIBCAMERA_IPA_RASPBERRYPI_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera/ipa_rpi.so +$(M_TARGET_PREFIX)LIBCAMERA_IPA_IPU3_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera/ipa_ipu3.so +$(M_TARGET_PREFIX)LIBCAMERA_IPA_VIMC_BIN := $(MESON_OUT_DIR)/install/usr/local/lib/libcamera/ipa_vimc.so +$(M_TARGET_PREFIX)LIBCAMERA_IPA_RKISP1_CONFIGS := $(MESON_OUT_DIR)/install/usr/local/share/libcamera/ipa/rkisp1 +$(M_TARGET_PREFIX)LIBCAMERA_IPA_RASPBERRYPI_CONFIGS := $(MESON_OUT_DIR)/install/usr/local/share/libcamera/ipa/raspberrypi +$(M_TARGET_PREFIX)LIBCAMERA_IPA_IPU3_CONFIGS := $(MESON_OUT_DIR)/install/usr/local/share/libcamera/ipa/ipu3 +$(M_TARGET_PREFIX)LIBCAMERA_IPA_VIMC_CONFIGS := $(MESON_OUT_DIR)/install/usr/local/share/libcamera/ipa/vimc + +LIBCAMERA_BINS := \ + $($(M_TARGET_PREFIX)LIBCAMERA_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_HAL_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_BASE_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_IPA_RKISP1_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_IPA_RASPBERRYPI_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_IPA_IPU3_BIN) \ + $($(M_TARGET_PREFIX)LIBCAMERA_IPA_VIMC_BIN) + +MESON_GEN_NINJA := \ + cd $(MESON_OUT_DIR) && PATH=/usr/bin:/usr/local/bin:$$PATH meson ./build \ + --cross-file $(AOSP_ABSOLUTE_PATH)/$(MESON_GEN_DIR)/aosp_cross \ + --buildtype=release \ + -Dandroid=enabled \ + -Dipas=$(subst $(space),$(comma),$(BOARD_LIBCAMERA_IPAS)) \ + -Dpipelines=$(subst $(space),$(comma),$(BOARD_LIBCAMERA_PIPELINES)) \ + -Dsysconfdir=/vendor/etc \ + -Dtest=false \ + -Dwerror=false \ + -Dallow_unsigned_ipas_in_process=true + +MESON_BUILD := PATH=/usr/bin:/bin:/sbin:$$PATH ninja -C $(MESON_OUT_DIR)/build + +$(MESON_GEN_FILES_TARGET): MESON_CPU_FAMILY := $(subst arm64,aarch64,$(TARGET_$(M_TARGET_PREFIX)ARCH)) + +define create-pkgconfig +echo -e "Name: $2" \ + "\nDescription: $2" \ + "\nVersion: $3" > $1/$2.pc + +endef + +# Taken from build/make/core/binary.mk. We need this +# to use definitions from build/make/core/definitions.mk +$(MESON_GEN_FILES_TARGET): PRIVATE_GLOBAL_C_INCLUDES := $(my_target_global_c_includes) +$(MESON_GEN_FILES_TARGET): PRIVATE_GLOBAL_C_SYSTEM_INCLUDES := $(my_target_global_c_system_includes) + +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_GLOBAL_CONLYFLAGS := $(my_target_global_conlyflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(my_target_global_cppflags) + +$(MESON_GEN_FILES_TARGET): PRIVATE_2ND_ARCH_VAR_PREFIX := $(M_TARGET_PREFIX) +$(MESON_GEN_FILES_TARGET): PRIVATE_CC := $(my_cc) +$(MESON_GEN_FILES_TARGET): PRIVATE_LINKER := $(my_linker) +$(MESON_GEN_FILES_TARGET): PRIVATE_CXX := $(my_cxx) +$(MESON_GEN_FILES_TARGET): PRIVATE_CXX_LINK := $(my_cxx_link) +$(MESON_GEN_FILES_TARGET): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS) +$(MESON_GEN_FILES_TARGET): PRIVATE_ASFLAGS := $(my_asflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_CONLYFLAGS := $(my_conlyflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_CFLAGS := $(my_cflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_CPPFLAGS := $(my_cppflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_CFLAGS_NO_OVERRIDE := $(my_cflags_no_override) +$(MESON_GEN_FILES_TARGET): PRIVATE_CPPFLAGS_NO_OVERRIDE := $(my_cppflags_no_override) +$(MESON_GEN_FILES_TARGET): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG) +$(MESON_GEN_FILES_TARGET): PRIVATE_DEBUG_CFLAGS := $(debug_cflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_C_INCLUDES := $(my_c_includes) +$(MESON_GEN_FILES_TARGET): PRIVATE_IMPORTED_INCLUDES := $(imported_includes) +$(MESON_GEN_FILES_TARGET): PRIVATE_LDFLAGS := $(my_ldflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_LDLIBS := $(my_ldlibs) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_TIDY_CHECKS := $(my_tidy_checks) +$(MESON_GEN_FILES_TARGET): PRIVATE_TIDY_FLAGS := $(my_tidy_flags) +$(MESON_GEN_FILES_TARGET): PRIVATE_ARFLAGS := $(my_arflags) +$(MESON_GEN_FILES_TARGET): PRIVATE_ALL_SHARED_LIBRARIES := $(built_shared_libraries) +$(MESON_GEN_FILES_TARGET): PRIVATE_ALL_STATIC_LIBRARIES := $(built_static_libraries) +$(MESON_GEN_FILES_TARGET): PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(built_whole_libraries) +$(MESON_GEN_FILES_TARGET): PRIVATE_ALL_OBJECTS := $(strip $(all_objects)) + +$(MESON_GEN_FILES_TARGET): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags) + +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_LIBCRT_BUILTINS := $(my_target_libcrt_builtins) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_CRTBEGIN_SO_O := $(my_target_crtbegin_so_o) +$(MESON_GEN_FILES_TARGET): PRIVATE_TARGET_CRTEND_SO_O := $(my_target_crtend_so_o) +## + +define m-lld-flags + -nostdlib -Wl,--gc-sections \ + $(PRIVATE_TARGET_CRTBEGIN_SO_O) \ + $(PRIVATE_ALL_OBJECTS) \ + -Wl,--whole-archive \ + $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \ + -Wl,--no-whole-archive \ + $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \ + $(PRIVATE_ALL_STATIC_LIBRARIES) \ + $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ + $(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_COVERAGE_LIB)) \ + $(PRIVATE_TARGET_LIBCRT_BUILTINS) \ + $(PRIVATE_TARGET_LIBATOMIC) \ + $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ + $(PRIVATE_LDFLAGS) \ + $(PRIVATE_ALL_SHARED_LIBRARIES) \ + $(PRIVATE_TARGET_CRTEND_SO_O) \ + $(PRIVATE_LDLIBS) +endef + +define m-lld-flags-cleaned + $(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/, \ + $(subst out/,$(AOSP_ABSOLUTE_PATH)/out/, \ + $(subst -Wl$(comma)--fatal-warnings,, \ + $(subst -Wl$(comma)--no-undefined-version,, \ + $(subst -Wl$(comma)--gc-sections,, \ + $(patsubst %dummy.o,, \ + $(m-lld-flags))))))) +endef + +define m-cpp-flags + $(PRIVATE_TARGET_GLOBAL_CFLAGS) \ + $(PRIVATE_TARGET_GLOBAL_CPPFLAGS) \ + $(PRIVATE_ARM_CFLAGS) \ + $(PRIVATE_RTTI_FLAG) \ + $(PRIVATE_CFLAGS) \ + $(PRIVATE_CPPFLAGS) \ + $(PRIVATE_DEBUG_CFLAGS) \ + $(PRIVATE_CFLAGS_NO_OVERRIDE) \ + $(PRIVATE_CPPFLAGS_NO_OVERRIDE) +endef + +define m-c-flags + $(PRIVATE_TARGET_GLOBAL_CFLAGS) \ + $(PRIVATE_TARGET_GLOBAL_CONLYFLAGS) \ + $(PRIVATE_ARM_CFLAGS) \ + $(PRIVATE_CFLAGS) \ + $(PRIVATE_CONLYFLAGS) \ + $(PRIVATE_DEBUG_CFLAGS) \ + $(PRIVATE_CFLAGS_NO_OVERRIDE) +endef + +define filter-c-flags + $(subst -std=gnu++17,, \ + $(subst -stdlib=libc++,, \ + $(subst -fno-rtti,, \ + $(patsubst -W%,, \ + $1)))) +endef + +define m-c-includes-common +$(addprefix -I , $(PRIVATE_C_INCLUDES)) \ +$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),,\ + $(addprefix -I ,\ + $(filter-out $(PRIVATE_C_INCLUDES), \ + $(PRIVATE_GLOBAL_C_INCLUDES))) \ + $(addprefix -isystem ,\ + $(filter-out $(PRIVATE_C_INCLUDES), \ + $(PRIVATE_GLOBAL_C_SYSTEM_INCLUDES)))) +endef + +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 30; echo $$?), 0) +# Android 11+ +define m-c-includes +$(foreach i,$(PRIVATE_IMPORTED_INCLUDES),$(EXPORTS.$(i)))\ +$(m-c-includes-common) +endef +define postprocess-includes +endef +else +# Android 10,9 +$(MESON_GEN_FILES_TARGET): PRIVATE_IMPORT_INCLUDES := $(import_includes) +define postprocess-includes + echo " $$(cat $(PRIVATE_IMPORT_INCLUDES)) " > $(MESON_GEN_DIR)/import_includes && \ + sed -i -e ':a;N;$$!ba;s/\n/ /g' \ + -e 's# \{2,\}# #g' \ + -e 's# -isystem # -isystem#g' \ + -e 's# -I # -I#g' \ + -e 's# -I# -I$(AOSP_ABSOLUTE_PATH)/#g' \ + -e 's# -isystem# -isystem$(AOSP_ABSOLUTE_PATH)/#g' \ + -e "s# #','#g" $(MESON_GEN_DIR)/import_includes && \ + sed -i "s#<_IMPORT_INCLUDES>#$$(cat $(MESON_GEN_DIR)/import_includes)#g" $(MESON_GEN_DIR)/aosp_cross +endef +define m-c-includes +<_IMPORT_INCLUDES> $(m-c-includes-common) +endef +endif + +define m-c-abs-includes + $(subst $(space)-isystem,$(space)-isystem$(AOSP_ABSOLUTE_PATH)/, \ + $(subst $(space)-I, -I$(AOSP_ABSOLUTE_PATH)/, \ + $(subst $(space)-I$(space),$(space)-I, \ + $(subst $(space)-isystem$(space),$(space)-isystem, \ + $(strip $(m-c-includes)))))) +endef + +$(MESON_GEN_FILES_TARGET): MESON_GEN_PKGCONFIGS:=$(MESON_GEN_PKGCONFIGS) +$(MESON_GEN_FILES_TARGET): MESON_GEN_DIR:=$(MESON_GEN_DIR) +$(MESON_GEN_FILES_TARGET): $(sort $(shell find -L $(LIBCAMERA_TOP) -not -path '*/\.*')) + mkdir -p $(dir $@) + echo -e "[properties]\n" \ + "c_args = [$(foreach flag, $(call filter-c-flags,$(m-c-flags) $(m-c-abs-includes)),'$(flag)', )'']\n" \ + "cpp_args = [$(foreach flag, $(call filter-c-flags,$(m-cpp-flags) $(m-c-abs-includes)),'$(flag)', )'']\n" \ + "c_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \ + "cpp_link_args = [$(foreach flag, $(m-lld-flags-cleaned),'$(flag)',)'']\n" \ + "needs_exe_wrapper = true\n" \ + "[binaries]\n" \ + "ar = '$(AOSP_ABSOLUTE_PATH)/$($($(M_TARGET_PREFIX))TARGET_AR)'\n" \ + "c = [$(foreach arg,$(PRIVATE_CC),'$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/,$(arg))',)'']\n" \ + "cpp = [$(foreach arg,$(PRIVATE_CXX),'$(subst prebuilts/,$(AOSP_ABSOLUTE_PATH)/prebuilts/,$(arg))',)'']\n" \ + "c_ld = 'lld'\n" \ + "cpp_ld = 'lld'\n\n" \ + "pkgconfig = ['env', 'PKG_CONFIG_LIBDIR=' + '$(AOSP_ABSOLUTE_PATH)/$(MESON_GEN_DIR)', '/usr/bin/pkg-config']\n\n" \ + "llvm-config = '/dev/null'\n" \ + "[host_machine]\n" \ + "system = 'linux'\n" \ + "cpu_family = '$(MESON_CPU_FAMILY)'\n" \ + "cpu = '$(MESON_CPU_FAMILY)'\n" \ + "endian = 'little'" > $(dir $@)/aosp_cross + + # + $(foreach pkg, $(MESON_GEN_PKGCONFIGS), $(call create-pkgconfig,$(dir $@),$(word 1, $(subst :, ,$(pkg))),$(word 2, $(subst :, ,$(pkg))))) + touch $@ + +$(MESON_OUT_DIR)/.build.timestamp: MESON_GEN_NINJA:=$(MESON_GEN_NINJA) +$(MESON_OUT_DIR)/.build.timestamp: MESON_BUILD:=$(MESON_BUILD) +$(MESON_OUT_DIR)/.build.timestamp: $(MESON_GEN_FILES_TARGET) $(link_deps) + rm -rf $(dir $@) + mkdir -p $(dir $@) + mkdir -p $(dir $@)/build + # Meson will update timestamps in sources directory, continuously retriggering the build + # even if nothing changed. Copy sources into intermediate dir to avoid this effect. + cp -r $(LIBCAMERA_TOP)/* $(dir $@) + $(MESON_GEN_NINJA) + $(MESON_BUILD) + touch $@ + +$(MESON_OUT_DIR)/install/.install.timestamp: MESON_BUILD:=$(MESON_BUILD) +$(MESON_OUT_DIR)/install/.install.timestamp: $(MESON_OUT_DIR)/.build.timestamp + rm -rf $(dir $@) + mkdir -p $(dir $@) + DESTDIR=$(AOSP_ABSOLUTE_PATH)/$(dir $@) $(MESON_BUILD) install + touch $@ + +$(LIBCAMERA_BINS): $(MESON_OUT_DIR)/install/.install.timestamp + echo "Build $@" + touch $@ From patchwork Thu Oct 27 22:41:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17710 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7A48DC3287 for ; Thu, 27 Oct 2022 22:41:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D83562FC0; Fri, 28 Oct 2022 00:41:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910516; bh=uPfBp734F70Nl4/faDEoCE+469eSaTe+2TU432+CN6U=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=yjIRSARoHBOjo66O5E27TC/XhpnJQJxXyYikcDvqk18ox70xhsvyKoxr6OKG2Sbcw ZvlAcCaI2DlrKONVP6xZMnrzd65qzz6wZMgSfFyRnHMWFKHDSiUJRDUXMg0OhXQVDC 77N+lh9TbMiSgfumSh+Pw478FNUnsF9JOgS6WdN1lcV3PoPkbH6ITWuuFrDPjLE1w9 rNVdby16DemYq2e1hAs6IwLCyhQnNNM8qjQzCIUdh44c7WfNLYCXuyHEqmSxsUQIyJ 3XaK9kBXxJgtV/bxXV7zbk0lPo2+NaRHxvV+/HZc65hKfrXZsqkhol9jc1XnmiBYIs xJyi1Tb4rYflw== Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A48162FB9 for ; Fri, 28 Oct 2022 00:41:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="XjHWY/fT"; dkim-atps=neutral Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-13c2cfd1126so4285130fac.10 for ; Thu, 27 Oct 2022 15:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=S6elEshRjeYKV2WspXbwSeu79nOguOd5x4rDscK6N9Y=; b=XjHWY/fT10u7B3XV60RdQjUOVtL3aCG4n8bdU3PP0buCI4nDe0ujmcDA11xkh51S7Y 5tDpx+THN035gzqamFEV5rr3q8KcDo08LZFRmmdrzVmkqB61QuTK2Ty7reElZ/J9X6fz tRzKCaaq49njOMQbEUTip/tA98+n8gTzjo4YFmIn0zP6ex/Trvt9fNPwTXI08xrpAd9V 4fNONgpAFXX0FYgAh6qiXhmqoRM3qMuez8Y8/CArDCRVCbI5yDc446Dmz+NJWFOW13WP JSROGhtky8zrmsfOrPIMNNxo/9yKSHpr75HeovU0GYekmtSZEUIDbwQoz3bbx21qFxSN Xw+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=S6elEshRjeYKV2WspXbwSeu79nOguOd5x4rDscK6N9Y=; b=FYzcLlDXw9NDwyWVV1fHFj/IGVndqwRU6rDPJyWAaRNSQm76V7FjToCH0YgxFqk9tm k1ouc4KMtyCebJwKanYRppanRE+JaQa34zra20hk9yXD06tFkoXBXPb92z1fPMG6o6nj T8Pa8/njhK2Ea6yJ0xWaaSNnlZpl1A1vdZGtQRZ67NzkSRfYCBPigFIj6nN3v365cmS5 dO2fOg/eLZj3zx3vwXaBvYnyXxs6UVWoYRasrM1yiSvDwG6ZXrqh1j4vtwKbY/1emH0/ 64xrli8VtEfrxZ9GHdMxu7yDdmU2ucrsFeuJDkC1AkTXAlXkDmkctLpSGpkN/f0vez2m dz6Q== X-Gm-Message-State: ACrzQf1/dkjsEGa7rT+xEDcFehBenOwibcpe1DqqHUzQ9XFbOJaiPgNo OxrkvLmV5M4yNjsvnwZ+4Jjgh9CYUCHpq4Nc X-Google-Smtp-Source: AMsMyM7itiP4r+T7RybKnWlNNyOKTzwF6HywXPwLyY/sTYyVU57ptLlkAqwfIkaXbG25eq43wBRZeg== X-Received: by 2002:a05:6870:c897:b0:11b:de9f:57c2 with SMTP id er23-20020a056870c89700b0011bde9f57c2mr6884800oab.267.1666910505867; Thu, 27 Oct 2022 15:41:45 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:45 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:34 -0500 Message-Id: <20221027224135.348115-10-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 09/10] ipa: add a flag to disable isolation for Android X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, libcamera isolates any IPAs whose signatures cannot be verified. Shared objects are created at build-time, and then signed. The public signing key is embedded in a .cpp file, and libcamera verifies IPA signatures at runtime. When libcamera cannot authenticate an IPA, it runs it out-of-process. This is problematic on three levels: * IPA signing fundamentally does not work on Android for vendor modules like HALs (discussed below) * Executables built to run out-of-process are not ABI-compatible with Android, making isolation infeasible [1] * Linux phone hardware tends to be low-end because of the FOSS requirement, so the performance hit from out-of-process IPA isolation is significant IPA signing fundamentally does not work for Android vendor modules: After we "meson install" built .so files to a known location, Android explicitly access them in PREBUILT_SHARED_LIBRARY or BUILD_PREBUILIT to transform the .so files by stripping symbols among other things [2]. By modifying prebuilt libraries after we have already signed them, the build system renders our signatures useless on Android. Android distribution maintainers can use this flag to disable signature verification, which will allow them to use libcamera. [1] https://github.com/waydroid/waydroid/issues/519 [2] https://cs.android.com/android/platform/superproject/+/master:build/make/core/cc_prebuilt_internal.mk?q=cc_prebuilt_internal Signed-off-by: Nicholas Roth --- meson.build | 4 ++++ meson_options.txt | 5 +++++ src/libcamera/ipa_manager.cpp | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/meson.build b/meson.build index 56910698..883847ef 100644 --- a/meson.build +++ b/meson.build @@ -74,6 +74,10 @@ if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOUR config_h.set('HAVE_SECURE_GETENV', 1) endif +if get_option('allow_unsigned_ipas_in_process') + config_h.set('ALLOW_UNSIGNED_IPAS_IN_PROCESS', 1) +endif + common_arguments = [ '-Wshadow', '-include', meson.current_build_dir() / 'config.h', diff --git a/meson_options.txt b/meson_options.txt index f1d67808..77b21b9a 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -64,3 +64,8 @@ option('pycamera', type : 'feature', value : 'disabled', description : 'Enable libcamera Python bindings (experimental)') + +option('allow_unsigned_ipas_in_process', + type : 'boolean', + value : false, + description : 'Allow unsigned IPAs to run in libcamera\'s address space') diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index 030ef43f..403cc42a 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -114,6 +114,14 @@ IPAManager::IPAManager() LOG(IPAManager, Warning) << "Public key not valid"; #endif +#if ALLOW_UNSIGNED_IPAS_IN_PROCESS + LOG(IPAManager, Warning) + << "All IPAs running in-process without signature verification." + << " This is recommended only for tightly-managed installs" + << " in contexts where both signature verification and out-of-process" + << " execution are infeasible, such as Android HALs."; +#endif + unsigned int ipaCount = 0; /* User-specified paths take precedence. */ @@ -281,6 +289,9 @@ IPAModule *IPAManager::module(PipelineHandler *pipe, uint32_t minVersion, bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const { +#if ALLOW_UNSIGNED_IPAS_IN_PROCESS + return true; +#endif #if HAVE_IPA_PUBKEY char *force = utils::secure_getenv("LIBCAMERA_IPA_FORCE_ISOLATION"); if (force && force[0] != '\0') { From patchwork Thu Oct 27 22:41:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17711 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7068DC3286 for ; Thu, 27 Oct 2022 22:41:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12C1662FB6; Fri, 28 Oct 2022 00:41:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910517; bh=4cI9I6aGIOl/wLNk3I1U3Yfc+1NNIOB1z7c/6t0GvHc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=D8DTlI3TB8UEL2WtJs70xfpewTUQIMNOQSEgBuVzcP26JGsP6F6VAy6EGUQdPn1N+ +VZNq1hO/nQioRyesZzlKHn36fsXWxu2zVAFOHk7k4nSfb1LynkL9qZ4Ykv/ytJ7Si +Fq66XCAsnOMbqYqkaxJ13bv4xDYWzefgZWeTjGQ5SSEawbXdd+pg7KKS3Uw6vY6rV jCk87anL3OmhSTlmZuqoHIqMMddVPW7MY5++NZ4+oJL1WjV1kglNd+c///lTFjcGJ4 DAE4SUQFMUG+r/3Jg276qPaJGW82kq/Xc0eTeJSfUoJO7tC6KaBxUmF0b4wIoCfSLo 1QhkQfar/f+TQ== Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 72FB662FBB for ; Fri, 28 Oct 2022 00:41:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="XiwNwYcS"; dkim-atps=neutral Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-13bd19c3b68so4298373fac.7 for ; Thu, 27 Oct 2022 15:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=5HEr0S3jZfrnOtGqtZpN55hkD+04x7ylR0jwpsDxAMs=; b=XiwNwYcSqZ9hK1FALN6aOeP0k0UNWetZr2TyBTfZ6bHqFmAgWJHRUAw39VQHQKVtIA /AP49VgsptEcRdWh+h/9Yj9uJXqyOvFPFHE3MQYCPkCMz5AJIxqTJ9jt3EpA26Se3Pyx FszVLPMIYXxA0QXKu+BSwflxrqQmkar8FUrrqzLo1bdl+Xe/Jcc6R3Na90uTfAlvqLCm KSssNPqjc2v/npW1T3k2X3T5PIrxBH4Tx6vn5q1wEpMnIXtFbWi2rWaAGblnm6yYPaKq GQnLIrV5P1nHWH1a7+VvQepr4OTnlNnaky53eUE9Q36xNQgR5yaK16amtIUuthC2qpK3 5aIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5HEr0S3jZfrnOtGqtZpN55hkD+04x7ylR0jwpsDxAMs=; b=o73gL6Po74uuzHmIhOhI7oEx8rm5myXBkr+kQ9GbvWuPC1zumenh3wG0nWhYQhCmAO nKb/hn8ENkicd5Dy4dJAd73CNlPheU8W+N1hyqs54ID3q7vNeq/6AtN2pxrJp4P6Bzho qD5df7Lk11JvzOsdQNz3vUN1kUK/2TCFm6/Eh+Z8GfTGTqGd+lvMrgana6DMOvuQL13g a+CSicjAlXDp9+Zf+JIvK4mTBdnKHmoaLatdZUlOHKeKY2s+aliecmA9ZIvfxa8SAZGE RweLYMFE8sItoRHN4LjuQZwB90yhwVgQUR87S8/rjKSHFIr2UaF0t2gguEj8l6VY5onx SVxQ== X-Gm-Message-State: ACrzQf2eWvIWjFlgsq2GeAreokX9jb7r7YDX9KesyE6Sz7E1HqO82yKG Te4FbDnZulG72b/835WtDJYBAQnY6okU6V+d X-Google-Smtp-Source: AMsMyM5S7Ys2RHufpCx0JNiZnT1g5p5Wxudi2YuDWwjjVWpf7y3oxktsxwsevtesyW+q+Lh8mC9w0A== X-Received: by 2002:a05:6870:169e:b0:136:7f6a:1de0 with SMTP id j30-20020a056870169e00b001367f6a1de0mr7554022oae.71.1666910506391; Thu, 27 Oct 2022 15:41:46 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:46 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:35 -0500 Message-Id: <20221027224135.348115-11-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 10/10] android: libcamera: add useful debug prints X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth I identified opportunities to make libcamera's log output easier to understand while working to get it working on my Android device as a HAL. These additional logging statements came out of that and will hopefully prove useful to Android distribution maintainers with the same goal as mine and to users who attempt to debug tools like Waydroid. Signed-off-by: Nicholas Roth --- src/android/.camera_hal_config.cpp.swp | Bin 16384 -> 0 bytes src/android/camera_capabilities.cpp | 12 +++++++++--- src/android/camera_hal_manager.cpp | 3 ++- src/libcamera/.v4l2_subdevice.cpp.swp | Bin 0 -> 40960 bytes 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 src/android/.camera_hal_config.cpp.swp create mode 100644 src/libcamera/.v4l2_subdevice.cpp.swp GIT binary patch literal 40960 zcmeI53wR_~b>|!Wh!qy~jK+G5XFM}BrB+EQ z-0E(+x<@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B4b4!p8MxW9IuB_ELr~mMx5u z_Mjm%jM-ozEM}b97N9K>4I^D}IE#y8bGg<^Kt+WA9^Z z$4@`FC$Rsifr$PLr}(X`{kof3S00?T4GBafWQfCBM*ipH?tIFQW>_&W5N~37&6l%c z(HyN@w~d$1X(;qUqVYcqr7=22`D8il5qCsyczDR9F{ zg2uLyNhIteIw!UTvXUC;f1NPm9($UcjYhRCKltvb#W;#_;7s;N@dn#12r@5zFg9ZG zs03C7ToJhOMap!_9@kTRb&j=}Nwi|m%sDJF^Wr9;r!>6ITGq*i$B}>rWRj_p3QL_E z?hfOGWKqO#=FOXRe%Y9fWm9fXl#RlEt-gF~at W$#MR$r^2aO^U3kT68cjq^Zx<5#nCGO literal 0 HcmV?d00001 diff --git a/src/android/.camera_hal_config.cpp.swp b/src/android/.camera_hal_config.cpp.swp deleted file mode 100644 index e6b7220ae345f309242d3d97dd369fe783e65ed6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI3TWlOx8OMjVp)92r1zy@baI!}3uI0VhQLAcVTe8<{XVs1E_!2dw)@pX@r)RYPYR0O1|Patvof9IUp z8SmQ81(1-Km44pc*>nA$bG|v>cgFSN@yb#5Kz>xi>n=@u_m-39o45Vr<}cp8Pjfss zSflG#d5Ltnwt1CgT49}Awowqt3saTZYGrQap+d`cxY6XUU*L}h+;fZ;F4awAoqI;X z_soLfSe|QJ1$n8qX0&Ri>on|U-fXw8R%h~iqClbm6zBwv+yl33hek(=q{l$|Ap7|K zl|-6Efkc5sfkc5sfkc5sfkc5sfkc7-BL#x?P1UqCeeb?3dQ$4?{ zugP1YK%zjRK%zjRK%zjRK%zjRK%zjRK%zjRK%&6^paO=aX}6+XTND7m`G4sD|MX5x zdlP&Id<$@3fGIEua^L{C2mJL8P5Tx2C3pcm56*)xfk!|a90LpB6JS61!|j^(d+-i; z3;Z0M180E`2EnC|Y1)^;d2j+82PS)CVqs z*TIY6N$>^mdEkLhgDG%77y(6a0NevEr_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0abPCE!(7;s+B3VCz>vos*{W5+QQ0IwNlFTj3?b}%ogV4uDdyyV_9r$ z@2=~rQcc5-w>Dj#smzsYrOD;;?EK=1Xa|hFQOBoEk%L*}w+)kHMW|=J(ewe^FH+)`bxlJl9s;lRB zn(N!E!`h;qTs#jZH?nO{rc7G=0d+Kl%q1+LG(7R&@bEgzDV4=K$7I3Hu>;FOUI;aV zts4#=jrULhl~Horo1WcV3s|OkzqFLx=kdkIA&ghZNM&RX<_=IT-7#Vtaz?s zaVM}FHurQ^on5HrM)M;%*UPnFZ#-%m`Tq~XXPt+iOa6a&zW+P;^}hwb0lx+p!6{G# ze}e!19{3)36>NYGsDUG(2tI)S{w}x--UiQuC%`elzLiYskO){iG|UfPOF7r1UxhuM!%Oih(uW2 zH$A%!f7^D1A5N}s|CTu2%_bcecCU!J%k6aqF7#d@cN+nZZY-mg=Z_ufu5;?HujGsScf~z}?3uq^@CDa}&ZB zl_mm!gh9;-9qiCBUE2rmQE#$n5MW!*+pnZ*XQx^sB7_=meJJpMQ&L0PHR)e zMPt3mmFMQm;@m>6I;l+D+tk^^X)$xQb@So0Se^~H<5*&*^>k0ppLpY>s4_I0nn4$Y zFDt@|B%TmHK0UhCjk739v28Cb&VQ;kd$)6 zF-DkFOr7MhWrWx;xqIDi3e|03tPI5eSiKVn1;k_|H@sVh5Oj|+$gFkCp`45A_>sZC z_dBM^eSa81L5DZt^KWn_h8hh*1O)$i&%HA?j=7MJ#&{2#$nYQX@;nq?J+lL!`h;WE PK!gP7+;cZs4r~7c$v(c4 diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 64bd8dde..ef0d10d0 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -374,14 +374,20 @@ void CameraCapabilities::computeHwLevel( camera_metadata_enum_android_info_supported_hardware_level hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL; - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR)) { + LOG(HAL, Info) << noFull << "missing manual sensor"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING)) { + LOG(HAL, Info) << noFull << "missing manual post processing"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } - if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) + if (!caps.count(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE)) { + LOG(HAL, Info) << noFull << "missing burst capture"; hwLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED; + } found = staticMetadata_->getEntry(ANDROID_SYNC_MAX_LATENCY, &entry); if (!found || *entry.data.i32 != 0) { diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index 7512cc4e..b229e2d5 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -140,7 +140,8 @@ void CameraHalManager::cameraAdded(std::shared_ptr cam) */ if (!isCameraExternal && !halConfig_.exists()) { LOG(HAL, Error) - << "HAL configuration file is mandatory for internal cameras"; + << "HAL configuration file is mandatory for internal cameras." + << " Camera " << cam->id() << "failed to load"; return; } diff --git a/src/libcamera/.v4l2_subdevice.cpp.swp b/src/libcamera/.v4l2_subdevice.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..f4985643e69f6e8d105e41e293e919c72eb82f99