SystemUI crash with minigbm/gralloc0 (and drmfb-composer)

178 views
Skip to first unread message

Michael Goffioul

unread,
Oct 8, 2019, 9:08:38 PM10/8/19
to andro...@googlegroups.com, android-...@googlegroups.com
In my quest to get Android 10 running on my hardware, I was experimenting with minigbm/gralloc0, using intel's version of minigbm (although I also tried AOSP minigbm with the same result). I encountered a problem whereby the device boots, but SystemUI crashes after a second or two. I tracked down the crash and found something weird, so I figured I might report it, in case it is useful for somebody else.

because mDevice is NULL at that point.

mDevice is supposed to be populated by gralloc_open, which maps to gralloc0_open in minigbm: https://github.com/projectceladon/minigbm/blob/master/cros_gralloc/gralloc0/gralloc0.cc#L175

What's happening is that the module is already initialized, so the code just returns the device structure. But at that point, the device structure is NULL. The reason for this is that the module has already been initialized from gralloc0_register_buffer: https://github.com/projectceladon/minigbm/blob/master/cros_gralloc/gralloc0/gralloc0.cc#L175
However this does not do a full initialization of the module, because it calls gralloc0_init with second argument set to false. So you end up with gralloc module that is only partially initialized. Hilarity ensues.

From the higher-level point of view, both the mapper and allocator HIDL (pass-through) use the gralloc module using some kind of adapter, the mapper ends up calling gralloc0_register_buffer, while the allocator calls gralloc0_open. And it happens that the mapper is used before the allocator.

lambdadroid

unread,
Oct 9, 2019, 8:02:36 AM10/9/19
to android-...@googlegroups.com, andro...@googlegroups.com
On Tue, Oct 08, 2019 at 09:08:13PM -0400, Michael Goffioul wrote:
> In my quest to get Android 10 running on my hardware, I was experimenting
> with minigbm/gralloc0, using intel's version of minigbm (although I also
> tried AOSP minigbm with the same result). I encountered a problem whereby
> the device boots, but SystemUI crashes after a second or two. I tracked
> down the crash and found something weird, so I figured I might report it,
> in case it is useful for somebody else.
>

Does this also happen with Intel's Gralloc1 implementation in minigbm?
Actually, I'm surprised that gralloc0 is working at all using Intel's
minigbm. They abandoned gralloc0 for Gralloc1 long ago and only update
Gralloc1 nowadays.

Michael Goffioul

unread,
Oct 9, 2019, 8:10:24 AM10/9/19
to android-...@googlegroups.com, andro...@googlegroups.com
No, it doesn't happen with gralloc1. Once I worked around the module initialization problem, gralloc0 works fine. I even got  the full codec2 stack to work on my hardware running Android 10.

Reply all
Reply to author
Forward
0 new messages