diff options
-rw-r--r-- | cmds/installd/migrate_legacy_obb_data.sh | 13 | ||||
-rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 3 | ||||
-rw-r--r-- | libs/renderengine/gl/ProgramCache.cpp | 9 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 1 | ||||
-rw-r--r-- | services/surfaceflinger/TransactionCompletedThread.cpp | 10 | ||||
-rw-r--r-- | services/surfaceflinger/TransactionCompletedThread.h | 2 |
7 files changed, 39 insertions, 10 deletions
diff --git a/cmds/installd/migrate_legacy_obb_data.sh b/cmds/installd/migrate_legacy_obb_data.sh index 4f8a1ecb56..10756881be 100644 --- a/cmds/installd/migrate_legacy_obb_data.sh +++ b/cmds/installd/migrate_legacy_obb_data.sh @@ -15,6 +15,19 @@ # See the License for the specific language governing permissions and # limitations under the License. +rm -rf /sdcard/Android/obb/test_probe +mkdir -p /sdcard/Android/obb/ +touch /sdcard/Android/obb/test_probe +if ! test -f /data/media/0/Android/obb/test_probe ; then + log -p i -t migrate_legacy_obb_data "No support for 'unshared_obb'. Not migrating" + rm -rf /sdcard/Android/obb/test_probe + exit 0 +fi + +# Delete the test file, and remove the obb folder if it is empty +rm -rf /sdcard/Android/obb/test_probe +rmdir /data/media/obb + if ! test -d /data/media/obb ; then log -p i -t migrate_legacy_obb_data "No legacy obb data to migrate." exit 0 diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index d6f88fc7a4..def9fe937c 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -365,6 +365,9 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr mContainsBuffer = other.mContainsBuffer; other.mContainsBuffer = false; + mEarlyWakeup = mEarlyWakeup || other.mEarlyWakeup; + other.mEarlyWakeup = false; + return *this; } diff --git a/libs/renderengine/gl/ProgramCache.cpp b/libs/renderengine/gl/ProgramCache.cpp index 086a324999..d242677f0c 100644 --- a/libs/renderengine/gl/ProgramCache.cpp +++ b/libs/renderengine/gl/ProgramCache.cpp @@ -575,10 +575,11 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) { float applyCornerRadius(vec2 cropCoords) { vec2 position = cropCoords - cropCenter; - // Increase precision here so that a large corner radius doesn't - // cause floating point error - highp vec2 dist = abs(position) + vec2(cornerRadius) - cropCenter; - float plane = length(max(dist, vec2(0.0))); + // Scale down the dist vector here, as otherwise large corner + // radii can cause floating point issues when computing the norm + vec2 dist = (abs(position) - cropCenter + vec2(cornerRadius)) / 16.0; + // Once we've found the norm, then scale back up. + float plane = length(max(dist, vec2(0.0))) * 16.0; return 1.0 - clamp(plane - cornerRadius, 0.0, 1.0); } )__SHADER__"; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 2d319101b3..6166789fc4 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -353,6 +353,11 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI mPropagateBackpressure = !atoi(value); ALOGI_IF(!mPropagateBackpressure, "Disabling backpressure propagation"); + property_get("debug.sf.enable_gl_backpressure", value, "0"); + mPropagateBackpressureClientComposition = atoi(value); + ALOGI_IF(mPropagateBackpressureClientComposition, + "Enabling backpressure propagation for Client Composition"); + property_get("debug.sf.enable_hwc_vds", value, "0"); mUseHwcVirtualDisplays = atoi(value); ALOGI_IF(mUseHwcVirtualDisplays, "Enabling HWC virtual displays"); @@ -1670,9 +1675,9 @@ void SurfaceFlinger::onMessageReceived(int32_t what) NO_THREAD_SAFETY_ANALYSIS { break; } - // For now, only propagate backpressure when missing a hwc frame. - if (hwcFrameMissed && !gpuFrameMissed) { - if (mPropagateBackpressure) { + if (frameMissed && mPropagateBackpressure) { + if ((hwcFrameMissed && !gpuFrameMissed) || + mPropagateBackpressureClientComposition) { signalLayerUpdate(); break; } diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index ddfe88c928..52655944de 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -1003,6 +1003,7 @@ private: volatile nsecs_t mDebugInTransaction = 0; bool mForceFullDamage = false; bool mPropagateBackpressure = true; + bool mPropagateBackpressureClientComposition = false; std::unique_ptr<SurfaceInterceptor> mInterceptor; SurfaceTracing mTracing{*this}; bool mTracingEnabled = false; diff --git a/services/surfaceflinger/TransactionCompletedThread.cpp b/services/surfaceflinger/TransactionCompletedThread.cpp index 5cf8eb1a1d..fd466dedff 100644 --- a/services/surfaceflinger/TransactionCompletedThread.cpp +++ b/services/surfaceflinger/TransactionCompletedThread.cpp @@ -197,8 +197,14 @@ status_t TransactionCompletedThread::addCallbackHandle(const sp<CallbackHandle>& } transactionStats->latchTime = handle->latchTime; - transactionStats->surfaceStats.emplace_back(handle->surfaceControl, handle->acquireTime, - handle->previousReleaseFence); + // If the layer has already been destroyed, don't add the SurfaceControl to the callback. + // The client side keeps a sp<> to the SurfaceControl so if the SurfaceControl has been + // destroyed the client side is dead and there won't be anyone to send the callback to. + sp<IBinder> surfaceControl = handle->surfaceControl.promote(); + if (surfaceControl) { + transactionStats->surfaceStats.emplace_back(surfaceControl, handle->acquireTime, + handle->previousReleaseFence); + } return NO_ERROR; } diff --git a/services/surfaceflinger/TransactionCompletedThread.h b/services/surfaceflinger/TransactionCompletedThread.h index 21e2678701..e849f714d0 100644 --- a/services/surfaceflinger/TransactionCompletedThread.h +++ b/services/surfaceflinger/TransactionCompletedThread.h @@ -49,7 +49,7 @@ public: sp<ITransactionCompletedListener> listener; std::vector<CallbackId> callbackIds; - sp<IBinder> surfaceControl; + wp<IBinder> surfaceControl; bool releasePreviousBuffer = false; sp<Fence> previousReleaseFence; |