|
开发平台:MT6737T 屏:mipi 4 lane, 720X1280
问题:
在多次唤醒后待机,会概率性出现待机不成功,同时power键也无法开机。
比较正常和异常情况下log的差异,发现问题出现在 Framework 的display模块。dumpsys display如下:
aeon6737t_66_n:/ $ dumpsys display
DISPLAY MANAGER (dumpsys display)
mOnlyCode=false
mSafeMode=false
mPendingTraversal=false
mGlobalDisplayState=OFF
mNextNonDefaultDisplayId=1
mDefaultViewport=DisplayViewport{valid=true, displayId=0, orientation=0, logicalFrame=Rect(0, 0 - 1280, 720), physicalFrame=Rect(0, 0 - 1280, 720), deviceWidth=1280, deviceHeight=720}
mExternaltouchViewport=DisplayViewport{valid=false, displayId=0, orientation=0, logicalFrame=Rect(0, 0 - 0, 0), physicalFrame=Rect(0, 0 - 0, 0), deviceWidth=0, deviceHeight=0}
mSingleDisplayDemoMode=false
mWifiDisplayScanRequestCount=0
Display Adapters: size=4
LocalDisplayAdapter
OverlayDisplayAdapter
mCurrentOverlaySetting=
mOverlays: size=0
WifiDisplayAdapter
mCurrentStatus={"featureState":2,"scanState":0,"activeDisplayState":0,"activeDisplay":{},"display":[],"sessionInfo":{"CLIentOrOwner":"client","groupId":"","passphrase":"","sessionId":0,"ipAddress":""}}
mFeatureState=2
mScanState=0
mActiveDisplayState=0
mActiveDisplay=null
mDisplays=[]
mAvailableDisplays=[]
mRememberedDisplays=[]
mPendingStatusChangeBroADCast=false
mSupportsProtectedBuffers=false
mDisplayController:
mWifiDisplayOnSetting=false
mWifiP2pEnabled=false
mWFDEnabled=false
mWfdEnabling=false
mNetworkInfo=null
mScanRequested=false
mDiscoverPeersInProgress=false
mDesiredDevice=null
mConnectingDisplay=null
mDisconnectingDisplay=null
mCancelingDisplay=null
mConnectedDevice=null
mConnectionRetriesLeft=0
mRemoteDisplay=null
mRemoteDisplayInterface=null
mRemoteDisplayConnected=false
mAdvertisedDisplay=null
mAdvertisedDisplaySurface=null
mAdvertisedDisplayWidth=0
mAdvertisedDisplayHeight=0
mAdvertisedDisplayFlags=0
mBackupShowTouchVal=0
mFast_NeedFastRtsp=false
mFast_DesireDMAc=null
mIsNeedRotate=false
mIsConnected_OtherP2p=false
mIsConnecting_P2p_Rtsp=false
mIsWFDConnected=false
mDRMContent_Mediaplayer=false
mPlayerID_Mediaplayer=0
mAvailableWifiDisplayPeers: size=0
VirtualDisplayAdapter
Display Devices: size=1
DisplayDeviceInfo{"Built-in Screen": uniqueId="local:0", 1280 x 720, modeId 1, defaultModeId 1, supportedModes [{id=1, width=1280, height=720, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=0}], HdrCapabilities android.view.Display$HdrCapabilities@b6f279f, density 240, 240.0 x 240.0 dpi, appVsyncOff -8000000, presDeadline 25666666, touch INTERNAL, rotation 0, type BUILT_IN, state OFF, FLAG_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
mAdapter=LocalDisplayAdapter
mUniqueId=local:0
mDisplayToken=android.os.BinderProxy@407468e
mCurrentLayerStack=-1
mCurrentOrientation=0
mCurrentLayerStackRect=Rect(0, 0 - 1280, 720)
mCurrentDisplayRect=Rect(0, 0 - 1280, 720)
mCurrentSurface=null
mBuiltInDisplayId=0
mActivePhysIndex=0
mActiveModeId=1
mActiveColorTransformId=1
mState=OFF
mBrightness=0
mBacklight=com.android.server.lights.LightsService$LightImpl@e6c7eaf
mDisplayInfos=
PhysicalDisplayInfo{1280 x 720, 60.000004 fps, density 1.5, 240.0 x 240.0 dpi, secure true, appVsyncOffset -8000000, bufferDeadline 25666666, colorTransform 0}
mSupportedModes=
DisplayModeRecord{mMode={id=1, width=1280, height=720, fps=60.000004}}
mSupportedColorTransforms=[
{id=1, colorTransform=0}]
Logical Displays: size=1
Display 0:
mDisplayId=0
mLayerStack=0
mHasContent=true
mRequestedMode=0
mRequestedColorTransformId=0
mDisplayOffset=(0, 0)
mPrimaryDisplayDevice=Built-in Screen
mBaseDisplayInfo=DisplayInfo{"Built-in Screen", uniqueId "local:0", app 1280 x 720, real 1280 x 720, largest app 1280 x 720, smallest app 1280 x 720, mode 1, defaultMode 1, modes [{id=1, width=1280, height=720, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=0}], hdrCapabilities android.view.Display$HdrCapabilities@b6f279f, rotation 0, density 240 (240.0 x 240.0) dpi, layerStack 0, appVsyncOff -8000000, presDeadline 25666666, type BUILT_IN, state OFF, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
mOverrideDisplayInfo=DisplayInfo{"Built-in Screen", uniqueId "local:0", app 1280 x 720, real 1280 x 720, largest app 1280 x 1244, smallest app 720 x 684, mode 1, defaultMode 1, modes [{id=1, width=1280, height=720, fps=60.000004}], colorTransformId 1, defaultColorTransformId 1, supportedColorTransforms [{id=1, colorTransform=0}], hdrCapabilities android.view.Display$HdrCapabilities@b6f279f, rotation 0, density 240 (240.0 x 240.0) dpi, layerStack 0, appVsyncOff -8000000, presDeadline 25666666, type BUILT_IN, state ON, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS}
Callbacks: size=32
0: mPid=733, mWifiDisplayScanRequested=false
1: mPid=991, mWifiDisplayScanRequested=false
2: mPid=1006, mWifiDisplayScanRequested=false
3: mPid=1256, mWifiDisplayScanRequested=false
4: mPid=1274, mWifiDisplayScanRequested=false
5: mPid=1288, mWifiDisplayScanRequested=false
6: mPid=1307, mWifiDisplayScanRequested=false
7: mPid=1508, mWifiDisplayScanRequested=false
8: mPid=1555, mWifiDisplayScanRequested=false
9: mPid=1627, mWifiDisplayScanRequested=false
10: mPid=1643, mWifiDisplayScanRequested=false
11: mPid=1659, mWifiDisplayScanRequested=false
12: mPid=1704, mWifiDisplayScanRequested=false
13: mPid=1826, mWifiDisplayScanRequested=false
14: mPid=1882, mWifiDisplayScanRequested=false
15: mPid=1905, mWifiDisplayScanRequested=false
16: mPid=1990, mWifiDisplayScanRequested=false
17: mPid=2056, mWifiDisplayScanRequested=false
18: mPid=2071, mWifiDisplayScanRequested=false
19: mPid=2089, mWifiDisplayScanRequested=false
20: mPid=2106, mWifiDisplayScanRequested=false
21: mPid=2124, mWifiDisplayScanRequested=false
22: mPid=2145, mWifiDisplayScanRequested=false
23: mPid=2175, mWifiDisplayScanRequested=false
24: mPid=2191, mWifiDisplayScanRequested=false
25: mPid=2208, mWifiDisplayScanRequested=false
26: mPid=2248, mWifiDisplayScanRequested=false
27: mPid=2269, mWifiDisplayScanRequested=false
28: mPid=2285, mWifiDisplayScanRequested=false
29: mPid=2300, mWifiDisplayScanRequested=false
30: mPid=2316, mWifiDisplayScanRequested=false
31: mPid=2333, mWifiDisplayScanRequested=false
Display Power Controller Locked State:
mDisplayReadyLocked=false
mPendingRequestLocked=policy=OFF, useProximitysensor=false, screenBrightness=102, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, useTwilight=false
mPendingRequestChangedLocked=false
mPendingWaitForNegativeProximityLocked=false
mPendingUpdatePowerStateLocked=false
Display Power Controller Configuration:
mScreenBrightnessDozeConfig=1
mScreenBrightnessDimConfig=10
mScreenBrightnessDarkConfig=1
mScreenBrightnessRangeMinimum=1
mScreenBrightnessRangeMaximum=255
mUseSoftwareAutoBrightnessConfig=true
mAllowAutoBrightnessWhileDozingConfig=false
mColorFadeFadesConfig=false
Display Power Controller Thread State:
mPowerRequest=policy=OFF, useProximitySensor=false, screenBrightness=102, screenAutoBrightnessAdjustment=0.0, brightnessSetByUser=true, useAutoBrightness=false, blockScreenOn=false, lowPowerMode=false, boostScreenBrightness=false, dozeScreenBrightness=-1, dozeScreenState=UNKNOWN, useTwilight=false
mWaitingForNegativeProximity=false
mProximitySensor={Sensor name="PROXIMITY", vendor="mtk", version=1, type=8, maxRange=10.0, resolution=1.0, power=0.13, minDelay=0}
mProximitySensorEnabled=false
mProximityThreshold=5.0
mProximity=Unknown
mPendingProximity=Unknown
mPendingProximityDebounceTime=-1 (139842 ms ago)
mScreenOffBecauseOfProximity=false
mAppliedAutoBrightness=false
mAppliedDiMMIng=false
mAppliedLowPower=false
mPendingScreenOnUnblocker=null
mPendingScreenOff=false
mReportedToPolicy=REPORTED_TO_POLICY_SCREEN_OFF
mScreenBrightnessRampAnimator.isAnimating()=false
mColorFadeOnAnimator.isStarted()=false
mColorFadeOffAnimator.isStarted()=false
Display Power State:
mScreenState=OFF
mScreenBrightness=10
mScreenReady=false
mScreenUpdatePending=false
mColorFadePrepared=true
mColorFadeLevel=0.0
mColorFadeReady=true
mColorFadeDrawPending=false
Photonic Modulator State:
mPendingState=OFF
mPendingBacklight=0
mActualState=OFF
mActualBacklight=0
mStateChangeInProgress=true
mBacklightChangeInProgress=false
Color Fade State:
mPrepared=true
mMode=1
mDisplayLayerStack=0
mDisplayWidth=1280
mDisplayHeight=720
mSurfaceVisible=true
mSurfaceAlpha=1.0
Automatic Brightness Controller Configuration:
mScreenAutoBrightnessSpline=MonotoneCubicSpline{[(0.0, 0.03137255: 0.0017156864), (128.0, 0.2509804: 0.0013786765), (256.0, 0.38431373: 6.1274506E-4), (384.0, 0.40784314: 1.8382352E-4), (512.0, 0.43137255: 1.8382352E-4), (640.0, 0.45490196: 1.8382352E-4), (768.0, 0.47843137: 1.8382363E-4), (896.0, 0.5019608: 1.8382363E-4), (1024.0, 0.5254902: 1.8382352E-4), (2048.0, 0.7137255: 1.61803E-4), (4096.0, 1.0: 0.0), (6144.0, 1.0: 0.0), (8192.0, 1.0: 0.0), (10240.0, 1.0: 0.0), (12288.0, 1.0: 0.0), (14336.0, 1.0: 0.0), (16384.0, 1.0: 0.0), (18432.0, 1.0: 0.0)]}
mScreenBrightnessRangeMinimum=1
mScreenBrightnessRangeMaximum=255
mLightSensorWARMUpTimeConfig=0
mBrighteningLightDebounceConfig=4000
mDarkeningLightDebounceConfig=8000
mResetAmbientLuxAfterWarmUpConfig=true
Automatic Brightness Controller State:
mLightSensor={Sensor name="LIGHT", vendor="MTK", version=1, type=5, maxRange=10240.0, resolution=1.0, power=0.13, minDelay=0}
mTwilight.getCurrentState()={TwilightState: isNight=false, mAmount=0.0}
mLightSensorEnabled=false
mLightSensorEnableTime=0 (139859 ms ago)
mAmbientLux=0.0
mAmbientLightHorizon=10000
mBrighteningLuxThreshold=0.0
mDarkeningLuxThreshold=0.0
mLastObservedLux=0.0
mLastObservedLuxTime=0 (139859 ms ago)
mRecentLightSamples=0
mAmbientLightRingBuffer=[]
mInitialHorizonAmbientLightRingBuffer=[]
mScreenAutoBrightness=-1
mScreenAutoBrightnessAdjustment=0.0
mScreenAutoBrightnessAdjustmentMaxGamma=3.0
mLastScreenAutoBrightnessGamma=1.0
mDozing=true
aeon6737t_66_n:/ $ dumpsys power
POWER MANAGER (dumpsys power)
Power Manager State:
mDirty=0x0
mWakefulness=Asleep
mWakefulnessChanging=true
mIsPowered=false
mPlugType=0
mBatteryLevel=97
mBatteryLevelWhenDreamStarted=0
mDockState=0
mStayOn=false
mProximityPositive=false
mBootCompleted=true
mSystemReady=true
mHalAutoSuspendModeEnabled=false
mHalInteractiveModeEnabled=true
mWakeLockSummary=0x0
mUserActivitySummary=0x0
mRequestWaitForNegativeProximity=false
mSandmanScheduled=false
mSandmanSummoned=false
mLowPowerModeEnabled=false
mBatteryLevelLow=false
mLightDeviceIdleMode=false
mDeviceIdleMode=false
mDeviceIdleWhitelist=[10008]
mDeviceIdleTempWhitelist=[]
mLastWakeTime=118572 (31716 ms ago)
mLastSleepTime=128576 (21712 ms ago)
mLastUserActivityTime=118572 (31716 ms ago)
mLastUserActivityTimeNoChangeLights=0 (150288 ms ago)
mLastInteractivePowerHintTime=118572 (31716 ms ago)
mLastScreenBrightnessBoostTime=0 (150288 ms ago)
mScreenBrightnessBoostInProgress=false
mDisplayReady=false
mHoldingWakeLockSuspendBlocker=false
mHoldingDisplaySuspendBlocker=true
Settings and Configuration:
mDecoupleHalAutoSuspendModeFROMDisplayConfig=false
mDecoupleHalInteractiveModeFromDisplayConfig=false
mWakeUpWhenPluggedOrUnpluggedConfig=true
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mTheaterModeEnabled=false
mSuspendWhenScreenOffDueToProximityConfig=true
mDreamsSupportedConfig=true
mDreamsEnabledByDefaultConfig=true
mDreamsActivatedOnSleepByDefaultConfig=false
mDreamsActivatedOnDockByDefaultConfig=true
mDreamsEnabledOnBatteryConfig=false
mDreamsBatteryLevelMinimumWhenPoweredConfig=-1
mDreamsBatteryLevelMinimumWhenNotPoweredConfig=15
mDreamsBatteryLevelDrainCutoffConfig=5
mDreamsEnabledSetting=true
mDreamsActivateOnSleepSetting=false
mDreamsActivateOnDockSetting=true
mDozeAfterScreenOffConfig=false
mLowPowerModeSetting=false
mAutoLowPowerModeConfigured=false
mAutoLowPowerModeSnoozing=false
mMinimumScreenOffTimeoutConfig=10000
mMaximumScreenDimDurationConfig=7000
mMaximumScreenDimRatioConfig=0.20000005
mScreenOffTimeoutSetting=60000
mSleepTimeoutSetting=-1
mMaximumScreenOffTimeoutFromDeviceAdmin=2147483647 (enforced=false)
mStayOnWhilePluggedInSetting=0
mScreenBrightnessSetting=102
mScreenAutoBrightnessAdjustmentSetting=0.0
mScreenBrightnessModeSetting=0
mScreenBrightnessOverrideFromWindowManager=-1
mUserActivityTimeoutOverrideFromWindowManager=10000
mUserInactiveOverrideFromWindowManager=false
mTemporaryScreenBrightnessSettingOverride=-1
mTemporaryScreenAutoBrightnessAdjustmentSettingOverride=NaN
mDozeScreenStateOverrideFromDreamManager=0
mDozeScreenBrightnessOverrideFromDreamManager=-1
mScreenBrightnessSettingMinimum=10
mScreenBrightnessSettingMaximum=255
mScreenBrightnessSettingDefault=102
mDoubleTapWakeEnabled=false
Sleep timeout: -1 ms
Screen off timeout: 10000 ms
Screen dim duration: 2000 ms
UID states:
UID 1000: 0
UID 1001: 0
UID 1037: 16
UID u0a1: 16
UID u0a2: 16
UID u0a10: 3
UID u0a13: 5
UID u0a21: 0
UID u0a31: 16
UID u0a33: 16
UID u0a36: 10
UID u0a38: 7
UID u0a45: 16
UID u0a48: 7
UID u0a50: 10
UID u0a56: 4
UID u0a57: 16
Wake Locks: size=0
Suspend Blockers: size=4
PowerManagerService.WakeLocks: ref count=0
PowerManagerService.Display: ref count=2
PowerManagerService.Broadcasts: ref count=0
PowerManagerService.WirelessChargerDetector: ref count=0
Display Power: state=ON
Wireless Charger Detector State:
mGravitySensor={Sensor name="Gravity Sensor", vendor="AOSP", version=3, type=9, maxRange=19.6133, resolution=0.00390625, power=6.48, minDelay=10000}
mPoweredWirelessly=false
mAtRest=false
mRestX=0.0, mRestY=0.0, mRestZ=0.0
mDetectionInProgress=false
mDetectionStartTime=0 (never)
mMustUpdateRestPosition=false
mTotalSamples=0
mMovingSamples=0
mFirstSampleX=0.0, mFirstSampleY=0.0, mFirstSampleZ=0.0
mLastSampleX=0.0, mLastSampleY=0.0, mLastSampleZ=0.0
注意到mHoldingDisplaySuspendBlocker=true,说明没有Display模块的Suspend锁没有正常释放。
然后根据这个线索一直往下找,发现在执行getHwComposer().setPowerMode(type, mode)时没有返回,一直阻塞。
不知道各位有没有遇到类似的问题,或者能够看到setPowerMode源码? |
|