Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void DisplayHardware::init(uint32_t dpy) EGLint numConfigs=0; EGLSurface surface; EGLContext context; mFlags = 0; mFlags = CACHED_BUFFERS; // TODO: all the extensions below should be queried through // eglGetProcAddress(). Loading Loading @@ -239,12 +239,17 @@ void DisplayHardware::init(uint32_t dpy) eglMakeCurrent(display, surface, surface, context); const char* const gl_extensions = (const char*)glGetString(GL_EXTENSIONS); const char* const gl_renderer = (const char*)glGetString(GL_RENDERER); LOGI("OpenGL informations:"); LOGI("vendor : %s", glGetString(GL_VENDOR)); LOGI("renderer : %s", glGetString(GL_RENDERER)); LOGI("renderer : %s", gl_renderer); LOGI("version : %s", glGetString(GL_VERSION)); LOGI("extensions: %s", gl_extensions); if (strstr(gl_renderer, "PowerVR SGX 530")) { LOGD("Assuming uncached graphics buffers."); mFlags &= ~CACHED_BUFFERS; } if (strstr(gl_extensions, "GL_ARB_texture_non_power_of_two")) { mFlags |= NPOT_EXTENSION; } Loading libs/surfaceflinger/DisplayHardware/DisplayHardware.h +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public: PARTIAL_UPDATES = 0x00020000, // video driver feature SLOW_CONFIG = 0x00040000, // software SWAP_RECTANGLE = 0x00080000, CACHED_BUFFERS = 0x00100000 }; DisplayHardware( Loading libs/surfaceflinger/Layer.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ Layer::Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& c, int32_t i) : LayerBaseClient(flinger, display, c, i), mSecure(false), mNoEGLImageForSwBuffers(false), mNeedsBlending(true), mNeedsDithering(false) { Loading Loading @@ -108,12 +109,14 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, const DisplayHardware& hw(graphicPlane(0).displayHardware()); PixelFormatInfo displayInfo; getPixelFormatInfo(hw.getFormat(), &displayInfo); const uint32_t hwFlags = hw.getFlags(); mFormat = format; mWidth = w; mHeight = h; mSecure = (flags & ISurfaceComposer::eSecure) ? true : false; mNeedsBlending = (info.h_alpha - info.l_alpha) > 0; mNoEGLImageForSwBuffers = !(hwFlags & DisplayHardware::CACHED_BUFFERS); // we use the red index int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); Loading Loading @@ -331,8 +334,16 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const } else { // it's allowed to modify the usage flags here, but generally // the requested flags should be honored. if (mNoEGLImageForSwBuffers) { if (usage & GraphicBuffer::USAGE_HW_MASK) { // request EGLImage for h/w buffers only usage |= GraphicBuffer::USAGE_HW_TEXTURE; } } else { // request EGLImage for all buffers usage |= GraphicBuffer::USAGE_HW_TEXTURE; } } return usage; } Loading libs/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: sp<Surface> mSurface; bool mSecure; bool mNoEGLImageForSwBuffers; int32_t mFrontBufferIndex; bool mNeedsBlending; bool mNeedsDithering; Loading Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -123,7 +123,7 @@ void DisplayHardware::init(uint32_t dpy) EGLint numConfigs=0; EGLSurface surface; EGLContext context; mFlags = 0; mFlags = CACHED_BUFFERS; // TODO: all the extensions below should be queried through // eglGetProcAddress(). Loading Loading @@ -239,12 +239,17 @@ void DisplayHardware::init(uint32_t dpy) eglMakeCurrent(display, surface, surface, context); const char* const gl_extensions = (const char*)glGetString(GL_EXTENSIONS); const char* const gl_renderer = (const char*)glGetString(GL_RENDERER); LOGI("OpenGL informations:"); LOGI("vendor : %s", glGetString(GL_VENDOR)); LOGI("renderer : %s", glGetString(GL_RENDERER)); LOGI("renderer : %s", gl_renderer); LOGI("version : %s", glGetString(GL_VERSION)); LOGI("extensions: %s", gl_extensions); if (strstr(gl_renderer, "PowerVR SGX 530")) { LOGD("Assuming uncached graphics buffers."); mFlags &= ~CACHED_BUFFERS; } if (strstr(gl_extensions, "GL_ARB_texture_non_power_of_two")) { mFlags |= NPOT_EXTENSION; } Loading
libs/surfaceflinger/DisplayHardware/DisplayHardware.h +1 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public: PARTIAL_UPDATES = 0x00020000, // video driver feature SLOW_CONFIG = 0x00040000, // software SWAP_RECTANGLE = 0x00080000, CACHED_BUFFERS = 0x00100000 }; DisplayHardware( Loading
libs/surfaceflinger/Layer.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ Layer::Layer(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& c, int32_t i) : LayerBaseClient(flinger, display, c, i), mSecure(false), mNoEGLImageForSwBuffers(false), mNeedsBlending(true), mNeedsDithering(false) { Loading Loading @@ -108,12 +109,14 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, const DisplayHardware& hw(graphicPlane(0).displayHardware()); PixelFormatInfo displayInfo; getPixelFormatInfo(hw.getFormat(), &displayInfo); const uint32_t hwFlags = hw.getFlags(); mFormat = format; mWidth = w; mHeight = h; mSecure = (flags & ISurfaceComposer::eSecure) ? true : false; mNeedsBlending = (info.h_alpha - info.l_alpha) > 0; mNoEGLImageForSwBuffers = !(hwFlags & DisplayHardware::CACHED_BUFFERS); // we use the red index int displayRedSize = displayInfo.getSize(PixelFormatInfo::INDEX_RED); Loading Loading @@ -331,8 +334,16 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const } else { // it's allowed to modify the usage flags here, but generally // the requested flags should be honored. if (mNoEGLImageForSwBuffers) { if (usage & GraphicBuffer::USAGE_HW_MASK) { // request EGLImage for h/w buffers only usage |= GraphicBuffer::USAGE_HW_TEXTURE; } } else { // request EGLImage for all buffers usage |= GraphicBuffer::USAGE_HW_TEXTURE; } } return usage; } Loading
libs/surfaceflinger/Layer.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: sp<Surface> mSurface; bool mSecure; bool mNoEGLImageForSwBuffers; int32_t mFrontBufferIndex; bool mNeedsBlending; bool mNeedsDithering; Loading