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

Commit ea8c7a02 authored by Alec Mouri's avatar Alec Mouri
Browse files

Remove per-display caching toggle

* No one uses it, and just globally toggles caching
* The global toggle broke :(

So fix this by just removing the per-display caching toggle.

Bug: 405288154
Flag: EXEMPT bug fix
Test: adb shell service SurfaceFlinger call 1040 i32 0
Change-Id: Id8e28e3a57db51599b190e1978db0b89607aa612
parent 7d0d256b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ namespace compositionengine::impl::planner {
// as a more efficient representation of parts of the layer stack.
// Implicitly, layer caching must also be enabled for the Planner to have any effect
// E.g., setprop debug.sf.enable_layer_caching 1, or
// adb shell service call SurfaceFlinger 1040 i32 1 [i64 <display ID>]
// adb shell service call SurfaceFlinger 1040 i32 1
class Planner {
public:
    Planner(renderengine::RenderEngine& renderengine);
+6 −19
Original line number Diff line number Diff line
@@ -7018,29 +7018,16 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r
                return NO_ERROR;
            }
            // Toggle caching feature
            // First argument is an int32 - nonzero enables caching and zero disables caching
            // Second argument is an optional uint64 - if present, then limits enabling/disabling
            // caching to a particular physical display
            // First argument is an int32 - nonzero enables caching and zero disables caching for
            // all displays
            case 1040: {
                auto future = mScheduler->schedule([&] {
                    n = data.readInt32();
                    PhysicalDisplayId inputId;
                    if (uint64_t inputDisplayId; data.readUint64(&inputDisplayId) == NO_ERROR) {
                        inputId = PhysicalDisplayId::fromValue(inputDisplayId);
                        if (!getPhysicalDisplayToken(inputId)) {
                            ALOGE("No display with id: %" PRIu64, inputDisplayId);
                            return NAME_NOT_FOUND;
                        }
                    }
                    {
                    Mutex::Autolock lock(mStateLock);
                    mLayerCachingEnabled = n != 0;
                    for (const auto& [_, display] : mDisplays) {
                            if (inputId == display->getPhysicalId()) {
                        display->enableLayerCaching(mLayerCachingEnabled);
                    }
                        }
                    }
                    return OK;
                });