Loading services/surfaceflinger/Android.mk +0 −7 Original line number Original line Diff line number Diff line Loading @@ -65,13 +65,6 @@ else DisplayHardware/HWComposer_hwc1.cpp DisplayHardware/HWComposer_hwc1.cpp endif endif ifeq ($(TARGET_BOARD_PLATFORM),omap4) LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY endif ifeq ($(TARGET_BOARD_PLATFORM),s5pc110) LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY endif ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS endif endif Loading services/surfaceflinger/RenderEngine/RenderEngine.cpp +16 −10 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,9 @@ #include "GLExtensions.h" #include "GLExtensions.h" #include "Mesh.h" #include "Mesh.h" #include <vector> #include <SurfaceFlinger.h> EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading Loading @@ -76,18 +79,21 @@ RenderEngine* RenderEngine::create(EGLDisplay display, int hwcFormat) { LOG_ALWAYS_FATAL("no supported EGL_RENDERABLE_TYPEs"); LOG_ALWAYS_FATAL("no supported EGL_RENDERABLE_TYPEs"); } } // Also create our EGLContext std::vector<EGLint> contextAttributes; EGLint contextAttributes[] = { contextAttributes.reserve(6); EGL_CONTEXT_CLIENT_VERSION, contextClientVersion, // MUST be first contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION); contextAttributes.push_back(contextClientVersion); #ifdef EGL_IMG_context_priority #ifdef EGL_IMG_context_priority #ifdef HAS_CONTEXT_PRIORITY if (SurfaceFlinger::useContextPriority) { #warning "using EGL_IMG_context_priority" contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG, contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); #endif } #endif #endif EGL_NONE, EGL_NONE contextAttributes.push_back(EGL_NONE); }; contextAttributes.push_back(EGL_NONE); EGLContext ctxt = eglCreateContext(display, config, NULL, contextAttributes); EGLContext ctxt = eglCreateContext(display, config, NULL, contextAttributes.data()); // if can't create a GL context, we can only abort. // if can't create a GL context, we can only abort. LOG_ALWAYS_FATAL_IF(ctxt==EGL_NO_CONTEXT, "EGLContext creation failed"); LOG_ALWAYS_FATAL_IF(ctxt==EGL_NO_CONTEXT, "EGLContext creation failed"); Loading services/surfaceflinger/SurfaceFlinger.cpp +6 −3 Original line number Original line Diff line number Diff line Loading @@ -112,6 +112,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; bool SurfaceFlinger::useContextPriority; SurfaceFlinger::SurfaceFlinger() SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), : BnSurfaceComposer(), Loading Loading @@ -164,6 +165,9 @@ SurfaceFlinger::SurfaceFlinger() ALOGI("SurfaceFlinger is starting"); ALOGI("SurfaceFlinger is starting"); useContextPriority = getBool< ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(false); // debugging stuff... // debugging stuff... char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX]; Loading Loading @@ -3224,9 +3228,8 @@ void SurfaceFlinger::logFrameStats() { void SurfaceFlinger::appendSfConfigString(String8& result) const void SurfaceFlinger::appendSfConfigString(String8& result) const { { result.append(" [sf"); result.append(" [sf"); #ifdef HAS_CONTEXT_PRIORITY result.appendFormat(" HAS_CONTEXT_PRIORITY=%d", useContextPriority); result.append(" HAS_CONTEXT_PRIORITY"); #endif #ifdef NEVER_DEFAULT_TO_ASYNC_MODE #ifdef NEVER_DEFAULT_TO_ASYNC_MODE result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); #endif #endif Loading services/surfaceflinger/SurfaceFlinger.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -129,6 +129,9 @@ public: static int64_t vsyncPhaseOffsetNs; static int64_t vsyncPhaseOffsetNs; static int64_t sfVsyncPhaseOffsetNs; static int64_t sfVsyncPhaseOffsetNs; // Instruct the Render Engine to use EGL_IMG_context_priority is available. static bool useContextPriority; static char const* getServiceName() ANDROID_API { static char const* getServiceName() ANDROID_API { return "SurfaceFlinger"; return "SurfaceFlinger"; } } Loading services/surfaceflinger/SurfaceFlinger_hwc1.cpp +6 −3 Original line number Original line Diff line number Diff line Loading @@ -111,6 +111,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; bool SurfaceFlinger::useContextPriority; SurfaceFlinger::SurfaceFlinger() SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), : BnSurfaceComposer(), Loading Loading @@ -155,6 +156,9 @@ SurfaceFlinger::SurfaceFlinger() ALOGI("SurfaceFlinger is starting"); ALOGI("SurfaceFlinger is starting"); useContextPriority = getBool< ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(false); char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX]; property_get("ro.bq.gpu_to_cpu_unsupported", value, "0"); property_get("ro.bq.gpu_to_cpu_unsupported", value, "0"); Loading Loading @@ -2996,9 +3000,8 @@ void SurfaceFlinger::logFrameStats() { void SurfaceFlinger::appendSfConfigString(String8& result) const void SurfaceFlinger::appendSfConfigString(String8& result) const { { result.append(" [sf"); result.append(" [sf"); #ifdef HAS_CONTEXT_PRIORITY result.appendFormat(" HAS_CONTEXT_PRIORITY=%d", useContextPriority); result.append(" HAS_CONTEXT_PRIORITY"); #endif #ifdef NEVER_DEFAULT_TO_ASYNC_MODE #ifdef NEVER_DEFAULT_TO_ASYNC_MODE result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); #endif #endif Loading Loading
services/surfaceflinger/Android.mk +0 −7 Original line number Original line Diff line number Diff line Loading @@ -65,13 +65,6 @@ else DisplayHardware/HWComposer_hwc1.cpp DisplayHardware/HWComposer_hwc1.cpp endif endif ifeq ($(TARGET_BOARD_PLATFORM),omap4) LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY endif ifeq ($(TARGET_BOARD_PLATFORM),s5pc110) LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY endif ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true) LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS endif endif Loading
services/surfaceflinger/RenderEngine/RenderEngine.cpp +16 −10 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,9 @@ #include "GLExtensions.h" #include "GLExtensions.h" #include "Mesh.h" #include "Mesh.h" #include <vector> #include <SurfaceFlinger.h> EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading Loading @@ -76,18 +79,21 @@ RenderEngine* RenderEngine::create(EGLDisplay display, int hwcFormat) { LOG_ALWAYS_FATAL("no supported EGL_RENDERABLE_TYPEs"); LOG_ALWAYS_FATAL("no supported EGL_RENDERABLE_TYPEs"); } } // Also create our EGLContext std::vector<EGLint> contextAttributes; EGLint contextAttributes[] = { contextAttributes.reserve(6); EGL_CONTEXT_CLIENT_VERSION, contextClientVersion, // MUST be first contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION); contextAttributes.push_back(contextClientVersion); #ifdef EGL_IMG_context_priority #ifdef EGL_IMG_context_priority #ifdef HAS_CONTEXT_PRIORITY if (SurfaceFlinger::useContextPriority) { #warning "using EGL_IMG_context_priority" contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG); EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG, contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG); #endif } #endif #endif EGL_NONE, EGL_NONE contextAttributes.push_back(EGL_NONE); }; contextAttributes.push_back(EGL_NONE); EGLContext ctxt = eglCreateContext(display, config, NULL, contextAttributes); EGLContext ctxt = eglCreateContext(display, config, NULL, contextAttributes.data()); // if can't create a GL context, we can only abort. // if can't create a GL context, we can only abort. LOG_ALWAYS_FATAL_IF(ctxt==EGL_NO_CONTEXT, "EGLContext creation failed"); LOG_ALWAYS_FATAL_IF(ctxt==EGL_NO_CONTEXT, "EGLContext creation failed"); Loading
services/surfaceflinger/SurfaceFlinger.cpp +6 −3 Original line number Original line Diff line number Diff line Loading @@ -112,6 +112,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; bool SurfaceFlinger::useContextPriority; SurfaceFlinger::SurfaceFlinger() SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), : BnSurfaceComposer(), Loading Loading @@ -164,6 +165,9 @@ SurfaceFlinger::SurfaceFlinger() ALOGI("SurfaceFlinger is starting"); ALOGI("SurfaceFlinger is starting"); useContextPriority = getBool< ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(false); // debugging stuff... // debugging stuff... char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX]; Loading Loading @@ -3224,9 +3228,8 @@ void SurfaceFlinger::logFrameStats() { void SurfaceFlinger::appendSfConfigString(String8& result) const void SurfaceFlinger::appendSfConfigString(String8& result) const { { result.append(" [sf"); result.append(" [sf"); #ifdef HAS_CONTEXT_PRIORITY result.appendFormat(" HAS_CONTEXT_PRIORITY=%d", useContextPriority); result.append(" HAS_CONTEXT_PRIORITY"); #endif #ifdef NEVER_DEFAULT_TO_ASYNC_MODE #ifdef NEVER_DEFAULT_TO_ASYNC_MODE result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); #endif #endif Loading
services/surfaceflinger/SurfaceFlinger.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -129,6 +129,9 @@ public: static int64_t vsyncPhaseOffsetNs; static int64_t vsyncPhaseOffsetNs; static int64_t sfVsyncPhaseOffsetNs; static int64_t sfVsyncPhaseOffsetNs; // Instruct the Render Engine to use EGL_IMG_context_priority is available. static bool useContextPriority; static char const* getServiceName() ANDROID_API { static char const* getServiceName() ANDROID_API { return "SurfaceFlinger"; return "SurfaceFlinger"; } } Loading
services/surfaceflinger/SurfaceFlinger_hwc1.cpp +6 −3 Original line number Original line Diff line number Diff line Loading @@ -111,6 +111,7 @@ const String16 sDump("android.permission.DUMP"); // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::vsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; int64_t SurfaceFlinger::sfVsyncPhaseOffsetNs; bool SurfaceFlinger::useContextPriority; SurfaceFlinger::SurfaceFlinger() SurfaceFlinger::SurfaceFlinger() : BnSurfaceComposer(), : BnSurfaceComposer(), Loading Loading @@ -155,6 +156,9 @@ SurfaceFlinger::SurfaceFlinger() ALOGI("SurfaceFlinger is starting"); ALOGI("SurfaceFlinger is starting"); useContextPriority = getBool< ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::useContextPriority>(false); char value[PROPERTY_VALUE_MAX]; char value[PROPERTY_VALUE_MAX]; property_get("ro.bq.gpu_to_cpu_unsupported", value, "0"); property_get("ro.bq.gpu_to_cpu_unsupported", value, "0"); Loading Loading @@ -2996,9 +3000,8 @@ void SurfaceFlinger::logFrameStats() { void SurfaceFlinger::appendSfConfigString(String8& result) const void SurfaceFlinger::appendSfConfigString(String8& result) const { { result.append(" [sf"); result.append(" [sf"); #ifdef HAS_CONTEXT_PRIORITY result.appendFormat(" HAS_CONTEXT_PRIORITY=%d", useContextPriority); result.append(" HAS_CONTEXT_PRIORITY"); #endif #ifdef NEVER_DEFAULT_TO_ASYNC_MODE #ifdef NEVER_DEFAULT_TO_ASYNC_MODE result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); result.append(" NEVER_DEFAULT_TO_ASYNC_MODE"); #endif #endif Loading