libcamera/utils
Paul Elder 31078711d6 ipa: Use FileDescriptor instead of int in layers above IPC payload
Regarding (de)serialization in isolated IPA calls, we have four layers:
- struct
- byte vector + fd vector
- IPCMessage
- IPC payload

The proxy handles the upper three layers (with help from the
IPADataSerializer), and passes an IPCMessage to the IPC mechanism
(implemented as an IPCPipe), which sends an IPC payload to its worker
counterpart.

When a FileDescriptor is involved, previously it was only a
FileDescriptor in the first layer; in the lower three it was an int. To
reduce the risk of potential fd leaks in the future, keep the
FileDescriptor as-is throughout the upper three layers. Only the IPC
mechanism will deal with ints, if it so wishes, when it does the actual
IPC. IPCPipeUnixSocket does deal with ints for sending fds, so the
conversion between IPCMessage and IPCUnixSocket::Payload converts
between FileDescriptor and int.

Additionally, change the data portion of the serialized form of
FileDescriptor to a 32-bit unsigned integer, for alightnment purposes
and in preparation for conversion to an index into the fd array.

Also update the deserializer of FrameBuffer::Plane accordingly.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2021-08-19 16:54:02 +09:00
..
hooks utils: hooks: pre-push: Reject commits with a Change-Id 2020-11-02 01:03:31 +02:00
ipc ipa: Use FileDescriptor instead of int in layers above IPC payload 2021-08-19 16:54:02 +09:00
ipu3 licenses: License all meson files under CC0-1.0 2020-05-13 16:46:24 +03:00
raspberrypi utils: raspberrypi: ctt: Fix namespace for sklearn NearestCentroid function 2021-08-03 10:54:26 +03:00
rkisp1 utils: rkisp1: Don't enable immutable link 2020-03-20 01:44:57 +01:00
tracepoints utils: tracepoints: Add simple statistics script 2020-11-03 11:33:41 +09:00
checkstyle.py utils: checkstyle.py: Handle renamed files in header add checker 2021-02-16 12:30:39 +02:00
gen-controls.py utils: gen-controls: Fix enumerators documentation 2020-12-27 12:28:00 +02:00
gen-formats.py utils: gen-formats: Support big-endian DRM formats 2021-02-01 22:33:55 +02:00
gen-header.sh libcamera: Move Header generation utilities to utils 2020-09-24 10:55:49 +01:00
gen-ipa-priv-key.sh libcamera: ipa: Move key generation to utils 2020-09-24 10:56:22 +01:00
gen-ipa-pub-key.py libcamera: ipa: Move key generation to utils 2020-09-24 10:56:22 +01:00
gen-version.sh libcamera: Add build time to version string for dirty builds 2020-08-06 16:20:15 +02:00
meson.build README, meson: Add dependency on ply and jinja2 for IPA interface generation 2020-11-11 19:23:16 +09:00
update-kernel-headers.sh utils: Add kernel headers update script 2021-03-08 16:54:29 +02:00
update-mojo.sh utils: update-mojo.sh: Add script for updating mojo 2021-05-26 13:03:12 +09:00