Show a patch.

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

{
    "id": 12399,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12399/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12399/",
    "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": "<20210525091249.1224608-1-paul.elder@ideasonboard.com>",
    "date": "2021-05-25T09:12:49",
    "name": "[libcamera-devel,v3] android: CameraDevice: Report proper min and max frame durations",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "29fff00cbed2368daa4267c856b902c37bd26735",
    "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/12399/mbox/",
    "series": [
        {
            "id": 2061,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2061/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2061",
            "date": "2021-05-25T09:12:49",
            "name": "[libcamera-devel,v3] android: CameraDevice: Report proper min and max frame durations",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2061/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12399/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12399/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 797D0C3202\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 May 2021 09:13:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CB53E68921;\n\tTue, 25 May 2021 11:13:07 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C300A602AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 May 2021 11:13:05 +0200 (CEST)",
            "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 7BA4B344;\n\tTue, 25 May 2021 11:13:03 +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=\"Dwe0Qlm8\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621933985;\n\tbh=s/Vo7puZVOWpqNWOYxREO/rGhdjMH5Glyuw0ejqovVw=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=Dwe0Qlm8V3Koh3o0DVZBMwbBgMPjY0XJQQjSI4Ps2DpEp7IUQRlyEvKeORndwS816\n\tmkcyxkj1FcEgYRPE6l3t1qO9DtDALnffVzBV/DzDkrO010tMXZdlvae2wQwRvnfYgB\n\tEA7h5ICE3b+W4jF54FwKSCZEgbD7aOro2Hn/7JAM=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 25 May 2021 18:12:49 +0900",
        "Message-Id": "<20210525091249.1224608-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3] android: CameraDevice: Report proper\n\tmin and max frame durations",
        "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 HAL layer was getting the min and max frame durations from the\ncamera, then rounding it to fps to report as available fps ranges. The\nsame min and max frame durations were then being reported as min and max\nframe durations. Since the fps are integer values while the frame\ndurations are in ns, this caused a rounding error making it seem like we\nwere reporting an available max fps that was higher than what was\nallowed by the minimum frame duration.\n\nAn example is if the minimum frame duration is reported as 33366700ns.\nThe HAL layer would then convert it to fps, which is 29.97, but it would\nbe rounded and reported as 30 fps. When 30 fps is converted to a frame\nduration it is 33333333ns, which is less than the minimum frame duration\nthat we report. Thus the minimum frame duration that we report\ncontradicts the fps range that we report.\n\nFix this by recalculating the frame durations based on the rounded fps\nvalues.\n\nThis allows the following CTS test to pass:\n- android.hardware.camera2.cts.SurfaceViewPreviewTest#testPreviewFpsRange\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n---\nChanges in v3:\n- reword the comment\n- break this patch out of the FULL series\n---\n src/android/camera_device.cpp | 7 +++++++\n 1 file changed, 7 insertions(+)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 74bba4a4..41db51f7 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -854,6 +854,13 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \t\tint32_t minFps = std::round(1e9 / maxFrameDurationNsec);\n \t\tminFps = std::max(1, minFps);\n \n+\t\t/*\n+\t\t * Force rounding errors so that we have the proper frame\n+\t\t * durations for when we reuse these variables later\n+\t\t */\n+\t\tminFrameDurationNsec = 1e9 / maxFps;\n+\t\tmaxFrameDurationNsec = 1e9 / minFps;\n+\n \t\t/*\n \t\t * Register to the camera service {min, max} and {max, max}\n \t\t * intervals as requested by the metadata documentation.\n",
    "prefixes": [
        "libcamera-devel",
        "v3"
    ]
}