Show a patch.

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

{
    "id": 20196,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20196/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20196/",
    "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": "<20240603224855.25011-1-laurent.pinchart@ideasonboard.com>",
    "date": "2024-06-03T22:48:55",
    "name": "libcamera: libipa: camera_sensor: define AR0521 helper functions inline",
    "commit_ref": "d9c6835e23ec9ff719acc76abb8cde89450680c2",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "80f8f8bc2c6de73e0f39cd8a1351d0e98c85d9aa",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20196/mbox/",
    "series": [
        {
            "id": 4355,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4355/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4355",
            "date": "2024-06-03T22:48:55",
            "name": "libcamera: libipa: camera_sensor: define AR0521 helper functions inline",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4355/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20196/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20196/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 53DDBBDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Jun 2024 22:49:15 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2F018634CA;\n\tTue,  4 Jun 2024 00:49:14 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 13D8A61A45\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jun 2024 00:49:12 +0200 (CEST)",
            "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 87B82AB5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Jun 2024 00:49:04 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RCjOx77m\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1717454944;\n\tbh=euANdLCjLP/csBD1TI4Xr8k1niasdQRatSAAv8A/USY=;\n\th=From:To:Subject:Date:From;\n\tb=RCjOx77m3IdpgFY6PJFlatDJN0cfzAEYPQnziY3JGDP2v9AM0AOc+yqmnh9y2wJCF\n\trZIuyQpoTjryKwoCfiPLPM/qS7tjEjfEzhjPbW04WxSyrGlG4sF3/fo18JyLcQsx1J\n\t7a9rc3Gt8GUOwE/159FcAJpyzbNnphoCpXItjlPE=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH] libcamera: libipa: camera_sensor: define AR0521 helper\n\tfunctions inline",
        "Date": "Tue,  4 Jun 2024 01:48:55 +0300",
        "Message-ID": "<20240603224855.25011-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "All CameraSensorHelper subclasses define their member functions inline,\nexcept for the CameraSensorHelperAr0521 class. Inline the gainCode() and\ngain() functions to match the other classes.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/libipa/camera_sensor_helper.cpp | 36 +++++++++++--------------\n 1 file changed, 16 insertions(+), 20 deletions(-)\n\n\nbase-commit: 6cd17515ffeb67fb38ffcc4d57aadf9732b54800",
    "diff": "diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\nindex 2cd61fccfbb9..782ff9904e81 100644\n--- a/src/ipa/libipa/camera_sensor_helper.cpp\n+++ b/src/ipa/libipa/camera_sensor_helper.cpp\n@@ -369,30 +369,26 @@ static constexpr double expGainDb(double step)\n class CameraSensorHelperAr0521 : public CameraSensorHelper\n {\n public:\n-\tuint32_t gainCode(double gain) const override;\n-\tdouble gain(uint32_t gainCode) const override;\n+\tuint32_t gainCode(double gain) const override\n+\t{\n+\t\tgain = std::clamp(gain, 1.0, 15.5);\n+\t\tunsigned int coarse = std::log2(gain);\n+\t\tunsigned int fine = (gain / (1 << coarse) - 1) * kStep_;\n+\n+\t\treturn (coarse << 4) | (fine & 0xf);\n+\t}\n+\n+\tdouble gain(uint32_t gainCode) const override\n+\t{\n+\t\tunsigned int coarse = gainCode >> 4;\n+\t\tunsigned int fine = gainCode & 0xf;\n+\n+\t\treturn (1 << coarse) * (1 + fine / kStep_);\n+\t}\n \n private:\n \tstatic constexpr double kStep_ = 16;\n };\n-\n-uint32_t CameraSensorHelperAr0521::gainCode(double gain) const\n-{\n-\tgain = std::clamp(gain, 1.0, 15.5);\n-\tunsigned int coarse = std::log2(gain);\n-\tunsigned int fine = (gain / (1 << coarse) - 1) * kStep_;\n-\n-\treturn (coarse << 4) | (fine & 0xf);\n-}\n-\n-double CameraSensorHelperAr0521::gain(uint32_t gainCode) const\n-{\n-\tunsigned int coarse = gainCode >> 4;\n-\tunsigned int fine = gainCode & 0xf;\n-\n-\treturn (1 << coarse) * (1 + fine / kStep_);\n-}\n-\n REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n \n class CameraSensorHelperImx219 : public CameraSensorHelper\n",
    "prefixes": []
}