Loading libs/ui/Surface.cpp +11 −3 Original line number Original line Diff line number Diff line Loading @@ -607,13 +607,21 @@ status_t Surface::lock(SurfaceInfo* info, bool blocking) { status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) { { if (mApiLock.tryLock() != NO_ERROR) { if (mApiLock.tryLock() != NO_ERROR) { LOGE("calling Surface::lock() from different threads!"); LOGE("calling Surface::lock from different threads!"); CallStack stack; CallStack stack; stack.update(); stack.update(); stack.dump("Surface::lock called from different threads"); stack.dump("Surface::lock called from different threads"); return WOULD_BLOCK; return WOULD_BLOCK; } } /* Here we're holding mApiLock */ if (mLockedBuffer != 0) { LOGE("Surface::lock failed, already locked"); mApiLock.unlock(); return INVALID_OPERATION; } // we're intending to do software rendering from this point // we're intending to do software rendering from this point setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); Loading Loading @@ -682,8 +690,8 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) status_t Surface::unlockAndPost() status_t Surface::unlockAndPost() { { if (mLockedBuffer == 0) { if (mLockedBuffer == 0) { LOGE("unlockAndPost failed, no locked buffer"); LOGE("Surface::unlockAndPost failed, no locked buffer"); return BAD_VALUE; return INVALID_OPERATION; } } status_t err = mLockedBuffer->unlock(); status_t err = mLockedBuffer->unlock(); Loading Loading
libs/ui/Surface.cpp +11 −3 Original line number Original line Diff line number Diff line Loading @@ -607,13 +607,21 @@ status_t Surface::lock(SurfaceInfo* info, bool blocking) { status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) { { if (mApiLock.tryLock() != NO_ERROR) { if (mApiLock.tryLock() != NO_ERROR) { LOGE("calling Surface::lock() from different threads!"); LOGE("calling Surface::lock from different threads!"); CallStack stack; CallStack stack; stack.update(); stack.update(); stack.dump("Surface::lock called from different threads"); stack.dump("Surface::lock called from different threads"); return WOULD_BLOCK; return WOULD_BLOCK; } } /* Here we're holding mApiLock */ if (mLockedBuffer != 0) { LOGE("Surface::lock failed, already locked"); mApiLock.unlock(); return INVALID_OPERATION; } // we're intending to do software rendering from this point // we're intending to do software rendering from this point setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); Loading Loading @@ -682,8 +690,8 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) status_t Surface::unlockAndPost() status_t Surface::unlockAndPost() { { if (mLockedBuffer == 0) { if (mLockedBuffer == 0) { LOGE("unlockAndPost failed, no locked buffer"); LOGE("Surface::unlockAndPost failed, no locked buffer"); return BAD_VALUE; return INVALID_OPERATION; } } status_t err = mLockedBuffer->unlock(); status_t err = mLockedBuffer->unlock(); Loading