Commit graph

2816 commits

Author SHA1 Message Date
Umang Jain
28990d36fe utils: ipc: Assign a new gid to proxy worker
Isolated IPAs are forked to a new process by the proxy worker, which
shares the same process group. This allows the undesired effect that
the proxy worker will receive signals such as SIGINT and will be closed
by a Ctrl-C event before the pipeline handlers have been able to fully
clean up.

Prevent this signal from being delivered to the proxy worker by moving
the process to a new process group, matching the pid of the isolated
proxy.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=60
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2021-07-27 10:07:13 +05:30
Laurent Pinchart
799a04b7e7 libcamera: CameraSensorProperties: Sort entries
Keep entries sorted by sensor name to ensure the file stays readable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-26 11:49:11 +03:00
Daniel Scally
34eef24d0b libcamera: Add OV8865 sensor properties
Add camera sensor properties for the OV8865 sensor. This is the world
facing camera on most MS Surface platforms.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-25 02:43:45 +03:00
Daniel Scally
2c88a6dbc1 libipa: Add CameraSensorHelper for ov8865
Add a CameraSensorHelperOv8865 class. The gain coefficients are gleaned
from the datasheet; the lowest 7 bits are reported there as fractional
bits, so real gain is val/128.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-25 01:52:48 +03:00
Umang Jain
48a380b389 libipa: Add CameraSensorHelper for IMX258
Extend the CameraSensorHelper factory with support for the IMX258
sensor found in the Nautilus Chromebook.

The values are read by manually tweaking the IMX258 kernel driver.
The IMX258 kernel driver hints that the sensor may be compatible
with the MIPI CCS specification, as the register set matches.
The values for analog gain constants are obtained by reading the
register indexes, corresponding to the analog gain constants, as
mentioned in MIPI CCS v1.1 specification.

The values have further been confirmed by Dave Stevenson as being
those specified in the datasheet.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-23 22:48:12 +05:30
Laurent Pinchart
951df850ad cam: Initialize CamApp::loopUsers_
The CamApp loopUsers_ member variable isn't initialized, which results
in random execution of the event loop. Fix it.

Fixes: caa6ffacb2 ("cam: Reorganize run() function and merge the two event loops")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
2021-07-23 18:40:48 +03:00
Laurent Pinchart
e0704e97ea cam: Support using multiple cameras concurrently
To allow testing capture from multiple cameras concurrently, turn the
--camera option into an array option, and create one CameraSession per
specified camera. The code is adapted to iterate over the sessions
vector instead of handling a single session. Thanks to all the
refactoring previously performed, changes are minimal.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:14:05 +03:00
Laurent Pinchart
721f4b03d8 cam: Add camera index to file name of capture frames
To prepare for multi-camera support, extend the file naming scheme for
captured frames to include the camera index in addition to the stream
name and frame number.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:14:03 +03:00
Laurent Pinchart
7dab1fa58f cam: Make camera-related options sub-options of OptCamera
Use the new hierarchical options feature of the option parser to turn
camera-related option (--capture, --file, --stream, --strict-formats and
--metadata) into children of the --camera option. As an added bonus, we
don't need to check anymore if a camera has been specified when capture
is requested, as that's now enforced by the option parser.

This change prepares for support of multiple cameras.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:59 +03:00
Laurent Pinchart
5082fe7b5b cam: Allow specifying directories in the --file option
The value of the --file option is the full name of the file to which
captured frames are written. To write files to a specific directory with
the default naming scheme, the "frame-#.bin" name has to appear at the
end of the file name. Simplify usage of the option by allowing --file to
specify a directory only. If the file name ends with a '/', the default
"frame-#.bin" file name is automatically appended.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:57 +03:00
Laurent Pinchart
caa6ffacb2 cam: Reorganize run() function and merge the two event loops
Reorganize the run() function to make it more readable, and merge the
two event loops into one as capture and hotplug monitoring don't have to
be mutually exclusive.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:55 +03:00
Laurent Pinchart
a2c634d449 cam: Move session_ member variable to a local variable in run() function
The session_ member of the CamApp class is only needed in the run()
function. Make it a local variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:54 +03:00
Laurent Pinchart
66c955648f cam: Move printing of camera information to CameraSession class
The three CamApp functions listControls(), listProperties() and
infoConfiguration() operate on a camera. They would thus be better
placed in the CameraSession class. Move them there. As they now have no
error to return anymore, make them void functions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:53 +03:00
Laurent Pinchart
3d50939113 cam: Move camera session creation and monitoring setup to run()
Move creation of the camera session and setup of the hotplug monitoring
from the init() function to the run() function, to group all the code
that performs operations based on command line options in a single
place. The cleanup() call on session creation failure isn't required
anymore, as the cleanup() function is called unconditionally upon return
from run().

This change allows merging two different code blocks related to hotplug
monitoring.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:51 +03:00
Laurent Pinchart
e548e583cc cam: Make CamApp::cameraName() static
The CamApp::cameraName() doesn't need to access any member of the CamApp
class. Make it static. While at it, drop an unneeded const from the
return value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:50 +03:00
Laurent Pinchart
2eeb431a93 cam: Drop unneeded error check and message
The EventLoop::exec() function returns the exit code of the event loop,
not an error status. Drop the corresponding error check and error
message.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:49 +03:00
Laurent Pinchart
033cac7f6d cam: Use std::unique_ptr<> to manage CameraManager
Store the CameraManager instance in a unique_ptr to simplify memory
management and avoid leaks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:48 +03:00
Laurent Pinchart
8519df23a9 cam: Move camera acquire to the CameraSession class
Continue moving towards making the CameraSession class the central point
to handle a camera by moving the camera acquire operation. A new
CameraSession::camera() function is needed to allow access to the camera
from CamApp.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:47 +03:00
Laurent Pinchart
8e716be529 cam: Move CameraConfiguration creation to CameraSession class
Creating a configuration for a camera is an operation that logically
belongs to the CameraSession class. Move it there.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:46 +03:00
Laurent Pinchart
34d986d1ec cam: Store camera session pointer in CamApp class
Move the local CameraSession variable from the CamApp::run() function to
a member variable of the CamApp class, created in CamApp::init(). This
is a first step towards moving code to the CameraSession class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:45 +03:00
Laurent Pinchart
24ca846a27 cam: camera_session: Use std::unique_ptr<> to manage class members
Store the BufferWriter and FrameBufferAllocator pointers in
std::unique_ptr<> instances to simplify memory management and avoid
leaks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:44 +03:00
Laurent Pinchart
4cd0f586fb cam: Move event loop execution from CameraSession to CamApp
To prepare for multiple concurrent camera sessions, move the event loop
exec() call from the CameraSession class to the CamApp class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:43 +03:00
Laurent Pinchart
011b3ff288 cam: Move event loop exit from CameraSession to CamApp
Make exiting the event loop the responsibility of the application, not
the camera session, to prepare for support of multiple camera sessions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:42 +03:00
Laurent Pinchart
453583e189 cam: camera_session: Access event loop through global instance
Don't pass the event loop to the CameraSession constructor, as passing
this global object explicitly isn't a design that can scale.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:40 +03:00
Laurent Pinchart
94d828d880 cam: Rename Capture to CameraSession
Rename the Capture class to CameraSession, to prepare for multi-camera
support that will gather more camera-related operations than capture in
that class.

While at it, remove an unneeded blank line.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:39 +03:00
Laurent Pinchart
180e95f06a cam: options: Fail parsing when non-option arguments are found
The options parser currently ignores non-option arguments silently,
which is confusing. It's a common error to run 'cam -c1 -C 10' and
expect only 10 frames to be captured. As the -C option takes an optional
argument, the number 10 is interpreted as a non-option argument instead
of the argument to the -C option.

Fail parsing with an appropriate message and print usage information
when a non-option argument is found. The parser may be extended later to
accept non-option arguments when the application has a use for them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-22 17:13:36 +03:00
Laurent Pinchart
3c63675560 cam: options: Avoid copies of OptionvValue and KeyValueParser::Options
The OptionValue toKeyValues() and toArray() functions return a copy of
the values. This is unnecessary, and can cause use-after-free issues
when taking references to the return values. Return references instead
to optimize the implementation and avoid issues.

The behaviour of the two functions is now undefined in case of an option
type mismatch. The current implementation catches this with an
assertion.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-22 17:13:32 +03:00
Laurent Pinchart
11298f3d47 cam: stream_options: Use OptionValue::empty() to test if option is set
The roles() and updateConfiguration() functions check if the OptStream
OptionValue they receive is empty by first casting it to an array. To
prepare for the toArray() function not allowing such a cast when the
option value is empty, test if the option value is empty instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-22 17:13:31 +03:00
Laurent Pinchart
812e5a946f cam: options: Add empty() function to OptionValue class
Add a convenience helper to check if an option value is empty, based on
the value type. This is useful as a shortcut syntax to check if an
option has been set.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-22 17:13:30 +03:00
Laurent Pinchart
668c87732a cam: options: Drop some OptionValue cast operators
While OptionValue cast operators to int and std::string allow useful
shortcut syntaxes, the cast operators to KeyValueParser::Options and
std::vector<OptionValue> are less useful. A an explicit static_cast call
would be more cumbersome to write than an explicit .toKeyValues() or
toArray(), and implicit cast hide too much of what's going on.

Drop those two cast operators, and replace the only implicit cast
occurrence with .toKeyValues(). While at it, drop the local opts
variable in StreamKeyValueParser::roles() as it isn't used.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:28 +03:00
Laurent Pinchart
bb682d2585 cam: options: Support parent-child relationship between options
Add support for creating a tree-based hieararchy of options instead of a
flat list. This is useful to support options that need to be interpreted
in the context of a particular occurrence of an array option.

The usage text automatically documents the options in their
corresponding context:

Options:
  -c, --camera camera ...                               Specify which camera to operate on, by id or by index
  -h, --help                                            Display this help message
  -I, --info                                            Display information about stream(s)
  -l, --list                                            List all cameras
      --list-controls                                   List cameras controls
  -p, --list-properties                                 List cameras properties
  -m, --monitor                                         Monitor for hotplug and unplug camera events

Options valid in the context of --camera:
  -C, --capture[=count]                                 Capture until interrupted by user or until <count> frames captured
  -F, --file[=filename]                                 Write captured frames to disk
                                                        If the file name ends with a '/', it sets the directory in which
                                                        to write files, using the default file name. Otherwise it sets the
                                                        full file path and name. The first '#' character in the file name
                                                        is expanded to the camera index, stream name and frame sequence number.
                                                        The default file name is 'frame-#.bin'.
  -s, --stream key=value[,key=value,...] ...            Set configuration of a camera stream
          height=integer                                Height in pixels
          pixelformat=string                            Pixel format name
          role=string                                   Role for the stream (viewfinder, video, still, raw)
          width=integer                                 Width in pixels
      --strict-formats                                  Do not allow requested stream format(s) to be adjusted
      --metadata                                        Print the metadata for completed requests

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:23 +03:00
Laurent Pinchart
b53f68e66c cam: options: Move key string left in usage() for key-value parser
When printing usage information for a key-value parser, the
documentation of the keys and values is printed in the second column of
the usage text:

  -s, --stream key=value[,key=value,...] ...            Set configuration of a camera stream
                                                        height=integer          Height in pixels
                                                        pixelformat=string      Pixel format name
                                                        role=string             Role for the stream (viewfinder, video, still, raw)
                                                        width=integer           Width in pixels
  -h, --help                                            Display this help message

This results in long lines. Improve this by moving the key description
to the first column, and aligning the value description as other option
description text:

  -s, --stream key=value[,key=value,...] ...            Set configuration of a camera stream
          height=integer                                Height in pixels
          pixelformat=string                            Pixel format name
          role=string                                   Role for the stream (viewfinder, video, still, raw)
          width=integer                                 Width in pixels
  -h, --help                                            Display this help message

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:22 +03:00
Laurent Pinchart
c71691e66c cam: options: Disable copy for parsers
Copying the OptionsParser class would result in the optionsMap_ entries
pointing to Option entries of the original instance. As there's no use
case for copying the class, disable copying.

Disable copying of KeyValueParser as well for consistency as there's no
use case either.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:21 +03:00
Laurent Pinchart
a8f3a68ec9 cam: options: Slit OptionsParser::usage() in two functions
To prepare for code reuse, split the printing of options out of
OptionsParser::usage() to a separate function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:20 +03:00
Laurent Pinchart
7c205c79d9 cam: options: Add optionName() function to Option structure
Add an Option::optionName() function that returns a string describing
the option name, with leading dashes. As a result,
OptionsParser::parseValueError() function becomes a single-line function
and can be inlined in its caller.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:18 +03:00
Laurent Pinchart
539820f5d6 cam: options: Move OptionValue class after OptionsParser
To prepare for usage of the OptionsParser::Options class in OptionValue,
move the definition of the OptionValue class after OptionsParser. There
is no functional change.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:16 +03:00
Laurent Pinchart
b938911884 cam: options: Document the options parser API
Before extending the option parser, document its existing API.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:13 +03:00
Laurent Pinchart
aeb6390418 cam: options: Move Option struct to options.cpp
The Option structure is an internal implementation detail and shouldn't
be exposed in the API. Move it to options.cpp. This requires moving the
inline constructors and destructors for the KeyValueParser and
OptionsParser classes to options.cpp as well, as they need a full
definition of the Option structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:11 +03:00
Laurent Pinchart
12cb9293fa cam: options: Make KeyValueParser::usage() private
The KeyValueParser::usage() function is meant to be called from an
OptionsParser or another KeyValueParser only. Make it private, and set
the OptionsParser class as a friend of the KeyValueParser class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-22 17:13:07 +03:00
Heiko Stuebner
ab4932f87d ipa: rkisp1: Add support for V12 isp blocks
Some values for array sizes differ between v10 and v12, so set them
in init() and adjust the auto exposure algorithm to the ae value
from there.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-07-22 14:38:44 +02:00
Paul Elder
5468048b68 Documentation: guides: application-developer: update pkgconfig name
The pkgconfig name was changed from camera to libcamera, but the
application developer guide wasn't updated. Update it to refer to the
new name.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=65
Fixes: ec7afef6 ("libcamera: Rename libcamera pkg-config generation")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-21 19:35:55 +09:00
Umang Jain
ab09913acb libcamera: v4l2_videodevice: Avoid extra construction of Framebuffer
While populating the V4L2BufferCache, avoid the extra construction of
FrameBuffer, which is currently done by passing the vector of
FrameBuffer::Planes. It is not wrong per se, but futile to have another
construction of FrameBuffer from a copy of buffer->planes() for the
corresponding Entry.

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>
2021-07-19 18:41:08 +05:30
Laurent Pinchart
c73170388e libcamera: ipa_manager: Allow forcing IPA module isolation
For test purpose it's useful to run open-source IPA modules in
isolation. This can already be done by deleting the corresponding
signature file, but that method can be inconvenient. Add a way to force
IPA module isolation through a new LIBCAMERA_IPA_FORCE_ISOLATION
environment variable.

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>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-07-19 08:20:37 +03:00
Laurent Pinchart
a5c81fc945 libcamera: ipa_manager: Split common code out of createIPA()
The createIPA() template function starts with code that doesn't depend
on the template parameters. Split it to a non-template function to avoid
code duplication in the binary.

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>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-07-19 08:20:34 +03:00
Laurent Pinchart
8847715ccd libcamera: ipa_manager: Fix IPA module min/max version check
The IPAManager::createIPA() function has its minVersion and maxVersion
parameters inverted. This doesn't cause any issue at the moment as both
the minimum and maximum version are set to 1 by all callers, but it's
still a bug. Fix it.

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>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-07-19 08:20:13 +03:00
Jacopo Mondi
e8a28b4b9b libcamera: controls: Fix minor error in documentation
Fix a small spelling mistake in the ControlInfoMap documentation.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-07-16 12:50:54 +02:00
Vedant Paranjape
4889464fd8 libcamera: Add pixel format BGRX8888
This patch adds pixel format BGRX8888 to libcamera. Additionally adds
mapping of V4L2 pixel format (V4L2_PIX_FMT_XRGB32) to BGRX8888.

Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-16 00:16:08 +03:00
Vedant Paranjape
3715d1b21d libcamera: Fix the V4L2 pixel format for formats::XBGR8888
This patch fixes V4L2 pixel format for formats::XBGR8888 by updating
the existing matching to V4L2_PIX_FMT_RGBX32

Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888")
Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-07-16 00:15:53 +03:00
Jean-Michel Hautbois
ea0b199da7 libipa: Correct OV5670 CameraSensorHelper gain values
The datasheet states that the low 7 bits are fraction bits.
real_gain = GainCode/128
For example, 0x080 is 1x gain, 0x100 is 2x gain.

It means that we should have m0=1 and c1=128.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-15 17:27:33 +02:00
Jean-Michel Hautbois
bda10cae5e libipa: Add CameraSensorHelper for OV13858
Extend the CameraSensorHelper factory with support for an
OV13858 sensor as found in the Soraka Chromebook.

The datasheet states that low 7 bits are fraction bits, so the gain is
calculated as gainCode=128*gain.
According to the formula, it means m0=1 and c1=128.
m1 then has to be 0, and c0=0.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-07-15 17:27:23 +02:00