Skip to content
Snippets Groups Projects
  1. Dec 28, 2023
    • Leon Scroggins III's avatar
      SF: Update present timing per display · 370b8b52
      Leon Scroggins III authored
      Calculate presentation timing info (i.e. expected- and earliest-
      PresentTime) separately for each display, since they are generally not
      in sync. This allows SF to present each display at the proper time,
      using tools that are already in use for the pacesetter display.
      
      CompositionRefreshArgs:
      - Replace earliest- and expected- PresentTime with a map of
        FrameTargets which hold the times.
      
      Output:
      - Retrieve appropriate times from the relevant FrameTarget.
      - Note: Since HAL virtual displays do not have a FrameTarget, they now
        are provided with the default expected (0) and earliest (nullopt)
        -PresentTimes. This is fine, since these times are irrelevant for
        a virtual display. Previously, they simply used the pacesetter's
        times.
      - Trace the expected present time.
      
      Scheduler:
      - Compute the expectedPresentTime aka expectedVsyncTime for follower
        displays via the next VSYNC after the pacesetter's
        expectedPresentTime. TODO (b/256196556): The "followers" should
        follow the frontrunner, not the pacesetter.
      
      SurfaceFlinger:
      - Populate CompositionRefreshArgs' map of FrameTargets.
      
      For now, continue using the same scheduledFrameTime for all follower
      displays. This is only used as a deadline for determining whether to
      render a CachedSet. Adjusting it per follower would make us more likely
      to render more CachedSets per frame, and we need a more holistic
      approach for caching anyway.
      
      Bug: 255601557
      Bug: 256196556
      Bug: 259132483
      Test: perfetto traces
      Change-Id: I2c27dc709afd1f33bddbf9c2ca1cd61dd335f66c
      370b8b52
    • Leon Scroggins III's avatar
      SF: Move present timing to FrameTargeter · 0bd0d4c6
      Leon Scroggins III authored
      Split out from I2c27dc709afd1f33bddbf9c2ca1cd61dd335f66c.
      
      Store earliestPresentTime on the FrameTarget, like expectedPresentTime,
      so it can be stored per display.
      
      Add FrameTargeter::computeEarliestPresentTime. This calculation was
      previously done in SurfaceFlinger, using data mostly contained in the
      FrameTargeter. This will simplify computing this per display.
      
      Move computation of the earliestPresentTime to
      FrameTargeter::beginFrame. Add a scheduler::Feature to track whether
      ExpectedPresentTime is supported.
      
      Make previousFrameVsyncTime and wouldPresentEarly protected, now that
      they are only called by FrameTargeter (subclass) and tests.
      
      Make the test a friend of FrameTarget for accessing the above methods.
      
      Bug: 255601557
      Bug: 256196556
      Bug: 259132483
      Test: atest libscheduler_test:FrameTargeterTest
      Test: atest
              libscheduler_test:FrameTargeterWithExpectedPresentSupportTest
      
      Change-Id: Ib927935de6ba2b7b8d5037b42eb635ae92019634
      0bd0d4c6
  2. Dec 27, 2023
    • Leon Scroggins III's avatar
      Move VsyncConfiguration from SF to Scheduler · 823d4ca5
      Leon Scroggins III authored
      This is part of the long term goal, tracked in b/241285191, of moving
      scheduling logic/state from SF to Scheduler. It also paves the way for
      a cleaner version of Ib927935de6ba2b7b8d5037b42eb635ae92019634.
      
      Bring RefreshRateStats along to Scheduler, since it is updated along
      with work that belongs in Scheduler.
      
      Mostly this is intended to not change behavior, but there are some
      exceptions:
      - the ordering of dumpsys SurfaceFlinger has changed, as some components
        are now internal to Scheduler, so they are dumped along with it.
      - two extra calls to update the RefreshRateStats along with
        updatePhaseConfiguration. The missing calls appear to be an oversight,
        and it's more natural to include the update in its new location.
      
      Move construction of VsyncModulator into Scheduler, since it is
      constructed from the VsyncConfiguration, now constructed in Scheduler.
      
      Add TestableScheduler.cpp, to prevent adding a circular dependency, now
      that the class's constructor references TestableSurfaceFlinger.
      
      Add Dumper::out for simplicity in updating dump calls.
      
      Bug: 241285191
      Bug: 255601557
      Bug: 256196556
      Bug: 259132483
      Test: libscheduler_test
      Test: libsurfaceflinger_unittest
      Change-Id: I01c93cfc3d2342cfbaaf8fe47dc2cd57d0e1fc43
      823d4ca5
  3. Dec 26, 2023
  4. Dec 23, 2023
  5. Dec 22, 2023
  6. Dec 21, 2023
  7. Dec 20, 2023
Loading