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

Commit 137d4bc9 authored by Steven Thomas's avatar Steven Thomas
Browse files

Add a system prop to control shader cache priming

Shader cache priming in surface flinger can take a significant amount of
time at system start, during which the device is basically stuck. Add a
system property to allow devices to disable shader cache priming if they
want.

Bug: 136204746

Test: Added logs locally to confirm setting the prop works as expected:
0 = don't do shader cache priming; any other value = do shader cache
priming. Default value is 1.

Change-Id: Iafd1823bcb6a96d69ca0bc7a4c0b847f8ceb9e77
parent 65495212
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -703,7 +703,11 @@ void SurfaceFlinger::init() {
    // set initial conditions (e.g. unblank default device)
    // set initial conditions (e.g. unblank default device)
    initializeDisplays();
    initializeDisplays();


    char primeShaderCache[PROPERTY_VALUE_MAX];
    property_get("service.sf.prime_shader_cache", primeShaderCache, "1");
    if (atoi(primeShaderCache)) {
        getRenderEngine().primeCache();
        getRenderEngine().primeCache();
    }


    // Inform native graphics APIs whether the present timestamp is supported:
    // Inform native graphics APIs whether the present timestamp is supported: