TODO
====

atomisp
-------

1. Items which MUST be fixed before the driver can be moved out of staging:

* Remove/disable custom v4l2-ctrls

* Remove unnecessary/unwanted module parameters

* Remove abuse of priv field in various v4l2 userspace API structs

* Refactor the codebase (random cleanups won't achieve this)

2. Items which SHOULD also be fixed eventually:

* Support ISP parameter passing via parameter buffers (see
  drivers/media/v4l2-core/v4l2-isp.c).

* The driver is intended to drive the PCI exposed versions of the device.
  It will not detect those devices enumerated via ACPI as a field of the
  i915 GPU driver (only a problem on BYT).

  There are some patches adding i915 GPU support floating at the Yocto's
  Aero repository (so far, untested upstream).

* Ensure that the driver will pass v4l2-compliance tests

sensor drivers
--------------

* Use v4l2-cci for register access

* Implement enable_streams and disable_streams pad ops (use s_stream
  compat helper)

* Implement Runtime PM support (see e.g. ov8856 driver)

* Use sub-device state and remove state related fields from device context
  structs

* Implement modern V4L2 camera sensor controls (see
  Documentation/userspace-api/media/drivers/camera-sensor.rst) or even
  Common Raw Sensor Model (which isn't in upsteam yet though; see
  <URL:https://gitlab.freedesktop.org/linux-media/users/sailus/-/tree/metadata?ref_type=heads>).

Testing
=======

Since libcamera support is not available yet, the easiest way to test for
now is using v4l2-ctl to select the input and gstreamer for streaming.

To select the input run:

v4l2-ctl -i <input>

Where <input> is 0 (front cam) or 1 (back cam).

The simplest gstreamer pipeline for testing running the sensor
at its max resolution is:

gst-launch-1.0 v4l2src ! videoconvert ! xvimagesink sync=false

To select e.g 640x480 as resolution use:

gst-launch-1.0 v4l2src ! video/x-raw,format=YV12,width=640,height=480 ! \
               videoconvert ! xvimagesink sync=false

And to show fps use:

gst-launch-1.0 v4l2src ! video/x-raw,format=YV12,width=640,height=480 ! \
               videoconvert ! fpsdisplaysink video-sink=xvimagesink sync=false

Often the image will be over / under exposed. This can be fixed by using
v4l2-ctl on the sensor subdev to tweak the exposure ctrl; or by using a GUI
app for v4l2-controls which also supports subdev such as the Fedora patched
gtk-v4l tool.
