Commit graph

2449 commits

Author SHA1 Message Date
Laurent Pinchart
02f56c5e5e Documentation: contributing: Add link to bugs.libcamera.org
Reference the issue tracker in the documentation, as relying on tribal
knowledge isn't a great option.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-03-25 19:34:58 +02:00
Laurent Pinchart
c2943a6e32 android: meson: Remove unneeded android_enabled check
We return early with subdir_done() if android_enabled is false. There's
no need to check the variable later in the file.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-25 19:34:54 +02:00
Hirokazu Honda
82b8151aa7 android: CameraDevice: Mark getResultMetadata() const function
CameraDevice::getResultMetadata() doesn't change either
|descriptor| and member variables. It should be marked as a
const function and |descriptor| should be passed with const
lvalue reference.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 19:34:54 +02:00
Hirokazu Honda
f101cc6878 android: CameraDevice: Manage requestTemplates_ with std::unique_ptr
CameraMetadata stored in requestTemplates_ in CameraDevice is
not necessary to be a raw pointer. This reduces the manual
new/delete code by changing the type to std::unique_ptr.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:27 +02:00
Hirokazu Honda
dca709c44a android: CameraDevice: Manage staticMetadata_ with std::unique_ptr
staticMetadata_ in CameraDevice is not necessary to be a raw
pointer. This reduces the manual new/delete code by changing the
type to std::unique_ptr.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:27 +02:00
Hirokazu Honda
17a6e78e00 android: Camera3RequestDescriptor: Manage buffers with std::vector
Camera3RequestDescriptor has a length and an allocated buffer
for camera_stream_buffer_t array. This replaces the variables
with std::vector.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:27 +02:00
Hirokazu Honda
14b262dacf android: CameraDevice: Return const shared_ptr& by camera()
CameraDevice::camera() originally returns shared_ptr. It is
mandatory to make a copy by calling camera() in this way. There
is no need of copying if a caller needs the reference of the
camera like const shared_ptr<Camera> &cam = camera(). That is, it
is a caller that copying is required. This changes the return
type of camera() to const shared_ptr&, so that we are able to
reduce one redundant copy in the above case.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:26 +02:00
Hirokazu Honda
9538ce4cc6 android: CameraDevice: Take shared_ptr in constructor
CameraDevice takes the ownership of Camera. Therefore,
shared_ptr would rather be used than const shared_ptr&.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:26 +02:00
Hirokazu Honda
1636d4c438 android: CameraHalManager: Fix a function call of a moved Camera
libcamera::Camera::id() is called after std::move() in
cameraAdded(). This fixes the issue by not executing std::move().

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:26 +02:00
Hirokazu Honda
10518882f3 android: CameraHalManager: Hold CameraManager with std::unique_ptr
CameraManager is owned by CameraHalManager. The ownership of the
object is not shared with other classes. So CameraHalManager
should manage CameraManager with std::unique_ptr.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:26 +02:00
Hirokazu Honda
212f410c7c android: CameraHalManager: Hold CameraDevice with std::unique_ptr
CameraDevice is owned by CameraHalManager. The ownership of the
object is not shared with other classes. So CameraHalManager
should manage CameraDevice with std::unique_ptr.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-25 00:45:25 +02:00
Kieran Bingham
1d8cc0a3ec libcamera: v4l2_videodevice: Prevent queueing buffers without a cache
The V4l2 buffer cache allows us to map incoming buffers to an instance
of the V4L2 buffer required to actually queue.

If the cache_ is not available, then the buffers required to allow
queuing to a device have been released, and this indicates an issue at
the pipeline handler.

This could be a common mistake, as it could happen if a pipeline handler
always requeues buffers to the device after they complete, without
checking if they are cancelled.

Catch any invalid queueing of buffers to the V4L2 video device when
resources have been released by adding a Fatal log message to highlight
the error during development.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:06 +00:00
Kieran Bingham
500e99174a ipa: ipu3: Do not set controls during configure
The configure operation is synchronous and should not send events back
to the pipeline handler.

If information needs to be returned from configure it should be handled
through the interface directly.

Move the initial call to setControls() out of configure() and into the
start() method which is called after the IPA running_ state is updated.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:05 +00:00
Kieran Bingham
6bf86aa260 libcamera: pipeline: ipu3: frames: Associate buffers with the request
Ensure that the buffers are associated with the request even if they are
used internally to be able to correctly map back to the resources they
are being used to fulfil.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:05 +00:00
Kieran Bingham
552ac5cfec libcamera: pipeline: ipu3: frames: Group FrameBuffer operations
Ensure that checks on resource availability are handled first, and then
operate on the queues only after the resources are confirmed as
available.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:05 +00:00
Kieran Bingham
597c67120e libcamera: pipeline: ipu3: Do not mark metadata complete early
When the imguOutputBufferReady() detects a cancelled frame, it is
reporting that the metadata has been processed in order to be able to
complete the cancelled request.

This causes the FrameInfo to be completed and deleted early, but then an
active buffer on the IMGU can complete and be unable to find the
FrameInfo for it to complete correctly.

Do not mark metadataProcessed early on the event that a single buffer is
detected as cancelled. The stopping of the V4L2 devices will ensure
that all queued buffers are returned to us and we can follow the normal
and expected shutdown sequence.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:05 +00:00
Kieran Bingham
4ce1a33e4b libcamera: pipeline: ipu3: Stop IPA before stopping devices
The IPA should be stopped before the hardware devices to ensure that
all asynchronous actions have completed within the IPA before resources
are removed and released.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 22:20:05 +00:00
Laurent Pinchart
b50c12bf18 utils: ipc: proxy: Process pending messages
Events may be queued to the pipeline handler between the pipeline
handler entering the ::stop() function, and before the call to stop the
IPA has completed.

Handle these events by dispatching all pending messages at the proxy
after the IPA has fully stopped.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 09:24:06 +00:00
Laurent Pinchart
f041482add utils: ipc: proxy: Assert asynchronous calls execute in the running state
Signals and calls from the IPA should not occur after the IPA has been
put into the stopped state.

Add assertions to catch and prevent any messages being processed after
this.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-24 09:24:06 +00:00
Laurent Pinchart
c7dd9655e5 meson: Add configuration option to build the cam application
Building the cam application isn't always desired, for instance in a
production environment that only needs the libcamera library. Add a
meson option to disable it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-23 19:15:55 +02:00
Laurent Pinchart
976e01d59b meson: Use subdir_done() to reduce indentation
Reduce the indentation in the gstreamer and qcam meson.build with
subdir_done(). This follows similar patterns in cam and v4l2.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-23 19:15:44 +02:00
Naushir Patuck
787852a240 ipa: raspberrypi: Rationalise parameters to ipa::configure()
Rename ConfigInput to IPAConfig to be more consistent with the naming,
and remove ConfigInput::op, as it is never used.

Replace ConfigOutput with a ControlList type, as that is the only return
type from ipa::configure().

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:59 +02:00
Naushir Patuck
b876c64613 ipa: raspberrypi: Rationalise parameters to ipa::start()
Separate out the in and out parameters in ipa::start() as they are not
the same. This function now takes in a ControlList and returns out a
struct StartConfig which holds a ControlList and drop frame count for
the pipeline handler to action.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:59 +02:00
Naushir Patuck
8ccddecc94 ipa: raspberrypi: Remove unused member variable
The lastMode_ member variable is now unused, so remove it.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:59 +02:00
Naushir Patuck
256b1e0302 ipa: raspberrypi: Move the controller initialise to ipa::init()
The controller initialise is a one-off operation, so move it from
ipa::configure() to ipa::init().

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:59 +02:00
Naushir Patuck
90ac9849f4 pipeline: raspberrypi: Conditionally open the embedded data node
Conditionally open the embedded data node in pipeline_handler::match()
based on whether the ipa::init() result reports if the sensor supports
embedded data or not.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:59 +02:00
Naushir Patuck
eec070039d pipeline: ipa: raspberrypi: Open the CamHelper on ipa::init()
Move the opening of the CamHelper from ipa::configure() to ipa::init().
This allows the pipeline handler to get the sensor specific parameters
in pipeline_handler::match() where the ipa is initialised.

Having the sensor parameters available earlier will allow selective
use of the embedded data node in a future change.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:58 +02:00
Naushir Patuck
ff9f60ce3f ipa: Add sensor model string to IPASettings
Pass the sensor model string to the IPA init() method through the
IPASettings structure.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 18:43:58 +02:00
Paul Elder
500c9a1f98 android: Return -EUSERS when failed to open a Camera that's in use
The correct return value for the HAL for hal_dev_open() when trying to
open a camera that's already opened is EUSERS. Make hal_dev_open()
return -EUSERS, and plumb the logic for this through
CameraHalManager::open().

This allows the following CTS tests to pass:
- android.hardware.camera2.cts.CameraManagerTest#testCameraManagerOpenAllCameras
- android.hardware.camera2.cts.MultiViewTest#testDualCameraPreview

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-03-23 19:23:21 +09:00
Hirokazu Honda
67e791373d libcamera: device_enumerator: Remove unnecessary rvalue references
There are std::unique_ptr rvalue reference arguments. They are
intended to pass the ownership to the functions. In the case,
it is right to let the argument be std::unique_ptr value and
pass by std::move().

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-23 03:47:01 +02:00
Jacopo Mondi
5154e14b3e android: camera_device: Do not default External to Front
Now that the camera location is not defaulted anymore in the library but
doesn't get registered if the firmware interface does not provide the
information, do not default it to FRONT if LocationExternal is reported.

To maintain compatibility with CTS requirements, default location to
FRONT only if the camera property is not available.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-03-22 08:59:12 +01:00
Jacopo Mondi
285d365186 libcamera: camera_sensor: Do not register Location if not available
Do not register the Location property if not available from the firmware
interface instead of defaulting it to External.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-03-22 08:59:07 +01:00
Jacopo Mondi
aab49f903e cam: Do not assume Location is available
In preparation to register the Location property only if the firware
interface provides it, do not assume it is available and build the
camera name using the camera sensor model as a fallback.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-03-22 08:58:52 +01:00
Marian Cichy
1a26f79f21 pipeline: simple: Update documentation on pipeline setup
After commit 4671911df0 ("pipeline: simple: Use breadth-first search
to setup media pipeline"), the explanation in the SimplePipeline
documentation how the handler tries to find a valid path to capture
device does not reflect the reality anymore. Update the text to the new
situation.

Fixes: 4671911df0 ("pipeline: simple: Use breadth-first search to setup media pipeline")
Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-20 22:24:09 +02:00
Nícolas F. R. A. Prado
aade93f503 Documentation: guides: pipeline-handler: Fix capture flag usage
The number of frames passed to the -C flag of cam should come right
after it, without a space, otherwise the value is discarded.
The log below already showed the correct usage, but the command in the
code-block was wrong, so fix it.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-20 22:11:42 +02:00
Nícolas F. R. A. Prado
f87be145cd Documentation: guides: pipeline-handler: Update code, commands and logs
The pipeline-handler guide is a bit outdated:
- ControlList* in start() is now const.
- Registered pipeline handler log now comes from Camera log and the message is different.

Update the pipeline-handler guide to reflect these changes.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-19 01:58:43 +02:00
Nícolas F. R. A. Prado
30a4e78043 Documentation: sensor-driver: Fix links to V4L2 documentation
Fix some links to the V4L2 documentation. The first one is indeed
pointing to the wrong page. The second one has a highlight embedded, so
not necessarily wrong, but not needed, so clean it up as well.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-19 01:56:33 +02:00
Nícolas F. R. A. Prado
d32accd654 Documentation: environment-variables: Use standard rST link syntax
The usage of # in embedded URIs for references to sections in
reStructuredText is HTML specific. Use the standard rST reference to
targets instead, to be compatible with other formats as well, should
this documentation ever be exported to PDF, for example.

See [1] for an equivalent commit in the Linux Kernel documentation.

[1] https://lore.kernel.org/linux-doc/20201228144537.135353-1-nfraprado@protonmail.com/

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-19 01:54:41 +02:00
Nícolas F. R. A. Prado
7ebc19752a Documentation: Fix typos and wrong rST syntax for literals
Fix some typos and some literals using ` instead of ``.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-19 01:51:57 +02:00
Marian Cichy
f908d49cce libcamera: request: Fix documentation of controls() method
The documentation of the controls() method refers to the methods
ControlList::operator[]() and ControlList::update(), which do not exist.

Instead refer to ControlList::get() and ControlList::set() to achieve a
similar documentation.

Fixes: a8c40942b9 ("libcamera: controls: Improve the API towards applications")
Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-19 01:41:56 +02:00
Jean-Michel Hautbois
79b48225ad libcamera: ipu3: Pass the BDS rectangle at IPA configure call
The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm
will be integrated.
In order to do that, the configure() interface needs to be modified.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-17 15:13:50 +01:00
Jean-Michel Hautbois
3f6785963d libcamera: ipu3: Move ipa configuration from start() to configure()
IPA was configured after all the pipeline devices were started,
including IPA itself.
Move it at the end of configure() call.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-17 15:04:56 +01:00
Paul Elder
0d0ac3cb13 ipa: ipa_interface: Add comment to defend the forward-declaration
Any struct that is defined in core.mojom with the skipHeader tag needs
to be present in ipa_interface.h, either forward-declared or #included.
Add a comment so that, in the future, people don't try to send patches
removing the seemingly unused forward-declaration.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-16 11:45:24 +09:00
Marian Cichy
4671911df0 pipeline: simple: Use breadth-first search to setup media pipeline
When the SimplePipeline is setting up its data and media pipeline in the
SimpleCameraData constructor, it merely tries to find the first valid
pad and link to the next entity, starting from the camera sensor.
Following this path may not always lead to a valid capture device and
therefore the setup will fail on some machines. This is for example an
issue when using the SimplePipeline on an i.MX-6Q with its i.MX IPU.

This commit implements a different approach to setup the media-pipeline
by finding the shortest path to a valid capture device, using the
breadth-first search algorithm. On i.MX6Q, the shortest path has a good
chance to be the path from the sensor to the CSI capture device, as
other paths may involve image converters, encoders or other IPU blocks
and will have therefore more nodes.

Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-16 02:03:37 +02:00
Dafna Hirschfeld
287e4f82bd gst: Use the streams of CameraConfiguration when allocating buffers
Currently, when allocating buffers, the streams of the Camera object are
used. Instead the streams of the CameraConfiguration object should be
used. This is because the Camera object holds all available streams
while the CameraConfiguration holds only the streams associated with the
current configuration.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-15 02:13:19 +02:00
David Plowman
21f90025e5 ipa: raspberrypi: Add support for imx327-based SE327M12 module
This patch adds support for the Soho Enterprises SE327M12 module.  The
sensor is an imx327 which therefore uses the imx290 kernel driver and
CamHelper.

To use this module and camera tuning, place the following in the
/boot/config.txt file:

dtoverlay=imx290,clock-frequency=37125000

and then the existing imx290.json file must be over-written with
se327m12.json

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>
2021-03-14 23:58:18 +02:00
Naushir Patuck
4f4f8bb8bc pipeline: raspberrypi: Use a default format for ISP::Output0
If the ISP::Output0 stream has not been configured, we must enable it
with a default format and resolution for internal use. This is to allow
the pipeline handler data flow to be consistent, and allow the IPA to
receive statistics for the frame.

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>
2021-03-13 22:21:01 +02:00
Naushir Patuck
cd3f70a14c pipeline: raspberrypi: Avoid multiple opens of Unicam embedded data node
It is possible for the application to call pipeline_handler::configure()
multiple times, which would attempt to open the Unicam embedded data
node on every call. This would cause a warning message as the node
would have already been opened. Avoid this by tracking if the node
has previously been opened.

Note that this is a temporary fix since the open call for the Unicam
embedded data node will be moved from pipeline_handler::configure() to
pipeline_handler::match().

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>
2021-03-13 22:20:56 +02:00
Naushir Patuck
1be6803924 libcamera: delayed_controls: Add missing documentation for ControlParams
Document struct DelayedControls::ControlParams and its associated
fields.

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>
2021-03-13 21:47:18 +02:00
Marian Cichy
80bebfb64e libcamera: gst: Fix double-free when acquire_buffer fails
If gst_buffer_pool_acquire_buffer in gst_libcamera_task_run fails, the
unique_ptr to the request-object gets reset and hence, its destructor
is called. However, the wrap-object points to the same object and is
still alive at this moment. When the task_run-function is finished, the
destructor of the wrap-object is called, which in return calls the
destructor of the request-object again.

Instead of taking care of both, the request and the wrap-object, we can
move the request to the wrap which will then effectively take care of
the request object automatically.

Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
2021-03-12 22:38:15 +02:00