Commit graph

1666 commits

Author SHA1 Message Date
Jacopo Mondi
dd0793ed1b libcamera: geometry: Add isNull() function to Rectangle class
It's common for code to check if a rectangle is null. Add a helper function
to do so and test the function in test/geometry.cpp

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-03 11:16:16 +02:00
Jacopo Mondi
d405d1fd5e libcamera: utils: Add alignUp and alignDown functions
Add to libcamera utils library two functions to round up or down a
value to an alignment and add a test in test/utils.cpp for the two
new functions.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-03 11:16:16 +02:00
Jacopo Mondi
4383252d93 libcamera: ipu3: Rename mbusCodesToInfo
The mbusCodesToInfo map actually maps media bus codes to PixelFormat
instances. Rename the map according to its actual function and while at
it drop the 'static' keyword as the map is already defined in an
anonymous namespace.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-03 11:16:16 +02:00
Niklas Söderlund
108b6a8a15 libcamera: device_enumerator_udev: Initialize monitor_ and notifier_ to nullptr
The monitor_ and notifier_ pointers are acted on in the destructor if
not set to nullptr, the pointers are however first initialized in
init() and enumerate(). Avoid acting on uninitialized pointers by
initializing them to nullptr in the constructor.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
2020-08-03 10:58:50 +02:00
Niklas Söderlund
f0f297c5f2 libcamera: device_enumerator_udev: Align class final declaration with sysfs subclass
Instead of marking each individual overloaded function with final mark
the whole class as final. This aligns the sysfs and udev based
DeviceEnumerator implementations.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
2020-08-03 10:43:36 +02:00
Umang Jain
f2df5abe5d libcamera: camera: Ensure deletion via deleteLater()
Object::deleteLater() ensures that the deletion of the Object
takes place in a thread it is bound to. Deleting the Object
in a different thread is a violation according to the libcamera
threading model.

On hot-unplug of a currently streaming camera, the last reference
of Camera when dropped from the application thread (for e.g. QCam's
thread), the destructor is then called from this thread. This is not
allowed by the libcamera threading model. Camera is meant to be deleted
in the thread it is bound to - in this case the CameraManager's thread.

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-31 23:33:38 +03:00
Umang Jain
9c5f821396 tests: Add a test case for the Object::deleteLater() API, to verify
- the object is deleted from the correct thread
- multiple deleteLater() calls delete the object once only

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-31 23:33:35 +03:00
Umang Jain
9558886f7a libcamera: object: Add deleteLater() support
This commit adds support to schedule the deletion of an Object to the
thread it is bound to (similar to [1]). An Object getting destroyed
by a different thread is considered as a violation as per the
libcamera threading model.

This will be useful for an Object where its ownership is shared via
shared pointers in different threads. If the thread which drops the
last reference of the Object is a different thread, the destructors
get called in that particular thread, not the one Object is bound to.
Hence, in order to resolve this kind of situation, the creation of
shared pointer can be accompanied by a custom deleter which in turns
use deleteLater() to ensure the Object is destroyed in its own thread.

[1] https://doc.qt.io/qt-5/qobject.html#deleteLater

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-31 23:33:32 +03:00
Umang Jain
3fe7c1cdb4 libcamera: thread: Support selective message dispatch to thread
Extend the current dispatchMessages() to support dispatching of
selective messsages according to the Message::Type passed in
the function argument. dispatchMessages() can now be called
explicitly to force deliver selected type's message to the
thread for processing (typically when event loop is not
running).

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-31 23:33:23 +03:00
Jacopo Mondi
6042ded8e7 libcamera: properties: Define pixel array properties
Add definition of pixel array related properties.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-31 17:34:45 +02:00
Laurent Pinchart
624f6d54ff test: Remove list-cameras test
The list-cameras test case is the very first test case that has been
added to libcamera. It has served to start the development of the unit
tests infrastructure. Since then, libcamera has grown several tests that
cover the same API, and more. It's time for list-cameras to retire.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-28 01:27:30 +03:00
Laurent Pinchart
b52fcf9b0f test: process: Test Process::kill()
Add a test to ensure that Process::kill() on an unstarted process is
safe. This aims at ensuring we don't kill other processes unexpectedly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-27 22:30:07 +03:00
Umang Jain
c8edfe29c1 qcam: Fix camera reference leak on hot-unplug
If the currently streaming camera is hot-unplugged, a camera reference
was still held by MainWindow::camera_, preventing it to be destructed,
until qcam window is closed. Plug the leak in the hot-unplug handler
itself.

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 22:30:07 +03:00
Umang Jain
e349cb0f8a libcamera: event_notifier: Fix signature typo setEnabled() in documentation
Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 22:30:07 +03:00
Andrey Konovalov
565f95d64f libcamera: pipeline: simple: Try next mbus code if setupFormats() fails
Now SimpleCameraData::setupFormats() can fail if the camera sensor
supports media bus code which some entities down the pipeline don't.

When this happens continue with the next media bus code instead of
aborting the enumeration of the possible pipeline configurations.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 22:04:50 +03:00
Andrey Konovalov
68e65da0cc libcamera: pipeline: simple: Make sure the formats at the link's pads match
Change SimpleCameraData::setupFormats() to return -EINVAL if the sink
pad of the link doesn't support the format set on the source pad of this
link.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 22:04:50 +03:00
Laurent Pinchart
7283eff090 libcamera: pipeline: simple: Setup links outside for format try loop
The SimpleCameraData::init() function needs to setup links along the
pipeline, but doesn't need to repeat that operation for each media bus
code it tries. Move the link setup before the loop.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-27 22:04:50 +03:00
Niklas Söderlund
3437067e9b libcamera: Add support for 16-bit Bayer formats
Add support for 16-bit Bayer formats.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 17:46:17 +02:00
Niklas Söderlund
90c793c698 include: drm_fourcc: Add 16-bit Bayer FourCC
The patch trying to upstream Bayer formats to the DRM FourCC header file
in Linux left out the 16-bit formats, add them. This addition will be
included in the next version of the DRM Bayer patch sent out.

Intention is to merge this in libcamera and update the header file once
the upstream patch is picked up.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 17:46:17 +02:00
Niklas Söderlund
30e0ea843e cam: Add optional argument to --capture to specify how many frames to capture
Extend the '--capture' option with and optional numerical argument to be
able to specify how many frames to capture before exiting. If the
optional argument is not provided the old behavior of running until the
user interrupts with a SIGINT is retained.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 17:31:13 +02:00
Niklas Söderlund
ed73469335 cam: capture: Cache the EventLoop handler
Prepare for the ability to exit the event loop based on conditions in
the request complete handler by caching the pointer instead of passing
it as an argument.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 17:31:13 +02:00
Niklas Söderlund
01ea694003 cam: Add option to disallow adjusting of requested formats
Add a '--strict-formats' option which fails the camera configuration
step if the format is adjusted,

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 17:31:13 +02:00
Naushir Patuck
3acc31b0e3 libcamera: request: Add log point on a completed request
Add a debug log point to indicate a request has completed.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-27 14:57:50 +03:00
You-Sheng Yang
774f0d1b9b libcamera: process: Fix killing innocent processes unexpectedly
When a libcamera::process is being destructed or called kill() without a
previous successful call to start(), it's pid_ may remains -1, which
causes all the killable processes being killed when passed to
`kill(pid_, SIG_KILL)`.

Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-27 13:53:53 +03:00
You-Sheng Yang
256845d5b7 qcam: Fix spelling
Fix a typo in the word "Unsupported".

Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-27 10:24:02 +01:00
David Plowman
9a1555a35c libcamera: qcam: Improve colour information in DNG files
This patch improves the colour information recorded in DNG files using
the ColourCorrectionMatrix metadata for the image. Note that we are
not supplying a full calibration using two illuminants, nonetheless
the single matrix here appears to be respected by a number of tools.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-25 00:51:38 +03:00
David Plowman
0bf1070ca8 libcamera: raspberrypi: Add ColourCorrectionMatrix control
Implements, for the Raspberry Pi platform, the returning of the CCM
(Colour Correction Matrix) used by the pipeline in the libcamera
metadata.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-25 00:51:38 +03:00
David Plowman
f5b45c180e libcamera: Add ColourCorrectionMatrix control
This control is principally for returning, in the image metadata, the
CCM (Colour Correction Matrix) used by the imaging pipeline. By which
we mean the 3x3 matrix that is applied to the camera RGB pixels after
subtraction of black levels and white-balancing, but before any gamma
transformation.

Some implementations may also choose to let an application set
explicit colour matrices, using this as a control.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-25 00:51:38 +03:00
Niklas Söderlund
a2a6f95bff android: camera_device: Add ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS
Define the ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS to zero to inform users
the HAL does not support any reprocessing.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
3312af649a android: camera_device: Remove scaler format information from Camera3Format
The scaler format information was only used for the
ANDROID_SCALER_AVAILABLE_FORMATS tag which is deprecated and removed. As
it has no other users remove it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
142a9ee3f8 android: camera_device: Use HAL_PIXEL_FORMAT_* defines for formats
The documentation says the HAL_PIXEL_FORMAT_* defines shall be used for
formats instead of ANDROID_SCALER_AVAILABLE_FORMATS_* for the
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS and
ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS tags.

This have worked in the past as the numerical value of the two sets are
the same for the formats supported.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
3530614fbf android: camera_device: Remove ANDROID_SCALER_AVAILABLE_FORMATS
According to the documentation the tag
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS deprecates the
ANDROID_SCALER_AVAILABLE_FORMATS tag. As the HAL implements both tags
remove the deprecated one.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Laurent Pinchart
7145d15e04 libcamera: formats: Remove unnecessary explicit constructor calls
When initializing the PixelFormatInfo::format field with a PixelFormat,
there's no need to call the PixelFormat (copy) constructor explicitly.
Remove the unnecessary calls.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-24 14:23:03 +03:00
Niklas Söderlund
a8a2048ab0 libcamera: v4l2_videodevice: Add using statement for format map
Define a using statement for the format maps returned by
V4L2Device::formats() and use it in all call sites. There is no
functional change in this patch.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
4a5b0df984 libcamera: formats: Remove ImageFormats
The ImageFormats helper class is not used anymore and can be removed.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
dcda73ec14 libcamera: v4l2_subdevice: Replace ImageFormats with a map
Replace the V4L2Subdevice usage of the ImageFormats class with a
std::map and the utils::map_keys() helper.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-23 16:31:41 +02:00
Niklas Söderlund
d9295552b1 libcamera: Add support for RGB565 format
Add support for RGB565 format.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-21 14:19:09 +02:00
Niklas Söderlund
7855dc922f libcamera: Add support for planar YVU420 format
Add support for planar YVU420.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-07-21 14:19:09 +02:00
Naushir Patuck
3e7aa49344 libcamera: pipeline: ipa: raspberrypi: Use dma heap allocs for LS tables
Remove use of vcsm allocations and replace with dma heap allocations.
The pipeline handler now passes the fd of the allocation over to the IPA
instead of the raw pointer.

Also use libcamera::FileDescriptor for fd lifetime management.

This commit must be built alongside the accompanying BCM2835 ISP kernel
driver changes at https://github.com/raspberrypi/linux/pull/3715.
Otherwise a mismatch will cause undefined behavior.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 16:36:28 +03:00
Naushir Patuck
3c02a808e8 include: linux: Add dma-buf.h and dma-heap.h UAPI headers
This commit adds the dmabuf UAPI headers from the mainline Linux kernel
v5.6.19. They are required by the Raspberry Pi library for lens shading
table allocations.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 16:36:27 +03:00
Paul Elder
c3548a333f tests: v4l2_compat: Fix v4l2-compliance and v4l2-ctl version parsing
v4l2-compliance originally printed the SHA before the version, leading
to the indexing that was used previously. Now that the version is
printed before the SHA, the indexing is incorrect. Fix this.

Although v4l2-ctl doesn't suffer the same issue, it is more correct to
use the zeroth index like the v4l2-compliance version check now does, so
fix that as well.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-17 18:50:10 +09:00
Laurent Pinchart
49771c6dcc libcamera: ipa_proxy: Allow stop() on a stopped IPA
To make error handling easier in callers, allow the stop() function to
be called when the proxy is already stopped, or not started yet.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-07-17 02:13:53 +03:00
Laurent Pinchart
2c0fad508c libcamera: pipeline: raspberrypi: Start IPA when starting camera
The IPA is meant to be started when starting the camera, and stopped
when stopping it. It was so far started early in order to handle the
IPAInterface::processEvent() call related to lens shading table
allocation before IPAInterface::configure() to pass the table to the
IPA. Now that the lens shading table is passed through configure(),
starting the IPA early isn't needed anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:50 +03:00
Laurent Pinchart
89682ea1c4 ipa: raspberrypi: Pass sensor config back from configure()
The Raspberry Pi IPA uses the custom RPI_IPA_ACTION_SET_SENSOR_CONFIG
frame action to send the sensor staggered write configuration to the
pipeline handler when the IPA is configured. Replace this ad-hoc
mechanism by passing the corresponding data back from the IPA to the
pipeline handler through the configure() response. This allows
synchronous handling of the response on the pipeline handler side.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:45 +03:00
Laurent Pinchart
40ed8b3b75 ipa: raspberrypi: Pass lens shading table through configure() function
The IPAInterface::configure() function now accepts custom configuration
data. Use it to pass the lens shading table instead of using a custom
IPA event. This will allow starting the IPA when starting the camera,
instead of pre-starting it early in order to process the lens shading
table allocation event.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:41 +03:00
Laurent Pinchart
c0b0b7205c ipa: raspberrypi: Drop CameraHelper::GetOrientation()
The camera sensor orientation is now handled by the pipeline handler.
Drop hardcoded per-sensor orientations from the IPA.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:40 +03:00
Laurent Pinchart
44aa793056 libcamera: pipeline: raspberrypi: Set sensor flip based on rotation
Instead of receiving sensor orientation configuration from the IPA,
retrieve it from the CameraSensor Rotation property, and configure the
HFLIP and VFLIP controls accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:38 +03:00
Laurent Pinchart
c567ca70d0 libcamera: pipeline: raspberrypi: Move configureIPA() to RPiCameraData
The PipelineHandlerRPi::configureIPA() function accesses plenty of
member data from the RPiCameraData class and no member from the
PipelineHandlerRPi class. Move it to RPiCameraData where it logically
belongs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:37 +03:00
Laurent Pinchart
44c4be5dba libcamera: pipeline: raspberrypi: Constify parameter to StaggeredCtrl::set()
The controls parameter of StaggeredCtrl::set(), passed by reference, is
not modified by the function. Make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-17 02:13:36 +03:00
Laurent Pinchart
44a9b13f88 libcamera: pipeline: raspberrypi: Drop unused local variable
The controls variable in PipelineHandlerRPi::start() is unused. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2020-07-17 02:13:34 +03:00