Patch Detail
Show a patch.
GET /api/patches/12634/?format=api
{ "id": 12634, "url": "https://patchwork.libcamera.org/api/patches/12634/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12634/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210618103351.1642060-2-paul.elder@ideasonboard.com>", "date": "2021-06-18T10:33:38", "name": "[libcamera-devel,v3,01/14] android: Add infrastructure for determining capabilities and hardware level", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "67cc2b2341af9467d94ba2b01c642e949a3766aa", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": { "id": 17, "url": "https://patchwork.libcamera.org/api/users/17/?format=api", "username": "epaul", "first_name": "Paul", "last_name": "Elder", "email": "paul.elder@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/12634/mbox/", "series": [ { "id": 2151, "url": "https://patchwork.libcamera.org/api/series/2151/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2151", "date": "2021-06-18T10:33:37", "name": "Preliminary FULL plumbing", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2151/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12634/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12634/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CE7C9BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Jun 2021 10:34:04 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 765D668946;\n\tFri, 18 Jun 2021 12:34:04 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F14668941\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Jun 2021 12:34:03 +0200 (CEST)", "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 34CC53E5;\n\tFri, 18 Jun 2021 12:34:01 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mYn6aeOc\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624012443;\n\tbh=DDyZJfAEx2CPr4RXyfDklS42LxrHzNi3OOwXiXQVd4g=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=mYn6aeOceqpS+TSwXvbfMKI1ri4pbJIcD+mLcBKl+Yx050TX/kOBHoN8puU//78gN\n\thCbZHIKW6OV/x3ZCK1zuxn2LRUcuFjo8yj4+4uUtN8EFTv3FQ8IH+EeJNq/7rEH22p\n\tAjndjmEFlZNbJ9VOA5tVBhQvPkdUdJTL5MWio/4s=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 18 Jun 2021 19:33:38 +0900", "Message-Id": "<20210618103351.1642060-2-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210618103351.1642060-1-paul.elder@ideasonboard.com>", "References": "<20210618103351.1642060-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 01/14] android: Add infrastructure for\n\tdetermining capabilities and hardware level", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add the infrastructure for checking and reporting capabilities. Use\nthese capabilities to determine the hardware level as well.\n\nSince the raw capability is set to true when support is determined to be\navailable, leave that as default false and set to true, since copying\nthe pattern of the other capabilities would cause redundant code.\n\nNote that this will cause CTS to fail, as we don't yet declare the lack\nof support for FULL based on the available controls.\n\nBug: https://bugs.libcamera.org/show_bug.cgi?id=55\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nThis patch doesn't need to be reviewed. It's just here for dependency\nresolution.\n\nChanges in v3:\n- fix come compiler errors\n- go ahead and initialize the capabilities to true, update the commit\n message accordingly\n\nChanges in v2:\n- add a flag for FULL, since there are a few requirements that are not\n obtained from capabilities alone\n- add burst capture capability, since that is required for FULL as well\n\nThis is my vision of how we would support the various capabilities.\nAlthough we don't have anything for FULL yet; I imagine that we would\nstart the flags for manual sensor and manual post processing with true,\nand then if a required control is unavailable, then we would set the\nflag to false.\n\nI considered declaring an enum in CameraDevice to mirror the android\nones, just for shorthand, but it seemed like a lot of code for not much\ngain. Unless the shorthand would be valuable because these constant\nnames are so long?\n\nI think the available keys lists will have to be moved to the head of\nthe function, and then as available controls are discovered add them to\nthat list.\n---\n src/android/camera_device.cpp | 43 +++++++++++++++++++++++++++--------\n 1 file changed, 33 insertions(+), 10 deletions(-)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 8c71fd06..25dd2569 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -13,6 +13,7 @@\n #include <array>\n #include <cmath>\n #include <fstream>\n+#include <map>\n #include <sys/mman.h>\n #include <tuple>\n #include <unistd.h>\n@@ -840,6 +841,17 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \tconst ControlInfoMap &controlsInfo = camera_->controls();\n \tconst ControlList &properties = camera_->properties();\n \n+\tstd::map<camera_metadata_enum_android_request_available_capabilities, bool>\n+\tcapabilities = {\n+\t\t{ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE, true },\n+\t\t{ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE, true },\n+\t\t{ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR, true },\n+\t\t{ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING, true },\n+\t\t{ ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW, false },\n+\t};\n+\n+\tbool fullSupport = true;\n+\n \t/* Color correction static metadata. */\n \t{\n \t\tstd::vector<uint8_t> data;\n@@ -1298,11 +1310,6 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \tuint8_t croppingType = ANDROID_SCALER_CROPPING_TYPE_CENTER_ONLY;\n \tstaticMetadata_->addEntry(ANDROID_SCALER_CROPPING_TYPE, croppingType);\n \n-\t/* Info static metadata. */\n-\tuint8_t supportedHWLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;\n-\tstaticMetadata_->addEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL,\n-\t\t\t\t supportedHWLevel);\n-\n \t/* Request static metadata. */\n \tint32_t partialResultCount = 1;\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_PARTIAL_RESULT_COUNT,\n@@ -1323,10 +1330,6 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS,\n \t\t\t\t maxNumInputStreams);\n \n-\tstd::vector<uint8_t> availableCapabilities = {\n-\t\tANDROID_REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE,\n-\t};\n-\n \t/* Report if camera supports RAW. */\n \tbool rawStreamAvailable = false;\n \tstd::unique_ptr<CameraConfiguration> cameraConfig =\n@@ -1338,7 +1341,7 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW &&\n \t\t info.bitsPerPixel == 16) {\n \t\t\trawStreamAvailable = true;\n-\t\t\tavailableCapabilities.push_back(ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW);\n+\t\t\tcapabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW] = true;\n \t\t}\n \t}\n \n@@ -1347,9 +1350,29 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS,\n \t\t\t\t numOutStreams);\n \n+\t/* Check capabilities */\n+\tstd::vector<uint8_t> availableCapabilities;\n+\tfor (auto cap : capabilities) {\n+\t\tif (cap.second)\n+\t\t\tavailableCapabilities.push_back(cap.first);\n+\t}\n \tstaticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES,\n \t\t\t\t availableCapabilities);\n \n+\tuint8_t supportedHWLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED;\n+\tif (capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR] &&\n+\t capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING] &&\n+\t capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE] &&\n+\t fullSupport)\n+\t\tsupportedHWLevel = ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL;\n+\tstaticMetadata_->addEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL,\n+\t\t\t\t supportedHWLevel);\n+\n+\tLOG(HAL, Info)\n+\t\t<< \"Hardware level: \"\n+\t\t<< (supportedHWLevel == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL\n+\t\t ? \"FULL\" : \"LIMITED\");\n+\n \tstd::vector<int32_t> availableCharacteristicsKeys = {\n \t\tANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES,\n \t\tANDROID_CONTROL_AE_AVAILABLE_ANTIBANDING_MODES,\n", "prefixes": [ "libcamera-devel", "v3", "01/14" ] }