Re: [PATCH v4 00/21] Qualcomm 8x16 Camera Subsystem driver

2017-08-08 Thread Sakari Ailus
On Tue, Aug 08, 2017 at 04:29:57PM +0300, Todor Tomov wrote:
> This patchset adds basic support for the Qualcomm Camera Subsystem found
> on Qualcomm MSM8916 and APQ8016 processors.
> 
> The driver implements V4L2, Media controller and V4L2 subdev interfaces.
> Camera sensor using V4L2 subdev interface in the kernel is supported.
> 
> The driver is implemented using as a reference the Qualcomm Camera
> Subsystem driver for Android as found in Code Aurora [1].
> 
> The driver is tested on Dragonboard 410C (APQ8016) with one and two
> OV5645 camera sensors. media-ctl [2] and yavta [3] applications were
> used for testing. Also Gstreamer 1.10.4 with v4l2src plugin is supported.
> 
> More information is present in the document added by the third patch.

Thanks!

Acked-by: Sakari Ailus 

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk


[PATCH v4 00/21] Qualcomm 8x16 Camera Subsystem driver

2017-08-08 Thread Todor Tomov
This patchset adds basic support for the Qualcomm Camera Subsystem found
on Qualcomm MSM8916 and APQ8016 processors.

The driver implements V4L2, Media controller and V4L2 subdev interfaces.
Camera sensor using V4L2 subdev interface in the kernel is supported.

The driver is implemented using as a reference the Qualcomm Camera
Subsystem driver for Android as found in Code Aurora [1].

The driver is tested on Dragonboard 410C (APQ8016) with one and two
OV5645 camera sensors. media-ctl [2] and yavta [3] applications were
used for testing. Also Gstreamer 1.10.4 with v4l2src plugin is supported.

More information is present in the document added by the third patch.

[1] https://source.codeaurora.org/quic/la/kernel/msm-3.10/
[2] https://git.linuxtv.org//v4l-utils.git
[3] http://git.ideasonboard.org/yavta.git

---

Patchset Changelog:

Version 4:
- rework video node format handling - now can be set independently from the
  format on the subdev linked to it. Format compatibility is checked
  on STREAM_ON and should be compatible to allow start of the streaming;
- fix sensor pixel clock rate request (use 4l2_ctrl_g_ctrl_int64());
- refuse to continue if received sensor pixel clock == 0;
- add function to calculate clock frequency margin;
- use proper functions/macros for 64bit division;
- add v4l2 format names of the supported formats in documentation;
- use media_entity_cleanup on camss_remove();
- remove uncompressed field from format struct - it is unused;
- remove magic values;
- fix SBGGR12 typo;
- improve CSI2 lane configuration description in documentation;
- do not touch compose selection rectangle sent by userspace;
- always destroy mutexes at the end;
- other small code fixes.

Version 3:
- use V4L2 fwnode framework;
- remove settle count parameter from DT and add logic to calculate it instead;
- refactor video device node format initialization;
- fixed copyright information;
- shorter clock names;
- remove redundant memset usage;
- print error code when error happens;
- do not check format type on g_fmt/s_fmt;
- add busy check on s_fmt;
- rename files to add camss- prefix;
- other small code fixes.

Version 2:
- patches 01-10 are updated from v1 following the review received and bugs
  and limitaitons found after v1 was posted. The updates include:
  - return buffers on unsuccessful stream on;
  - fill device capabilities in struct video_device;
  - simplify v4l2 file handle usage - no custom struct for file handle;
  - use vb2_fop_poll and vb2_fop_mmap v4l2 file operations;
  - add support for read/write I/O;
  - add support for DMABUF streaming I/O;
  - add support for EXPBUF and PREPARE_BUF ioctl;
  - avoid a race condition between device unbind and userspace access
to the video node;
  - use non-contiguous memory for video buffers;
  - switch to V4L2 multi-planar API;
  - add useful error messages in case of an overflow in ISPIF;
  - other small and style fixes.

- patches 11-19 are new (they were not ready/posted with v1). I'm including
  these in this patchset as they add valuable features and may be desired
  for a real world usage of the driver.

---

The driver depends on patches:
- [media] media: Make parameter of media_entity_remote_pad() const
- [media] v4l2-mediabus: Add helper functions
- v4l: Add packed Bayer raw12 pixel formats 

The first and second are already on linux-next, the third one is included in
this patchset to ensure successful compilation.

---

V4L2 compliance test result:

$ v4l2-compliance -d /dev/video0 -s
v4l2-compliance SHA   : 172b663ea1fd16909a390f508851098a58061d9b

Driver Info:
Driver name   : qcom-camss
Card type : Qualcomm Camera Subsystem
Bus info  : platform:1b0ac00.camss
Driver version: 4.9.34
Capabilities  : 0x85201000
Video Capture Multiplanar
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps   : 0x05201000
Video Capture Multiplanar
Read/Write
Streaming
Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)