summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline
AgeCommit message (Collapse)Author
2020-10-20libcamera: Omit extra semicolonsHirokazu Honda
The end semicolons with LOG_DEFINE_CATEGORY, LOG_DECLARE_CATEGORY and REGISTER_PIPELINE_HANDLER are unnecessary. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-12libcamera: pipeline: simple: enable qcom-camssAndrey Konovalov
qcom-camss driver supports MIPI CSI2 receivers on APQ8016 and APQ8096 Application processors from Qualcomm, which are used on e.g. DragonBoard 410c and DragonBoard 820c dev boards respectively. The simple pipeline handler provides basic support for these devices. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-10libcamera: pipeline: simple: enable mplane devices using contiguous memoryAndrey Konovalov
The current simple pipeline handler refuses to work with capture devices which have V4L2_CAP_VIDEO_CAPTURE_MPLANE flag set in the device capabilities field. This is too restrictive, as devices supporting the multi-planar API can be using contiguous memory for semi-planar and planar formats, and this would just work without any changes to libcamera. Drop the guard against MPLANE devices, and replace it with the check of the number of planes in the format the simple pipeline handler is going to use for capture. This will let MPLANE devices which don't use non-contiguous memory for frame buffers to work with the simple pipeline handler. The following code in SimpleCameraData::init() filters out the pixel formats libcamera doesn't support: PixelFormat pixelFormat = videoFormat.first.toPixelFormat(); if (!pixelFormat) continue; So the check for the number of memory planes this patch adds would not trigger until non-contiguous planar formats becomes supported in libcamera, and video devices using these formats are enabled in the simple pipeline handler. Then this check will remind one to review the simple pipeline handler code. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-07pipeline: ipa: raspberrypi: Switch to use C++17 features where possibleNaushir Patuck
With the recent change to use C++17, the following code changes can be made: - Use C++17 [[fallthough]] attribute instead of /* Fall through */. - Swap boost::any to std::any. 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>
2020-10-02pipeline: raspberrypi: Sensor flips should be applied unconditionallyNaushir Patuck
The code in pipeline_handler::start() that applies the flips were in a block that was conditional on the RPi::IPA_CONFIG_STAGGERED_WRITE return result. This should be applied unconditionally. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-02libcamera: pipeline: uvcvideo: Set sensor model propertyNiklas Söderlund
Set the sensor model property from the model reported in the media graph. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-02libcamera: pipeline: uvcvideo: Initialize CameraData from MediaDeviceNiklas Söderlund
The UVCCameraData::init() is the only consumer of the default entry in the media graph, move the lookup of it into the init() function and pass it the MediaDevice. This is done in preparation to extend the CameraData initialization to consume more information from the MediaDevice. 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-10-01libcamera: pipeline: rkisp1: Add support for XRGB8888Niklas Söderlund
The self path supports XRGB8888, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Add support for R8Niklas Söderlund
Both the main and self path support R8, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Add support for RGB656Niklas Söderlund
The self path supports RGB565, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Fix media bus propagation for NV{12,21}Niklas Söderlund
The upstream driver has changed how the link formats are validated when starting to stream [1]. This revealed that libcamera did not adjust the media bus format from the link between {main,self} resizer source pad and the capture video device as expected by the driver. The media bus code YUYV8_2X8 was hardcoded to MEDIA_BUS_FMT_YUYV8_2X8 for all pixel formats while it must be adjusted to YUYV8_1_5X8 for NV12 and NV21, fix this. 1. 6803a9e0e1e43e9e ("media: staging: rkisp1: cap: simplify link validation by comparing media bus code") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Remove support for YVYU and VYUYNiklas Söderlund
The upstream driver has dropped support for YVYU and VYUY [1], remove support from the pipeline handler. 1. 3acb3e06baf64e28 ("media: staging: rkisp1: cap: remove unsupported formats") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Use the media link to track if a path is enabledNiklas Söderlund
Instead of manually tracking if a path is enable or not use the media graph link status. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path link handling to RkISP1PathNiklas Söderlund
Move the path link handling to RkISP1Path, there is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move start and stop of path to RkISP1PathNiklas Söderlund
Move the start and stop of a path to RkISP1Path. This allows the importing of buffers to be moved closer the path start/stop simplifying the code. Also by adding a simple running tracker the error logic in PipelineHandlerRkISP1 can be simplified as stop() can always be called. This also removes all external users of RkISP1Path::video_ so it can be made private. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Add wrappers for accessing the path video deviceNiklas Söderlund
As a step to be able to make RkISP1Path::video_ private add simple wrappers for buffer handling. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path configuration generation and ↵Niklas Söderlund
validation to RkISP1Path Move the path configuration generation and validation to RkISP1Path. This is done to increase code reuse and to encapsulate the main and self path differences inside the RkISP1Path class. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path configuration to RkISP1PathNiklas Söderlund
Move the path configuration to RkISP1Path to increase code reuse and make the V4L2 subdevice resizer private to the path. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Breakout basic path handling to own classNiklas Söderlund
The self and main paths are very similar and the introduction of support for two simultaneous streams have made it clear their handling could be abstracted in a separate class. This is the first step to create such a class by breaking out the initialization and storage of the video and subdevices. There is no functional change in this patch. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: stream: Rename StillCaptureRaw to RawNiklas Söderlund
With the buffer copy removed from all pipelines for raw capture rename StillCaptureRaw to Raw to better describe the role. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-29libcamera: ipu3: Adjust comment on ImgU configurationJacopo Mondi
Be more precise in commenting why the ImgU shall not be configured if only the RAW stream is requested. As an example, if the ImgU gets unecessary configured: cam -srole=viewfinder -c2 -C -> WORKS cam -srole=stillraw -c2 -C -> WORKS cam -srole=viewfinder -c2 -C -> Failed to queue buffer 0: Invalid argument Since commit ("libcamera: ipu3: Fix RAW+YUV capture") the ImgU configuration procedure also correctly implements the assumption that at least one of the YUV output is being operated. If that's not the case, as in the RAW-only capture use case, the code tries to access a non-existing configuration. One more reason to exit early if no YUV stream is requested. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-29libcamera: ipu3: Remove dead code checkJacopo Mondi
Since the re-implementation of the IPU3 pipeline handler configuration procedure, the main output is always assigned in case any YUV stream is requested. Remove a dead code block that checks for the main output to be valid. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-29libcamera: ipu3: Fix RAW+YUV captureJacopo Mondi
When requesting one RAW stream and one YUV stream the StreamConfiguration assigned to the RAW stream is the first one added to the CameraConfiguration, while the YUV stream gets assigned to the main output. At configure() time the viewfinder output needs to be configured with the same format as the main output, but since the introduction of RAW capture support, the pipeline has not been updated and still assumes the main output configuration is the first one in the CameraConfiguration. This causes the viewfinder to be configured with the same format as the raw stream, breaking capture operations. Before this commit the following command fails and the ImgU does not produce frames: cam -srole=stillraw -srole=viewfinder -c2 -C Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-29ipa: raspberrypi: Tidy up variable names to be consistentNaushir Patuck
Change variable names to camel case to be consistent with the rest of the source files. Remove #define consts and replace with constexpr. Add some newlines to make the code more readable. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Kieran: Rebase merge conflicts resolved] [Kieran: Fix checkstyle line under 80 chars] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29ipa: raspberrypi: Move IPA parameters to the RPi namespaceNaushir Patuck
All IPA related types/params are now moved to the RPi namespace. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Kieran: Rebase merge conflicts fixed] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29pipeline: raspberrypi: Rename RPi::RPiStream and RPi::RPiDeviceNaushir Patuck
Rename RPi::RPiStream -> RPi::Stream and RPi::RPiDevice -> RPi::Device. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: raspberrypi: Plumb user transform through to IPADavid Plowman
This commit plumbs the user transform from the Raspberry Pi pipeline handler through to the IPA. Note that the transform is actually handled in the sensor (by setting the h/v flip bits), so the IPAs need to understand the orientation of the image they receive. Once in the IPA we add it to the CameraMode description, so that it becomes automatically available to all the individual control algorithms. The IPA configure method has to be reordered just a little so as to fill in the transform in the camera mode before calling SwitchMode. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: raspberrypi: Set camera flips correctly from user transformDavid Plowman
The Raspberry Pi pipeline handler allows all transforms except those involving a transpose. The user transform is combined with any inherent rotation of the camera, and the camera's H and V flip bits are set accordingly. Note that the validate() method has to work out what the final Bayer order of any raw streams will be, before configure() actually applies the transform to the sensor. We make a note of the "native" (untransformed) Bayer order when the system starts, so that we can deduce transformed Bayer orders more easily. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: Add user Transform to CameraConfigurationDavid Plowman
Add a field to the CameraConfiguration (including the necessary documentation) to represent a 2D transform requested by the application. All pipeline handlers are amended to coerce this to the Identity, marking the configuration as "adjusted" if something different had been requested. Pipeline handlers that support Transforms can be amended subsequently. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: pipeline: raspberrypi: Revert "Set sensor default orientation ↵David Plowman
before configure()" This reverts commit 1e8c91b65695449c5246d17ba7dc439c8058b781. Now that we shall be implementing application-defined 2D transforms it's no longer possible to set the sensor orientation so early on. We have to wait until we have the CameraConfiguration object as that's where the application puts its choice of transform. 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: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Expose self path streamNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Add format validation for self pathNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Track buffers for self pathNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Configure self pathNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Add self path devicesNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Prefix main path video and resizerNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Set the crop rectangleNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Export stream formats to applicationsNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Create RkISP1Frames from camera dataNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Prepare buffer ready handlers for multiple streamsNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Setup links as part of configurationNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Breakout mainpath size and format constraintsNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Remove redundant check of buffer in RequestNiklas Söderlund
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-28libcamera: pipeline: rkisp1: Set number of planes based on formatNiklas Söderlund
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: 2b1a908b5222e263 ("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-21pipeline: ipa: raspberrypi: Handle any externally allocated FrameBufferNaushir Patuck
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-21pipeline: raspberrypi: Use an unordered_set to store IPA buffer idsNaushir Patuck
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-21pipeline: raspberrypi: Use an unordered_map for the stream buffer listNaushir Patuck
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-21libcamera: pipeline: ipa: raspberrypi: Remove use of FrameBuffer cookieNaushir Patuck
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-21libcamera: pipeline: raspberrypi: Add more robust stream buffer logicNaushir Patuck
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-21libcamera: pipeline: raspberrypi: Fix bug in passing configuration to IPANaushir Patuck
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>