am 2b5b55e7: Merge "sf: Fix incorrect state reporting in dumpsys"

* commit '2b5b55e73c79658b9a0ae3fdf347f6dbe65e3c68':
  sf: Fix incorrect state reporting in dumpsys
This commit is contained in:
Dan Stoza 2015-06-12 17:00:44 +00:00 committed by Android Git Automerger
commit 0501cdbc04
2 changed files with 4 additions and 0 deletions

View File

@ -635,6 +635,7 @@ status_t HWComposer::setFramebufferTarget(int32_t id,
} }
status_t HWComposer::prepare() { status_t HWComposer::prepare() {
Mutex::Autolock _l(mDisplayLock);
for (size_t i=0 ; i<mNumDisplays ; i++) { for (size_t i=0 ; i<mNumDisplays ; i++) {
DisplayData& disp(mDisplayData[i]); DisplayData& disp(mDisplayData[i]);
if (disp.framebufferTarget) { if (disp.framebufferTarget) {
@ -1145,6 +1146,7 @@ static String8 getFormatStr(PixelFormat format) {
} }
void HWComposer::dump(String8& result) const { void HWComposer::dump(String8& result) const {
Mutex::Autolock _l(mDisplayLock);
if (mHwc) { if (mHwc) {
result.appendFormat("Hardware Composer state (version %08x):\n", hwcApiVersion(mHwc)); result.appendFormat("Hardware Composer state (version %08x):\n", hwcApiVersion(mHwc));
result.appendFormat(" mDebugForceFakeVSync=%d\n", mDebugForceFakeVSync); result.appendFormat(" mDebugForceFakeVSync=%d\n", mDebugForceFakeVSync);

View File

@ -354,6 +354,8 @@ private:
// mLists[i>0] can be NULL. that display is to be ignored // mLists[i>0] can be NULL. that display is to be ignored
struct hwc_display_contents_1* mLists[MAX_HWC_DISPLAYS]; struct hwc_display_contents_1* mLists[MAX_HWC_DISPLAYS];
DisplayData mDisplayData[MAX_HWC_DISPLAYS]; DisplayData mDisplayData[MAX_HWC_DISPLAYS];
// protect mDisplayData from races between prepare and dump
mutable Mutex mDisplayLock;
size_t mNumDisplays; size_t mNumDisplays;
cb_context* mCBContext; cb_context* mCBContext;