diff options
author | Antti Hatala <ahatala@nvidia.com> | 2010-09-09 02:33:05 -0700 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2010-09-09 12:06:48 -0700 |
commit | 11042a41c1fe1415df0f45ef5fd3905d34b6e01a (patch) | |
tree | 2b4f1fc582c24b2bef28c19be3d47a7819fda09e /services/surfaceflinger | |
parent | 982f58bdccce7e4e537cffb2410ad78d73398461 (diff) | |
download | frameworks_base-11042a41c1fe1415df0f45ef5fd3905d34b6e01a.zip frameworks_base-11042a41c1fe1415df0f45ef5fd3905d34b6e01a.tar.gz frameworks_base-11042a41c1fe1415df0f45ef5fd3905d34b6e01a.tar.bz2 |
surfaceflinger: give hwcomposer a chance to release buffers
Change-Id: I605fa779702022865dd58df3b36f37c2644ade36
Diffstat (limited to 'services/surfaceflinger')
3 files changed, 10 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp index 166c528..3e23929 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -292,6 +292,9 @@ void DisplayHardware::fini() void DisplayHardware::releaseScreen() const { DisplayHardwareBase::releaseScreen(); + if (mHwc->initCheck() == NO_ERROR) { + mHwc->release(); + } } void DisplayHardware::acquireScreen() const diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 0291d78..129be4e 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -87,6 +87,11 @@ status_t HWComposer::commit() const { return (status_t)err; } +status_t HWComposer::release() const { + int err = mHwc->set(mHwc, NULL, NULL, NULL); + return (status_t)err; +} + size_t HWComposer::getNumLayers() const { return mList ? mList->numHwLayers : 0; } diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index c5d5c2b..22ff10c 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -48,6 +48,8 @@ public: // commits the list status_t commit() const; + // release hardware resources + status_t release() const; size_t getNumLayers() const; hwc_layer_t* getLayers() const; |