Merge "hwc: Fix locking."

This commit is contained in:
Linux Build Service Account
2013-08-23 17:32:54 -07:00
committed by Gerrit - the friendly Code Review server
6 changed files with 97 additions and 119 deletions

View File

@@ -267,10 +267,8 @@ static int hwc_prepare(hwc_composer_device_1 *dev, size_t numDisplays,
{
int ret = 0;
hwc_context_t* ctx = (hwc_context_t*)(dev);
ctx->mBlankLock.lock();
//Will be unlocked at the end of set
ctx->mExtLock.lock();
ctx->mSecureLock.lock();
ctx->mDrawLock.lock();
reset(ctx, numDisplays, displays);
ctx->mOverlay->configBegin();
@@ -322,7 +320,7 @@ static int hwc_eventControl(struct hwc_composer_device_1* dev, int dpy,
#ifdef QCOM_BSP
case HWC_EVENT_ORIENTATION:
if(dpy == HWC_DISPLAY_PRIMARY) {
Locker::Autolock _l(ctx->mBlankLock);
Locker::Autolock _l(ctx->mDrawLock);
// store the primary display orientation
// will be used in hwc_video::configure to disable
// rotation animation on external display
@@ -341,7 +339,7 @@ static int hwc_blank(struct hwc_composer_device_1* dev, int dpy, int blank)
ATRACE_CALL();
hwc_context_t* ctx = (hwc_context_t*)(dev);
Locker::Autolock _l(ctx->mBlankLock);
Locker::Autolock _l(ctx->mDrawLock);
int ret = 0, value = 0;
ALOGD_IF(BLANK_DEBUG, "%s: %s display: %d", __FUNCTION__,
blank==1 ? "Blanking":"Unblanking", dpy);
@@ -625,9 +623,7 @@ static int hwc_set(hwc_composer_device_1 *dev,
MDPComp::resetIdleFallBack();
ctx->mVideoTransFlag = false;
//Was locked at the beginning of prepare
ctx->mSecureLock.unlock();
ctx->mExtLock.unlock();
ctx->mBlankLock.unlock();
ctx->mDrawLock.unlock();
return ret;
}
@@ -717,6 +713,7 @@ int hwc_getDisplayAttributes(struct hwc_composer_device_1* dev, int disp,
void hwc_dump(struct hwc_composer_device_1* dev, char *buff, int buff_len)
{
hwc_context_t* ctx = (hwc_context_t*)(dev);
Locker::Autolock _l(ctx->mDrawLock);
android::String8 aBuf("");
dumpsys_log(aBuf, "Qualcomm HWC state:\n");
dumpsys_log(aBuf, " MDPVersion=%d\n", ctx->mMDP.version);