libcamera/include
Laurent Pinchart 0028536d70 libcamera: controls: Don't over-optimize ControlValue layout
The ControlValue class size should be minimized to save space, as it can
be instantiated in large numbers. The current implementation does so by
specifying several members as bitfields, but does so too aggressively,
resulting in fields being packed in an inefficient to access way on some
platforms. For instance, on 32-bit x86, the numElements_ field is offset
by 7 bits in a 32-bit word. This additionally causes a static assert
that checks the size of the class to fail.

Relax the constraints on the isArray_ and numElements_ fields to avoid
inefficient access, and to ensure that the class size is identical
across all platforms. This will need to be revisited anyway when
stabilizing the ABI, so add a \todo comment as a reminder.

Fixes: 1fa4b43402 ("libcamera: controls: Support array controls in ControlValue")
Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-20 16:47:45 +02:00
..
android include: android: Add SPDX tags 2019-08-12 10:34:13 +02:00
ipa libcamera: controls: Rename ControlRange to ControlInfo 2020-03-20 16:47:45 +02:00
libcamera libcamera: controls: Don't over-optimize ControlValue layout 2020-03-20 16:47:45 +02:00
linux include: linux: Update v4l2-controls.h 2020-02-14 16:27:29 +01:00
meson.build libcamera: Move ipa includes to the same level as libcamera 2019-09-15 13:57:08 +03:00