From fcfeb4b5970c8f361634429934a2518d7e8328dd Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 8 Mar 2010 11:14:20 -0800 Subject: fixes for [2474091] Saw Poor behaviour playing a video. - fix a bug when hacking video buffers into gralloc buffers where the buffer size was incorrect this was causing the "direct-form-texture" mode to fail - also when the above fails, make sure to revert to the "mdp copy mode" before going to "slow mode" - finally disable completely the "direct-from-texture" mode for now. It cannot work because the allocated buffers can't respect the GPU constraints (alignment and such). We'll have to find a solution for that. --- libs/surfaceflinger/Layer.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libs/surfaceflinger/Layer.cpp') diff --git a/libs/surfaceflinger/Layer.cpp b/libs/surfaceflinger/Layer.cpp index c0805137f2..7ca7875366 100644 --- a/libs/surfaceflinger/Layer.cpp +++ b/libs/surfaceflinger/Layer.cpp @@ -156,7 +156,11 @@ void Layer::reloadTexture(const Region& dirty) if (mFlags & DisplayHardware::DIRECT_TEXTURE) { if (buffer->usage & GraphicBuffer::USAGE_HW_TEXTURE) { if (mTextures[index].dirty) { - initializeEglImage(buffer, &mTextures[index]); + if (initializeEglImage(buffer, &mTextures[index]) != NO_ERROR) { + // not sure what we can do here... + mFlags &= ~DisplayHardware::DIRECT_TEXTURE; + goto slowpath; + } } } else { if (mHybridBuffer==0 || (mHybridBuffer->width != buffer->width || @@ -166,8 +170,13 @@ void Layer::reloadTexture(const Region& dirty) buffer->width, buffer->height, buffer->format, GraphicBuffer::USAGE_SW_WRITE_OFTEN | GraphicBuffer::USAGE_HW_TEXTURE); - initializeEglImage( - mHybridBuffer, &mTextures[0]); + if (initializeEglImage( + mHybridBuffer, &mTextures[0]) != NO_ERROR) { + // not sure what we can do here... + mFlags &= ~DisplayHardware::DIRECT_TEXTURE; + mHybridBuffer.clear(); + goto slowpath; + } } GGLSurface t; @@ -236,6 +245,7 @@ void Layer::reloadTexture(const Region& dirty) } else #endif { +slowpath: for (size_t i=0 ; i