Reland "SF: Set an initial mode [...] for external displays"
Rebased and modified from Iec154c488ef7af9b8e1d6386509e97c9ce85103b, patch set 3. Does not include I688b0c922747a80e881965a1dc243d11ba2c7438, which was reverted. DM currently always picks 1080p@60 for an external display. More work (tracked in b/318534874) needs to be done in SF in order to use that mode initially. In the meantime, have SF pick the same mode on hotplug so that it avoids extra mode switches. Move "force" into DisplayModeRequest. If a request is already pending this allows forcing the final request if a pending request forced it, even if the new request does not. This matches how emitEvent is handled. If a DisplayModeRequest is forced, don't early exit in initiateDisplayModeChanges, which does not honor "force". When loading display modes for an external display, look for 1080p@60 and treat it as the active mode. If the display does not have 1080p@60, pick the mode closest to (but not exceeding) 1080p@60. DM will pick an appropriate mode later. When adding that display, apply that active mode so it will be used by SF. Fixes: 305813445 Test: libsurfaceflinger_unittest Test: YouTube is not frozen or choppy on external display hotplug. Test: Remove the option of 1080p@60 and connect. Change-Id: I6864d88b327e0f207947b44ce14b97f323170714
Loading
Please register or sign in to comment