From patchwork Tue Aug 3 14:02:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13182 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 6AF45C3232 for ; Tue, 3 Aug 2021 14:02:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BB6A9687CC; Tue, 3 Aug 2021 16:02:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JvPgr4Yw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D65906026A for ; Tue, 3 Aug 2021 16:02:44 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.238.109.12]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C23F3F0; Tue, 3 Aug 2021 16:02:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1627999364; bh=NU4lqr9AqUVv6a3ckD7LGwtRV+gRPZq62zUvERkfr8k=; h=From:To:Cc:Subject:Date:From; b=JvPgr4Ywz0fZSXkjSI/8vp5Lq4ZxwLygupX6boRQ+DD+v+N+FAxweyLLLNfxVBe2P OfM77AwvphqwIv9WXWKSelycdgoS6gXTZa07UqAlE3rPUDFZCSBJAubWjSMl8tbuhJ i4+pJWXvEpDzV2aN6zh5yugrzuCCvjA8ZZgtQvlA= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Tue, 3 Aug 2021 19:32:33 +0530 Message-Id: <20210803140237.19302-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/4] android: Handle internal UVC cameras X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" libcamera-core all UVC cameras as 'external' (which makes sense as there is not much information to accurately determine location). However, in the HAL layer, we can probably determine accurately by looking at HAL config file camera entries. This series addresses the handling of such cameras, where the libcamera reports properties::CameraLocationExternal, but we know one of the UVC is internal/integrated to the system. It should be treated as internal. Also, as a point raised while reviews, we should disallow 'location: external' in HAL config file. Testing: With nautilus, it has one UVC and one IPU3 cameras. With these patches applied, both these cameras have id as '0' & '1' (i.e. internal). With camera service still running, I hotplugged a external UVC camera, and it got the camera numerical id as '1000'. Changes in v4: - Commit message typos - Drop the camera id_ < 1000 check in 3/4. It's not required because if a cameraConfigData is valid and has front/back valid location, it implicitly means that camera is internal. Changes in v3: - Introduce a new patch 2/4 to disallow 'external' location in HAL config - In 3/4, Reflect and adapt `if` checks accordingly in context of 2/4. (No tags have been collected intentionally due to change in `if` conditional checks) - Few minor clarifications in comments. Change in v2: - Introduce a re-factor patch 1/3 - Change comments in 2/3 Umang Jain (4): android: Instantiate CameraDevice after checking HAL config validity android: Disallow external location in HAL config android: Override camera as "Internal" provided found in HAL config android: nautilus: Add camera HAL configuration src/android/camera_device.cpp | 13 ++++++++++++- src/android/camera_hal_config.cpp | 2 -- src/android/camera_hal_manager.cpp | 23 ++++++++++++++++++++--- src/android/data/nautilus/camera_hal.yaml | 8 ++++++++ 4 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 src/android/data/nautilus/camera_hal.yaml