From patchwork Fri Jul 30 11:01:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13168 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 DAE39C3230 for ; Fri, 30 Jul 2021 11:02:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F67A687C5; Fri, 30 Jul 2021 13:02:09 +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="Rkp4aVzv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 85311687BF for ; Fri, 30 Jul 2021 13:02:08 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5F9E189B; Fri, 30 Jul 2021 13:02:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1627642928; bh=c+34qa8aMZBTvDHQXVehLuouzjpJuViqAwK3oPMEZDM=; h=From:To:Cc:Subject:Date:From; b=Rkp4aVzvM1vY00wmkV/UJN05ZxgYp2xjt8nyi4kYQrtDlvdLQnjbnoydt0XiyP2WK ZInyl7pHOc2XWA/KBENKA6LnLsri8GMv1HnykU9b52oyvR3M2TICaFUPXEAs/zdCok OKeIJZFnMN69DBRbDWuxAdqiJVe1AlJ3ltBL1WfE= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Jul 2021 16:31:50 +0530 Message-Id: <20210730110154.181370-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 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