OSDN Git Service

gralloc0_register_buffer: initialize gralloc0 when needed pie-x86
authorMauro Rossi <issor.oruam@gmail.com>
Sat, 18 Apr 2020 08:20:32 +0000 (10:20 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Mon, 20 Apr 2020 08:43:56 +0000 (10:43 +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 ecae6b8..9449e5a 100644 (file)
@@ -245,7 +245,7 @@ static int gralloc0_register_buffer(struct gralloc_module_t const *module, buffe
        auto mod = const_cast<struct gralloc0_module *>(const_module);
 
        if (!mod->initialized)
-               if (gralloc0_init(mod, false))
+               if (gralloc0_init(mod, true))
                        return -ENODEV;
 
        int ret = mod->driver->retain(handle);