From f351fb532761dabe00ba9b8b31cab8f462d3c05d Mon Sep 17 00:00:00 2001 From: Yahan Zhou Date: Thu, 25 May 2017 10:46:18 -0700 Subject: 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 --- system/gralloc/gralloc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 #include #include @@ -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) { -- cgit v1.2.3 From 22dd0fee8fac517021e9f7d970da70a7b9803385 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 8 Jun 2017 17:17:17 -0700 Subject: Fix aosp_arm build for ODR POST_O should include ODR as well. CODENAME.PPR is not defined. Test: m -j Fixes: 62435156 Change-Id: I72c8023ec1328cea06fe12bc7b4c8480da8ad7c6 --- Android.mk | 2 +- common.mk | 4 ++-- system/OpenglSystemCommon/Android.mk | 2 +- system/egl/Android.mk | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Android.mk b/Android.mk index a53f0722..31db4f22 100644 --- a/Android.mk +++ b/Android.mk @@ -28,7 +28,7 @@ ifeq (O, $(PLATFORM_VERSION_CODENAME)) EMUGL_COMMON_CFLAGS += -DGOLDFISH_HIDL_GRALLOC endif -ifeq ($(PLATFORM_VERSION_CODENAME.PPR1),P) +ifdef IS_AT_LEAST_OPD1 EMUGL_COMMON_CFLAGS += -DEMULATOR_OPENGL_POST_O=1 endif diff --git a/common.mk b/common.mk index 81f558bd..c15812e9 100644 --- a/common.mk +++ b/common.mk @@ -106,8 +106,8 @@ EMUGL_EXPORT_TYPES := \ STATIC_LIBRARIES \ ADDITIONAL_DEPENDENCIES -ifeq ($(PLATFORM_VERSION_CODENAME.PPR1),P) -EMUGL_EXPORT_TYPES += HEADER_LIBRARIES +ifdef IS_AT_LEAST_OPD1 +EMUGL_EXPORT_TYPES += HEADER_LIBRARIES endif # Initialize a module in our database diff --git a/system/OpenglSystemCommon/Android.mk b/system/OpenglSystemCommon/Android.mk index 007b5039..71d851f6 100644 --- a/system/OpenglSystemCommon/Android.mk +++ b/system/OpenglSystemCommon/Android.mk @@ -11,7 +11,7 @@ LOCAL_SRC_FILES := \ QemuPipeStream.cpp \ ThreadInfo.cpp -ifeq ($(PLATFORM_VERSION_CODENAME.PPR1),P) +ifdef IS_AT_LEAST_OPD1 LOCAL_HEADER_LIBRARIES += libnativebase_headers $(call emugl-export,HEADER_LIBRARIES,libnativebase_headers) diff --git a/system/egl/Android.mk b/system/egl/Android.mk index 476cf948..0c7317a7 100644 --- a/system/egl/Android.mk +++ b/system/egl/Android.mk @@ -13,7 +13,7 @@ LOCAL_SRC_FILES := \ egl.cpp \ ClientAPIExts.cpp -ifeq ($(PLATFORM_VERSION_CODENAME.PPR1),P) +ifdef IS_AT_LEAST_OPD1 LOCAL_SHARED_LIBRARIES += libdl libnativewindow else LOCAL_SHARED_LIBRARIES += libdl -- cgit v1.2.3 From 8527011e4cc8f052b6ab023764ae1176b4fc3feb Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Thu, 8 Jun 2017 17:39:04 -0700 Subject: Resolve emulator opengl dependencies. Test: lunch aosp_arm; mma -j BOARD_VNDK_VERSION=current Test: builds Bug: 37342627 Change-Id: I1dfb4a5cd3121ee83fc15cb885cdf4dad1317aa6 --- system/OpenglSystemCommon/Android.mk | 5 +++++ system/egl/Android.mk | 5 +++++ system/egl/goldfish_sync.h | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/system/OpenglSystemCommon/Android.mk b/system/OpenglSystemCommon/Android.mk index 71d851f6..93051195 100644 --- a/system/OpenglSystemCommon/Android.mk +++ b/system/OpenglSystemCommon/Android.mk @@ -17,6 +17,11 @@ LOCAL_HEADER_LIBRARIES += libnativebase_headers $(call emugl-export,HEADER_LIBRARIES,libnativebase_headers) endif +ifdef IS_AT_LEAST_OPD1 +LOCAL_HEADER_LIBRARIES += libhardware_headers +$(call emugl-export,HEADER_LIBRARIES,libhardware_headers) +endif + $(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/private) $(call emugl-end-module) diff --git a/system/egl/Android.mk b/system/egl/Android.mk index 0c7317a7..2d7a5595 100644 --- a/system/egl/Android.mk +++ b/system/egl/Android.mk @@ -19,6 +19,11 @@ else LOCAL_SHARED_LIBRARIES += libdl endif +ifdef IS_AT_LEAST_OPD1 +LOCAL_SHARED_LIBRARIES += libui +LOCAL_HEADER_LIBRARIES += libnativebase_headers +endif + # Used to access the Bionic private OpenGL TLS slot LOCAL_C_INCLUDES += bionic/libc/private diff --git a/system/egl/goldfish_sync.h b/system/egl/goldfish_sync.h index 4667a776..6b30fe5b 100644 --- a/system/egl/goldfish_sync.h +++ b/system/egl/goldfish_sync.h @@ -18,6 +18,10 @@ #include #include #include +#ifdef EMULATOR_OPENGL_POST_O +#include +#include +#endif #include // Make it conflict with ioctls that are not likely to be used -- cgit v1.2.3