Show a patch.

GET /api/1.1/patches/11525/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 11525,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11525/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11525/",
    "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": "<20210309023907.83798-1-paul.elder@ideasonboard.com>",
    "date": "2021-03-09T02:39:07",
    "name": "[libcamera-devel,v2.1] ipa: raspberrypi: Use direct return value for configure()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4fea2ff0027c501ac5c39ad2f6b2f4f778fdb4ba",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11525/mbox/",
    "series": [
        {
            "id": 1773,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1773/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1773",
            "date": "2021-03-09T02:39:07",
            "name": "[libcamera-devel,v2.1] ipa: raspberrypi: Use direct return value for configure()",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1773/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11525/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11525/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 5CC67BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Mar 2021 02:39:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C976068A9C;\n\tTue,  9 Mar 2021 03:39:20 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D5A5A602E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Mar 2021 03:39:19 +0100 (CET)",
            "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 62725527;\n\tTue,  9 Mar 2021 03:39:15 +0100 (CET)"
        ],
        "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=\"hpZ8pH4n\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615257559;\n\tbh=ejbWlZBb92kwIHUCSHu6hmQgd9Pi1RwL95a1lNYIZFo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hpZ8pH4nlrWK18MeXHGivNEzDnSPM5h+sH1W4sVgZC6Cg2TMicaj1c8lCRTGaXY2I\n\tYQjw1Ct4P1YKsc8MPcMDRwFwZ+k7+mCOFVDvbgapjoxun/hoGyfUsf92D52gPzENl3\n\tGy3qtCRW+HgDQwT13kpSwnqfTOQHLiKEaNJ6Gb+4=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  9 Mar 2021 11:39:07 +0900",
        "Message-Id": "<20210309023907.83798-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210308074828.13228-4-paul.elder@ideasonboard.com>",
        "References": "<20210308074828.13228-4-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2.1] ipa: raspberrypi: Use direct return\n\tvalue for configure()",
        "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": "Now that we support returning int directly in addition to other output\nparameters, improve the configure() function in the raspberrypi IPA\ninterface.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n---\nChanges in v2.1:\n- remove init() changes, keep configure changes\n---\n include/libcamera/ipa/raspberrypi.mojom       |  2 +-\n src/ipa/raspberrypi/raspberrypi.cpp           | 34 ++++++++-----------\n .../pipeline/raspberrypi/raspberrypi.cpp      |  5 ++-\n 3 files changed, 18 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex c3d614b8..eb427697 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -77,7 +77,7 @@ interface IPARPiInterface {\n \t\t  map<uint32, IPAStream> streamConfig,\n \t\t  map<uint32, ControlInfoMap> entityControls,\n \t\t  ConfigInput ipaConfig)\n-\t\t=> (ConfigOutput results, int32 ret);\n+\t\t=> (int32 ret, ConfigOutput results);\n \n \t/**\n \t * \\fn mapBuffers()\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 85a2b846..7904225a 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -84,11 +84,11 @@ public:\n \t\t   ipa::RPi::StartControls *result) override;\n \tvoid stop() override {}\n \n-\tvoid configure(const CameraSensorInfo &sensorInfo,\n-\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t       const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t       const ipa::RPi::ConfigInput &data,\n-\t\t       ipa::RPi::ConfigOutput *response, int32_t *ret) override;\n+\tint configure(const CameraSensorInfo &sensorInfo,\n+\t\t      const std::map<unsigned int, IPAStream> &streamConfig,\n+\t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n+\t\t      const ipa::RPi::ConfigInput &data,\n+\t\t      ipa::RPi::ConfigOutput *response) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid signalStatReady(const uint32_t bufferId) override;\n@@ -290,16 +290,15 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo)\n \tmode_.max_frame_length = sensorInfo.maxFrameLength;\n }\n \n-void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n-\t\t       [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t       const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t       const ipa::RPi::ConfigInput &ipaConfig,\n-\t\t       ipa::RPi::ConfigOutput *result, int32_t *ret)\n+int IPARPi::configure(const CameraSensorInfo &sensorInfo,\n+\t\t      [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n+\t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n+\t\t      const ipa::RPi::ConfigInput &ipaConfig,\n+\t\t      ipa::RPi::ConfigOutput *result)\n {\n \tif (entityControls.size() != 2) {\n \t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n-\t\t*ret = -1;\n-\t\treturn;\n+\t\treturn -1;\n \t}\n \n \tresult->params = 0;\n@@ -309,14 +308,12 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \n \tif (!validateSensorControls()) {\n \t\tLOG(IPARPI, Error) << \"Sensor control validation failed.\";\n-\t\t*ret = -1;\n-\t\treturn;\n+\t\treturn -1;\n \t}\n \n \tif (!validateIspControls()) {\n \t\tLOG(IPARPI, Error) << \"ISP control validation failed.\";\n-\t\t*ret = -1;\n-\t\treturn;\n+\t\treturn -1;\n \t}\n \n \t/* Setup a metadata ControlList to output metadata. */\n@@ -334,8 +331,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\tif (!helper_) {\n \t\t\tLOG(IPARPI, Error) << \"Could not create camera helper for \"\n \t\t\t\t\t   << cameraName;\n-\t\t\t*ret = -1;\n-\t\t\treturn;\n+\t\t\treturn -1;\n \t\t}\n \n \t\t/*\n@@ -403,7 +399,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \n \tlastMode_ = mode_;\n \n-\t*ret = 0;\n+\treturn 0;\n }\n \n void IPARPi::mapBuffers(const std::vector<IPABuffer> &buffers)\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 6387fae5..0f01ce8f 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1250,9 +1250,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \t/* Ready the IPA - it must know about the sensor resolution. */\n \tipa::RPi::ConfigOutput result;\n \n-\tipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n-\t\t\t&result, &ret);\n-\n+\tret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n+\t\t\t      &result);\n \tif (ret < 0) {\n \t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n \t\treturn -EPIPE;\n",
    "prefixes": [
        "libcamera-devel",
        "v2.1"
    ]
}