summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chia-I Wu <olv@google.com> 2017-05-18 02:35:27 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-18 02:35:27 +0000
commit051ca32c5ec78f40ffb438564ce7c2ac8640817f (patch)
tree3423459e2061f247feb6a17ba5df2d8f38297157
parent4a09c8fb5ee6526c281e2c3a454ffa2afabc7e09 (diff)
parent06da1581fce27bcfd006ddc32d7ee1e0ff40f0b1 (diff)
Merge "libui: flush hwbinder commands in Allocator::allocate" into oc-dev
am: 06da1581fc Change-Id: I23fb96fa38421ff8e1788b489d927736534ea458
-rw-r--r--libs/ui/Android.bp1
-rw-r--r--libs/ui/Gralloc2.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp
index 5ccf1788c6..406968d323 100644
--- a/libs/ui/Android.bp
+++ b/libs/ui/Android.bp
@@ -72,6 +72,7 @@ cc_library_shared {
"libhardware",
"libhidlbase",
"libhidltransport",
+ "libhwbinder",
"libsync",
"libutils",
"liblog",
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
index f8d9401a0e..87dbaf47d3 100644
--- a/libs/ui/Gralloc2.cpp
+++ b/libs/ui/Gralloc2.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "Gralloc2"
+#include <hwbinder/IPCThreadState.h>
#include <ui/Gralloc2.h>
#include <log/log.h>
@@ -241,6 +242,9 @@ Error Allocator::allocate(BufferDescriptor descriptor, uint32_t count,
*outStride = tmpStride;
});
+ // make sure the kernel driver sees BC_FREE_BUFFER and closes the fds now
+ hardware::IPCThreadState::self()->flushCommands();
+
return (ret.isOk()) ? error : kTransactionError;
}