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>
This commit is contained in:
Laurent Pinchart
2025-10-20 19:03:17 +03:00
parent b97c6f2883
commit bcaed97380
4 changed files with 28 additions and 59 deletions
+1 -2
View File
@@ -8,8 +8,6 @@ module ipa.vimc;
import "include/libcamera/ipa/core.mojom";
const string VimcIPAFIFOPath = "/tmp/libcamera_ipa_vimc_fifo";
enum IPAOperationCode {
IPAOperationNone,
IPAOperationInit,
@@ -26,6 +24,7 @@ enum IPAOperationCode {
interface IPAVimcInterface {
init(libcamera.IPASettings settings,
libcamera.SharedFD traceFd,
IPAOperationCode code,
[flags] TestFlag inFlags)
=> (int32 ret, [flags] TestFlag outFlags);