From 0378f4d89772b6cb7824c0abb2fc6600d7a27325 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 12 Aug 2020 15:03:23 -0700 Subject: Expose EGL_ANDROID_native_fence_sync to the applications This change also sorts the global extension lists in alphabetical order. Bug: 157518032 Test: build, compile, boot Test: EGL_ANDROID_native_fence_sync in RenderEngine dump Change-Id: I6614b9532daf7747fcadbe38744d5293cf8198b4 --- libs/gui/SyncFeatures.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libs/gui/SyncFeatures.cpp') diff --git a/libs/gui/SyncFeatures.cpp b/libs/gui/SyncFeatures.cpp index fcae05c8ad..8df6e81596 100644 --- a/libs/gui/SyncFeatures.cpp +++ b/libs/gui/SyncFeatures.cpp @@ -27,8 +27,6 @@ #include -extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); - namespace android { ANDROID_SINGLETON_STATIC_INSTANCE(SyncFeatures); @@ -40,8 +38,8 @@ SyncFeatures::SyncFeatures() : Singleton(), EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); // This can only be called after EGL has been initialized; otherwise the // check below will abort. - const char* exts = eglQueryStringImplementationANDROID(dpy, EGL_EXTENSIONS); - LOG_ALWAYS_FATAL_IF(exts == nullptr, "eglQueryStringImplementationANDROID failed"); + const char* exts = eglQueryString(dpy, EGL_EXTENSIONS); + LOG_ALWAYS_FATAL_IF(exts == nullptr, "eglQueryString failed"); if (strstr(exts, "EGL_ANDROID_native_fence_sync")) { // This makes GLConsumer use the EGL_ANDROID_native_fence_sync // extension to create Android native fences to signal when all -- cgit v1.2.3-59-g8ed1b From 56c4b15aeea82af058c2049dee4cb21c741e01d9 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 3 Sep 2020 17:53:31 -0700 Subject: Remove obsolete DONT_USE_FENCE_SYNC option Unable to find any recent uses of DONT_USE_FENCE_SYNC and EGL_KHR_fence_sync is a CDD required extension, so device support must be present. So remove this last config option from libgui, and then also remove the dump methods that just return the library name. Test: builds Change-Id: I29362d6cb7ce9ef9f2338dcbf55814973abd6c3d --- libs/gui/Android.bp | 1 - libs/gui/GuiConfig.cpp | 31 ------------------------------ libs/gui/SyncFeatures.cpp | 8 -------- libs/gui/include/gui/GuiConfig.h | 29 ---------------------------- libs/ui/Android.bp | 1 - libs/ui/UiConfig.cpp | 28 --------------------------- libs/ui/include/ui/UiConfig.h | 29 ---------------------------- libs/ui/include_vndk/ui/UiConfig.h | 1 - services/surfaceflinger/SurfaceFlinger.cpp | 4 ---- 9 files changed, 132 deletions(-) delete mode 100644 libs/gui/GuiConfig.cpp delete mode 100644 libs/gui/include/gui/GuiConfig.h delete mode 100644 libs/ui/UiConfig.cpp delete mode 100644 libs/ui/include/ui/UiConfig.h delete mode 120000 libs/ui/include_vndk/ui/UiConfig.h (limited to 'libs/gui/SyncFeatures.cpp') diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 9285b23d74..ae265cab8f 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -55,7 +55,6 @@ cc_library_shared { "DisplayEventDispatcher.cpp", "DisplayEventReceiver.cpp", "GLConsumer.cpp", - "GuiConfig.cpp", "IConsumerListener.cpp", "IDisplayEventConnection.cpp", "IGraphicBufferConsumer.cpp", diff --git a/libs/gui/GuiConfig.cpp b/libs/gui/GuiConfig.cpp deleted file mode 100644 index 3ec20ee0c0..0000000000 --- a/libs/gui/GuiConfig.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace android { - -void appendGuiConfigString(std::string& configStr) { - static const char* config = - " [libgui" -#ifdef DONT_USE_FENCE_SYNC - " DONT_USE_FENCE_SYNC" -#endif - "]"; - configStr.append(config); -} - -}; // namespace android diff --git a/libs/gui/SyncFeatures.cpp b/libs/gui/SyncFeatures.cpp index 8df6e81596..1a8fc1a00a 100644 --- a/libs/gui/SyncFeatures.cpp +++ b/libs/gui/SyncFeatures.cpp @@ -71,15 +71,7 @@ bool SyncFeatures::useNativeFenceSync() const { return mHasNativeFenceSync; } bool SyncFeatures::useFenceSync() const { -#ifdef DONT_USE_FENCE_SYNC - // on some devices it's better to not use EGL_KHR_fence_sync - // even if they have it - return false; -#else - // currently we shall only attempt to use EGL_KHR_fence_sync if - // USE_FENCE_SYNC is set in our makefile return !mHasNativeFenceSync && mHasFenceSync; -#endif } bool SyncFeatures::useWaitSync() const { return (useNativeFenceSync() || useFenceSync()) && mHasWaitSync; diff --git a/libs/gui/include/gui/GuiConfig.h b/libs/gui/include/gui/GuiConfig.h deleted file mode 100644 index 7aa54321fd..0000000000 --- a/libs/gui/include/gui/GuiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_GUI_CONFIG_H -#define ANDROID_GUI_CONFIG_H - -#include - -namespace android { - -// Append the libgui configuration details to configStr. -void appendGuiConfigString(std::string& configStr); - -}; // namespace android - -#endif /*ANDROID_GUI_CONFIG_H*/ diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp index 2acc5bb14c..3fa2e53ca3 100644 --- a/libs/ui/Android.bp +++ b/libs/ui/Android.bp @@ -120,7 +120,6 @@ cc_library_shared { "PixelFormat.cpp", "PublicFormat.cpp", "Size.cpp", - "UiConfig.cpp", ], include_dirs: [ diff --git a/libs/ui/UiConfig.cpp b/libs/ui/UiConfig.cpp deleted file mode 100644 index 0ac863d718..0000000000 --- a/libs/ui/UiConfig.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace android { - -void appendUiConfigString(std::string& configStr) { - static const char* config = - " [libui]"; - configStr.append(config); -} - - -}; // namespace android diff --git a/libs/ui/include/ui/UiConfig.h b/libs/ui/include/ui/UiConfig.h deleted file mode 100644 index d1d6014a7b..0000000000 --- a/libs/ui/include/ui/UiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_UI_CONFIG_H -#define ANDROID_UI_CONFIG_H - -#include - -namespace android { - -// Append the libui configuration details to configStr. -void appendUiConfigString(std::string& configStr); - -}; // namespace android - -#endif /*ANDROID_UI_CONFIG_H*/ diff --git a/libs/ui/include_vndk/ui/UiConfig.h b/libs/ui/include_vndk/ui/UiConfig.h deleted file mode 120000 index f580ce1095..0000000000 --- a/libs/ui/include_vndk/ui/UiConfig.h +++ /dev/null @@ -1 +0,0 @@ -../../include/ui/UiConfig.h \ No newline at end of file diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9e5b8d8d7e..e6417ad740 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -75,7 +74,6 @@ #include #include #include -#include #include #include #include @@ -4725,8 +4723,6 @@ void SurfaceFlinger::dumpAllLocked(const DumpArgs& args, std::string& result) co result.append("Build configuration:"); colorizer.reset(result); appendSfConfigString(result); - appendUiConfigString(result); - appendGuiConfigString(result); result.append("\n"); result.append("\nDisplay identification data:\n"); -- cgit v1.2.3-59-g8ed1b