Loading include/surfaceflinger/IGraphicBufferAlloc.h +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,14 @@ public: */ virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) = 0; #ifdef QCOM_HARDWARE /* Free all but one of the GraphicBuffer objects that the server is * currently referencing. If bufIndex is not a valid index of the buffers * the server is referencing, then all buffers are freed. */ virtual void freeAllGraphicBuffersExcept(int bufIndex) = 0; #endif }; // ---------------------------------------------------------------------------- Loading libs/gui/IGraphicBufferAlloc.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ namespace android { enum { CREATE_GRAPHIC_BUFFER = IBinder::FIRST_CALL_TRANSACTION, #ifdef QCOM_HARDWARE FREE_ALL_GRAPHIC_BUFFERS_EXCEPT, #endif }; class BpGraphicBufferAlloc : public BpInterface<IGraphicBufferAlloc> Loading Loading @@ -63,6 +66,16 @@ public: *error = result; return graphicBuffer; } #ifdef QCOM_HARDWARE virtual void freeAllGraphicBuffersExcept(int bufIdx) { Parcel data, reply; data.writeInterfaceToken( IGraphicBufferAlloc::getInterfaceDescriptor()); data.writeInt32(bufIdx); remote()->transact(FREE_ALL_GRAPHIC_BUFFERS_EXCEPT, data, &reply); } #endif }; IMPLEMENT_META_INTERFACE(GraphicBufferAlloc, "android.ui.IGraphicBufferAlloc"); Loading Loading @@ -108,6 +121,14 @@ status_t BnGraphicBufferAlloc::onTransact( } return NO_ERROR; } break; #ifdef QCOM_HARDWARE case FREE_ALL_GRAPHIC_BUFFERS_EXCEPT: { CHECK_INTERFACE(IGraphicBufferAlloc, data, reply); int bufIdx = data.readInt32(); freeAllGraphicBuffersExcept(bufIdx); return NO_ERROR; } break; #endif default: return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/SurfaceTexture.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1104,6 +1104,9 @@ void SurfaceTexture::freeAllBuffersLocked() { for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { freeBufferLocked(i); } #ifdef QCOM_HARDWARE mGraphicBufferAlloc->freeAllGraphicBuffersExcept(-1); #endif } void SurfaceTexture::freeAllBuffersExceptHeadLocked() { Loading @@ -1120,6 +1123,9 @@ void SurfaceTexture::freeAllBuffersExceptHeadLocked() { freeBufferLocked(i); } } #ifdef QCOM_HARDWARE mGraphicBufferAlloc->freeAllGraphicBuffersExcept(head); #endif } status_t SurfaceTexture::drainQueueLocked() { Loading opengl/libs/Android.mk +0 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,6 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_CFLAGS += -fvisibility=hidden LOCAL_CFLAGS += -DEGL_TRACE=1 ifeq ($(TARGET_BOARD_PLATFORM),msm7k) LOCAL_CFLAGS += -DADRENO130=1 endif ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif Loading services/surfaceflinger/SurfaceFlinger.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -2724,9 +2724,25 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h w, h, strerror(-err), graphicBuffer->handle); return 0; } #ifdef QCOM_HARDWARE Mutex::Autolock _l(mLock); mBuffers.add(graphicBuffer); #endif return graphicBuffer; } #ifdef QCOM_HARDWARE void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { Mutex::Autolock _l(mLock); if (0 <= bufIdx && bufIdx < mBuffers.size()) { sp<GraphicBuffer> b(mBuffers[bufIdx]); mBuffers.clear(); mBuffers.add(b); } else { mBuffers.clear(); } } #endif // --------------------------------------------------------------------------- GraphicPlane::GraphicPlane() Loading Loading
include/surfaceflinger/IGraphicBufferAlloc.h +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,14 @@ public: */ virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) = 0; #ifdef QCOM_HARDWARE /* Free all but one of the GraphicBuffer objects that the server is * currently referencing. If bufIndex is not a valid index of the buffers * the server is referencing, then all buffers are freed. */ virtual void freeAllGraphicBuffersExcept(int bufIndex) = 0; #endif }; // ---------------------------------------------------------------------------- Loading
libs/gui/IGraphicBufferAlloc.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ namespace android { enum { CREATE_GRAPHIC_BUFFER = IBinder::FIRST_CALL_TRANSACTION, #ifdef QCOM_HARDWARE FREE_ALL_GRAPHIC_BUFFERS_EXCEPT, #endif }; class BpGraphicBufferAlloc : public BpInterface<IGraphicBufferAlloc> Loading Loading @@ -63,6 +66,16 @@ public: *error = result; return graphicBuffer; } #ifdef QCOM_HARDWARE virtual void freeAllGraphicBuffersExcept(int bufIdx) { Parcel data, reply; data.writeInterfaceToken( IGraphicBufferAlloc::getInterfaceDescriptor()); data.writeInt32(bufIdx); remote()->transact(FREE_ALL_GRAPHIC_BUFFERS_EXCEPT, data, &reply); } #endif }; IMPLEMENT_META_INTERFACE(GraphicBufferAlloc, "android.ui.IGraphicBufferAlloc"); Loading Loading @@ -108,6 +121,14 @@ status_t BnGraphicBufferAlloc::onTransact( } return NO_ERROR; } break; #ifdef QCOM_HARDWARE case FREE_ALL_GRAPHIC_BUFFERS_EXCEPT: { CHECK_INTERFACE(IGraphicBufferAlloc, data, reply); int bufIdx = data.readInt32(); freeAllGraphicBuffersExcept(bufIdx); return NO_ERROR; } break; #endif default: return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/SurfaceTexture.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1104,6 +1104,9 @@ void SurfaceTexture::freeAllBuffersLocked() { for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { freeBufferLocked(i); } #ifdef QCOM_HARDWARE mGraphicBufferAlloc->freeAllGraphicBuffersExcept(-1); #endif } void SurfaceTexture::freeAllBuffersExceptHeadLocked() { Loading @@ -1120,6 +1123,9 @@ void SurfaceTexture::freeAllBuffersExceptHeadLocked() { freeBufferLocked(i); } } #ifdef QCOM_HARDWARE mGraphicBufferAlloc->freeAllGraphicBuffersExcept(head); #endif } status_t SurfaceTexture::drainQueueLocked() { Loading
opengl/libs/Android.mk +0 −4 Original line number Diff line number Diff line Loading @@ -39,10 +39,6 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES LOCAL_CFLAGS += -fvisibility=hidden LOCAL_CFLAGS += -DEGL_TRACE=1 ifeq ($(TARGET_BOARD_PLATFORM),msm7k) LOCAL_CFLAGS += -DADRENO130=1 endif ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER endif Loading
services/surfaceflinger/SurfaceFlinger.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -2724,9 +2724,25 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h w, h, strerror(-err), graphicBuffer->handle); return 0; } #ifdef QCOM_HARDWARE Mutex::Autolock _l(mLock); mBuffers.add(graphicBuffer); #endif return graphicBuffer; } #ifdef QCOM_HARDWARE void GraphicBufferAlloc::freeAllGraphicBuffersExcept(int bufIdx) { Mutex::Autolock _l(mLock); if (0 <= bufIdx && bufIdx < mBuffers.size()) { sp<GraphicBuffer> b(mBuffers[bufIdx]); mBuffers.clear(); mBuffers.add(b); } else { mBuffers.clear(); } } #endif // --------------------------------------------------------------------------- GraphicPlane::GraphicPlane() Loading