diff options
-rw-r--r-- | services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp | 1 | ||||
-rw-r--r-- | services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp | 9 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index 21be02b4a9..b0f74c23e3 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -70,6 +70,7 @@ VirtualDisplaySurface::VirtualDisplaySurface(HWComposer& hwc, VirtualDisplayId d mFbProducerSlot(BufferQueue::INVALID_BUFFER_SLOT), mOutputProducerSlot(BufferQueue::INVALID_BUFFER_SLOT), mSecure(secure), + mSinkUsage(0), mForceHwcCopy(SurfaceFlinger::useHwcForRgbToYuv) { mSource[SOURCE_SINK] = sink; mSource[SOURCE_SCRATCH] = bqProducer; diff --git a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp index d128fefda9..2fc48754e9 100644 --- a/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp +++ b/services/surfaceflinger/Scheduler/RefreshRateConfigs.cpp @@ -467,7 +467,14 @@ auto RefreshRateConfigs::getBestRefreshRateLocked(const std::vector<LayerRequire ? getMaxScoreRefreshRate(scores.rbegin(), scores.rend()) : getMaxScoreRefreshRate(scores.begin(), scores.end()); - if (primaryRangeIsSingleRate) { + bool noFpsScored = std::all_of(scores.begin(), scores.end(), + [](RefreshRateScore score) { return score.score == 0; }); + if (noFpsScored) { + ALOGV("No fps scored - choose %s", to_string(mActiveModeIt->second->getFps()).c_str()); + return {mActiveModeIt->second, kNoSignals}; + } + + if (primaryRangeIsSingleRate) { // If we never scored any layers, then choose the rate from the primary // range instead of picking a random score from the app range. if (std::all_of(scores.begin(), scores.end(), diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index d2d1f88b73..1751b16233 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3664,8 +3664,7 @@ void SurfaceFlinger::updateVsyncSource() mScheduler->onScreenReleased(mAppConnectionHandle); } else if (mNextVsyncSource && (mActiveVsyncSource == NULL)) { mScheduler->onScreenAcquired(mAppConnectionHandle); - bool isPrimary = mNextVsyncSource->isPrimary(); - nsecs_t vsync = (isPrimary && (mVsyncPeriod > 0)) ? mVsyncPeriod : getVsyncPeriodFromHWC(); + nsecs_t vsync = getVsyncPeriodFromHWC(); mScheduler->resyncToHardwareVsync(true, Fps::fromPeriodNsecs(vsync)); } else if ((mNextVsyncSource != NULL) && (mActiveVsyncSource != NULL)) { @@ -4175,6 +4174,7 @@ void SurfaceFlinger::processDisplayChanged(const wp<IBinder>& displayToken, if (display->isVirtual()) { releaseVirtualDisplay(display->getVirtualId()); } + destroySmomoInstance(display); } mDisplays.erase(displayToken); |