frameworks/av: Add patch for cameraservice fdsan crash

This commit is contained in:
Peter Cai 2022-09-05 14:23:53 -04:00
parent c6b56cf04d
commit 466da9c1be
5 changed files with 47 additions and 4 deletions

View File

@ -1,7 +1,7 @@
From 51deb8e31ca57f19420277cc92b26375233e9050 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 18 Aug 2022 15:44:46 -0400
Subject: [PATCH 1/4] APM: Restore S, R and Q behavior respectively for
Subject: [PATCH 1/5] APM: Restore S, R and Q behavior respectively for
telephony audio
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)

View File

@ -1,7 +1,7 @@
From 5def9ad1a26e28d517666e34301dc725c1660e36 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 24 Aug 2022 15:42:39 -0400
Subject: [PATCH 2/4] APM: Optionally force-load audio policy for system-side
Subject: [PATCH 2/5] APM: Optionally force-load audio policy for system-side
bt audio HAL
Required to support our system-side bt audio implementation, i.e.

View File

@ -1,7 +1,7 @@
From e31fc6f3f79848e6f7e7b1b4abe82aa26571cf7b Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Thu, 25 Aug 2022 13:30:29 -0400
Subject: [PATCH 3/4] APM: Remove A2DP audio ports from the primary HAL
Subject: [PATCH 3/5] APM: Remove A2DP audio ports from the primary HAL
These ports defined in the primary HAL are intended for A2DP offloading,
however they do not work in general on GSIs, and will interfere with

View File

@ -1,7 +1,7 @@
From 9d5b1f22e00167bd6f75fde20ace1c1d1e964318 Mon Sep 17 00:00:00 2001
From: Peter Cai <peter@typeblog.net>
Date: Wed, 1 Jun 2022 16:56:46 -0400
Subject: [PATCH 4/4] camera: Implement property to override default camera
Subject: [PATCH 4/5] camera: Implement property to override default camera
Complement to the frameworks/base patch.

View File

@ -0,0 +1,43 @@
From d68bf009f5f9065163ae6ece838cdb77784e3595 Mon Sep 17 00:00:00 2001
From: Emilian Peev <epeev@google.com>
Date: Fri, 5 Aug 2022 17:28:06 -0700
Subject: [PATCH 5/5] Camera: Avoid unnecessary close of buffer acquire fence
fds
According to the gralloc lock documentation:
The ownership of acquireFence is always transferred to the callee, even
on errors.
Bug: 241455881
Test: Manual using camera application
Change-Id: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
Merged-In: Ieec34b54aaa7f0d773eccb593c3daaa3e41bae0b
---
.../camera/libcameraservice/device3/Camera3OutputStream.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
index 1e20ee0eb8..f23a2de340 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -327,7 +327,7 @@ status_t Camera3OutputStream::fixUpHidlJpegBlobHeader(ANativeWindowBuffer* anwBu
status_t res =
gbLocker.lockAsync(
GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_RARELY,
- &mapped, fenceFd.get());
+ &mapped, fenceFd.release());
if (res != OK) {
ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
return res;
@@ -1298,7 +1298,7 @@ void Camera3OutputStream::dumpImageToDisk(nsecs_t timestamp,
void* mapped = nullptr;
base::unique_fd fenceFd(dup(fence));
status_t res = graphicBuffer->lockAsync(GraphicBuffer::USAGE_SW_READ_OFTEN, &mapped,
- fenceFd.get());
+ fenceFd.release());
if (res != OK) {
ALOGE("%s: Failed to lock the buffer: %s (%d)", __FUNCTION__, strerror(-res), res);
return;
--
2.37.2