summaryrefslogtreecommitdiffstats
path: root/meta-multimedia
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-02-20 18:48:22 -0800
committerKhem Raj <raj.khem@gmail.com>2024-02-21 19:59:51 -0800
commit1f1a60797085389e288b5eb8eca7d14a5f0e2465 (patch)
tree5c2073d5faa7d39dc87b99d1c27e49bbed93e991 /meta-multimedia
parent7132d7b5713dca3ed5a1275d33b76db9cadb937d (diff)
downloadmeta-openembedded-1f1a60797085389e288b5eb8eca7d14a5f0e2465.tar.gz
libcamera: Replace VLAs with alloca
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch34
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb1
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch
new file mode 100644
index 000000000..a6526d590
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch
@@ -0,0 +1,34 @@
1From 7982e55ce3a8b3c60a47258ff7d37d0dd78c303d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 20 Feb 2024 18:44:23 -0800
4Subject: [PATCH] rpi: Use alloca instead of variable length arrays
5
6Clang-18+ diagnoses this as error
7
8| ../git/src/ipa/rpi/controller/rpi/alsc.cpp:499:10: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] | 499 | int xLo[X], xHi[X];
9| | ^
10
11Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2024-February/040529.html]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/ipa/rpi/controller/rpi/alsc.cpp | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/src/ipa/rpi/controller/rpi/alsc.cpp b/src/ipa/rpi/controller/rpi/alsc.cpp
18index 8a205c60..8c0ae8eb 100644
19--- a/src/ipa/rpi/controller/rpi/alsc.cpp
20+++ b/src/ipa/rpi/controller/rpi/alsc.cpp
21@@ -496,8 +496,8 @@ void resampleCalTable(const Array2D<double> &calTableIn,
22 * Precalculate and cache the x sampling locations and phases to save
23 * recomputing them on every row.
24 */
25- int xLo[X], xHi[X];
26- double xf[X];
27+ int *xLo = (int*)alloca(X), *xHi = (int*)alloca(X);
28+ double *xf = (double*)alloca(X);
29 double scaleX = cameraMode.sensorWidth /
30 (cameraMode.width * cameraMode.scaleX);
31 double xOff = cameraMode.cropX / (double)cameraMode.sensorWidth;
32--
332.43.2
34
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
index 5b2e86336..b96e69eeb 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.2.0.bb
@@ -12,6 +12,7 @@ SRC_URI = " \
12 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \ 12 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \
13 file://0001-media_device-Add-bool-return-type-to-unlock.patch \ 13 file://0001-media_device-Add-bool-return-type-to-unlock.patch \
14 file://0002-options-Replace-use-of-VLAs-in-C.patch \ 14 file://0002-options-Replace-use-of-VLAs-in-C.patch \
15 file://0001-rpi-Use-alloca-instead-of-variable-length-arrays.patch \
15" 16"
16 17
17SRCREV = "89227a428a82e724548399d35c98ea89566f9045" 18SRCREV = "89227a428a82e724548399d35c98ea89566f9045"