From patchwork Mon Oct 24 05:55: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: 17677 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 78E41BD16B for ; Mon, 24 Oct 2022 05:55:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F6A062EEC; Mon, 24 Oct 2022 07:55:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590953; bh=2DJHBIv3lJ1ncEjTiHiFNMOOJnyb+5sStiN4rc78Rzs=; 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=iQkXxcdkTcP1JOoiaDV6oPXCPVGCJxNCoga1gAaUXOmQYpnx/mPsqiuPAMYY7Isgl W1ZkJqVTA57c423Q+5Uj4sXhkLO6x51JRXG3RLG2vGF5rTpfmfIHEw1NKMipw81mXn LzsI7kiX4p+AOKmsXLOSWkrYbZ7V/5iidRRnvLAbTsipWF7om5jCs9i/3PLVXziGF4 9gRllde19RVJHWuaWb1lWTnfIUStHhT9FJOZBHUS6oqod17I/o6/quN2E2a+0+ulpK 8uusJaXlE25Xo1grX0kD/qPKgkrqrQzm3KwwHsWEniV3Zme2b9E1pu9z0oWZZoutCE DFZ4J/vXi6xmw== Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C46F261F4C for ; Mon, 24 Oct 2022 07:55:51 +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="T7bvSu+s"; dkim-atps=neutral Received: by mail-ot1-x333.google.com with SMTP id br15-20020a056830390f00b0061c9d73b8bdso5361922otb.6 for ; Sun, 23 Oct 2022 22:55:51 -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=9rplnuUN0pnsIlI3cmDpVxuZ3BxsKKTvsZ2YHWy1u2E=; b=T7bvSu+sYZ+j/4XjWP00dW8fH131PWir0TDkanUfUb+kKuGDHAg2aNkOX5zK1EbYbh GEBj/LXehlWk/99YYApSaJQcZ1MEMnIPfYlnSZXPmxKOgW7UvBkDZLiI/cVzaPRj0DkX N8W186sqqT6Ogffv2930F0uo4ziztbKOk7DI3ah7OheXtkYEJCKjK4p5wE+1i1h/8ptV lAC5AZ6oqHH2oQ0ByktaYPf5Q0t0/z4o4ZvR3UpDy1XHG2uaiAGr2wfwpF2EK0O2Y0W9 vMrB66/PPZkPzsIZYal8sOj41o59ZHYoBOTA+EUiXDkXjVguLLyqlqwFbtiCgNhpLS+3 CuTQ== 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=9rplnuUN0pnsIlI3cmDpVxuZ3BxsKKTvsZ2YHWy1u2E=; b=vfv0+9/rj7phsgP5Ops8HsJrJY2jxTWY3uPJZfhWFCguQD6QOfTD/fYbqGx8nkWWzz ZnGN5rKtoectz3yRsj6ZuJwgGMzI67fkZWy4KPxJbEG3g9gmGb8Qpzy8nL5TVXaQKRKM M0MJIm+vX4fC7GKM9KPZzP84jlgh4N8hYE5zVpJZnzJ/rVmwR8bifnKo2bPFs7aWxYa/ qPLxSJMc2AoC3wO1npMIYJoR72dmOzh/WD0GVjWKxMQDkXTvIqC4owLuqPU0JVERVFHp VXxhIoYslNW8tk3wDVFF7zAFwoJKOAbcDNxQPCJprAxmQxIf95Fc2bo0ZJQ2iyxZW+Is SFAw== X-Gm-Message-State: ACrzQf2eHG0hFETdvMtOpqThye7AXtnJcVt0Hwx3jBHiqfu+06XvpSUW vB8la/gXf/LROF7dTFyXcWxJV1IsOPDcE+yh X-Google-Smtp-Source: AMsMyM6DZCVIkXT9K+HvkFjqmlj2Y43DoxOTWtah64pohKtUmlFq/TqiwoP/zi/r/ZzravC9NtsJKg== X-Received: by 2002:a05:6830:148e:b0:661:9422:f0e1 with SMTP id s14-20020a056830148e00b006619422f0e1mr16471640otq.205.1666590950213; Sun, 23 Oct 2022 22:55:50 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:49 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:33 -0500 Message-Id: <20221024055543.116040-2-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 01/11] Fixes Bug 156, which breaks libcamera on Android < 12. 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 Signed-off-by: Nicholas Roth Signed-off-by: Signed-off-by: Nicholas Roth --- src/ipa/ipu3/algorithms/agc.cpp | 18 ++++++++++++++---- src/ipa/raspberrypi/cam_helper.cpp | 9 ++++++--- src/ipa/raspberrypi/cam_helper_imx296.cpp | 5 ++++- src/ipa/raspberrypi/controller/rpi/agc.cpp | 18 ++++++++++++++---- src/ipa/raspberrypi/controller/rpi/lux.cpp | 5 ++++- src/ipa/rkisp1/algorithms/agc.cpp | 22 ++++++++++++++++++---- 6 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index a1a3c38f..80c551bb 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -100,7 +100,10 @@ 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; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double ten_millis = utils::Duration(10ms).get(); + activeState.agc.exposure = ten_millis / + configuration.sensor.lineDuration.get(); frameCount_ = 0; return 0; @@ -238,11 +241,16 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, * * Push the shutter time up to the maximum first, and only then * increase the gain. + * + * TODO(Bug 156): Workaround for LLVM bug. */ + double exposureValueDouble = exposureValue.get(); + utils::Duration shutterTimeRaw(exposureValueDouble / minAnalogueGain_); utils::Duration shutterTime = - std::clamp(exposureValue / minAnalogueGain_, + std::clamp(shutterTimeRaw, minShutterSpeed_, maxShutterSpeed_); - double stepGain = std::clamp(exposureValue / shutterTime, + double shutterTimeDouble = shutterTime.get(); + double stepGain = std::clamp(exposureValueDouble / shutterTimeDouble, minAnalogueGain_, maxAnalogueGain_); LOG(IPU3Agc, Debug) << "Divided up shutter and gain are " << shutterTime << " and " @@ -250,7 +258,9 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, IPAActiveState &activeState = context.activeState; /* Update the estimated exposure and gain. */ - activeState.agc.exposure = shutterTime / configuration.sensor.lineDuration; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double lineDurationDouble = configuration.sensor.lineDuration.get(); + activeState.agc.exposure = shutterTimeDouble / lineDurationDouble; activeState.agc.gain = stepGain; } diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index d90ac1de..31a9a1ef 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -63,7 +63,8 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats, uint32_t CamHelper::exposureLines(const Duration exposure, const Duration lineLength) const { - return exposure / lineLength; + /* TODO(Bug 156): Workaround for LLVM bug. */ + return exposure.get() / lineLength.get(); } Duration CamHelper::exposure(uint32_t exposureLines, const Duration lineLength) const @@ -84,9 +85,11 @@ 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. + * + * TODO(Bug 156): Workaround for LLVM bug. */ - frameLengthMin = minFrameDuration / mode_.minLineLength; - frameLengthMax = maxFrameDuration / mode_.minLineLength; + frameLengthMin = minFrameDuration.get() / mode_.minLineLength.get(); + frameLengthMax = maxFrameDuration.get() / mode_.minLineLength.get(); /* * 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..e48f5cf2 100644 --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp @@ -57,7 +57,10 @@ 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); + /* TODO(Bug 156): Workaround for LLVM bug. */ + double exposureTime = Duration(exposure - 14.26us).get(); + double timePerLineNano = timePerLine.get(); + return std::max(minExposureLines, exposureTime / timePerLineNano); } Duration CamHelperImx296::exposure(uint32_t exposureLines, diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index bd54a639..720ba788 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -418,7 +418,10 @@ void Agc::prepare(Metadata *imageMetadata) Duration actualExposure = deviceStatus.shutterSpeed * deviceStatus.analogueGain; if (actualExposure) { - status_.digitalGain = status_.totalExposureValue / actualExposure; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double totalExposureDouble = status_.totalExposureValue.get(); + double actualExposureDouble = actualExposure.get(); + status_.digitalGain = totalExposureDouble / actualExposureDouble; LOG(RPiAgc, Debug) << "Want total exposure " << status_.totalExposureValue; /* * Never ask for a gain < 1.0, and also impose @@ -823,7 +826,10 @@ void Agc::divideUpExposure() } if (status_.fixedAnalogueGain == 0.0) { if (exposureMode_->gain[stage] * shutterTime >= exposureValue) { - analogueGain = exposureValue / shutterTime; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double exposureDouble = exposureValue.get(); + double shutterTimeDouble = shutterTime.get(); + analogueGain = exposureDouble / shutterTimeDouble; break; } analogueGain = exposureMode_->gain[stage]; @@ -838,10 +844,14 @@ void Agc::divideUpExposure() */ if (!status_.fixedShutter && !status_.fixedAnalogueGain && status_.flickerPeriod) { - int flickerPeriods = shutterTime / status_.flickerPeriod; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double shutterTimeDouble = shutterTime.get(); + double flickerPeriod = status_.flickerPeriod.get(); + int flickerPeriods = shutterTimeDouble / flickerPeriod; if (flickerPeriods) { Duration newShutterTime = flickerPeriods * status_.flickerPeriod; - analogueGain *= shutterTime / newShutterTime; + double newShutterTimeDouble = newShutterTime.get(); + analogueGain *= shutterTimeDouble / newShutterTimeDouble; /* * 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..49303409 100644 --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp @@ -93,8 +93,11 @@ void Lux::process(StatisticsPtr &stats, Metadata *imageMetadata) /* add .5 to reflect the mid-points of bins */ double currentY = sum / (double)num + .5; double gainRatio = referenceGain_ / currentGain; + /* TODO(Bug 156): Workaround for LLVM bug. */ + double referenceShutterSpeedDouble = referenceShutterSpeed_.get(); + double deviceShutterSpeed = deviceStatus.shutterSpeed.get(); double shutterSpeedRatio = - referenceShutterSpeed_ / deviceStatus.shutterSpeed; + referenceShutterSpeedDouble / deviceShutterSpeed; 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..3ea0b732 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -74,7 +74,13 @@ 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; + /* TODO(Bug 156): Explicit division of ticks (e.g., `x.get() / + * y.get()` as opposed to `x / y`) is a workaround for + * LLVM bug 41130 and should be reverted once we no longer target + * Android 11 / sdk30 since it compromises unit safety and readability. */ + constexpr libcamera::utils::Duration ten_millis(10ms); + long double exposure = ten_millis.get() / context.configuration.sensor.lineDuration.get(); + context.activeState.agc.exposure = uint32_t(exposure); /* * According to the RkISP1 documentation: @@ -211,17 +217,25 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, /* * Push the shutter time up to the maximum first, and only then * increase the gain. + * + * TODO(Bug 156): Explicit division of ticks (e.g., `x.get() / + * y.get()` as opposed to `x / y`) is a workaround for + * LLVM bug 41130 and should be reverted once we no longer target + * Android 11 / sdk30 since it compromises unit safety and readability. */ - utils::Duration shutterTime = std::clamp(exposureValue / minAnalogueGain, + utils::Duration shutterTimeUnclamped(exposureValue.get() / minAnalogueGain); + utils::Duration shutterTime = std::clamp(shutterTimeUnclamped, minShutterSpeed, maxShutterSpeed); - double stepGain = std::clamp(exposureValue / shutterTime, + double stepGainUnclamped = exposureValue.get() / shutterTime.get(); + double stepGain = std::clamp(stepGainUnclamped, 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 = uint32_t(shutterTime.get() / + configuration.sensor.lineDuration.get()); activeState.agc.gain = stepGain; } From patchwork Mon Oct 24 05:55: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: 17678 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 442BBBD16B for ; Mon, 24 Oct 2022 05:55:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 09A7562EF2; Mon, 24 Oct 2022 07:55:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590956; bh=rteEdorfeYf2WMIU0zZHBkRaXqRJ5MwkQvm/TECYYCs=; 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=2Mgd0vd+MvrZP1nyzaTVdl0dFkxvx/4XZnl8bVNZbH37r/v6wV8mABxei08chhlgV OM4arKksr6mti/yd/o+BVUYgUv5kPznMUnJz83RsirrXtFVzpURGh9jU6hvc+kiCy7 ryUBKY9n580W839NGyvekjmSqoSrX50qfZCXG1LCab9yZu+APSL9kvYSjYNm7q7jnR jtD3G1xYpAT8vl2HOdWRCdXlXAEmC6eCIfsdUwrm7VJ+tjJWmfyKoNowGyPgqaIPt2 +Aog7WDy1oJpkr4+mUnUW54o5GOiRkbMs9QhEIUMzdzBBeQdskCgRD1u7WffJhQZxp x4PV7+yvKBloQ== Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8883461F4C for ; Mon, 24 Oct 2022 07:55:54 +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="KZX0qYAO"; dkim-atps=neutral Received: by mail-ot1-x331.google.com with SMTP id r13-20020a056830418d00b0065601df69c0so5363192otu.7 for ; Sun, 23 Oct 2022 22:55:54 -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=S/Zpa27nkzDhV6rhVl67Z8VoZFYssjvzoo5aGuTsmsE=; b=KZX0qYAOV4nsyCzVY6akCOrm/uWIOoES+2zjVz7YezoYp/JXidFgiVvfOu5+/jxNNC qS1mo89WQQeENw09x2RzIJOGknW4D1cwf7ONnkYBllOjlbzbNDR+O0iLi9CngahVQTbb 7DJFRPzmEPnxFroF5bhRVTwD8Cu7xAsBhbI0DEmxF3UxDYmCQFoTw2MqD3czOX7ELKGA m5f6CHTH9HVFwjb0bCMtfHtXHuhqcu3qL7PJtIdsbNPG/EcugFbdZUn4YLcWTiMAFfZk d39RYGV9yoB8qYSoaYzcRpE4/5pwZid2WZTXzEWhFS9s1N9z+mvsssSeXebeRaphWYog OfGg== 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=S/Zpa27nkzDhV6rhVl67Z8VoZFYssjvzoo5aGuTsmsE=; b=pKFQbQSaxmJZ7zA1/gaj4TY8izBK4wLAFZbjN+0sYtfr1vXW1IUYae4+0r9x5Oxu4R eAyWclsGyu821jUEdQ9mZZ8GGFuCNW+mRCp4n9QaiLgOKo+u2glCcGMYnqI5mmFF5qme lKbIYKklvkP/lCo+/68E0OUwZJN/45ABwagLNuGVu2PB98P9rkhS4o69HJ/d6Ez7aUb7 s7efsIxbqdh7OSYsubcqGnnYDkpiuADoRSYPIdZxxC/4vanJhpF+lg1pBaM3DMq2nE89 geZ4zEPbGPBJ8azgAZw+dmJ1l0vsXqx9ED2vIbh27yHAbyrgTpjSvwgFgd7u3GX2cKm3 7lWg== X-Gm-Message-State: ACrzQf0n2eMipya00LcII8wxSPcCXF826f+sLawmdD4Mlsa20zPoVeGr 964McoCgedEL7uYzxEP5gzwXsJcEXUNT+I8R X-Google-Smtp-Source: AMsMyM538Dc5FqnVrRhivifgZp5ZtDhXNUz7EzgknWGV26PHI5Lv39sdk0HKR7W7gGQ0DzQg+wlexw== X-Received: by 2002:a05:6830:16c7:b0:661:b465:6e1e with SMTP id l7-20020a05683016c700b00661b4656e1emr15675370otr.124.1666590952599; Sun, 23 Oct 2022 22:55:52 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:52 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:34 -0500 Message-Id: <20221024055543.116040-3-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/11] Adds missing thread-safety annotations, lack of which break the build. 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 ../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(); } ^ --- 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 Mon Oct 24 05:55: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: 17687 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 DAE6BC3287 for ; Mon, 24 Oct 2022 05:56:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8390562F1E; Mon, 24 Oct 2022 07:56:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590969; bh=1rE44FJQZfuZwwcQV9s/JuDpAcNkLpfV5OTqSPkqhtk=; 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=WEz0L1xLvC5MSm8jvJuSp6d4GkaIW6/pOAbmGMva2QWjSQS8yYyWd72IJaj2Zc7I3 N90wXeymU65XxeuSz4YyLP6YoWTTZfMQ/UAfx2HiDqdeBY2G1/NMDwZYp7q4NDQV6E Dg8yeOHDlac2yb/c91o4sJ/DAgGYuA+UJlWNOhfw4z8Q/aUmAmswQFVNwfxdHw/z4D 8PKtikMLQLGrzwH+YnDvt13GoigTy8YJ5y+4cnImYWcAg1GPl95xQtZcsmt7FVtzKJ AjUho00bZss+YwNr+zZSSRNTBBfQ3QCo1zY2KwcSM0gE4EoSyTF74t0bxQy3q7xjwz JTfww8Qu95TmA== Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5118C62F16 for ; Mon, 24 Oct 2022 07:56:05 +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="HK9b27pv"; dkim-atps=neutral Received: by mail-oi1-x232.google.com with SMTP id o64so9808925oib.12 for ; Sun, 23 Oct 2022 22:56:05 -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=TV8/l+1UakKHPjAiAmlj9NPWzyQA9lh6hT9yNy15JWM=; b=HK9b27pvieJR0l5aGVdIY0Vim0ejSTK7u05ISW+9wkJENc6QqRbzT6+I4v8HgfWbIP BMswSKDAa7CkOT1enh4pE+QRr0E98jVSc9onnD0ih3sMiqM9gqh2adf39/7q209BhRHq JVRV/h9UlDZiT5R3DEndBFHU8SQBX3gGbrHCKpwd1OK2Paz1CrUX8oLsTX4A9E/BYLTw hOfK/Z3cvzLXLKn+I368HVnXkw/Z4FUx1+6v6hpvv7A6v1rxDnB+RaasUP586UNYTPsD 2peLBEkjwlLdSTwijD7Q/roj6MWA81lYQvHhsDkA6Iy33XP+MLB5wNIWHHh0amksrhak hqKg== 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=TV8/l+1UakKHPjAiAmlj9NPWzyQA9lh6hT9yNy15JWM=; b=K7bknSuuWACTUidDQKhhWhEPqh5kv2dvP5fEhBpIaQsHVBAESoSXFK/lDuJz4FkfAv Y7O5XKc0gnufQ49NvQZtfpOji1D4qrppkybQJytI6tkSC2UBzERKlsIH5ZKaOCLQL0FQ R2zoaw2qnUXqry/Tl9Mo5lVUlhCDpmvQmE9aZ7xHwrYXGHlDz5nlAtjrQDlmPMLiv6Bc 6Z2K19vh9qglZRgZppmKFccR8TRbOIE5E9WPv13eKtDSqe72sB6jdGqLMq5VGsWSDuMg pr+Tk2CJ5/klfZKDBUOAFzivo52Bl72cHy3ojtAD5DvPqfh2Q2h3TFtUdD0VhZk+Y13+ asRg== X-Gm-Message-State: ACrzQf25eD3KHJTabHQ0U0ltKab+53eUWk8olkR5K8qYol7DEbdcPAjl tlPISbD8DutL+sR5yJ7CCJqUL6f8Rbg70P5s X-Google-Smtp-Source: AMsMyM5jiEi5zcqhOPS1gBu9XINwIAjfx9nskIAhR26caPwuEvYuxOwLuOw+pxK1eX9EKhD2zpY0QQ== X-Received: by 2002:a05:6870:b407:b0:13a:f0b9:7c13 with SMTP id x7-20020a056870b40700b0013af0b97c13mr13159590oap.212.1666590953808; Sun, 23 Oct 2022 22:55:53 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:53 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:35 -0500 Message-Id: <20221024055543.116040-4-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/11] Adds rkisp1 metadata required for the Android HAL to use it. 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 --- src/ipa/rkisp1/rkisp1.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index ba3c547e..c536852c 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -100,6 +100,13 @@ const ControlInfoMap::Map rkisp1Controls{ { &controls::Contrast, ControlInfo(0.0f, 1.993f) }, { &controls::Saturation, ControlInfo(0.0f, 1.993f) }, { &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) }, + /* libcamera requires a fixed value for minimum frame duration, + * but this depends on the frame size and the rkisp1 device datasheets + * measure this in pixels per second. Neither the datasheets nor the driver + * specify a maximum. The minimum below is for 1920x1920. The maximum + * corresponds to two seconds. */ + { &controls::FrameDurationLimits, ControlInfo(48505, 2000000) }, + { &controls::draft::MaxLatency, ControlInfo(0) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, }; From patchwork Mon Oct 24 05:55:36 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: 17679 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 5BAD7BD16B for ; Mon, 24 Oct 2022 05:55:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DF3A262EFB; Mon, 24 Oct 2022 07:55:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590958; bh=ktXcytuB3Jdh41eKmKNNYbYKnPgRWZSaWHPJNGA5AiA=; 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=pH997UAoDmBwOYfAQpodKD+g8EIHZwj1jlv7pGNJAK1iDbYekKQfjuK7N4tTwm4ym 2SKSBErSlUF7v7nkHQpsty/2usu1hOSHUN7ZF8sK3i0Cxg93E6JTtni2zUH0xXGxRV vxZ+rvx44dfz3HSpKb3V+ls1a04E3puQ6LE+SAarjHWcuxIWXVxK6kQfXzqueUfHCH 6/I89PAPSwiUM2HtsHe0vs3EDS4GDmapsDS1YEZzei76r1+rY22yrFf/5S3IQaducv BCBbGhwGOPKfnt4ngbK8v6t+P9We3CtXFR+YOmBL0O6R21/tdMQZSA7s0Z6hUcj5kI sXS2tiAxGwHhw== Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 54F3362EF6 for ; Mon, 24 Oct 2022 07:55:56 +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="Hr6u9crW"; dkim-atps=neutral Received: by mail-ot1-x334.google.com with SMTP id w6-20020a056830110600b00665bf86f012so207720otq.0 for ; Sun, 23 Oct 2022 22:55:56 -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=bOAoyEBkd5by/xGJCiHnwCn4ZxsEtwV5enJoK+EaJao=; b=Hr6u9crWYInpzQuVXUBYxGyHSUWw4oDdiaD5AWFZ78N0SloShaeSoV7OrdOLbk4nWa qqt90uoSLNBBzjUWvnoU0FXzEgge3KdDefig5i0onW6WF7estJSFKvEZhAJja5L02xvU 8EHXk86vUZkvIu+2x0bwcEThAurNmf/dauCUUJcuAKNTvzMcMalOBinGDhtimYZT6r1u 4l1tpb7eXhSUka7c4fK1WeRTa9zGJ4d2ZrZ9uyunEptwwA1mYjiB8O9eP64osjk9GD6v 7Q9PFZB1iwG/KwNsPA72qG3tgJ/zZOVqs2z02LMNRjAZ79P+q8uZrVs1s+XVkMp/fX/q YyEg== 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=bOAoyEBkd5by/xGJCiHnwCn4ZxsEtwV5enJoK+EaJao=; b=iNMMsZP5HwacO7lg/qSmwEDzO1MIJt1BlZbyQvxYnCN/5kpDah230/vn4bVJWJhCXR nfi+hbNG2u/rGnfILoLj9qemZohoMAk1Ikm1lSNqRio8jrMbFpFpghydXMCh0Pk4YIwV SGJw3Bh2mYFhhPvUzMStjU3hEwwembl3dJSMEHGSlrD1fcZsRlUg0HzmvGFiw007H8yu 8xXYKLBwO3tiCfii/VXBIQaRDzR9HnvDc4DUirAIsSTUjuGIlqdvQWBzxdwMJc4YPiUK KJ7S/zhOyoehFSknINdFxy2PM//XcA6pieY7Xz0i4SxlnpVhNpFyWkyWEnEdA8HmpLog Go8g== X-Gm-Message-State: ACrzQf3IlDfuXYpbedCLdBLUG+CYDq5QhY4/mj51uAOJsveU/PFvJRad l0jL1oNqhPhARxyTVWLc9R+PJp4Wh9HhlXfm X-Google-Smtp-Source: AMsMyM4O0JtZVubEnjIOmgu8hHfmimDPsknjX6F6sLfnc728XKeOv75E3WF4RPaEtMCoNYk+MSJbnQ== X-Received: by 2002:a05:6830:6083:b0:660:d54e:583 with SMTP id by3-20020a056830608300b00660d54e0583mr15583735otb.282.1666590954833; Sun, 23 Oct 2022 22:55:54 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:54 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:36 -0500 Message-Id: <20221024055543.116040-5-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/11] Adds metadata for the ov8858, which the PinePhone Pro uses. 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 --- 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..1d9a45a7 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, 128 }; + } +}; +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 Mon Oct 24 05:55:37 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: 17680 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 0FED0C3285 for ; Mon, 24 Oct 2022 05:55:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AB74462F00; Mon, 24 Oct 2022 07:55:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590958; bh=ttc2WUU+qWMQtvv8fyyaS8hnpNsn8cRPU3hPTKqBV+M=; 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=qGE9bKulMvxm7qz2qs6umLPcCMw/vunRtXbAyS9eos4Sw/T+rXKVEEq1EuJ5NZHrr wNPGB5fkAktsZlUHbGAu3ZMGdzTTL/w7n9Y0Q8VYGelQgP5s6ku3dvQE/7qcE9TiE3 XlMS2Da/CrZmrCAkCUHnOfCjL7r9feVSVgTuMxD4XhYf4WZvl8E7g0IEwSkr1wZuWy 8Gwbp+b4CzgDZ6bRD/eKcGTwYquwrpQ6aeTmCmsd0kXdgbpS9WtBoUnCXT27bcgMmn pfW2eGinN+7rHFYV+1rV7gXqx82HXU/gcAyVP9kg08wVYp+JJMTmvMnRnmiaGfPxAm bcY8zYboJJFfQ== 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 9AD2362EF8 for ; Mon, 24 Oct 2022 07:55:57 +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="5uKI8BaE"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-132fb4fd495so10735627fac.12 for ; Sun, 23 Oct 2022 22:55:57 -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=52KQAlg+dJJpg0sPJRNZtOs43oa4UM3f4Tmy/yyvJu8=; b=5uKI8BaExIEZAxAcIkIhW46RNqgyYsOkXefUEYGLj9Mt7zEzD2iETbLDmgHNsaL61S r9Y0VQzbVsuBYAKLcf8ifIXMochRXBfRQ8iTjxh9/jVBKGSxNxLWqEsXSlP461WT5g7H WBFZsP2NN64fJZH4cAhpQYP1NYGKF7lW1i20QPTj35F9y1G/8RNR59arYLSHgJfy8vbv QSfOVkbMaHwwwW+WLNI2HV2xf2iaPndDewxk9nKjDCP7cPbYQhub/4yfGcEy7W7F1n5H RYfrQG/4yXjK7ETH/lC23Lo90EdAUreig7YyYP25M0MSpw+fciXru/ox4/W3PYf9nkbN 05LA== 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=52KQAlg+dJJpg0sPJRNZtOs43oa4UM3f4Tmy/yyvJu8=; b=x5HAIxy+7UGUlehSzP2DOWMUR3/dUTQoHF3avhTJK5ErBcktEHeLQag2n+/rc6nuWH A+AQ/19140z5YVSoTis3/NuzOFux6W/apV1q2VpvEA7J3b9sBhcReEGC07o0J+K6PR6b NSDTlLxXbIAiS7hHwuZetx/8mRHSSbk43p/bmH5UCwNqs5n+oYW0xrKDA5WJt8F5FEH0 2KIhEtEH7FAHxZNzyBmwXzKbCWv9rrJhMqCPuCE9aNob1f0rvvpgMvlriFyCQO818ONn il6U+A9q4fWwcdy7smkCbhIMtEUXDE00mAaKU+I1nuSG1m2pI+VxwU2MbrGQff7s00tA P15g== X-Gm-Message-State: ACrzQf2j/WmXHewzNbzDNLwaSURC5bf8cLJ2EGosGFmn77fl30Iyszuv xcZkaVEEtUGvDnXuzpEBcvom6k5L0g24I8Ya X-Google-Smtp-Source: AMsMyM5owKyCXnwZ8f6+kcek8TmMhklpuyjJdvnoEK9/FSvnDPQl4x97InvkIZyBRVLxygly0oTabw== X-Received: by 2002:a05:6870:b027:b0:136:662d:7cf5 with SMTP id y39-20020a056870b02700b00136662d7cf5mr37171528oae.110.1666590955940; Sun, 23 Oct 2022 22:55:55 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:55 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:37 -0500 Message-Id: <20221024055543.116040-6-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/11] Removes references to std::filesystem, which Android 11's toolchain does not support. 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 --- src/android/camera_hal_config.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index bacfe4b9..c06c993d 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,13 +159,7 @@ CameraHalConfig::CameraHalConfig() */ int CameraHalConfig::parseConfigurationFile() { - std::filesystem::path filePath = LIBCAMERA_SYSCONF_DIR; - filePath /= "camera_hal.yaml"; - if (!std::filesystem::is_regular_file(filePath)) { - LOG(HALConfig, Debug) - << "Configuration file: \"" << filePath << "\" not found"; - return -ENOENT; - } + std::string filePath = LIBCAMERA_SYSCONF_DIR "/camera_hal.yaml"; File file(filePath); if (!file.open(File::OpenModeFlag::ReadOnly)) { From patchwork Mon Oct 24 05:55:38 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: 17681 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 D1A53BD16B for ; Mon, 24 Oct 2022 05:56:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4ACDD62F07; Mon, 24 Oct 2022 07:56:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590961; bh=breCCh63FsMp5+MEBP3jhEKp5No/51/koZTax1ibB2Y=; 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=hUVw9SomDfsqoP1xIJH3tEvdiogSEnFQ5qHbyulTDfjD5ZfEXYl2wGMj4aGTWFpEP 8aax29EC5korTwUZ3LFKIIoYDuuNWZz9S6yI6i6q7QKOxWTxJ6LU/HMi5oRXV3yz1p Lyih8CgnSwY543dHvRjqUTwKaHoUI0YpwQy67Bd2cmKlZOLk9cpDvvk5uOgASMQ1Ks NE8HJUqv7Xh6H5v1S1gjoOdcJLJ8gXW3o7riF+Mg4IGr1EYRKSSvNRCDdDWeNaFvJg 46rPbNQWkQGWQT8NonDjCLHqfZ9jJ1ANX6vj9waSsu6WTLc1ggUB3NM3sAAil/AMsS RSPGsLRO2BScw== Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6406862EFD for ; Mon, 24 Oct 2022 07:55:58 +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="hW1L/Pmd"; dkim-atps=neutral Received: by mail-ot1-x32e.google.com with SMTP id r8-20020a056830120800b00661a0a236efso5375895otp.4 for ; Sun, 23 Oct 2022 22:55:58 -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=pZ84C5K1watUpfIy+91HbdonC6HclrfVdxoyKumcppg=; b=hW1L/Pmd33kK+sG5rgXEY3NkqxeYlH+8gWSOBjQZz7XZjswhJ1at1JE7PBhYxUNOqE XKATQVtYR1EbPPIHKpa4W4yZnw7EDbpRvKUSSx0oFetY8CMc4AVRCrVSDtbWPfDL9ZqQ lReoeVPCXE6K6u50MFLHmmCUjE1XWQXvTat3ubIo/M8+IQDuUgVVfqHsZerMNVg4G0BP l3dLbSp2W5UyQz83Y8wDYLl7bqxlybWOeiEpapveKS6QcCE7tmXCipFsLoeuSwLBurT4 gp1U3geN6OWhquqjnJ7U4hSojMCIT/epjVx3uuzuCzE1D/xbc3a1GDB1/DdXql77ZWb9 we5Q== 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=pZ84C5K1watUpfIy+91HbdonC6HclrfVdxoyKumcppg=; b=d6IaY0r1bcMm+bkiVoSmEsBYs/nssN3K0IxEPtniEU+xhvrUFP634GL8HUTWLIfdiV FRYYhQRl6RXjJKTpNNxoX7uaUeJM+vNmkNBRIgXjU+OlKa3PqA1ibZ4wv3qv0QJCdQfl qWhPPGrLV6ZUdlaWz7WKWdTXqZob4L/rlM5CTGN0zha4BKI+Ua8BSkW5evfYJoivLus4 oZ8TwVijrFMm8jkpd+HwcAvqTxC5w6ayuuHXhMuUXz8WcufSWmlPr1AQg7Y5MHdtWE79 oHoOHc8BONBTVDtR6ou8SkwBXRJk40EYypRqgo8sNlO9hiuuCrQhsKqczFvIKnOV/Qu9 9aWA== X-Gm-Message-State: ACrzQf0PrEoN2pGrdUGKNQ1dTEUYMnMVnoNSE089a+7maIS798wn1/uW S2uwR/Vf0dawN4lbVPrTZIn8T9wNoMhizftb X-Google-Smtp-Source: AMsMyM6oJEtfCCb+fxuWHMKRuD73NqV5QxZBNbE6bHL9E+4kfFqEuJ7t8+Fjyzy59NpH3rDpzTn9+A== X-Received: by 2002:a9d:bd7:0:b0:661:a864:3d9a with SMTP id 81-20020a9d0bd7000000b00661a8643d9amr15830208oth.20.1666590956839; Sun, 23 Oct 2022 22:55:56 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:56 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:38 -0500 Message-Id: <20221024055543.116040-7-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/11] Replaces abs() with std::abs(), which supports double-precision in clang. 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 --- 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 Mon Oct 24 05:55:39 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: 17682 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 967CAC3285 for ; Mon, 24 Oct 2022 05:56:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 465CF61F4C; Mon, 24 Oct 2022 07:56:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590962; bh=l1YSxb16YMG5Rjo9BUIYM0BK9ohwnhRVgri/kbpMAhw=; 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=pdBAAqjwQW+Tlg6qTRdxZI3mSUS7nr2k4uU92spd5SN7/VBG331Gls0VRlHJqeMAW vSQRtNCbvqJz4VjiATe/jqpG61PFhN/n6TbHUdIv67GaWO79lw2WWc9Ix44qODXtWH biG2O6TCuEmt0/KELzrmeCcrHwUqrc6San2eAjL1/wlGvjirS62WvTXLL9bnpS8ovd 2/pOTEimq0Ib3K69ZVrDh+BEwm0xv0il8W0RJCFNi/gyujzw5y1NMVPfw4464fcDCl J9oFnoSh4guz95Y5rzA+No1mjZX7GX1l4I6kRHo8eyQ6Wtc55wngSh7SUOb+lca5cW JNDFwtQXBZpiQ== 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 80EBE62EEF for ; Mon, 24 Oct 2022 07:55:58 +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="hBwZbmR4"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-132fb4fd495so10735673fac.12 for ; Sun, 23 Oct 2022 22:55:58 -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=2AtyVqDzlHbSkpBALiBvD0oxmgvK5tvSmEvE0mRkleY=; b=hBwZbmR4ax7pVZ5OrktXICEzoLvwpxz5Jskp1YkXA9bi1FBkFkHAQJNU8AtJxcHHZc 8coKb+f/lSh7fo+w2yPy6mcscTJSdTUyEkSeQiJaPOgUyeZOhSYEv83PYvy/ZohouLBe oX+c9vBvWY/MtrB8L0lrR53OFZY03Ht1vjwXIP4Jc05gMPaO3TDXDPEk+C1Fx1TVNK6c ZcyTZsU6KoVz4rDjnJ0/bTv4Vv4Pg/yhypY3oviZ1W9DWCyoqHiDVPC2jC3XRwhwYivg rOs8aLzQ6LxPG/mgDW4o2YHmIxpEDfWZmbNCIsQkdyHoUmcNNRkpek/SHS75uzhBspe7 U+7w== 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=2AtyVqDzlHbSkpBALiBvD0oxmgvK5tvSmEvE0mRkleY=; b=PyTz15tAZGCWDp8WJD2k3tZ5/9IzoYaDf0I8x8Rq7r8YrCnUe0D1dRAVXaYYMWJfO4 fJaB0UgU04hbtFtLoGLqNbSv5tTC+AWCaMhsN+bAztoTpVwMbBoWR1GH7pCXQB+A2bGc szzSs8VRJ+McJghnSHa83gGM1hLrB/btlwV4vHmgkwRhyK5tPz6gb/wmLEPGiQLj/8Mi FCES+xNihwFp5p9xO6TVyG80ILUG5z9oLY0dvPQByXK+m6CH5fJcwKn4zBtU3FxL1bBo UrjVvyet6UH9MiFOumrDdIB1ZE2+JBBPlef/RfTA0C9ppW4nwspWbFmC7jCPOozqIFng OrRA== X-Gm-Message-State: ACrzQf3Iy4QYa0g59tyhmmRo+YHevvFYSIdDX7eMfxeqpsXdzYKzuKJ7 0CLQxkYgecJacBFxczsNIrlSJogxAi/oXVqK X-Google-Smtp-Source: AMsMyM4MGJGHjw9A4uYqFMPtf5zO1BydCnpYiZd8QQNfptLjdjjYz6PANMsX2e1Wr2ByrQE73sAc0Q== X-Received: by 2002:a05:6870:b61e:b0:13a:f0ad:8147 with SMTP id cm30-20020a056870b61e00b0013af0ad8147mr13897202oab.270.1666590957700; Sun, 23 Oct 2022 22:55:57 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:57 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:39 -0500 Message-Id: <20221024055543.116040-8-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 07/11] Makes libdl optional when the runtime includes a dynamic loader. 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 --- 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 Mon Oct 24 05:55:40 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: 17683 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 7DC2FBD16B for ; Mon, 24 Oct 2022 05:56:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 18E5162F14; Mon, 24 Oct 2022 07:56:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590965; bh=mvpp/AXcH55Ihc+1iO4nWkuuHc7yyAOzRS0UYe/7Ntg=; 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=uiysZaaJFD/RqoaKrjiXBD70xEHP9SJDTsNyD/Dp7ndD8eboZCiK9rD2Ivfly9XzV vj3wGWok6HYSEsCqF7Z0EFtwdGVqgW3tmwAM0jqCvuiPzrQYuSGpNOWzkaJknBoesV 0v5IU0Xv3A879plqGRK/bVXAXOQVCsqHO7+P6xRevYf8lIZAnSX7ed4W6gllL0xEb2 oXhNEaLj5Or3q00mzFvJFohZDFIRQOrLqAeWZMIs6dmPqL+K5ZQN8c2QZHjR1KYxbc c5tOsTned8XItgqWISvU3/v6hYXC5Bo7uc4vfHjIMCR5y9+9xolENSfUGvg9e5XwI5 tGJFiA6Jmbj6w== 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 76D3862EF6 for ; Mon, 24 Oct 2022 07:56:00 +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="kFRE5TUD"; dkim-atps=neutral Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-13b6336a1acso5277829fac.3 for ; Sun, 23 Oct 2022 22:56:00 -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=bFCDFBN6Gu/UE2X3RBv2GIgJlscealx/uenvhEnHRRg=; b=kFRE5TUDKLUYYct2WCwYa+rOP5d7zVb7hh04RSf1g6amQUZXbbEw4dHaQO+2aPLYO9 GTvBenbLA6cnGgNgdE3D/xAsrCQW6+uXuI8/Hx9jDlaTqkcCEmElM8GqT0Sc5bXvsa0g CnLLyiYWL11ZXMYiubiaWFQn2LQsXc+/FbcntzOR6SoFKbbPJVQ9OFMuoFU4lvXGCCoS Jr28pDEIytjJnMvxfpB+EUYhuyD9YmbIO6VKIPH1cT0WVBawsYEsBlgGNviP5/dFSTmM aY0m3Guhzjfs8aWR57q2mBHa7iWcbny20mK9Fqgsd46v45SvtvTS6QAvmMkkbg0pC3E/ 02XQ== 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=bFCDFBN6Gu/UE2X3RBv2GIgJlscealx/uenvhEnHRRg=; b=VPjQHwu1K92XWLyds6bRlzBwh7fib5wwxrRvr11wMC/fFwkL2C1fAw//pE1lalrzAO NhkbgYv1h9XXnvu6T6tAQdHpKrdZtmD4czpvaxzngKB79So7nNMSfZ/Xe05L7LiR4NQR fnSqXC8u8q0l7qPjbG/kbrHVaXP/bPAXKPo94FyDvYu1cAU8GTgLG1QOAK2gp6HDaXRX AV4+nGCzjq9UAtmkQoSYeJa+opiobJR+dbGU12wtnGNtyYTyYZtjICP6DXAqzjKhPu9Y NS+9yu84cXIbjNduoIYKYeVlO3WyRCvQFgOOjCEmCX9N6jBgqfIC4Xr7iNmCdm3GmPmq zoNQ== X-Gm-Message-State: ACrzQf3wicIU5Lo3FdgP2ypFXksAcUDGUyhmJEynuLI4/J0q6G4vNovW ww7BGSKxvuImlE5TfaXkxNRbsJNY3LYjw35/ X-Google-Smtp-Source: AMsMyM6RXbC4ki2SgoM9C4K+U4UlNT/NZSm60XmDS/9A5lSxRdIiiI4MRq/G71ZO7110MdIG67WW7w== X-Received: by 2002:a05:6870:c147:b0:136:90c4:ee84 with SMTP id g7-20020a056870c14700b0013690c4ee84mr19875058oad.295.1666590958766; Sun, 23 Oct 2022 22:55:58 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:58 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:40 -0500 Message-Id: <20221024055543.116040-9-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 08/11] Removes code to force using libc++ instead of libstdc++ if available. 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 This breaks during cross-compilation when this is not true for the meson-cross cross-compiler target. Error: clang++: error: argument unused during compilation: '-stdlib=libc++' [-Werror,-Wunused-command-line-argument] --- meson.build | 8 -------- 1 file changed, 8 deletions(-) diff --git a/meson.build b/meson.build index 56910698..7d0588d2 100644 --- a/meson.build +++ b/meson.build @@ -95,14 +95,6 @@ if cc.get_id() == 'clang' ] endif - # Use libc++ by default if available instead of libstdc++ when compiling - # with clang. - if cc.find_library('libc++', required: false).found() - cpp_arguments += [ - '-stdlib=libc++', - ] - endif - cpp_arguments += [ '-Wextra-semi', '-Wthread-safety', From patchwork Mon Oct 24 05:55:41 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: 17684 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 07795C3285 for ; Mon, 24 Oct 2022 05:56:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7DE4862F17; Mon, 24 Oct 2022 07:56:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590966; bh=8dK/hyVkFa9l4QITdedmqptYF0pa9Ow1zxArdOZrEr8=; 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=x3RJEChvHCp8eapxzlk323PSW6qr93CAYVE4UHMMnumqwytiRa5/sM02oRaKP84At D7zt4w1xskrPXjyRsLlLgH6Y0vaQ6cvuNLY3dkGRC2XuOIDpM9Uu3c8VVjJ3esDZbQ /p9nB1QwYHOS1MSB23RUf3xNT7P5oLzbIXyKEUV84s9xGD9x9wmFOErLDcvpUawsts 4yyn1sx6VqW3mIR5UVv/nRhoqMayuPCEG3WyMIWmAXOxuDslLkrMCW/jNrSVWIjM2F N/n24U1eTF5uH76LsI6IS+Myf92S2g65NppI9FK6aTchdbPM5gloykvrVV9ezc9IzE 72WKffDci/FEA== Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C425D62F09 for ; Mon, 24 Oct 2022 07:56:01 +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="HI4xtw6P"; dkim-atps=neutral Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1322d768ba7so10796333fac.5 for ; Sun, 23 Oct 2022 22:56:01 -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=y2hEpCsq8TLWKTKIEMZub7cdxGQHSOfebJxxIIDwedc=; b=HI4xtw6PmOOBtM2m98houl8IxluHuln6JGDYce/esR7VL6xhNWCMxS7jL35/oi6fUA MUnRdL/iO+YlgLq0lJ5Uun9uDK8wwxI0v81yMgwPnnK5G8pOVzZemYK1MfFPjTJ6jf6w J/nG93L5syU8x6/DiiYE6aVx1fgWCo+t3zOr6GU0k7t9MVEEGXbE7BbxqO3WStroh9TW QVpgJrH5LXwnrIckyAAEf2i3VFqKBHPCWMs3RvTwXH7uLvQeiZ/dK/P2rxG90VPY6B/6 PDfxAUxFBEKUsrAtDMi+BE/T5XBCu2TNp50X6P7t2b/rC9yzfiULiZgvSldYNzvNAuv9 XRAw== 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=y2hEpCsq8TLWKTKIEMZub7cdxGQHSOfebJxxIIDwedc=; b=faMpYNFy8y50RC+V5MHqMrXLrPCj3rzusPeVIJzlAowE2ozIaTXTK5hR2haVENU2qq 55zORS9whLqB4WlxXjb97qktCjAcMj1j9XlRJ0ZjY3mz8ORWXrKdUwwCeI8rhJpnqgqN gOzeti4ZatcL52sxr3ONv9A4H7XLrRmlxBpG1RqO4H81ggbHA4tRifqLfeDhQUrmWaN5 h/LijQd5DRvaF9hyrsqE1CfF4SRNm2hXm3dnP6019TF7JjSLIWc79uMvLERJk1r+N6bQ UpZG55bp4OvLO8NFYVuTmiEvlSQxu4iQ/Wcm6VqU4FC9Ck7bjGzyorbusgJmD8piTe6E 1uQw== X-Gm-Message-State: ACrzQf31ua322jy0WdjkW+MzAQlajqJem2zz9CCqJfCDNMFkgo2dmK0F G58jBKfs6mcTYC/dM+bCI9ugrBHb2hEAsuVs X-Google-Smtp-Source: AMsMyM7Ek/MChTpcIl9ZmhOz+EGRgYcFtnXkr2kLoCFDZduhSuvGA6D1ZyvLXRoEV1fNzU9TX4J8rQ== X-Received: by 2002:a05:6870:2498:b0:131:958e:3cbd with SMTP id s24-20020a056870249800b00131958e3cbdmr38489487oaq.72.1666590960235; Sun, 23 Oct 2022 22:56:00 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:55:59 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:41 -0500 Message-Id: <20221024055543.116040-10-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 09/11] Adds Android makefiles to build libcamera 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 --- android/Android.mk | 86 ++++++++++++ android/meson_cross.mk | 296 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 382 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..bb1661cd --- /dev/null +++ b/android/meson_cross.mk @@ -0,0 +1,296 @@ +# 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 \ + -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 -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 Mon Oct 24 05:55:42 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: 17685 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 5B9A1C3286 for ; Mon, 24 Oct 2022 05:56:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE3BA62F18; Mon, 24 Oct 2022 07:56:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590967; bh=SuhQ6dhEWp88i57VP77y/jAbxTL15UkDhiV9cnvQkik=; 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=km0hrn38Ib9hVLkuKSFXmQIPlpbgUmUTw3z5zoLdeyPHmWxy1CaKKwSzuO1FgGdNi bIy3dHdlrHlB+/JERkpl6CXAjrUOV9JLjBI9Ua2+SumEsWM/135jUSKS/vOUCz61TF G96N32qGLb01NWQGG9Do8osRR12jJxI0hBE+CpfKZruU08uLP0EyPOXHDbN4XDkrtU CuRA0CEVNVmTqja6Ir/vheiMbUtyAd8zLwi2iys67MSKo2c+nKAxRbFUd1r+lyotTo tVHuugizFjWcnUk8SIPFepO3cZLuuhh1sm2TywWJlBsAinAbV4wDbMUDHhjFXFWjCJ jzhaRuGLFZzQQ== Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5646762F0A for ; Mon, 24 Oct 2022 07:56:02 +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="WAPOILri"; dkim-atps=neutral Received: by mail-ot1-x32c.google.com with SMTP id z11-20020a05683020cb00b00661a95cf920so5365302otq.5 for ; Sun, 23 Oct 2022 22:56:02 -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=huXpY0kdXALbfYSJ3F6nqYO414tLR2zn4iq7mxfc+Zk=; b=WAPOILri6uBXcMjQ4qBqAXoTnEl5GwzHyfjtheK5C+met4hKIACwiJFxWFujnyRoaO lQZg6oq7KiJiKC9OIGAmyD5BEfOTIpzOIMJ2qaRhN3AThw+A5ani10SsqaPTONBjeqFy ygCxeWqRmgL/iiW0dxzOJO6yRH26pLEq7oJ4M/MvmgHPsslDyrxTve4ZstNquqJBFOV3 kdX5BLQm3z4OiDBtl7+L4k1PDVc779zeagw1DVVWwP87NC5iBupPExAQTA9xKdEjnqxA DQr5ujCP4kzkGlTN7ky5dFXpGD7tOWLJ06LHZ6H9Cq5r16A20zMJcSncV1Ubh2d5DNn7 9lZQ== 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=huXpY0kdXALbfYSJ3F6nqYO414tLR2zn4iq7mxfc+Zk=; b=RumoWvdONlK1XqIects/T2fZtcXF59hYH0yDAYxwr/WHIyfGRVXV7YX7VZd5kh2yTh 8X2YfYG/2W4zfSX1SLKbt32qun038XFPs544Iaui51a+Mr0uTArbJpCyE5gvn+amtOik vu8k28TpW0F9YqxTzqQ6HWtRg6WHZYWNqFvI46f081wrgIN/F/IADqxkC2fK2X+YvXKY 8UqGbuTrZQHwqpueK8DvnYcU1Up2v3M2JAvhic2zmihIQV6lmRD9jWXT7TtNwHRW9Yky 7hs+uLaosmTh/z5edxyItK90bO4i+sGZTHhTDJJjcS/n2GeQpjDSKGYQgKMBtwqbTDqe GFOw== X-Gm-Message-State: ACrzQf3tAi9kPnDsM4/2dWjMnqozT+ws05ca9F+RyV0h6XEPrTlbWB4Y o7whjWnzmnxiA1mEddehwzSJlLl6VbFw2WDL X-Google-Smtp-Source: AMsMyM4tT8LCjRSBpbBgBB1BcoOHk1blD2NrmLMAKPfWRVqSnesNv6zwjwaVHC/cy6GyTTU/guI2Nw== X-Received: by 2002:a05:6830:618c:b0:65b:d2db:5f77 with SMTP id cb12-20020a056830618c00b0065bd2db5f77mr15423770otb.348.1666590960709; Sun, 23 Oct 2022 22:56:00 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:56:00 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:42 -0500 Message-Id: <20221024055543.116040-11-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/11] Adds a flag to disable IPA isolation, necessary 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 --- 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 7d0588d2..2303f752 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 Mon Oct 24 05:55:43 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: 17686 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 E2DFEBD16B for ; Mon, 24 Oct 2022 05:56:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76D2462F10; Mon, 24 Oct 2022 07:56:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666590968; bh=HUrqt4wqP8i1FlW/s6geLVzyP/5YAcKzD5Wz9hdN3T0=; 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=w4O4X70XIEJypD3Q0Td1qw3uqlhUjhbrAQlFcKeFrBsvNoYs9scrQxTv7onYEpWtN iV0QgiwvOzlQaArZCSQ6CunJ3aGlHt/1ZRrg3DH1izEIwXDNMw9//+eK/9W3HF3Uyp eA4QXjnAj1BsypgA7WEhsq7tfi1TW8IISpEJt79fF4MYU3aXYQN2QeeOMkoPiv978T nI/EkG6EI7VbQFul8l9dnYUMC+xfB802FP41if7DYEhCBZ2etzEeXoNLao6rTBxfYG q//9dJEtTallhlrlr5+JrTTGf92DLjN0hePVHbtSpRI3gAedYqTRce856eO+KfbZud tyQTq+FvJ5GAw== Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AB4F962EFD for ; Mon, 24 Oct 2022 07:56:02 +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="Z5U275JO"; dkim-atps=neutral Received: by mail-ot1-x331.google.com with SMTP id r13-20020a056830418d00b0065601df69c0so5363325otu.7 for ; Sun, 23 Oct 2022 22:56:02 -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=d2Wxn9GxD9kN8fj4nu1ugggjmE6Wwm8g2qACyX8n20Y=; b=Z5U275JOHe4cFOgze2NusWxZx7MkPDKEBu+QQC1J67CwcfAZilUPDZom3Tq38u/pAD TtizbHIXFqtXq70Y2NzW6MAZOwNi7ehAFS/nLqzlyXDChkpvWpGwNbdKO32EGhYbeRAN Ug6r3eOBCzGF26zwf4VRdfixa+PWu2Um/IavYNyBbXDoairfuA2GT9ywlAJ0pilLGoyD bLskI3Dr/s5pL29qpwx1/fe7OIyQBs26G5ixZqAaniRxd+b8LhBzLSO1D2vk8d01HdK4 5MT9OkxHuB0qt1h9uXu0f1Tll5hp4eCM+NKqdcimhF0VcWLWT6LlCjUbF6uN7oxUySSi Sprg== 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=d2Wxn9GxD9kN8fj4nu1ugggjmE6Wwm8g2qACyX8n20Y=; b=PwjcVqnNWNMzlrsrSVJLwW+j8fi8jsRN3muPVdxk02IgNa85T9g+ap2P8/WdzTqFZH wVGaKvkKiUtHkbNVVZkaCZoYeiM/rOuTvhsEY1trCFs2uaj65ECm23OYikfXqJ0d8YN2 rrvigXxHNZwZClY4KIeXUfJtkKZuCSoc49Ph1Wigv5E6UE4gpjC4Uu2TcqbwoKcox1nO o5HxyceNi85MgJW+4Q324qfvZGwPeToSveA0VS08YR5oiSIN4vKUpwtnIHXB9tlWk4dF qzY+y6H2H3Dy/kRwW1MHZUAsA7aq0sNivWBGJAPxEY2ID0geVPlHrBrPVDm7rTsWMm0q Wz5Q== X-Gm-Message-State: ACrzQf0VX3K2wfk/hYroClr3DQ9cqEYrMC2Pyud5mF6YJZ0uksJr99CD XrIeGdsX0GsjjIUhA7cNmVf8nAxPv5UIayaB X-Google-Smtp-Source: AMsMyM7G70LX2W6tsmg6V8E3gcRLd5mUy/nUQrLVkW0gMIjx0BjLDaACYbU7DBPPBERFK589QHuwLw== X-Received: by 2002:a05:6830:6002:b0:660:7be2:59b2 with SMTP id bx2-20020a056830600200b006607be259b2mr15353176otb.183.1666590961980; Sun, 23 Oct 2022 22:56:01 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:7bc3:aed3:676f:10a0]) by smtp.gmail.com with ESMTPSA id x15-20020a9d628f000000b0066193df8edasm3980278otk.34.2022.10.23.22.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 22:56:01 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Oct 2022 00:55:43 -0500 Message-Id: <20221024055543.116040-12-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024055543.116040-1-nicholas@rothemail.net> References: <20221024055543.116040-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/11] Adds useful debug print statements. 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 --- src/android/camera_capabilities.cpp | 12 +++++++++--- src/android/camera_hal_manager.cpp | 3 ++- src/libcamera/base/log.cpp | 6 +++++- src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 ++ src/libcamera/v4l2_subdevice.cpp | 3 ++- 5 files changed, 20 insertions(+), 6 deletions(-) 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..7fac4e3f 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 NOT loaded: \"" << cam->id() << "\""; return; } diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index 55fbd7b0..b8c2c99f 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -625,8 +625,12 @@ void Logger::parseLogFile() void Logger::parseLogLevels() { const char *debug = utils::secure_getenv("LIBCAMERA_LOG_LEVELS"); - if (!debug) + if (!debug) { + syslog(LOG_INFO, "Could not find LIBCAMERA_LOG_LEVELS in env"); return; + } else { + syslog(LOG_INFO, "LIBCAMERA_LOG_LEVELS is %s", debug); + } for (const char *pair = debug; *debug != '\0'; pair = debug) { const char *comma = strchrnul(debug, ','); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 2d38f0fb..a2038704 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -33,10 +33,12 @@ bool RkISP1Path::init(MediaDevice *media) std::string resizer = std::string("rkisp1_resizer_") + name_ + "path"; std::string video = std::string("rkisp1_") + name_ + "path"; + LOG(RkISP1, Debug) << "Creating " << resizer; resizer_ = V4L2Subdevice::fromEntityName(media, resizer); if (resizer_->open() < 0) return false; + LOG(RkISP1, Debug) << "Creating " << video; video_ = V4L2VideoDevice::fromEntityName(media, video); if (video_->open() < 0) return false; diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 15e8206a..8f86387b 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -392,7 +392,8 @@ int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target, if (ret < 0) { LOG(V4L2, Error) << "Unable to get rectangle " << target << " on pad " - << pad << ": " << strerror(-ret); + << pad << ": " << strerror(-ret) << "." + << "device path: " << devicePath() << " device node: " << deviceNode(); return ret; }