Commit graph

3486 commits

Author SHA1 Message Date
Paul Elder
0040820fc1 libipa: camera_sensor_helper: Add OV5640 helper
The OV5640 is an OmniVision sensor with a linear gain model, expressed
in 1/16 steps.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-04-01 14:48:29 +03:00
Laurent Pinchart
e342e522cb libipa: camera_sensor_helper: Add IMX296 helper
The IMX296 is a Sony sensor that expresses its gain in 0.1dB units. It
thus maps to the exponential gain model.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-01 14:48:29 +03:00
Laurent Pinchart
4011994780 libipa: camera_sensor_helper: Add IMX290 helper
The IMX290 is a Sony sensor that expresses its gain in 0.3dB units. It
thus maps to the exponential gain model.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-01 14:48:24 +03:00
Laurent Pinchart
8ad9249fb0 libipa: camera_sensor_helper: Implement exponential gain model
The CameraSensorHelper specifies two gain models, linear and
exponential. They are modelled after the MIPI CCS specification. Only
the linear model has been implemented, the exponential model was left
for later.

We now need to support sensors that configure their gain in a hardware
register with a value expressed in dB. This has similarities with the
MIPI CCS exponential gain model, but is only has an exponential factor,
while CCS also allows sensors to support a configurable linear factor.

The full CCS exponential model needs two values (for the linear and
exponential factors) to express a gain, while IPAs use a single linear
gain value internally. However, the exponential gain model example in
the CCS specification has a fixed linear factor, which may indicate that
it could be common for sensors that implement the exponential gain model
to only use the exponential factor. For this reason, implement the
exponential gain model with a fixed linear factor, but with a
sensor-specific coefficient for the exponential factor that allows
expressing the gain in dB (or other logarithmical units) instead of
limiting it to powers of 2 as in the MIPI CCS specification.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-01 14:29:25 +03:00
Laurent Pinchart
a9d43c4710 libipa: camera_sensor_helper: Reorganize gain constants
To prepare for other gain models than the linear model, store the gain
constants in a union with per-model members. Due to the lack of
designated initializer support in gcc with C++17, initializing a single
complex structure that includes a union will be difficult. Split the
gain model type to a separate variable to work around this issue.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-04-01 14:29:05 +03:00
Laurent Pinchart
f9e2df9519 libcamera: v4l2_videodevice: Fix potential errno overwrite
The errno variable can potentially be overwritten by operator<<(). Store
it in a local variable before logging the error message.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-04-01 14:18:10 +03:00
Laurent Pinchart
b90faccb2c libcamera: camera_sensor: Add IMX290 sensor properties
The Sony IMX290 is a rolling shutter sensor with a 1945x1109 pixel array
size, with a recommended resolution after CFA interpolation of
1920x1080.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-29 13:20:09 +03:00
Laurent Pinchart
9bb0889baf gstreamer: Fix typo in comment
Possibly the most trivial patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-29 01:42:26 +03:00
Umang Jain
60c3d32a89 ipa: ipu3: Ensure controls exists in before they are queried
Add a validation check for sensor controls validateSensorControls()
before they are queried in IPAIPU3::updateSessionConfiguration().
Fail the IPAIPU3::configure() if the required sensor controls are
not found.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 17:01:17 +05:30
Umang Jain
36f0cd57cb ipa: ipu3: Drop sensor controls private members from IPAIPU3
Drop exposure, gain private members from IPAIPU3 because the values
are handled directly via IPAFrameContext.

Move the default vblank value from IPAIPU3 to IPASessionConfiguration
structure as it is a default static value not expected to change
for a session.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 17:01:17 +05:30
Umang Jain
a76b06e951 ipa: ipu3: Consolidate querying of exposure and gain limits
The exposure and gain limits are required for AGC configuration
handled in IPAIPU3::updateSessionConfiguration(), which is happening
already. Therefore the max/min private members in IPAIPU3 class for
exposure/gain serve no use except setting initial values of exposure_
and gain_ members.

Drop the max/min private members from IPAIPU3 class and set initial
gain_ and exposure_ in  IPAIPU3::updateSessionConfiguration().

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 17:01:17 +05:30
Jean-Michel Hautbois
4b2251509f ipa: rkisp1: Introduce AWB
The RkISP1 ISP calculates a mean value for Y, Cr and Cb at each frame.
There is a RGB mode which could theoretically give us the values for R,
G and B directly, but it seems to be failing right now.

Convert those values into R, G and B and estimate the gain to apply in a
grey world.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 12:31:37 +02:00
Jean-Michel Hautbois
8917c9e7ba ipa: rkisp1: agc: Add a histogram-based gain
As for the IPU3, we can estimate the histogram of the luminance. The
RkISP1 can estimate multiple ones, the R, G and B ones, the Y only one
and a combination of RGB. The one we are interested by in AGC is the Y
histogram.

Use the hardware revision to determine the number of bins of the
produced histogram.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 12:31:37 +02:00
Jean-Michel Hautbois
88c69f8808 ipa: libipa: Histogram: Constify the constructor span
The Histogram constructor does not modify the data. Pass it a
Span<const uint32_t> instead of a Span<uint32_t>.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 12:31:37 +02:00
Jean-Michel Hautbois
13c1e48e8e ipa: rkisp1: Introduce Black Level Correction
In order to have the proper pixel levels, apply a fixed black level
correction, based on the imx219 tuning file in RPi. The value is 4096 on
16 bits, and the pipeline for RkISP1 is on 12 bits, scale it.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 12:31:37 +02:00
Jean-Michel Hautbois
f84e5e01a4 ipa: rkisp1: Use frame counter for the request queued
Introduce a frameCount variable in the IPAFrameContext which increments
each time a request is queued. It is reset at configure call, when the
camera is started.

This will allow the frameCount to be used by other algorithms, without
having to keep multiple private frame counters.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 12:31:37 +02:00
Laurent Pinchart
4efca856c0 utils: hooks: pre-push: Catch commits without author's SoB
The pre-push git hook script catches commits without a SoB line
corresponding to the committer, but doesn't perform the same check on
the author. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-28 13:29:32 +03:00
Naushir Patuck
7349031294 test: Test V4L2BufferCache::isEmpty() member function
Add a test for V4L2BufferCache::isEmpty() for various levels for cache
fullness.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
2022-03-28 02:18:39 +03:00
Naushir Patuck
5704856681 libcamera: v4l2_videodevice: Empty the V4L2 buffer cache on streamOff()
When streamOff() is called, ensure the cache entries for the remaining queued
buffers are freed since this will not happen via the dequeueBuffer() mechanism.

Additionally, add a V4L2BufferCache::isEmpty() function and assert that the
cache is empty at the end of the streamOff() call.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.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>
2022-03-28 02:18:34 +03:00
Naushir Patuck
1fb71a6ffa libcamera: v4l2_videodevice: Do not allow buffer queueing in stopping state
If the device is in the process of being stopped (i.e. Stopping state), any
call to queueBuffer() must fail. This is to ensure the integrity of the buffer
queue, as it gets cleared at the end of streamOff.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
2022-03-28 02:18:23 +03:00
Naushir Patuck
988ec3f417 libcamera: v4l2_videodevice: Better tracking of the device state
Replace the existing streaming_ state variable with an enum to track the
following three state: Streaming, Stopping, and Stopped. The alternate states
will be used in a subsequent commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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>
2022-03-28 02:17:22 +03:00
Naushir Patuck
ec173ef5d3 pipeline: raspberrypi: Repurpose RPi::Stream::reset()
The original use of RPi::Stream::reset() was to clear the external flag state
and free/clear out the framebuffers for the stream. However, the latter is now
done through PipelineHandlerRPi::configure(). Rework
PipelineHandlerRPi::configure() to call RPi::Stream::setExternal() instead of
RPi::Stream::reset() to achieve the same thing.

Repurpose RPi::Stream::reset() to instead reset the state of the buffer handling
logic, where all internally allocated buffers are put back into the queue of
available buffers. As such, rename the function to RPi::Stream::resetbuffers().
This resetbuffers() is now called from PipelineHandlerRPi::start(), allowing the
pipeline handler to correctly deal with start()/stop()/start() sequences and
reusing the buffers allocated on the first start().

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-28 02:16:38 +03:00
Naushir Patuck
6ab7d87ff2 pipeline: raspberrypi: Free buffers in the RPiCamera destructor and re-configure
Currently, all framebuffer allocations get freed and cleared on a stop in
PipelineHandlerRPi::stopDevice(). If PipelineHandlerRPi::start() is then called
without an intermediate PipelineHandlerRPi::configure(), it will re-allocate and
prepare all the buffers again, which is unnecessary.

Fix this by not freeing the buffer in PipelineHandlerRPi::stopDevice(), but
insted doing it in PipelineHandlerRPi::configure(), as the buffers might have
to be resized.

Add a flag to indicate that buffer allocations need to be done on the next
call to PipelineHandlerRPi::start().

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.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>
2022-03-28 02:16:35 +03:00
Naushir Patuck
73c07bf289 pipeline: raspberrypi: Move freeBuffers() to the RPiCameraData class
This function used to clear the camera buffers does not belong in the
PipelineHandlerRPi class as it only access members of the RPiCameraData,
so move it.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@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>
2022-03-28 02:16:30 +03:00
Naushir Patuck
e96e9e6e1d pipeline: raspberrypi: Avoid over-allocation for ISP Output 1
The V4L2DeviceFormat structure for the ISP Output 1 node was a copy of what is
used ISP Output 0 node, but with the size changed. However, the plane size and
stride values were not updated. So there is a possibility that the buffer might
be over-sized for the requested resolution.

Fix this by only copying the relevant fields from the ISP Output 0
V4L2DeviceFormat structure, and let the device driver size the planes as needed.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@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>
2022-03-28 02:16:24 +03:00
Laurent Pinchart
54398c1583 libcamera: base: timer: Drop start() overload with int argument
The start(unsigned int msec) overload is error-prone, as the argument
unit can easily be mistaken in callers. Drop it and update all callers
to use the start(std::chrono::milliseconds) overload instead.

The callers now need to use std::chrono_literals. The using statement
could be added to timer.h for convenience, but "using" is discouraged in
header files to avoid namespace pollution. Update the callers instead,
and while at it, sort the "using" statements alphabetically in tests.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-03-25 13:11:12 +02:00
Laurent Pinchart
074fa98ac4 pipeline: rkisp1: Match sensor aspect ratio when generating configurations
The RkISP1Path::generateConfiguration() function limits the maximum
resolution to the sensor resolution, to avoid upscaling. It however
doesn't take the sensor aspect ratio into account, which leads to a
maximum (and default) resolution of 1920x1920 when using the self path
with a sensor that has a higher resolution.

Fix it by constraining the minimum and maximum resolutions to match the
sensor's aspect ratio.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-03-25 11:44:54 +02:00
Laurent Pinchart
bf5b3af88f cam: Fix indentation in meson.build
One if...endif block is incorrectly indented. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-03-25 11:34:31 +02:00
Umang Jain
c7d4599565 ipa: rkisp1: Replace event-based ops with dedicated functions
The IPARkISP1Interface currently uses event-type based structures in
order to communicate with the pipeline-handler (and vice-versa).
Replace the event based structures with dedicated functions associated
to each operation.

The translated naming scheme of operations to dedicated functions:
  ActionV4L2Set         => setSensorControls
  ActionParamFilled     => paramsBufferReady
  ActionMetadata        => metdataReady
  EventSignalStatBuffer => processStatsBuffer()
  EventQueueRequest     => queueRequest()

The lexical of IPARkISP1::metadataReady() will now conflict with the
metadataReady Signal being introduced in this patch as part of the
interface change. Hence, rename IPARkISP1::metadataReady() to
IPARkISP1::prepareReady() to prevent the conflict.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-03-23 21:53:42 +05:30
Umang Jain
db269cc4b3 ipa: rkisp1: Drop private exposure and gain limits
The private members of exposure and gain limits can be dropped
from IPARkISP1 since they are not used class-wide and can be easily
replaced by local counter-parts.

In case they are required to be widely available, these should then
sit in IPASessionConfiguration.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-03-23 21:53:38 +05:30
Umang Jain
ed859f554f libcamera: framebuffer: Add a missing space in documentation
s/bytesused/bytes used/

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 21:53:01 +05:30
Umang Jain
b24e39be48 libcamera: v4l2_videodevice: Clarify setting of v4l2_buffer timestamp
Add a comment to clarify why we set v4l2_buffer timestamp while
queuing the buffer (VIDIOC_QBUF). The timstamps are required to
be supplied for memory-to-memory devices for output streams which
then are copied to capture stream buffers with the help of
V4L2_BUF_FLAG_TIMESTAMP_COPY (set by the driver).

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 21:52:57 +05:30
Umang Jain
ea9bc717bd libcamera: v4l2_videodevice: Remove setting of buffer sequence
The struct v4l2_buffer documentation [1] clearly states
that setting of the sequence is done by the driver. libcamera does
not really need to set this field while queuing the buffer(s).

[1]: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/buffer.html#struct-v4l2-buffer

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 21:52:24 +05:30
Paul Elder
9cdf837ab7 libcamera: camera_sensor: Add OV5640 sensor properties
Add an entry to the sensor properties for the ov5640. Only the first
test pattern is included as the others that are exposed by the kernel
don't correspond to any that are defined in the libcamera control.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-03-23 17:42:17 +09:00
Naushir Patuck
fc9bbddf0c ipa: raspberrypi: Add tuning file for IMX296 sensor
The Sony IMX296 exists in two versions, colour (Bayer) and monochrome.
The tuning file corresponds to the monochrome version.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2022-03-23 01:50:17 +02:00
Naushir Patuck
f687116904 ipa: raspberrypi: Add camera helper for Sony IMX296 sensor
The Sony IMX296 sensor has an exponential gain model, and adds a fixed
14.26µs offset to the exposure time expressed in line units.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 01:50:14 +02:00
Naushir Patuck
3dc81300c7 ipa: raspberrypi: cam_helper: Make exposure conversion functions virtual
Some sensors (namely the Sony IMX296, whose support will be added
shortly) require different conversion formulas between exposure time and
exposure lines. Make the Exposure() and ExposureLines() functions
virtual to allow this.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 01:50:12 +02:00
Laurent Pinchart
91021c38e4 libcamera: camera_sensor: Add IMX296 sensor properties
The Sony IMX296 is a global shutter sensor with a 1456x1088 pixel array
size, with a recommended resolution after CFA interpolation of
1440x1080.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-23 01:49:26 +02:00
David Plowman
b9b5e776f6 ipa: raspberrypi: awb: Fix typo in AWB mode conversion table
The AwbAuto mode is defined in all the JSON tuning files as "auto",
not "normal". The effect of this was that you couldn't switch back to
"auto" mode once you had switched away.

Signed-off-by: David Plowman <david.plowman@raspberrypi.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>
2022-03-23 01:19:23 +02:00
Kieran Bingham
a8284e3570 v4l2: camera_proxy: Fix header include order
The includes in the v4l2_camera_proxy do not match the code style
and trigger clang-format changes when running checkstyle.

Update and fix the include order accordingly

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 16:35:59 +00:00
Laurent Pinchart
4581ce0a82 ipa: ipu3: agc: Use existing local short-hand variable in configure()
The configure() function has a local configuration variable referencing
context.configuration for the purpose of shortening lines. Use it
instead of context.configuration in the remaining locations, and
constify it while at it as the configuration isn't meant to be modified.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 16:35:51 +00:00
Laurent Pinchart
4b2515899c ipa: ipu3: agc: Reset frame count when configuring AGC
The frame count is used to skip the gain and exposure filtering when
starting. It thus needs to be reset when configuring the algorithm, to
avoid slower convergence when stopping and restarting.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 16:35:04 +00:00
Daniel Scally
f0bfb2f19e libipa: Add CameraSensorHelper for OV2740
The datasheet for the OV2740 gives 0x80 as 1x gain, so real gain
is GainCode / 128.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 16:34:47 +00:00
Daniel Scally
a42c00e01e libcamera: Add OV2740 camera sensor properties
Add camera sensor property entries for the OmniVision 2740 camera
sensor.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 16:34:23 +00:00
Kieran Bingham
242f665351 README: Extend gstreamer examples
There have been many reports of facing difficulties with the gstreamer
element and getting the libcamerasrc to successfully negotiate with
other gstreamer elements.

This is often due to the current limitations on colorimetry and frame
rate support in the element, and can usually be worked around by
specifying those explicitly in the caps.

Provide a tested example to capture, encode, and stream images as jpeg
to a remote device in the gstreamer section of the getting started
readme.

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-17 10:10:36 +00:00
Daniel Scally
58faa4f360 ipa: ipu3: Send lens controls to pipeline handler
Pick up the focus value from the AF algorithm and send lens controls
along in the frame context.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-15 17:20:59 +00:00
Daniel Scally
1aecc633e4 libcamera: ipu3: Pass lens controls to config info
When configuring the pipeline we want to share the controls for any
VCM device against the sensor too - pass them to the lensControls
member of configInfo

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-15 17:20:59 +00:00
Daniel Scally
8fc169da5f libcamera: ipa: Rename ctrls_ member
Now that we have added lens controls, rename the existiing
member of the class to clarify that it relates to the sensor's
controls.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-15 17:20:59 +00:00
Daniel Scally
5413e78893 libcamera: ipa: Add lens control member to ipu3 ipa interface
Add further members to the ipu3 ipa interface that will hold lens
controls passed in by configInfo

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-15 17:20:59 +00:00
Daniel Scally
931556c37c libcamera: camera_lens: Add function to fetch subdev controls
Add a function to the CameraLens class to fetch the V4L2 controls
for its V4L2 subdev

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-03-15 17:20:59 +00:00