summaryrefslogtreecommitdiff
path: root/test/pipeline/ipu3/ipu3_pipeline_test.cpp
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-22 14:59:13 +0100
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-29 20:41:37 +0100
commited1cb19e7657b888bea6b66b6d409302b4bf4f25 (patch)
tree0a00435d5f46eb09dcab2b64e1f47bd26e536f6a /test/pipeline/ipu3/ipu3_pipeline_test.cpp
parent90da3af347d59c9d32431835ddcaa7363ba663ed (diff)
ipa: Do not modify the sensor limits
The driver is responsible for setting the proper limits for its controls. The IMX219 has an analogue gain of 1.0 when the gain code is set to 0, therefore we can not clamp to a minimum gain code of 1. Rework this for both IPU3 and RkISP1, for both Exposure and Gain controls. 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>
Diffstat (limited to 'test/pipeline/ipu3/ipu3_pipeline_test.cpp')
0 files changed, 0 insertions, 0 deletions
4 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2020, Google Inc.
 *
 * rkisp1path.h - Rockchip ISP1 path helper
 */
#ifndef __LIBCAMERA_PIPELINE_RKISP1_PATH_H__
#define __LIBCAMERA_PIPELINE_RKISP1_PATH_H__

#include <memory>
#include <vector>

#include <libcamera/base/signal.h>
#include <libcamera/base/span.h>

#include <libcamera/camera.h>
#include <libcamera/geometry.h>
#include <libcamera/pixel_format.h>

#include "libcamera/internal/media_object.h"
#include "libcamera/internal/v4l2_videodevice.h"

namespace libcamera {

class MediaDevice;
class V4L2Subdevice;
struct StreamConfiguration;
struct V4L2SubdeviceFormat;

class RkISP1Path
{
public:
	RkISP1Path(const char *name, const Span<const PixelFormat> &formats,
		   const Size &minResolution, const Size &maxResolution);

	bool init(MediaDevice *media);

	int setEnabled(bool enable) { return link_->setEnabled(enable); }
	bool isEnabled() const { return link_->flags() & MEDIA_LNK_FL_ENABLED; }

	StreamConfiguration generateConfiguration(const Size &resolution);
	CameraConfiguration::Status validate(StreamConfiguration *cfg);

	int configure(const StreamConfiguration &config,
		      const V4L2SubdeviceFormat &inputFormat);

	int exportBuffers(unsigned int bufferCount,
			  std::vector<std::unique_ptr<FrameBuffer>> *buffers)
	{
		return video_->exportBuffers(bufferCount, buffers);
	}

	int start();
	void stop();

	int queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); }
	Signal<FrameBuffer *> &bufferReady() { return video_->bufferReady; }

private:
	static constexpr unsigned int RKISP1_BUFFER_COUNT = 4;

	const char *name_;
	bool running_;

	const Span<const PixelFormat> formats_;
	const Size minResolution_;
	const Size maxResolution_;

	std::unique_ptr<V4L2Subdevice> resizer_;
	std::unique_ptr<V4L2VideoDevice> video_;
	MediaLink *link_;
};

class RkISP1MainPath : public RkISP1Path
{
public:
	RkISP1MainPath();
};

class RkISP1SelfPath : public RkISP1Path
{
public:
	RkISP1SelfPath();
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_PIPELINE_RKISP1_PATH_H__ */