Db820c - mipi csi camera support

hi,

http://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/latest/

In this release , which is the kernel branch mapped to the built bootimage ? does it mapped to this git tree
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git/log/?h=release/db820c/qcomlt-4.11

Does it has mipi csi camera supported?

regards,
vinaysimha

I’m also looking forward to those answers. I hope someone could give us some feedback on the features roadmap of the Linaro Debian related to the CSI camera drivers (such as OV5645, CAMSS and CCI), which are required for enabling the cameras. What I can notice is that the support for this board (DB820c) is still preliminary, and those missing features will be deployed in next releases. But this is just my guess.

hi,

yes, the current builds are still preliminary. We are working on a kernel upgrade to our 4.14 release branch (e.g. the same branch we use for DB410c). That should happen really soon now, we are getting close.

In terms of camera/CSI, you can expect pretty much the same features set as on DB410c. The following is done and the code is available publicly on mailing lists already:

  • Input from camera sensor via CSIPHY - DPHY (2 phase);
  • Generation of test input data by the TG in CSID;
  • RDI interface of VFE (VFE0 only) - raw dump of the input data to memory. Supported formats:
    • YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV / V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY);
    • MIPI RAW8 (8bit Bayer RAW - V4L2_PIX_FMT_SRGGB8 / V4L2_PIX_FMT_SGRBG8 / V4L2_PIX_FMT_SGBRG8 / V4L2_PIX_FMT_SBGGR8);
    • MIPI RAW10 (10bit packed Bayer RAW - V4L2_PIX_FMT_SBGGR10P / V4L2_PIX_FMT_SGBRG10P / V4L2_PIX_FMT_SGRBG10P / V4L2_PIX_FMT_SRGGB10P);
    • MIPI RAW12 (12bit packed Bayer RAW - V4L2_PIX_FMT_SRGGB12P / V4L2_PIX_FMT_SGBRG12P / V4L2_PIX_FMT_SGRBG12P / V4L2_PIX_FMT_SRGGB12P).

The following is done internally, and not yet available publicly. Pending some internal reviews.

  • PIX interface of VFE (VFE0 only):
    • Format conversion.
      • Supported input formats:: YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV / V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY).
      • Supported output formats:
        • NV12/NV21 (two plane YUV 4:2:0 - V4L2_PIX_FMT_NV12 / V4L2_PIX_FMT_NV21);
        • NV16/NV61 (two plane YUV 4:2:2 - V4L2_PIX_FMT_NV16 / V4L2_PIX_FMT_NV61);
        • YUYV/UYVY/YVYU/VYUY (packed YUV 4:2:2 - V4L2_PIX_FMT_YUYV / V4L2_PIX_FMT_UYVY / V4L2_PIX_FMT_YVYU / V4L2_PIX_FMT_VYUY).
    • Scaling support. Configuration of the VFE0 Encoder Scale module for downscalling with ratio up to 16x.
    • Cropping support. Configuration of the VFE0 Encoder Crop module.
  • RDI interface of VFE (VFE0 only) - raw dump of the input data to memory. Add support for:
    • MIPI RAW14 (14bit packed Bayer RAW - V4L2_PIX_FMT_SRGGB14P / V4L2_PIX_FMT_SGBRG14P / V4L2_PIX_FMT_SGRBG14P / V4L2_PIX_FMT_SRGGB14P).
  • CSID/ISPIF - add support for RAW MIPI10 to Plain16 format conversion (PRDI mode).
    Supported input format:
    • MIPI RAW10 (10bit packed Bayer RAW - V4L2_PIX_FMT_SBGGR10P).
      Supported output format:
    • Plain16 (10bit Bayer RAW in 16bit words - V4L2_PIX_FMT_SBGGR10).

All changes are expected to be available in the upcomgin 4.14 release branch, and at some point in the mainline Linux kernel.

Thank you, Nicolas.
These are very good news!

Since the latest snapshots of Linaro Debian are already based on Kernel 4.14, I’d like to confirm if MIPI-CSI2 cameras are already supported in DragonBoard 820c.

the CSI2 driver for APQ8096 are not yet merged in the 4.14 branch, they are available in a branch, we are doing some final testing of this branch these days, and they will be merged shortly.

Hi ndec,
i tested ov5645 with branch-release/db820c/qcomlt-4.11-camera then camera preview worked fine.

now i’m testing same with release/qcomlt-4.14 branch then camera is launching after some delay(~45sec) and getting below crash
Unknown pixelformat 0x45454270
[] v4l_enum_fmt+0x1428/0x1720
[] __video_do_ioctl+0x23c/0x2a8
[] video_usercopy+0x268/0x470
[] video_ioctl2+0x14/0x20
[] v4l2_ioctl+0xe8/0x118
[] do_vfs_ioctl+0xa4/0x748
[] SyS_ioctl+0x8c/0xa0

and once camera is launched only green video artifact is visible in the preview(uploaded the screnshot) and continuously getting below logs
arm_smmu_context_fault: 101959 callbacks suppressed
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13b2a0e0, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13b43940, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13b71e60, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13baa9e0, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13be90e0, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13c17ce0, fsynr=0x31, cb=0
arm-smmu da0000.arm,smmu: Unhandled context fault: fsr=0x402, iova=0x13c4ada0, fsynr=0x31, cb=0

how to resolve this issue?

Regards,
Laxman

Hi,

Can you tell me how to connect Db820c and ov5645?

I noticed that DB820c (APQ8096 Camera Subsystem) has two VFE (VFE0 and VFE1). So, hardware scaling and cropping will be possible for two cameras simultaneously.

Hi Nico

Is there any plan to get PIX support for RAW formats (SXXXX10P) ? I just got imx214 upstream sailus/media_tree.git - media_tree.git development repository and I would love to get video encoding running.

If not, are you aware if it is possible in the Android stack?

Thanks!

AFAIK there is no current plan, but you what’s preventing you to retrieve frame from raw interface (and then encode them)?

The encoder does not support RAW formats and I want to avoid doing the color conversion in CPU or OpenGL. Obviously if there was some kind of doc I would upstream the code and If at least it is supported in Android I would not mind trying to reverse engineer the Camera2 driver.

I admit it’s a good reason.

That would be great :wink:

You can have a look at the codeaurora driver:
https://source.codeaurora.org/quic/la/kernel/msm-4.9/tree/drivers/media/platform/msm/camera_v2?h=CogSystems-msm-49/msm-4.9

I think you mainly need to look at ‘isp’ dir in which camera interface is configured/selected and registers configured accordingly.

Thanks for the tip. A fast grep of “git grep 10P drivers/media/platform/msm/” does not give any result, but I will look deeper.

Cheers!

I think that bayer-10bit is known as CAMIF_QCOM_RAW mode in this downstream driver.

Which linux debian version use for dragonboard 820c?

Hi Nicolas -

I have a 16 bit input camera data - YCb YCr the Y and Cb/Cr components are each 8 bits, so 16 bits per clock. Is there a format that will support this over MIPI? Even a RAW16 or BT565 that I can fake the driver into using? I am reformatting the camera data using an FPGA with a MIPI output.

Currently I am doubling my pixel clock and feeding the data in as a RAW8 format, with 2x the width and then taking care of this in my software running on the 820. This is problematic as the FPGA won’t support doubling the pixel clock at 1080P60 rates (much less 4K).

Thanks for any ideas, Best - STeve

Maybe YUYV format fits better?