Patch Detail
Show a patch.
GET /api/patches/11808/?format=api
{ "id": 11808, "url": "https://patchwork.libcamera.org/api/patches/11808/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11808/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20210401101340.160590-3-paul.elder@ideasonboard.com>", "date": "2021-04-01T10:13:34", "name": "[libcamera-devel,RFC,2/8] android: CameraDevice: Report proper min and max frame durations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f3e30f41643556a25982c4c268c57b900edfb2ce", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": { "id": 17, "url": "https://patchwork.libcamera.org/api/users/17/?format=api", "username": "epaul", "first_name": "Paul", "last_name": "Elder", "email": "paul.elder@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/11808/mbox/", "series": [ { "id": 1878, "url": "https://patchwork.libcamera.org/api/series/1878/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1878", "date": "2021-04-01T10:13:32", "name": "android: First set of FULL fixes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1878/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11808/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11808/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 A40B8C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 1 Apr 2021 10:13:58 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5D17C6877C;\n\tThu, 1 Apr 2021 12:13:58 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 726DB6877C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 1 Apr 2021 12:13:57 +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 E917CF7;\n\tThu, 1 Apr 2021 12:13:55 +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=\"rnZUWyjc\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617272037;\n\tbh=Rt2fUsGmgRsrmQj4W1bmEZDWInTDjnToWsB5lFEwIPc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rnZUWyjciCsdTNABfa5Fu+dv765IXFfAFqLmOYjpsfUsJWOZH4Qrnm3Eno7auy8WS\n\tX3DESXIYB1YEPgSG8TxrByz5R3LPS4JErLMcpxvLd6PIQjV/TfcWUbJ2sTRDao//Y2\n\tG/i742dz/FL6MqpTW7EW/Ty4Fgj1Frg0s2dHtsgY=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 1 Apr 2021 19:13:34 +0900", "Message-Id": "<20210401101340.160590-3-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20210401101340.160590-1-paul.elder@ideasonboard.com>", "References": "<20210401101340.160590-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH 2/8] android: CameraDevice: Report\n\tproper min 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>", "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": "The HAL layer was getting the min and max frame durations from 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 was was allowed\nby the minimum frame duration.\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>\n---\n src/android/camera_device.cpp | 4 ++++\n 1 file changed, 4 insertions(+)", "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 2a685507..30ea3ade 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -799,6 +799,10 @@ 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/* Avoid rounding errors when we reuse these variables later */\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", "RFC", "2/8" ] }