OSDN Git Service

gralloc0_register_buffer: initialize gralloc0 when needed pie-x86_intel
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 10 May 2020 10:03:49 +0000 (12:03 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Sun, 10 May 2020 11:24:06 +0000 (13:24 +0200)
Based on Michael Goffioul "Always initialize gralloc0 module"
considerign that !mod->initialized defines the condition when it's needed.

Original commit message:
Both mapper and allocator HIDL adapter uses the same gralloc module, but
the mapper HILD does not fully initialize the module, leaving the
allocator HIDL in limbo if the mapper HIDL is called first.

Fixes SystemUI crash on startup.

cros_gralloc/gralloc0/gralloc0.cc

index 2aef42f..ff7fb3c 100644 (file)
@@ -202,7 +202,7 @@ static int gralloc0_register_buffer(struct gralloc_module_t const *module, buffe
        auto mod = (struct gralloc0_module *)module;
 
        if (!mod->initialized)
-               if (gralloc0_init(mod, false))
+               if (gralloc0_init(mod, true))
                        return -ENODEV;
 
        return mod->driver->retain(handle);