Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5de27f85 authored by Su Hong Koo's avatar Su Hong Koo
Browse files

SF: Migrate pacesetter display designation to display with highest refresh rate

The pacesetter display is the physical display whose vblank signals are
used to schedule global commit/composition/presentation.

Currently, the pacesetter display designation is given to the active
display, which is always a built-in display. Meaning if an external
display with higher refresh rate is connected, it will still be driven
at a slower effective rate corresponding to the pacesetter's refresh
rate.

This CL adds Scheduler::selectNewPacesetterDisplay(), which looks at
all powered-on physical displays and their refresh rates, and chooses
the display with the highest refresh rate as the new pacesetter
display. The selection logic prefers stability, and will prefer to keep the
current pacesetter display if all other displays with the highest
refresh rates are roughly equal to the current pacesetter's refresh
rate.

This CL adds a variant of Scheduler::setPacesetterDisplay() without any
argument, which uses selectNewPacesetterDisplay() to select the
pacesetter. Furthermore, if the pacesetter_selection flag is enabled,
register/unregister display will use the display from
selectNewPacesetterDisplay() over the active display that's passed in.

Flag: com.android.graphics.surfaceflinger.flags.pacesetter_selection
Bug: 389983418, 241286431
Test: Manually tested on comet + more, new unit tests
Change-Id: I0fbd12d769abfdd501551a845cabc155dce6a9f6
parent 9ff64f6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment