From 3133e407c294f9788ae77bebf2405d7862fc9d58 Mon Sep 17 00:00:00 2001
From: Mauro Rossi <issor.oruam@gmail.com>
Date: Sun, 10 Jun 2018 15:47:21 +0200
Subject: [PATCH] HACK: EglMananger: disable EGL_KHR_partial_update code to
 avoid SIGABRT

--------- beginning of crash
04-02 16:13:48.012  2818  2967 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 2967 (RenderThread), pid 2818 (ndroid.systemui)
04-02 16:13:48.031  3028  3028 I crash_dump64: performing dump of process 2818 (target tid = 2967)
04-02 16:13:48.031  3028  3028 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-02 16:13:48.032  3028  3028 F DEBUG   : Build fingerprint: 'Android-x86/android_x86_64/x86_64:8.1.0/OPM5.171019.017/utente04011831:userdebug/test-keys'
04-02 16:13:48.032  3028  3028 F DEBUG   : Revision: '0'
04-02 16:13:48.032  3028  3028 F DEBUG   : ABI: 'x86_64'
04-02 16:13:48.032  3028  3028 F DEBUG   : pid: 2818, tid: 2967, name: RenderThread  >>> com.android.systemui <<<
04-02 16:13:48.032  3028  3028 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-02 16:13:48.032  3028  3028 F DEBUG   : Abort message: 'Failed to set damage region on surface 0x7bdc479ff240, error=EGL_BAD_ACCESS'
---
 libs/hwui/renderthread/EglManager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index bd4708da562..3cf309cdab5 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -396,14 +396,14 @@ Frame EglManager::beginFrame(EGLSurface surface) {
 
 void EglManager::damageFrame(const Frame& frame, const SkRect& dirty) {
 #ifdef EGL_KHR_partial_update
-    if (EglExtensions.setDamage && mSwapBehavior == SwapBehavior::BufferAge) {
+/*  if (EglExtensions.setDamage && mSwapBehavior == SwapBehavior::BufferAge) {
         EGLint rects[4];
         frame.map(dirty, rects);
         if (!eglSetDamageRegionKHR(mEglDisplay, frame.mSurface, rects, 1)) {
             LOG_ALWAYS_FATAL("Failed to set damage region on surface %p, error=%s",
                     (void*)frame.mSurface, eglErrorString());
         }
-    }
+    } code disabled for testing */
 #endif
 }
 
-- 
2.17.1

