summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayDevice.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-03-25 14:43:23 -0700
committerJesse Hall <jessehall@google.com>2013-03-27 14:58:09 -0700
commit02d86567d95b99e1142941ed7ec23a4465822813 (patch)
tree70c664e137836fb8bbf22391fa2787d8c44a9393 /services/surfaceflinger/DisplayDevice.cpp
parent5a557a61d6a5cd2d82dcd961b1d72b5621eb014d (diff)
downloadframeworks_native-02d86567d95b99e1142941ed7ec23a4465822813.zip
frameworks_native-02d86567d95b99e1142941ed7ec23a4465822813.tar.gz
frameworks_native-02d86567d95b99e1142941ed7ec23a4465822813.tar.bz2
Clean up HWC state when releasing a DisplayDevice
DisplayDevices can be released when DisplayManager removes them from the display list, or (for virtual displays) when the surface is set to NULL. We were only cleaning up HWC resources associated with the display in the first case. Bug: 8384764 Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 6936a7f..68b0b7f 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -143,6 +143,15 @@ DisplayDevice::~DisplayDevice() {
}
}
+void DisplayDevice::disconnect(HWComposer& hwc) {
+ if (mHwcDisplayId >= 0) {
+ hwc.disconnectDisplay(mHwcDisplayId);
+ if (mHwcDisplayId >= DISPLAY_VIRTUAL)
+ hwc.freeDisplayId(mHwcDisplayId);
+ mHwcDisplayId = -1;
+ }
+}
+
bool DisplayDevice::isValid() const {
return mFlinger != NULL;
}
@@ -419,11 +428,11 @@ void DisplayDevice::dump(String8& result, char* buffer, size_t SIZE) const {
const Transform& tr(mGlobalTransform);
snprintf(buffer, SIZE,
"+ DisplayDevice: %s\n"
- " type=%x, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
+ " type=%x, hwcId=%d, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
"flips=%u, isSecure=%d, secureVis=%d, acquired=%d, numLayers=%u\n"
" v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d],"
"transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
- mDisplayName.string(), mType,
+ mDisplayName.string(), mType, mHwcDisplayId,
mLayerStack, mDisplayWidth, mDisplayHeight, mNativeWindow.get(),
mOrientation, tr.getType(), getPageFlipCount(),
mIsSecure, mSecureLayerVisible, mScreenAcquired, mVisibleLayersSortedByZ.size(),