Compare commits

...
Author SHA1 Message Date
Robert Mader 5b3b71b793 temp/libcamera: Backport simple-pipeline buffer count patch
Which has already landed upstream. It has been observed to reduce
frame drops in some situations, notably with the Pixel 3a rear
camera.
2024-10-01 00:35:44 +02:00
2 changed files with 53 additions and 1 deletions

No files matched your search

@@ -0,0 +1,50 @@
From d3f0e40d49378a70405b975169ab444f4a565a17 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@collabora.com>
Date: Thu, 26 Sep 2024 23:07:39 +0200
Subject: [PATCH 5/5] pipeline: simple: Increase buffer count to four
Which is not only what many other pipeline handlers use, but also a good
lower limit when dealing with DRM and similar APIs. Even Mesas EGL and
Vulkan WSI implementations use for the reason outlined in mesa commit
992a2dbba80aba35efe83202e1013bd6143f0dba:
> When the compositor is directly scanning out from the application's buffer it
> may end up holding on to three buffers. These are the one that is is currently
> scanning out from, one that has been given to DRM as the next buffer to flip
> to, and one that has been attached and will be given to DRM as soon as the
> previous flip completes. When we attach a fourth buffer to the compositor it
> should replace that third buffer so we should get a release event immediately
> after that. This patch therefore also changes the number of buffer slots to 4
> so that we can accomodate that situation.
Given the popularity of this buffer number the bump should be unlikely
to cause problems. At the same time it may help with performance or
even work around glitches.
The previous number was introduced in commit
a8964c28c80fb520ee3c7b10143371081d41405a without mentioning a specific
reason against the change at hand.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
src/libcamera/pipeline/simple/simple.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 29320a26..b32f8b2c 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -1134,7 +1134,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
cfg.frameSize = format.planes[0].size;
}
- cfg.bufferCount = 3;
+ cfg.bufferCount = 4;
}
return status;
--
2.46.2
+3 -1
View File
@@ -3,7 +3,7 @@
pkgname=libcamera
pkgver=9999
_pkgver=0.3.2
pkgrel=6
pkgrel=7
pkgdesc="Linux camera framework"
url="https://libcamera.org/"
arch="all"
@@ -46,6 +46,7 @@ source="https://gitlab.freedesktop.org/camera/libcamera/-/archive/v$_pkgver/libc
0002-libcamera-simple-Force-disable-softwareISP-for-milli.patch
0003-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
0004-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
0005-pipeline-simple-Increase-buffer-count-to-four.patch
qcam.desktop
90-libcamera.rules
"
@@ -150,6 +151,7 @@ ac7df3e4509ae874199810057f4d8416da71720c15534578cc352608a8ae228dfa4814f9eb995d55
9b6da8bd11ff9d8400ed721fbbeb960ac8753c078fdd971d786a446a9f96fea19dfc55be2705dc44a152e11de996f88139c1d24637bffc257da5083d19fe80c9 0002-libcamera-simple-Force-disable-softwareISP-for-milli.patch
0fc6a1108c4e905d2d422a664622dc25ec459f13765b5711ad009d4df0fd0cceda8cd067a18e5e54eb2346b292481952161e72deb03d416ba80b300256c25e40 0003-libcamera-simple-Enable-softISP-for-the-Pinephone.patch
35c74746453f4c2e24a2185331afabcf64e3af01bec2462ec09940518cda0e91c4a1f33853b4b009e1f8352af3c606fbd4b4d3791ffbba0f610f19538380c4c8 0004-libcamera-simple-Skip-hwISP-formats-if-swISP-is-acti.patch
b3ba41f81f30979e9b2bd41f5068cd720a11cde2e2a2e31a875493ad9e299cb3dd7b81b5862bea71201001533c6bde18e3d025f65df23e73af3b9363857654a2 0005-pipeline-simple-Increase-buffer-count-to-four.patch
22167a4eceb6d1b40b0b7c45fdf116c71684f5340de7f767535cb8e160ad9d2ae0f00cb3d461f73a344520a48a4641cf46226841d78bee06bfbfd2a91337f754 qcam.desktop
cb4eb19eec766f1b8667a8b7c9d5f7d44a2dce79fddfdf3b6e3d1849066cebe79f82566bdcf6659c7ddf4faaf233d5adac10cda636935785e5305e2b7e9b34a9 90-libcamera.rules
"