summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/data/meson.build
AgeCommit message (Collapse)Author
2021-08-14raspberrypi: ipa: Add tuning files for "NOIR" ov5647, imx219, imx477 modulesDavid Plowman
"NOIR" modules are ones that have had the IR filters removed but are otherwise identical. The same tuning can be used as for the regular version except that the colour calibration supplied to the AWB algorithm no longer works. Instead we need to switch the algorithm to its basic "grey world" method. Users with "NOIR" modules can switch to the matching "xxx_noir.json" tuning file by using the LIBCAMERA_RPI_TUNING_FILE environment variable. Signed-off-by: David Plowman <david.plowman@raspberypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-08-02ipa: raspberrypi: Add support for imx378 sensorDavid Plowman
This commit adds a tuning file for the 12MP imx378 sensor. The sensor actually shares the same driver (and CamHelper) as the imx477 so only a new tuning file is required. The default choice of imx477.json can be overridden by pointing LIBCAMERA_RPI_TUNING_FILE at a version of the new imx378.json file. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-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>
2021-06-28libcamera: ipa: raspberrypi: Add support for ov9281 sensorDavid Plowman
The necessary tuning file and CamHelper is added for the ov9281 sensor. The ov9281 is a 1280x800 monochrome global shutter sensor. To enable it, please add dtoverlay=ov9281 to the /boot/config.txt file and reboot the Pi. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-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>
2021-05-11meson: Replace obselete join_paths() with '/' operatorUmang Jain
Since meson v0.49.0, join_paths() is equivalent to '/' hence, drop and replace it with '/' short-hand in meson files. This commit does not introduce any functional changes. 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> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-03-14ipa: raspberrypi: Add support for imx327-based SE327M12 moduleDavid Plowman
This patch adds support for the Soho Enterprises SE327M12 module. The sensor is an imx327 which therefore uses the imx290 kernel driver and CamHelper. To use this module and camera tuning, place the following in the /boot/config.txt file: dtoverlay=imx290,clock-frequency=37125000 and then the existing imx290.json file must be over-written with se327m12.json Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-03-09ipa: raspberrypi: Add support for imx290/imx327 sensorsDavid Plowman
imx290 and imx327 share the same kernel driver (imx290.c) and are therefore both recognised here as "imx290". We add the necessary CamHelper for these sensors, as well as a camera tuning file. The tuning was done with an Innomaker STARVIS IMX327LQR module. These have no IR cut filter so there is no proper colour tuning. However, you should obtain reasonable results for most modules using this sensor. Specific tunings for further modules can always be added subsequently. To use this sensor on the Raspberry Pi platform, please add dtoverlay=imx290,clock-frequency=74250000 into your /boot/config.txt file. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-06-09libcamera: Add missing SPDX headers to miscellaneous small filesLaurent Pinchart
Add missing SPDX headers to miscellaneous small files. Use CC0-1.0 for meson.build, .gitignore and the small include/linux/README, and licenses matching the corresponding component for other files. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-11libcamera: ipa: Raspberry Pi IPANaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) libcamera IPA and associated libraries. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
class to allocate and manage memory shareable between processes * * SharedMem manages memory suitable for sharing between processes. When an * instance is constructed, it allocates a memory buffer of the requested size * backed by an anonymous file, using the memfd API. * * The allocated memory is exposed by the mem() function. If memory allocation * fails, the function returns an empty Span. This can be also checked using the * bool() operator. * * The file descriptor for the backing file is exposed as a SharedFD by the fd() * function. It can be shared with other processes across IPC boundaries, which * can then map the memory with mmap(). * * A single memfd is created for every SharedMem. If there is a need to allocate * a large number of objects in shared memory, these objects should be grouped * together and use the shared memory allocated by a single SharedMem object if * possible. This will help to minimize the number of created memfd's. */ SharedMem::SharedMem() = default; /** * \brief Construct a SharedMem with memory of the given \a size * \param[in] name Name of the SharedMem * \param[in] size Size of the shared memory to allocate and map * * The \a name is used for debugging purpose only. Multiple SharedMem instances * can have the same name. */ SharedMem::SharedMem(const std::string &name, std::size_t size) { UniqueFD memfd = MemFd::create(name.c_str(), size, MemFd::Seal::Shrink | MemFd::Seal::Grow); if (!memfd.isValid()) return; fd_ = SharedFD(std::move(memfd)); void *mem = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd_.get(), 0); if (mem == MAP_FAILED) { fd_ = SharedFD(); return; } mem_ = { static_cast<uint8_t *>(mem), size }; } /** * \brief Move constructor for SharedMem * \param[in] rhs The object to move */ SharedMem::SharedMem(SharedMem &&rhs) { this->fd_ = std::move(rhs.fd_); this->mem_ = rhs.mem_; rhs.mem_ = {}; } /** * \brief Destroy the SharedMem instance * * Destroying an instance invalidates the memory mapping exposed with mem(). * Other mappings of the backing file, created in this or other processes with * mmap(), remain valid. * * Similarly, other references to the backing file descriptor created by copying * the SharedFD returned by fd() remain valid. The underlying memory will be * freed only when all file descriptors that reference the anonymous file get * closed. */ SharedMem::~SharedMem() { if (!mem_.empty()) munmap(mem_.data(), mem_.size_bytes()); } /** * \brief Move assignment operator for SharedMem * \param[in] rhs The object to move */ SharedMem &SharedMem::operator=(SharedMem &&rhs) { this->fd_ = std::move(rhs.fd_); this->mem_ = rhs.mem_; rhs.mem_ = {}; return *this; } /** * \fn const SharedFD &SharedMem::fd() const * \brief Retrieve the file descriptor for the underlying shared memory * \return The file descriptor, or an invalid SharedFD if allocation failed */ /** * \fn Span<uint8_t> SharedMem::mem() const * \brief Retrieve the underlying shared memory * \return The memory buffer, or an empty Span if allocation failed */ /** * \fn SharedMem::operator bool() * \brief Check if the shared memory allocation succeeded * \return True if allocation of the shared memory succeeded, false otherwise */ /** * \class SharedMemObject * \brief Helper class to allocate an object in shareable memory * \tparam The object type * * The SharedMemObject class is a specialization of the SharedMem class that * wraps an object of type \a T and constructs it in shareable memory. It uses * the same underlying memory allocation and sharing mechanism as the SharedMem * class. * * The wrapped object is constructed at the same time as the SharedMemObject * instance, by forwarding the arguments passed to the SharedMemObject * constructor. The underlying memory allocation is sized to the object \a T * size. The bool() operator should be used to check the allocation was * successful. The object can be accessed using the dereference operators * operator*() and operator->(). * * While no restriction on the type \a T is enforced, not all types are suitable * for sharing between multiple processes. Most notably, any object type that * contains pointer or reference members will likely cause issues. Even if those * members refer to other members of the same object, the shared memory will be * mapped at different addresses in different processes, and the pointers will * not be valid. * * A new anonymous file is created for every SharedMemObject instance. If there * is a need to share a large number of small objects, these objects should be * grouped into a single larger object to limit the number of file descriptors. * * To share the object with other processes, see the SharedMem documentation. */ /** * \var SharedMemObject::kSize * \brief The size of the object stored in shared memory */ /** * \fn SharedMemObject::SharedMemObject(const std::string &name, Args &&...args) * \brief Construct a SharedMemObject * \param[in] name Name of the SharedMemObject * \param[in] args Arguments to pass to the constructor of the object T * * The \a name is used for debugging purpose only. Multiple SharedMem instances * can have the same name. */ /** * \fn SharedMemObject::SharedMemObject(SharedMemObject<T> &&rhs) * \brief Move constructor for SharedMemObject * \param[in] rhs The object to move */ /** * \fn SharedMemObject::~SharedMemObject() * \brief Destroy the SharedMemObject instance * * Destroying a SharedMemObject calls the wrapped T object's destructor. While * the underlying memory may not be freed immediately if other mappings have * been created manually (see SharedMem::~SharedMem() for more information), the * stored object may be modified. Depending on the ~T() destructor, accessing * the object after destruction of the SharedMemObject causes undefined * behaviour. It is the responsibility of the user of this class to synchronize * with other users who have access to the shared object. */ /** * \fn SharedMemObject::operator=(SharedMemObject<T> &&rhs) * \brief Move assignment operator for SharedMemObject * \param[in] rhs The SharedMemObject object to take the data from * * Moving a SharedMemObject does not affect the stored object. */ /** * \fn SharedMemObject::operator->() * \brief Dereference the stored object * \return Pointer to the stored object */ /** * \fn const T *SharedMemObject::operator->() const * \copydoc SharedMemObject::operator-> */ /** * \fn SharedMemObject::operator*() * \brief Dereference the stored object * \return Reference to the stored object */ /** * \fn const T &SharedMemObject::operator*() const * \copydoc SharedMemObject::operator* */ } /* namespace libcamera */