summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/ipu3/imgu.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-07-01 12:08:42 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-08-03 11:16:17 +0200
commit968ab9bad0ed392b4c9917bcc5cb5dbf268e1918 (patch)
tree5d540e9e12f7ae203f75d16d9a2d419a7c55b669 /src/libcamera/pipeline/ipu3/imgu.h
parentd6a9ff0239c7d22f9690080b64e33ee2c047457a (diff)
libcamera: ipu3: imgu: Calculate ImgU pipe configuration
Instrument the ImgU component to dynamically calculate the image manipulation pipeline intermediate sizes. To correctly configure the ImgU it is necessary to program the IF, BDS and GDC sizes, which are currently fixed to the input frame size. The procedure used to calculate the intermediate sizes has been ported from the pipe_config.py python script, available at: https://github.com/intel/intel-ipu3-pipecfg at revision: 61e83f2f7606 ("Add more information into README") Define two structures (ImgUDevice::Pipe and ImgUDevice::PipeConfig) to allow the pipeline handler to supply and retrieve configuration parameters from the ImgU. Finally, add a new operation to the ImgUDevice that calculates the pipe configuration parameters based on the requested input and output sizes. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/imgu.h')
-rw-r--r--src/libcamera/pipeline/ipu3/imgu.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h
index 23ec1ca1..2f9dc022 100644
--- a/src/libcamera/pipeline/ipu3/imgu.h
+++ b/src/libcamera/pipeline/ipu3/imgu.h
@@ -23,8 +23,28 @@ struct StreamConfiguration;
class ImgUDevice
{
public:
+ struct PipeConfig {
+ float bds_sf;
+ Size iif;
+ Size bds;
+ Size gdc;
+
+ bool isNull() const
+ {
+ return iif.isNull() || bds.isNull() || gdc.isNull();
+ }
+ };
+
+ struct Pipe {
+ Size input;
+ Size main;
+ Size viewfinder;
+ };
+
int init(MediaDevice *media, unsigned int index);
+ PipeConfig calculatePipeConfig(Pipe *pipe);
+
int configureInput(const Size &size, V4L2DeviceFormat *inputFormat);
int configureOutput(const StreamConfiguration &cfg,