From patchwork Wed Sep 4 12:08:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1910 Return-Path: Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 09BC960BB2 for ; Wed, 4 Sep 2019 14:07:21 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 907A220005; Wed, 4 Sep 2019 12:07:19 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , kamesan@google.com, jcliang@google.com, shik@google.com, wtlee@google.com Date: Wed, 4 Sep 2019 14:08:43 +0200 Message-Id: <20190904120847.11934-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/4] android: Rework metadata tags X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 12:07:21 -0000 Hello, Quoting here the v2 cover letter for some background: ------------------------------------------------------------------------------ following a first simple patch "[PATCH] android: camera_device: Add pipeline max depth static metadata" a discussion with Ren-Pei and Ricky made clear the current metadata support was buggy, and since the ANDROID_REQUEST_AVAILABLE_CAPABILITIES tag was not reported, cros_camera_test failed to identify which static tags we were missing. Adding that tag opened a small pandora box, as the test reported -a lot- of tag where missing, and some of there were wrongly reported as part of the capture request template. This series tries to address this, by reporting all tags marked as "BC" and so required by LIMITED hardware level devices, cleaning up and improving the generated request template, and using more opportune sized for each metadata tag. cros_camera_test seems now more happy, both in regard to static metadata and the generated request template: # cros_camera_test --gtest_filter=Camera3ModuleFixture.* [==========] 9 tests from 1 test case ran. (2 ms total) [ PASSED ] 9 tests. # cros_camera_test --gtest_filter=Camera3DeviceTest* [==========] 22 tests from 4 test cases ran. (1044 ms total) [ PASSED ] 18 tests. [ FAILED ] 4 tests, listed below: [ FAILED ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorBeforeOpen/0, where GetParam() = 0 [ FAILED ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorBeforeOpen/1, where GetParam() = 1 [ FAILED ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorAfterOpen/0, where GetParam() = 0 [ FAILED ] Camera3DeviceTest/Camera3AlgoSandboxIPCErrorTest.IPCErrorAfterOpen/1, where GetParam() = 1 (I guess it's fine if we fail the IPC related tests) As all of this has been triggered by a system crash with R78 I would ask Laurent to test the series with his environment. I tested with R77 and things seems fine. ------------------------------------------------------------------------------ In this v3 there are just a few small reworks to the series: - use 2 as pipeline depth - remove two static tags from the template request - verify the metadata pack sizes is big enough* * Laurent suggested to use valgrind, but the android metadata library actually keeps track of the available and used space. Adding a new tag when space is exhausted fails, no need to manually check for out-of-bounds write. Re-sorted patches 3 and 4 compared to v2. Now tested with R78 by Laurent and confirmed the crash is fixed Thanks j Jacopo Mondi (4): android: camera_device: Add missing static metadata android: camera_device: Use correct sizes for static metadata android: camera_device: Rework template generation android: camera_device: Report available keys src/android/camera_device.cpp | 510 +++++++++++++++++++++++++--------- 1 file changed, 377 insertions(+), 133 deletions(-) --- 2.23.0