Patch Detail
Show a patch.
GET /api/1.1/patches/11308/?format=api
{ "id": 11308, "url": "https://patchwork.libcamera.org/api/1.1/patches/11308/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11308/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210216103140.1077307-3-naush@raspberrypi.com>", "date": "2021-02-16T10:31:38", "name": "[libcamera-devel,2/4] ipa: raspberrypi: Remove MdParserRPi", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "730761b0a44ff92538855e45048047ccba9f9b32", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11308/mbox/", "series": [ { "id": 1696, "url": "https://patchwork.libcamera.org/api/1.1/series/1696/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1696", "date": "2021-02-16T10:31:36", "name": "Raspberry Pi: Embedded data usage", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1696/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11308/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11308/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 C4E55BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Feb 2021 10:32:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3749C637E5;\n\tTue, 16 Feb 2021 11:32:15 +0100 (CET)", "from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99D82637D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 11:32:12 +0100 (CET)", "by mail-wr1-x42d.google.com with SMTP id n8so12264294wrm.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 02:32:12 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\ta186sm3018054wme.17.2021.02.16.02.32.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 16 Feb 2021 02:32:11 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"pSoUytr6\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=qmnEAoO4i7QBLDEGgA6LFmWZLM34sydbmOWer6mxaWY=;\n\tb=pSoUytr6z+CFLilg2ARCsxoe6OTXcv/7JZuto6A7mgURY5NrCs1Q7Az4yjKZ46nnqE\n\tfD0nJaGsO8bPTzHGGeMINqh2ZvKOuL8yqGZLubrQEwqDvVwEPqVbHkcHwG/SmAmxuuNk\n\t2RqN/pN3Vh6K1DXt24gce1EM922rnozITczO6VIv8ADG7NlTSWTytE/CNPTe3JZuVqVa\n\trbcUA4Oy2GqJpsDV7D0mR085Wdtat2XSLULHrWvjqPfVIqpsKs1yJGNOKhdnLJtB7vrh\n\tgQeGD2HDlBgDTNnZlm/rG5kS2bah6npF3YNDPW8lg5GHcYLUTxSWQK+LbnTrUcUhgbxH\n\tOgLQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=qmnEAoO4i7QBLDEGgA6LFmWZLM34sydbmOWer6mxaWY=;\n\tb=KvLovm+VnYTMAVXB7fYf9d9lXVen9QxaEEAjJQ9ijs3ApZVaSdqRoC1ZB6vIDzyVKO\n\t7MXqPHrIGR+FVE5AVvfjeXOPQAvZJtunjZ60p4eRqoUBa+b3Rjf9EQbFjDBUJh6qhqpp\n\tHahXJqgnGCbR9cpD2TWtu1hJK7/2KneNiqiPD0S+fTxJeDoWHlf3DstvsAECifFp3+PT\n\t3EPyqrHg+I5i5eWJYUMqYRFEd/UEcGFaI+kJlmtK8iqYrnnDaxXczidZt4fhaOtcIiTd\n\tS2QzXaDPRLVbCv5Mxu4r07xNiBvY1+Qqc4z3cXgyCyXPKycIV7CV6wNCbbsAYYF/iarH\n\tQgUA==", "X-Gm-Message-State": "AOAM530lzXpQeQKjasGE1adE9OhYTlk9+sb9wLNMHgIBCDePThCJ9Ebu\n\tyPecD6hkrjgw7it3Ub35Ov8wFHbfW+DweFdH", "X-Google-Smtp-Source": "ABdhPJwb8Fr0yOpmyKVY1BZdaHnXHBgj7UsedqYQdIWE68icUHiS1NYvTisxr2AD5jam59dilDd0Eg==", "X-Received": "by 2002:adf:d082:: with SMTP id y2mr1351419wrh.293.1613471532138;\n\tTue, 16 Feb 2021 02:32:12 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 16 Feb 2021 10:31:38 +0000", "Message-Id": "<20210216103140.1077307-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210216103140.1077307-1-naush@raspberrypi.com>", "References": "<20210216103140.1077307-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 2/4] ipa: raspberrypi: Remove MdParserRPi", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "With the recent change to pass a ControlList to the IPA with exposure\nand gain values used for a frame, RPiController::MdParserRPi is not\nneeded any more. Remove all traces of it.\n\nThe derived CamHelper objects now pass nullptr values for the parser to\nthe base CamHelper class when sensors do not use metadata.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 9 ++++--\n src/ipa/raspberrypi/cam_helper_imx219.cpp | 4 +--\n src/ipa/raspberrypi/cam_helper_ov5647.cpp | 3 +-\n src/ipa/raspberrypi/md_parser_rpi.cpp | 37 -----------------------\n src/ipa/raspberrypi/md_parser_rpi.hpp | 32 --------------------\n src/ipa/raspberrypi/meson.build | 1 -\n 6 files changed, 8 insertions(+), 78 deletions(-)\n delete mode 100644 src/ipa/raspberrypi/md_parser_rpi.cpp\n delete mode 100644 src/ipa/raspberrypi/md_parser_rpi.hpp", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 93d1b7b0296a..c9cdc39c5932 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -42,7 +42,8 @@ CamHelper::CamHelper(MdParser *parser, unsigned int frameIntegrationDiff)\n \n CamHelper::~CamHelper()\n {\n-\tdelete parser_;\n+\tif (parser_)\n+\t\tdelete parser_;\n }\n \n uint32_t CamHelper::ExposureLines(double exposure_us) const\n@@ -88,8 +89,10 @@ uint32_t CamHelper::GetVBlanking(double &exposure, double minFrameDuration,\n void CamHelper::SetCameraMode(const CameraMode &mode)\n {\n \tmode_ = mode;\n-\tparser_->SetBitsPerPixel(mode.bitdepth);\n-\tparser_->SetLineLengthBytes(0); /* We use SetBufferSize. */\n+\tif (parser_) {\n+\t\tparser_->SetBitsPerPixel(mode.bitdepth);\n+\t\tparser_->SetLineLengthBytes(0); /* We use SetBufferSize. */\n+\t}\n \tinitialized_ = true;\n }\n \ndiff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp\nindex 95b8e698fe3b..0e454d0de2dc 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n@@ -19,8 +19,6 @@\n #include \"cam_helper.hpp\"\n #if ENABLE_EMBEDDED_DATA\n #include \"md_parser.hpp\"\n-#else\n-#include \"md_parser_rpi.hpp\"\n #endif\n \n using namespace RPiController;\n@@ -62,7 +60,7 @@ CamHelperImx219::CamHelperImx219()\n #if ENABLE_EMBEDDED_DATA\n \t: CamHelper(new MdParserImx219(), frameIntegrationDiff)\n #else\n-\t: CamHelper(new MdParserRPi(), frameIntegrationDiff)\n+\t: CamHelper(nullptr, frameIntegrationDiff)\n #endif\n {\n }\ndiff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\nindex a7f417324048..75486e900d31 100644\n--- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n@@ -8,7 +8,6 @@\n #include <assert.h>\n \n #include \"cam_helper.hpp\"\n-#include \"md_parser_rpi.hpp\"\n \n using namespace RPiController;\n \n@@ -38,7 +37,7 @@ private:\n */\n \n CamHelperOv5647::CamHelperOv5647()\n-\t: CamHelper(new MdParserRPi(), frameIntegrationDiff)\n+\t: CamHelper(nullptr, frameIntegrationDiff)\n {\n }\n \ndiff --git a/src/ipa/raspberrypi/md_parser_rpi.cpp b/src/ipa/raspberrypi/md_parser_rpi.cpp\ndeleted file mode 100644\nindex 2b0bcfc5f034..000000000000\n--- a/src/ipa/raspberrypi/md_parser_rpi.cpp\n+++ /dev/null\n@@ -1,37 +0,0 @@\n-/* SPDX-License-Identifier: BSD-2-Clause */\n-/*\n- * Copyright (C) 2020, Raspberry Pi (Trading) Limited\n- *\n- * md_parser_rpi.cpp - Metadata parser for generic Raspberry Pi metadata\n- */\n-\n-#include <string.h>\n-\n-#include \"md_parser_rpi.hpp\"\n-\n-using namespace RPiController;\n-\n-MdParserRPi::MdParserRPi()\n-{\n-}\n-\n-MdParser::Status MdParserRPi::Parse(void *data)\n-{\n-\tif (buffer_size_bytes_ < sizeof(rpiMetadata))\n-\t\treturn ERROR;\n-\n-\tmemcpy(&metadata, data, sizeof(rpiMetadata));\n-\treturn OK;\n-}\n-\n-MdParser::Status MdParserRPi::GetExposureLines(unsigned int &lines)\n-{\n-\tlines = metadata.exposure;\n-\treturn OK;\n-}\n-\n-MdParser::Status MdParserRPi::GetGainCode(unsigned int &gain_code)\n-{\n-\tgain_code = metadata.gain;\n-\treturn OK;\n-}\ndiff --git a/src/ipa/raspberrypi/md_parser_rpi.hpp b/src/ipa/raspberrypi/md_parser_rpi.hpp\ndeleted file mode 100644\nindex 52f54f008056..000000000000\n--- a/src/ipa/raspberrypi/md_parser_rpi.hpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-/* SPDX-License-Identifier: BSD-2-Clause */\n-/*\n- * Copyright (C) 2019, Raspberry Pi (Trading) Limited\n- *\n- * md_parser_rpi.hpp - Raspberry Pi metadata parser interface\n- */\n-#pragma once\n-\n-#include \"md_parser.hpp\"\n-\n-namespace RPiController {\n-\n-class MdParserRPi : public MdParser\n-{\n-public:\n-\tMdParserRPi();\n-\tStatus Parse(void *data) override;\n-\tStatus GetExposureLines(unsigned int &lines) override;\n-\tStatus GetGainCode(unsigned int &gain_code) override;\n-\n-private:\n-\t// This must be the same struct that is filled into the metadata buffer\n-\t// in the pipeline handler.\n-\tstruct rpiMetadata\n-\t{\n-\t\tuint32_t exposure;\n-\t\tuint32_t gain;\n-\t};\n-\trpiMetadata metadata;\n-};\n-\n-}\ndiff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\nindex 9e9ea80b93ad..0baf7b7e8d4a 100644\n--- a/src/ipa/raspberrypi/meson.build\n+++ b/src/ipa/raspberrypi/meson.build\n@@ -17,7 +17,6 @@ rpi_ipa_includes = [\n rpi_ipa_sources = files([\n 'raspberrypi.cpp',\n 'md_parser.cpp',\n- 'md_parser_rpi.cpp',\n 'cam_helper.cpp',\n 'cam_helper_ov5647.cpp',\n 'cam_helper_imx219.cpp',\n", "prefixes": [ "libcamera-devel", "2/4" ] }