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

Commit 5a96326e authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Force client composition if we'd use rotator

HWC can only handle a certain range of scaling values, and will
fall back into rotator mode otherwise. However, there is an issue
at the moment with the rotator that leads to one missed frame
when enabling it, and we're better off with GL comp in that
case.

Add some temporary hack to force GPU composition if we detect
that the scaling value is set to a value that would put us into
rotator mode.

Test: Have some animation with a lot of scaling, observe no
jank.
Bug: 72106793
Bug: 64674361
Change-Id: I7eb55947179f4347e93caf572cc926ddbec9df9f
parent 5b15ef66
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -626,9 +626,15 @@ void Layer::setGeometry(const sp<const DisplayDevice>& displayDevice, uint32_t z
        transform = Transform(invTransform) * tr * bufferOrientation;
    }

    // STOPSHIP (b/72106793): If we have less than 25% scaling, HWC usually needs to use the rotator
    // to handle it. However, there is one guaranteed frame of jank when we switch to using the
    // rotator. In the meantime, we force GL composition instead until we have a better fix for the
    // HWC issue.
    bool extremeScaling = abs(t[0][0]) <= 0.25 || abs(t[1][1]) <= 0.25;

    // this gives us only the "orientation" component of the transform
    const uint32_t orientation = transform.getOrientation();
    if (orientation & Transform::ROT_INVALID) {
    if (orientation & Transform::ROT_INVALID || extremeScaling) {
        // we can only handle simple transformation
        hwcInfo.forceClientComposition = true;
    } else {