minui: Handle the failures from the drm backend in gr_init

In a charger mode manual test, we encounter failures from the
MinuiBackendDrm when calling DrmEnableCrtc and Flip. To make the minui
more robust, we should fall back to another backend if drm's SetCrtc
fails. And check the value of gr_draw before dereferencing.

Bug: 80249440
Test: boot to recovery
Change-Id: Ibd1ca1fb1115fe1132684586c54eccd8fb4c3ad9
This commit is contained in:
Tianjie Xu
2018-06-05 17:10:23 -07:00
parent 02ee7bf29d
commit ccf00a2007
3 changed files with 16 additions and 7 deletions
+4
View File
@@ -356,6 +356,10 @@ int gr_init() {
gr_flip();
gr_flip();
if (!gr_draw) {
printf("gr_init: gr_draw becomes nullptr after gr_flip\n");
return -1;
}
gr_rotate(DEFAULT_ROTATION);