[libcamera-devel,RFC,0/3] IPU3: Tweak sensor format selection
mbox series

Message ID 20210730082832.152626-1-umang.jain@ideasonboard.com
Headers show
Series
  • IPU3: Tweak sensor format selection
Related show

Message

Umang Jain July 30, 2021, 8:28 a.m. UTC
Different IPU3 platforms have different constraints that require certain
tweaking on the policy on how libcamera determines best sensor format.
To address these contraints, we need to drop CameraSensor::getFormat()
and have IPU3 specific sensor format selector member function.

Patch 1/3 and 2/3 prepares the base to introduce new policy on
selection. Patch 3/3 is the crux of the change, meant to address
constraints faced on Nautilus and Soraka.

This is a RFC where only preliminary testing have been done.
Extensive testing and further discussions are still under-way.

Umang Jain (3):
  libcamera: base: camera_sensor: Expose sensor's formats map
  ipu3: cio2: Replicate CameraSensor::getFormats() to a member function
  ipu3: cio2: Customize sensor format selection logic

 include/libcamera/internal/camera_sensor.h |   1 +
 src/libcamera/pipeline/ipu3/cio2.cpp       | 115 ++++++++++++++++++++-
 src/libcamera/pipeline/ipu3/cio2.h         |   5 +
 3 files changed, 119 insertions(+), 2 deletions(-)

Comments

Umang Jain July 30, 2021, 8:28 a.m. UTC | #1
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.

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'.

Change in v2:
- Introduce a re-factor patch 1/3
- Change comments in 2/3

Umang Jain (3):
  android: Instantiate CameraDevice after checking HAL config validity
  android: Override camera is "Internal" provided if found on HAL config
  android: nautilus: Add camera HAL configuration

 src/android/camera_device.cpp             | 10 +++++++++-
 src/android/camera_hal_manager.cpp        | 24 ++++++++++++++++++++---
 src/android/data/nautilus/camera_hal.yaml |  8 ++++++++
 3 files changed, 38 insertions(+), 4 deletions(-)
 create mode 100644 src/android/data/nautilus/camera_hal.yaml
Umang Jain July 30, 2021, 8:30 a.m. UTC | #2
Ouch, didn't delete patch dir before sending new series, please ignore!

Thanks!

On 7/30/21 1:58 PM, Umang Jain wrote:
> 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.
>
> 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'.
>
> Change in v2:
> - Introduce a re-factor patch 1/3
> - Change comments in 2/3
>
> Umang Jain (3):
>    android: Instantiate CameraDevice after checking HAL config validity
>    android: Override camera is "Internal" provided if found on HAL config
>    android: nautilus: Add camera HAL configuration
>
>   src/android/camera_device.cpp             | 10 +++++++++-
>   src/android/camera_hal_manager.cpp        | 24 ++++++++++++++++++++---
>   src/android/data/nautilus/camera_hal.yaml |  8 ++++++++
>   3 files changed, 38 insertions(+), 4 deletions(-)
>   create mode 100644 src/android/data/nautilus/camera_hal.yaml
>