Backport a few more changes from S7 stock pie blobs
authorDanny Wood <danwood76@gmail.com>
Sun, 21 Jul 2019 14:19:46 +0000 (15:19 +0100)
committerJan Altensen <info@stricted.net>
Sun, 5 Apr 2020 10:24:54 +0000 (12:24 +0200)
Change-Id: I9b4615b4f94ec3c7f02d64c0b5b919d56e7c63c0

libvppdisplay/ExynosDisplay.cpp
libvppdisplay/ExynosDisplay.h

index 61484418aa2d827093a3dd488b6e4580d45054b9..afb6e22f4c3ec98840d086495fd3ae635b509c70 100644 (file)
@@ -427,7 +427,7 @@ int ExynosDisplay::set(hwc_display_contents_1_t *contents)
     if (mType != EXYNOS_SECONDARY_DISPLAY)
     {
 #endif
-    if (err)
+    if (err < 0)
         fence = clearDisplay();
 
     if (fence == 0) {
@@ -456,6 +456,19 @@ int ExynosDisplay::set(hwc_display_contents_1_t *contents)
     }
 #endif
 
+    uint32_t rectCount = 0;
+    for (size_t i = 0; i < contents->numHwLayers; i++) {
+        hwc_layer_1_t &layer = contents->hwLayers[i];
+        if (layer.handle) {
+            private_handle_t *handle = private_handle_t::dynamicCast(layer.handle);
+            if (handle->format == HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV
+                    && rectCount < mOriginFrect.size())
+                layer.sourceCropf = mOriginFrect[rectCount++];
+        }
+    }
+    mOriginFrect.clear();
+    mBackUpFrect.clear();
+
     return err;
 }
 
@@ -2108,18 +2121,6 @@ int ExynosDisplay::postFrame(hwc_display_contents_1_t* contents)
         layer.acquireFenceFd = -1;
         layer.releaseFenceFd = -1;
     }
-    rectCount = 0;
-    for (size_t i = 0; i < contents->numHwLayers; i++) {
-        hwc_layer_1_t &layer = contents->hwLayers[i];
-        if (layer.handle) {
-            private_handle_t *handle = private_handle_t::dynamicCast(layer.handle);
-            if (handle->format == HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_PRIV
-                    && rectCount < mOriginFrect.size())
-                layer.sourceCropf = mOriginFrect[rectCount++];
-        }
-    }
-    mOriginFrect.clear();
-    mBackUpFrect.clear();
 
     if (!this->mVirtualOverlayFlag && (ret >= 0))
         this->mLastFbWindow = mFbWindow;
index 5bd4cbde4e9c0ece33b374edebe82eb8516dd435..b71a72fb34cce6338771d7bac3c1a683b3986276 100644 (file)
@@ -82,6 +82,12 @@ const struct deconFormat {
     {DECON_PIXEL_FORMAT_YVU420, "FORMATYVU420"},
     {DECON_PIXEL_FORMAT_YUV420M, "FORMATYUV420M"},
     {DECON_PIXEL_FORMAT_YVU420M, "FORMATYVU420M"},
+#ifdef DECON_PIXEL_FORMAT_NV12N
+    {DECON_PIXEL_FORMAT_NV12N, "FORMATNV21N"},
+#endif
+#ifdef DECON_PIXEL_FORMAT_NV12N_10B
+    {DECON_PIXEL_FORMAT_NV12N_10B, "FORMATNV21N10B"},
+#endif
 };
 
 enum {