From: Jan Altensen <info@stricted.net>
Date: Sun, 4 Aug 2019 01:50:17 +0000 (+0200)
Subject: libhwc: fix compilation
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5526451905da36fd24fee9a2beba3837cb0a80ac;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos.git

libhwc: fix compilation

Change-Id: Ie3a71a213cfce49ae749abbae34b415d2fdb8144
---

diff --git a/libhwc/ExynosHWC.cpp b/libhwc/ExynosHWC.cpp
index 4bda388..9bc1203 100644
--- a/libhwc/ExynosHWC.cpp
+++ b/libhwc/ExynosHWC.cpp
@@ -699,7 +699,6 @@ void *hwc_vsync_thread(void *data)
 int exynos5_blank(struct hwc_composer_device_1 *dev, int disp, int blank)
 {
     ATRACE_CALL();
-    int fence = 0;
     struct exynos5_hwc_composer_device_1_t *pdev =
             (struct exynos5_hwc_composer_device_1_t *)dev;
 #ifdef SKIP_DISPLAY_BLANK_CTRL
@@ -1042,7 +1041,7 @@ int exynos_setActiveConfig(struct hwc_composer_device_1* dev, int disp, int inde
     return -1;
 }
 
-int exynos_setCursorPositionAsync(struct hwc_composer_device_1 *dev, int disp, int x_pos, int y_pos)
+int exynos_setCursorPositionAsync(struct hwc_composer_device_1 *dev __unused, int disp __unused, int x_pos __unused, int y_pos __unused)
 {
     return 0;
 }
@@ -1050,7 +1049,6 @@ int exynos_setCursorPositionAsync(struct hwc_composer_device_1 *dev, int disp, i
 int exynos_setPowerMode(struct hwc_composer_device_1* dev, int disp, int mode)
 {
     ATRACE_CALL();
-    int fence = 0;
     struct exynos5_hwc_composer_device_1_t *pdev =
             (struct exynos5_hwc_composer_device_1_t *)dev;
 #ifdef SKIP_DISPLAY_BLANK_CTRL
@@ -1195,7 +1193,6 @@ int exynos5_open(const struct hw_module_t *module, const char *name,
 {
     int ret = 0;
     int refreshRate;
-    int sw_fd;
 
     if (strcmp(name, HWC_HARDWARE_COMPOSER)) {
         return -EINVAL;
@@ -1569,19 +1566,19 @@ int exynos5_close(hw_device_t *device)
 }
 
 static struct hw_module_methods_t exynos5_hwc_module_methods = {
-    open: exynos5_open,
+    .open = exynos5_open,
 };
 
 hwc_module_t HAL_MODULE_INFO_SYM = {
-    common: {
-        tag: HARDWARE_MODULE_TAG,
-        module_api_version: HWC_MODULE_API_VERSION_0_1,
-        hal_api_version: HARDWARE_HAL_API_VERSION,
-        id: HWC_HARDWARE_MODULE_ID,
-        name: "Samsung exynos5 hwcomposer module",
-        author: "Samsung LSI",
-        methods: &exynos5_hwc_module_methods,
-        dso: 0,
-        reserved: {0},
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .module_api_version = HWC_MODULE_API_VERSION_0_1,
+        .hal_api_version = HARDWARE_HAL_API_VERSION,
+        .id = HWC_HARDWARE_MODULE_ID,
+        .name = "Samsung exynos5 hwcomposer module",
+        .author = "Samsung LSI",
+        .methods = &exynos5_hwc_module_methods,
+        .dso = 0,
+        .reserved = {0},
     }
 };
diff --git a/libhwc/ExynosHWC.h b/libhwc/ExynosHWC.h
index a56a90d..6b05e81 100644
--- a/libhwc/ExynosHWC.h
+++ b/libhwc/ExynosHWC.h
@@ -171,7 +171,6 @@ const size_t NO_FB_NEEDED = NUM_HW_WINDOWS + 1;
 
 #ifndef FIMD_BW_OVERLAP_CHECK
 const size_t MAX_NUM_FIMD_DMA_CH = 2;
-#else
 const int FIMD_DMA_CH_IDX[S3C_FB_MAX_WIN] = {0, 1, 1, 1, 0};
 #endif
 
diff --git a/libvideocodec/Android.mk b/libvideocodec/Android.mk
index 97c2166..346313c 100644
--- a/libvideocodec/Android.mk
+++ b/libvideocodec/Android.mk
@@ -32,6 +32,7 @@ endif
 ifneq ($(filter-out 3.4, $(TARGET_LINUX_KERNEL_VERSION)),)
 LOCAL_CFLAGS += -DCID_SUPPORT
 LOCAL_CFLAGS += -DUSE_DEFINE_H264_SEI_TYPE
+LOCAL_CFLAGS += -DUSE_ORIGINAL_HEADER
 endif
 
 # since 3.18 kernel
diff --git a/libvppdisplay/ExynosDisplay.cpp b/libvppdisplay/ExynosDisplay.cpp
index 546c6b4..ea2a6ea 100644
--- a/libvppdisplay/ExynosDisplay.cpp
+++ b/libvppdisplay/ExynosDisplay.cpp
@@ -2642,7 +2642,11 @@ void ExynosDisplay::determineBandwidthSupport(hwc_display_contents_1_t *contents
                     supportedInternalMPP->mState = MPP_STATE_ASSIGNED;
                     mLayerInfos[fbIndex]->mInternalMPP = supportedInternalMPP;
                     mLayerInfos[fbIndex]->mDmaType = getDeconDMAType(mLayerInfos[fbIndex]->mInternalMPP);
+#if defined(MAX_DECON_DMA_TYPE)
                     if (mLayerInfos[fbIndex]->mDmaType >= MAX_DECON_DMA_TYPE) {
+#else
+                    if (mLayerInfos[fbIndex]->mDmaType >= IDMA_MAX) {
+#endif
                         ALOGE("getDeconDMAType with InternalMPP for FramebufferTarget failed (MPP type: %d, MPP index: %d)",
                                 mLayerInfos[fbIndex]->mInternalMPP->mType, mLayerInfos[fbIndex]->mInternalMPP->mIndex);
                         mLayerInfos[fbIndex]->mDmaType = 0;
@@ -3410,5 +3414,9 @@ int ExynosDisplay::checkConfigValidation(decon_win_config *config)
 
 int ExynosDisplay::setPowerMode(int mode)
 {
+#if defined(S3CFB_POWER_MODE)
     return ioctl(this->mDisplayFd, S3CFB_POWER_MODE, &mode);
+#else
+    return ioctl(this->mDisplayFd, FBIOBLANK, (mode == HWC_POWER_MODE_OFF ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK));
+#endif
 }