Show a patch.

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

{
    "id": 15454,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15454/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15454/",
    "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": "<20220315175345.479951-3-kieran.bingham@ideasonboard.com>",
    "date": "2022-03-15T17:53:44",
    "name": "[libcamera-devel,2/3] ipa: ipu3: af: Use geometry classes to perform grid centering",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3ff59f739081b2642f3f277f391c263d7acef967",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": {
        "id": 11,
        "url": "https://patchwork.libcamera.org/api/1.1/users/11/?format=api",
        "username": "kbingham",
        "first_name": "Kieran",
        "last_name": "Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/15454/mbox/",
    "series": [
        {
            "id": 2964,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2964/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2964",
            "date": "2022-03-15T17:53:42",
            "name": "ipa: ipu3: af: Small improvements",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2964/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15454/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15454/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\r\n\t[92.243.16.209])\r\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 00D96C3262\r\n\tfor <parsemail@patchwork.libcamera.org>;\r\n\tTue, 15 Mar 2022 17:53:57 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E63FB604DA;\r\n\tTue, 15 Mar 2022 18:53:55 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\r\n\t[213.167.242.64])\r\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0BA3C604DA\r\n\tfor <libcamera-devel@lists.libcamera.org>;\r\n\tTue, 15 Mar 2022 18:53:54 +0100 (CET)",
            "from Monstersaurus.ksquared.org.uk.beta.tailscale.net\r\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\r\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A7C8F1C57;\r\n\tTue, 15 Mar 2022 18:53:53 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\r\n\ts=mail; t=1647366836;\r\n\tbh=rHcFZzLLbiRXEO5UNZlK2Upbi+S11EVe2qeCnKUc9AY=;\r\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\r\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\r\n\tFrom;\r\n\tb=D4RWjG/QACA9Rz42vaU3Cr2LfFMfhIMcli6yb13Op9+5rEJcpXxTCrNy/CqMALya8\r\n\t6zsCSWoBZMIf0ByaYpdN2pOqfzTUoeZvi6PW0Ql4eBuF2FenkzoH0hyvpziE+S/g+U\r\n\tVOh4CnUh037xdeK7JbrST//M3cTgse8k350HpTZlRXq6oN5/EqqobtZ+GjLo6jfRls\r\n\tbd7d58v7H1CUfXazGHIQrLQUaDILKAcDVFhPOMYMVv3fo7a47Gtk3T2LIMwHlb7FOY\r\n\tOGBm1uIV2Wcs/Sjf9PFs0CcKfplJav/fBbOnd425BjphE1KuK5HwMZPeJ5LasjLuJm\r\n\t/Jh9xLpedvCDA==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\r\n\ts=mail; t=1647366833;\r\n\tbh=rHcFZzLLbiRXEO5UNZlK2Upbi+S11EVe2qeCnKUc9AY=;\r\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\r\n\tb=NBQuLVtPabSW+MBuxdNxo+rjrmkoiyK8WPJeNlEN0s4RSUesfdwP1Vfz0VehNOf66\r\n\tyJB7mrQXAzxvSrdyW/YIUpsLiDTaSVvNeIJjflmzLLSsixRCGpfsXe/P0sx/L+b1nl\r\n\ta7Kx0nhhzAK6R0bBilaVAC64Hor1GnFiSDNsVtPo="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \r\n\tunprotected) header.d=ideasonboard.com\r\n\theader.i=@ideasonboard.com\r\n\theader.b=\"NBQuLVtP\"; dkim-atps=neutral",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Tue, 15 Mar 2022 17:53:44 +0000",
        "Message-Id": "<20220315175345.479951-3-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "In-Reply-To": "<20220315175345.479951-1-kieran.bingham@ideasonboard.com>",
        "References": "<20220315175345.479951-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/3] ipa: ipu3: af: Use geometry classes\r\n\tto perform grid centering",
        "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>,\r\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>,\r\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Kieran Bingham via libcamera-devel\r\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Use our geometry classes for Rectangle, Size and Point to identify\nthe region of interest for the autofocus, and center it on the BDS output.\n\nThis will facilitate custom ROI being passed in through controls at a later\ntime.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/af.cpp | 24 ++++++++++++++++--------\n 1 file changed, 16 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\r\nindex 3cedf8cbd687..469762a29937 100644\r\n--- a/src/ipa/ipu3/algorithms/af.cpp\r\n+++ b/src/ipa/ipu3/algorithms/af.cpp\r\n@@ -141,16 +141,24 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\r\n \tgrid.block_height_log2 = kAfMinGridBlockHeight;\r\n \tgrid.height_per_slice = kAfDefaultHeightPerSlice;\r\n \r\n-\t/* x_start and y start are default to BDS center */\r\n-\tgrid.x_start = (configInfo.bdsOutputSize.width / 2) -\r\n-\t\t       (((grid.width << grid.block_width_log2) / 2));\r\n-\tgrid.y_start = (configInfo.bdsOutputSize.height / 2) -\r\n-\t\t       (((grid.height << grid.block_height_log2) / 2));\r\n+\t/* Position the AF grid in the center of the BDS output. */\r\n+\tRectangle bds(configInfo.bdsOutputSize);\r\n+\tSize gridSize(grid.width << grid.block_width_log2,\r\n+\t\t      grid.height << grid.block_height_log2);\r\n+\r\n+\t/*\r\n+\t * \\todo - Support request metadata\r\n+\t * - Set the ROI based on any input controls in the request\r\n+\t * - Return the AF ROI as metadata in the Request\r\n+\t * - Provide an alignedTo on a point, or Rectangle x,y position\r\n+\t */\r\n+\tRectangle roi = gridSize.centeredTo(bds.center());\r\n+\tPoint start = roi.topLeft();\r\n \r\n \t/* x_start and y_start should be even */\r\n-\tgrid.x_start = (grid.x_start / 2) * 2;\r\n-\tgrid.y_start = (grid.y_start / 2) * 2;\r\n-\tgrid.y_start = grid.y_start | IPU3_UAPI_GRID_Y_START_EN;\r\n+\tgrid.x_start = (start.x / 2) * 2;\r\n+\tgrid.y_start = (start.y / 2) * 2;\r\n+\tgrid.y_start |= IPU3_UAPI_GRID_Y_START_EN;\r\n \r\n \t/* Initial max focus step */\r\n \tmaxStep_ = kMaxFocusSteps;",
    "prefixes": [
        "libcamera-devel",
        "2/3"
    ]
}