Commit graph

5589 commits

Author SHA1 Message Date
Umang Jain
de20d00455 android: jpeg: exif: Set timezone information
The EXIF specification defines three timezone related tags, namely
OffsetTime, OffsetTimeOriginal and OffsetTimeDigitized. However,
these are not supported by libexif (as of v0.6.21) hence, carry
the tags' positional values in our implementation until we get
this support from libexif itself.

Since these tags were introduced in EXIF specification v2.31, set
the exif version number explicitly too.

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-09-29 05:55:08 +03:00
Umang Jain
51bfc82392 android: jpeg: exif: Pad extra byte only for ASCII format in setString()
The EXIF standard states that EXIF_FORMAT_UNDEFINED shall not be
terminated with NULL. The patch implements this particular detail and
pad one extra byte for EXIF_FORMAT_ASCII to null-terminate strings.

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-09-29 05:55:00 +03:00
Niklas Söderlund
bd542ae775 include: linux: Update rkisp1 header
Refresh the RkISP1 user-space header to match the latest state in the
media-tree [1]. This requires update of symbol names in the RkISP1 IPA
but there is no functional change.

Unfortunately the upstream header has a few problems that needs to be
fixed before it can be used.

1. The SPDX header does not satisfy the Linux scripts/headers_install.sh
   so the installation step have to be done manually (dropping _UAPI
   prefix from header include guard). Issue is reported upstream.

2. The BIT() macro is used in the header but unfortunately this macro
   is not accessible in user-space headers. Fix this by reverting back
   to open code setting the bit without macro. Fix submitted upstream
   and acked by maintainer.

1. d7a81a5b07313535 ("media: staging: rkisp1: uapi: remove __packed")
2. [PATCH v2] staging: rkisp1: uapi: Do not use BIT() macro

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-29 03:53:55 +02:00
Niklas Söderlund
3baedef8ce libcamera: ipa: rkisp1: Include linux/v4l2-controls.h
Do not depend on other headers to pull in the V4L2 controls header.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-29 03:53:55 +02:00
Tomi Valkeinen
f517960c6a FrameBufferAllocator: fix non-copyability
FrameBufferAllocator is supposed to delete copy constructor and
copy-assignment operator. It doesn't do that as it uses Camera as a
parameter instead of FrameBufferAllocator.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
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-09-29 03:55:27 +03:00
Niklas Söderlund
921c0cdc6a libcamera: pipeline: rkisp1: Expose self path stream
Expose the self stream to applications and prefers it for the viewfinder
and video roles as it can be extended to produce RGB. Keep preferring
the main path for still capture as it could be extended to support RAW
formats which makes most sense for still capture.

With this change the self path becomes available to applications and a
camera backed by this pipeline can produce two streams simultaneously.

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-09-28 23:53:45 +02:00
Niklas Söderlund
1beff36f5a libcamera: pipeline: rkisp1: Add format validation for self path
Extend the format validation to work with both main and self paths. The
heuristics honors that the first stream in the configuration has the
highest priority while still examining both streams for a best match.

It is not possible to capture from the self path as the self stream is
not yet exposed to applications.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
aabc50ea7f libcamera: pipeline: rkisp1: Track buffers for self path
In preparation of supporting both the main and self path extend
RkISP1FrameInfo to track buffers from the self path stream.

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>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
9196a07313 libcamera: pipeline: rkisp1: Configure self path
Allow for both the main and self path streams to be configured. This
change adds the self path as an internal stream to the pipeline handler.
It is not exposed as a Camera stream so it can not yet be used.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
606a0c7fff libcamera: pipeline: rkisp1: Add self path devices
Add the V4L2 device nodes needed to operate the self path.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
95946056d6 libcamera: pipeline: rkisp1: Prefix main path video and resizer
In preparation of supporting both the main and self path prefix the main
path specific variables with mainPath.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
1e1bac5fff libcamera: pipeline: rkisp1: Set the crop rectangle
Changing resolutions back and forth can provoke the crop rectangle to go
out of sync, set it as part of format configuration.

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>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
1c57ff4729 libcamera: pipeline: rkisp1: Export stream formats to applications
The information about stream format is available but not exported to
applications, fix this.

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>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
8b9309d382 libcamera: pipeline: rkisp1: Create RkISP1Frames from camera data
Create RkISP1Frames from camera data instead of picking information out
from it. This is done to prepare for multi stream support where more
information from the camera data will be needed.

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-09-28 23:53:45 +02:00
Niklas Söderlund
f65e6b124b libcamera: pipeline: rkisp1: Prepare buffer ready handlers for multiple streams
The buffer ready handlers are designed for a single application facing
stream from the main path. To prepare for multiple application facing
streams from main and/or self path the handlers need to be prepared.

The data keeping track of the frame number and advancing the timeline
can be moved from the application facing buffer ready handler to the
statistics handler. For each request processed there will always be a
statistic buffer and as the ISP is inline and is the source of both
main, self and statistic paths there is no change in behavior.

The application facing handler no longer needs a special case for
cancelled frames and can be made simpler. With this change the handlers
are ready to deal with any combinations of application facing streams.

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-09-28 23:53:45 +02:00
Niklas Söderlund
fedc77842e libcamera: pipeline: rkisp1: Setup links as part of configuration
In preparation of supporting both the main and self path configure all
the media graph links as a part of the configuration step. Before this
change the link between ISP and DMA engine was setup at match time as
the only supported path was the main path and only the link between
sensor and ISP was updated at part of the configuration step.

The main path is still the only path between ISP and DMA engine that is
possible to enable.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
e260513f52 libcamera: pipeline: rkisp1: Breakout mainpath size and format constraints
Breakout the mainpath size and format constrains as it will be used in
more places then just validate(). While at it use the new helpers to
validate Size.

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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
0862959184 libcamera: pipeline: rkisp1: Remove redundant check of buffer in Request
There is no need to check if Request contains a buffer belonging the
RkISP1 Camera as this is already done in Camera::queueRequest(), remove
the redundant check.

Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-28 23:53:45 +02:00
Niklas Söderlund
afe0ad41db libcamera: pipeline: rkisp1: Set number of planes based on format
The RkISP1 pipeline originally only supported NV formats which have 2
planes. When support for YUV formats was added the plane count on the
output format was not made to reflect this. Instead of hard coding the
plane count to 2 fetch the number of planes from the format information.

Reported-by: Jacopo Mondi <jacopo@jmondi.org>
Fixes: 2b1a908b52 ("libcamera: camera: Add a validation API to the CameraConfiguration class")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28 23:53:45 +02:00
Ezequiel Garcia
aac96e34ba meson: Define python3 and python3-yaml required dependencies
With this change, meson will complain specifically about missing
python3 and missing python3-yaml. As specified by meson
documentation: https://mesonbuild.com/Python-module.html,
this change requires meson v0.51.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:40 +03:00
Ricardo Ribalda
da81e368e7 meson: Bump meson version to 0.51
Version 0.51 allows, among others, checking for python modules, which is
a required feature.

It is also now easily accessible: it is in stable distros such as Debian
testing, or in pip:

https://tracker.debian.org/pkg/meson
https://pypi.org/project/meson/

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:34 +03:00
Ricardo Ribalda
aba567338b Documentation: Move all dependencies into features
This way if the user enables the documentation and the dependencies are
missing the configure fails.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:30 +03:00
Ricardo Ribalda
4e998cea15 Documentation: Search for dot binary
Doxygen depends on dot to generate the documentation. Make this
dependency explicit on the meson file.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:27 +03:00
Ricardo Ribalda
f08b720acc README: Add missing dependency for documentation
Doxygen fails to create the documentation with this message:

[145/276] Generating doxygen with a custom command
sh: 1: dot: not found
error: Problems running dot: exit code=127, command='dot', arguments='"/home/user/libcamera/build/Documentation/api-html/inline_dotgraph_1.dot" -Tpng -o "/home/user/libcamera/build/Documentation/api-html/dot_inline_dotgraph_1.png"'
sh: 1: dot: not found
error: Problems running dot: exit code=127, command='dot', arguments='"/home/user/libcamera/build/Documentation/api-html/inline_dotgraph_1.dot" -Tcmapx -o "/home/user/libcamera/build/Documentation/api-html/dot_inline_dotgraph_1.map"'
[276/276] Linking target test/utils

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:25 +03:00
Ricardo Ribalda
507a94d904 README: Add missing libtiff-dev package for qcam
Without it:

Run-time dependency libtiff-4 found: NO (tried pkgconfig and cmake)

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:23 +03:00
Ricardo Ribalda
dff416a84b README: Add missing package for Qt5 tools
Without it:

Program /usr/lib/x86_64-linux-gnu/qt5/bin/lrelease found: NO
Program lrelease-qt5 found: NO
Program lrelease found: NO found  but need: '== 5.14.2'

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:11 +03:00
Ricardo Ribalda
20177249c0 README: Move pkg-config to Meson section
pkg-config it is not only used to detect libudev-dev, it is used for
detecting gstreamer and others. So it is more correct to place it on the
Meson Build system section.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:06 +03:00
Ricardo Ribalda
ad55da5713 README: Add libboost to list of dependencies
Raspberry Pi IPA, which is enabled by default, requires libboost to
compile.
Specify in the documentation its dependencies and how to disable the
IPA.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:08:03 +03:00
Ricardo Ribalda
c84d64e305 README: Move the required dependencies to the top
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:07:59 +03:00
Ricardo Ribalda
b30c8b5848 README: Unify dependency names
All the dependencies are for libcamera, so we should move all the
packages under this paragraph, or make a paragraph for Meson, and a
second one for python3-yaml. I think the later is more clear.

Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24 21:07:53 +03:00
Kieran Bingham
4af45819d0 libcamera: ipa: Move key generation to utils
Move the GPLv2 utilities used for generating public and private keys to
the utilities subtree.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-24 10:56:22 +01:00
Kieran Bingham
131629d3a2 src: meson: Rename ipa_gen_priv_key to gen_ipa_priv_key
Refactor the naming of the custom command variable to match the style
used in the other custom target generators, and the name of the script.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-24 10:55:54 +01:00
Kieran Bingham
c09626cd63 libcamera: Move Header generation utilities to utils
Move the GPL2 utilities which handle generation of controls, formats and
the top level libcamera header to the utils subtree.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-24 10:55:49 +01:00
Kieran Bingham
d6b6ad950d meson: Process utils first
The utils directory can contain helpers and support tools which are used
throughout other components of the build.

Ensure that the utils subdir is parsed first allowing helpers to be
defined there.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-24 10:55:39 +01:00
Niklas Söderlund
f999ee85fa libcamera: buffer: Remove copyFrom()
There are no user left of the copyFrom() operation, remove it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-22 12:06:09 +02:00
Naushir Patuck
39798e8777 pipeline: ipa: raspberrypi: Handle any externally allocated FrameBuffer
Handle the case where a FrameBuffer that has been externally allocated
(i.e. not through the v4l2 video device) is passed into a Request.

We must store the buffer pointer in the stream internal buffer list to
identify when used.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:49 +02:00
Naushir Patuck
dd0df6d739 pipeline: raspberrypi: Use an unordered_set to store IPA buffer ids
By using a set container, we can easily insert/remove buffer ids that have
been mmaped by the IPA. This will be required to track buffers allocated
externally and passed to the pipeline handler through a Request.

Move the IPA buffer mapping code into a function to remove duplicated
code.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
e1784ca883 pipeline: raspberrypi: Use an unordered_map for the stream buffer list
By using a map container, we can easily insert/remove buffers from the
buffer list. This will be required to track buffers allocated externally
and passed to the pipeline handler through a Request.

Replace the buffer index tracking with an id generated internally by the
stream object.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
f22ffc0ebe libcamera: pipeline: ipa: raspberrypi: Remove use of FrameBuffer cookie
The FrameBuffer cookie may be set by the application, so this cannot
be set by the pipeline handler as well. Revert to using a simple index
into the buffer list to identify buffers passing to and from the IPA.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
b752c57c33 libcamera: pipeline: raspberrypi: Add more robust stream buffer logic
Add further queueing into the RPiStream object to ensure that we always
follow the buffer ordering (be it internal or external) given by
incoming Requests.

This is essential, otherwise we risk dropping frames that are meant to
be part of a Request, and can cause the pipeline to stall indefinitely.
This also prevents any possibility of mismatched frame buffers going
through the pipeline and out to the application.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
45430e12ee libcamera: pipeline: raspberrypi: Fix bug in passing configuration to IPA
The counter was not incremented, so multiple streams would only pass the
last stream config to the IPA.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
2df7bf1681 libcamera: pipeline: raspberrypi: Rework stream buffer logic for zero-copy
Stop using v4l2_videodevice::allocateBuffer() for internal buffers and
instead export/import all buffers. This allows the pipeline to return
any stream buffer requested by the application as zero-copy.

Advertise the Unicam Image stream as the RAW capture stream now.

The RPiStream object now maintains a new list of buffers that are
available to queue into a device. This is needed to distinguish between
FrameBuffers allocated for internal use vs externally provided buffers.
When a Request comes in, if a buffer is not provided for an exported
stream, we re-use a buffer from this list.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
3e7ee080d6 libcamera: pipeline: raspberrypi: Remove const qualifier from RPiStream
For the zero-copy RAW capture feature, the RPiStream will have to be
modified. Remove the const qualifier in anticipation of the future
commits for this feature.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
addd343b96 libcamera: pipeline: raspberrypi: Increase the number of RAW buffers
Increase the number of expected RAW buffers in the stream configuration
to 2. This will avoid dropping Unicam frames when exporting RAW streams.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
dd0a9cf2b1 libcamera: pipeline: raspberrypi: Add some debug logging
No functional changes, only added some more trace points.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
8404d02d75 libcamera: pipeline: ipa: raspberrypi: Rework drop frame signalling
The IPA now signals up front how many frames it wants the pipeline
handler to drop. This makes it easier to handle up-coming changes to the
buffer handling for import/export buffers.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Naushir Patuck
6bca768a0b libcamera: pipeline: raspberrypi: Move RPiStream into a separate file
Put RPiStream into the RPi namespace and add a new log category (RPISTREAM).
Reorder methods into logical groups for readability.

There are no functional changes in this commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21 13:10:48 +02:00
Laurent Pinchart
e390f9f618 Documentation: Adjust guidelines regarding math.h header
While libcamera prefers usage of the C standard library headers (xxx.h)
over the C++ version (cxxx), we make an exception for cmath as the
overloaded versions of the math functions are convenient. Document this,
and adjust checkstyle.py accordingly.

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-09-21 13:55:02 +03:00
Laurent Pinchart
beed258a5a test: Include specific headers instead of libcamera.h
Let's only pull required headers, to avoid slowing compilation down.

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-09-21 13:50:42 +03:00
Laurent Pinchart
2fa4ba01ff libcamera: Don't unnecessarily include event_notifier.h
The ipc_unixsocket.h and process.h internal headers don't need to
include event_notifier.h, the former because a forward declaration
suffices, and the latter because it doesn't use event notifiers. Remove
the unnecessary include, and include signal.h instead which is required
and was included indirectly through event_notifier.h.

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-09-21 13:50:30 +03:00