libvppdisplay: backport acquireFenceFd close check from SM-N935S blob to stop potenti...
authorDanny Wood <danwood76@gmail.com>
Thu, 4 Jul 2019 17:39:17 +0000 (18:39 +0100)
committerJan Altensen <info@stricted.net>
Sun, 5 Apr 2020 10:24:52 +0000 (12:24 +0200)
Change-Id: I6459575717a03ae8522e4d083edf0aad49724092

libvppdisplay/ExynosDisplay.cpp

index ea2a6eac1d8a8a2322085abdd28551bf054db208..17bfdebe54aec0f47a26044566f81bf25620f6e3 100644 (file)
@@ -470,6 +470,15 @@ void ExynosDisplay::dupFence(int fence, hwc_display_contents_1_t *contents)
         if (layer.handle != NULL)
             handle = private_handle_t::dynamicCast(layer.handle);
 
+        /* If Fb is not needed and this is a HWC buffer (function reverse engineered from S7 libexynosdisplay.so) */
+        if(!mFbNeeded && layer.compositionType == HWC_FRAMEBUFFER_TARGET) {
+            /* Close the acquire fence Fd if it is valid */
+            if(layer.acquireFenceFd >= 0) {
+                close(layer.acquireFenceFd);
+                layer.acquireFenceFd = -1;
+            }
+        }
+
         if ((mVirtualOverlayFlag == true) && (layer.compositionType == HWC_OVERLAY) &&
                 ((handle != NULL) && (getDrmMode(handle->flags) == NO_DRM)) &&
                 (mFirstFb <= i) && (i <= mLastFb))