From ccf00a2007a363f5847636f7b53c0c89311e09d4 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 5 Jun 2018 17:10:23 -0700 Subject: 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 --- minui/graphics_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'minui/graphics_drm.h') diff --git a/minui/graphics_drm.h b/minui/graphics_drm.h index de9621205..756625b03 100644 --- a/minui/graphics_drm.h +++ b/minui/graphics_drm.h @@ -42,7 +42,7 @@ class MinuiBackendDrm : public MinuiBackend { private: void DrmDisableCrtc(int drm_fd, drmModeCrtc* crtc); - void DrmEnableCrtc(int drm_fd, drmModeCrtc* crtc, GRSurfaceDrm* surface); + int DrmEnableCrtc(int drm_fd, drmModeCrtc* crtc, GRSurfaceDrm* surface); GRSurfaceDrm* DrmCreateSurface(int width, int height); void DrmDestroySurface(GRSurfaceDrm* surface); void DisableNonMainCrtcs(int fd, drmModeRes* resources, drmModeCrtc* main_crtc); -- cgit v1.2.3