diff options
author | Yahan Zhou <yahan@google.com> | 2017-05-25 10:46:18 -0700 |
---|---|---|
committer | Yahan Zhou <yahan@google.com> | 2017-06-08 18:19:15 +0000 |
commit | f351fb532761dabe00ba9b8b31cab8f462d3c05d (patch) | |
tree | 058357822d8e17b39d949c7d72698ce721c444bb | |
parent | 73cb02262b956368078fafa453a0be77de3b3080 (diff) | |
download | goldfish-opengl-f351fb532761dabe00ba9b8b31cab8f462d3c05d.tar.gz |
Always open a file descriptor for color buffer
O framework assumes at least one file descriptor is associated with one
color buffer. This CL always open at least one file descriptor if it is
in O.
BUG: 37719038
Test: run cts -m CtsNativeHardwareTestCases -t
android.hardware.cts.AHardwareBufferNativeTest#testNative
Change-Id: I439e8a9042bca79ef06cb7773ad92976adf1e3f0
-rw-r--r-- | system/gralloc/gralloc.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index 0b6785e7..ae0a3243 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -27,6 +27,7 @@ #include "HostConnection.h" #include "ProcessPipe.h" #include "glUtils.h" +#include <utils/CallStack.h> #include <cutils/log.h> #include <cutils/properties.h> @@ -604,7 +605,11 @@ static int gralloc_alloc(alloc_device_t* dev, } } - if (sw_read || sw_write || hw_cam_write || hw_vid_enc_read) { + // API26 always expect at least one file descriptor is associated with + // one color buffer + // BUG: 37719038 + if (PLATFORM_SDK_VERSION >= 26 || + sw_read || sw_write || hw_cam_write || hw_vid_enc_read) { // keep space for image on guest memory if SW access is needed // or if the camera is doing writing if (yuv_format) { |