Show a patch.

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

{
    "id": 13275,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/13275/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13275/",
    "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": "<20210810075854.86191-4-umang.jain@ideasonboard.com>",
    "date": "2021-08-10T07:58:53",
    "name": "[libcamera-devel,v2,3/4] ipu3: cio2: Change sensor size selection policy",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "25067c41209c03e1f39c6bf0f628a8fe1a52a8d9",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": {
        "id": 12,
        "url": "https://patchwork.libcamera.org/api/1.1/users/12/?format=api",
        "username": "uajain",
        "first_name": "Umang",
        "last_name": "Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/13275/mbox/",
    "series": [
        {
            "id": 2328,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2328/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2328",
            "date": "2021-08-10T07:58:50",
            "name": "ipu3: Change sensor size selection policy",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2328/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13275/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13275/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 D032ABD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 Aug 2021 07:59:10 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9A4D36884F;\n\tTue, 10 Aug 2021 09:59:10 +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 1285B687DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Aug 2021 09:59:09 +0200 (CEST)",
            "from perceval.ideasonboard.com (unknown [103.238.109.8])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EB87DEE;\n\tTue, 10 Aug 2021 09:59:07 +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=\"vVuW6CPZ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628582348;\n\tbh=ztSBoGxIHRY6RabL/Z0ZrRT+YLswlAD2ozhrlQveljo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vVuW6CPZdewgzQWhkPUJJTe/FXvXpBnoH/bzE7jfB3kZvL7UDIShYvxvboN2vRXpj\n\tKpV8Ks6xaa2oyvmf0LEWnAjxqGVqKe6XEeC6m+3Hq3YSlsMB5UdLaW0TIM4XdEPcQM\n\tf45W9cCh2HzCQA/7Sw3+anw41XIvYbP/Yy5unWo4=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 10 Aug 2021 13:28:53 +0530",
        "Message-Id": "<20210810075854.86191-4-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210810075854.86191-1-umang.jain@ideasonboard.com>",
        "References": "<20210810075854.86191-1-umang.jain@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 3/4] ipu3: cio2: Change sensor size\n\tselection policy",
        "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": "The current implementation of getSensorFormat() prioritizes sensor\nsizes that match the output size FOV ratio.\n\nModify the frame size selection procedure to prioritize resolutions\nwith the same FOV as the sensor's native one, to avoid cropping in the\nsensor pixel array.\n\nFor example:\n\n- on a Soraka device equipped with ov13858 as back sensor, with a\n  native resolution of 4224x3136 (4:3), when requested to select the\n  sensor output size to produce 1080p (16:9) a frame size of 2112x1188\n  (16:9) is selected causing the ImgU configuration procedure to fail.\n  If a resolution with the same FOV as the sensor's native size, such\n  as 2112x1568 (4:3), is selected the pipeline works correctly.\n\nSuggested-by:: Jacopo Mondi <jacopo@jmondi.org>\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nTested-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nTested-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/cio2.cpp | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex 88dd364b..3c9331e3 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -248,8 +248,8 @@ StreamConfiguration CIO2Device::generateConfiguration(Size size) const\n  *\n  * - The desired \\a size shall fit in the sensor output size to avoid the need\n  *   to up-scale.\n- * - The sensor output size shall match the desired aspect ratio to avoid the\n- *   need to crop the field of view.\n+ * - The aspect ratio of sensor output size shall be as close as possible to\n+ *   the sensor's native resolution field of view.\n  * - The sensor output size shall be as small as possible to lower the required\n  *   bandwidth.\n  * - The desired \\a size shall be supported by one of the media bus code listed\n@@ -273,7 +273,9 @@ V4L2SubdeviceFormat CIO2Device::getSensorFormat(const std::vector<unsigned int>\n {\n \tunsigned int desiredArea = size.width * size.height;\n \tunsigned int bestArea = std::numeric_limits<unsigned int>::max();\n-\tfloat desiredRatio = static_cast<float>(size.width) / size.height;\n+\tconst Size &resolution = sensor_->resolution();\n+\tfloat desiredRatio = static_cast<float>(resolution.width) /\n+\t\t\t     resolution.height;\n \tfloat bestRatio = std::numeric_limits<float>::max();\n \tSize bestSize;\n \tuint32_t bestCode = 0;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "3/4"
    ]
}