Skip to content

Enable camera preview for AM62x boards with OV5640

Mattijs Korpershoek requested to merge mkorpershoek/csi into ti-android-12

This series enable Camera preview via the standard com.android.camera2 built-in AOSP app.

Reproduce steps

To reproduce, we should:

  1. Plug it in, hardware wise
  2. Select dtbo_index 2 in U-boot shell with:
=> env set dtbo_index 2
=> saveenv
=> reset

Hardware required:

  • AM62x SK board
  • OV5640 sensor module from ALINX

Detailed description

This series can be divided in 3 sections:

  1. Getting libcamera up-to-date with Android's (new) way of using gralloc + misc bugfixes.
  2. Extending the PostProcessorYuv to accept more formats than NV12
  3. Implement YUYV->NV12 conversion using libyuv and add various hacks around that

Some individual commits go over why this conversion is required, but I'll sum it up here for better visibility:

On am62x platforms, the receiver driver (j721e-csi2rx) only supports packed YUV422 formats such as YUYV, YVYU, UYVY and VYUY.

However, the IMGTEC gralloc implementation on am62x only supports semi-planar YUV420 formats such as NV12.

Since gralloc and j721e-csi2rx are incompatible, we need a way to get gralloc to allocate (NV12) the kernel-requested buffer length (YUYV).

Additional notes

The receiver and the sensor (ov5640) hardware are both capable of YUV420, however:

  • we are not aware of OV5640 being tested with YUV420 formats on any vendor tree.
  • NV12 has different line lines (even lines are twice as long as odd lines) Different line-sized DMA transfers have not been tested on the TI CSI-RX SHIM IP.

Bug: TIAU-319

Signed-off-by: Mattijs Korpershoek mkorpershoek@baylibre.com

Edited by Mattijs Korpershoek

Merge request reports

Loading