Files
external_libcamera/include/libcamera/ipa/vimc.mojom
Laurent Pinchart bcaed97380 test: ipa: ipa_interface: Replace FIFO with pipe
The ipa_interface unit test uses a FIFO to communicate with the vimc IPA
module. FIFOs are named pipes, created in the file system. The path to
the FIFO is hardcoded so that both the unit test and IPA module know
where to locate the file.

If the ipa_interface crashes for any reason, the FIFO will not be
removed, and subsequent usage of the vimc IPA module will hang when
trying to write to the FIFO in the IPA module.

Fix this by replacing the FIFO with a pipe. Pipes are unidirectional
data channels that are represented by a pair of file descriptors,
without any presence in the file system. The write end of the pipe is
passed to the vimc IPA module init() function, and then used the same
way as the FIFO.

While at it, use a std::unique_ptr to manage the notifier in the unit
test instead of manually allocating and deleting the object.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
2026-04-24 01:17:47 +03:00

55 lines
1.4 KiB
Plaintext

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* \todo Document the interface and remove the related EXCLUDE_PATTERNS entry.
*/
module ipa.vimc;
import "include/libcamera/ipa/core.mojom";
enum IPAOperationCode {
IPAOperationNone,
IPAOperationInit,
IPAOperationStart,
IPAOperationStop,
};
[scopedEnum] enum TestFlag {
Flag1 = 0x1,
Flag2 = 0x2,
Flag3 = 0x4,
Flag4 = 0x8,
};
interface IPAVimcInterface {
init(libcamera.IPASettings settings,
libcamera.SharedFD traceFd,
IPAOperationCode code,
[flags] TestFlag inFlags)
=> (int32 ret, [flags] TestFlag outFlags);
configure(libcamera.IPACameraSensorInfo sensorInfo,
map<uint32, libcamera.IPAStream> streamConfig,
map<uint32, libcamera.ControlInfoMap> entityControls) => (int32 ret);
start() => (int32 ret);
stop();
mapBuffers(array<libcamera.IPABuffer> buffers);
unmapBuffers(array<uint32> ids);
[async] queueRequest(uint32 frame, libcamera.ControlList controls);
/*
* The vimc driver doesn't use parameters buffers. To maximize coverage
* of unit tests that rely on the VIMC pipeline handler, we still define
* interface functions that mimick how other pipeline handlers typically
* handle parameters at runtime.
*/
[async] computeParams(uint32 frame, uint32 bufferId);
};
interface IPAVimcEventInterface {
paramsComputed(uint32 bufferId, [flags] TestFlag flags);
};