diff options
author | HyunKyung Kim <hk310.kim@samsung.com> | 2019-03-27 14:14:23 +0900 |
---|---|---|
committer | HyunKyung Kim <hk310.kim@samsung.com> | 2019-10-28 13:49:42 +0900 |
commit | e1d2612e0084267dffd5cb28b2d20bcc0902d4da (patch) | |
tree | f227608e1698f72371b7680a6ef5903520ce9911 /libhwc2.1 | |
parent | 36db95c010409f5a24111fab6db3f8d39f3bf57d (diff) | |
download | gs101-e1d2612e0084267dffd5cb28b2d20bcc0902d4da.tar.gz |
libhwc2.1: Move fb interface specific function
This patch creates ExynosPrimaryDisplayFbInterfaceModule
instead of ExynosDisplayFbInterface.
ExynosPrimaryDisplayFbInterfaceModule implementation can
be different according to chipset.
Implementation setting idma_type is in
ExynosPrimaryDisplayFbInterfaceModule because it is different
according to chipset and it is fb interface specific implementation.
Change-Id: I8816b0bed2769ce9309bf95f19671ece75c3f772
Signed-off-by: HyunKyung Kim <hk310.kim@samsung.com>
Diffstat (limited to 'libhwc2.1')
7 files changed, 97 insertions, 65 deletions
diff --git a/libhwc2.1/Android.mk b/libhwc2.1/Android.mk index f1e488d..b6d043f 100644 --- a/libhwc2.1/Android.mk +++ b/libhwc2.1/Android.mk @@ -18,4 +18,5 @@ LOCAL_SRC_FILES += \ ../../$(TARGET_SOC)/libhwc2.1/libresource/ExynosMPPModule.cpp \ ../../$(TARGET_SOC)/libhwc2.1/libresource/ExynosResourceManagerModule.cpp \ ../../$(TARGET_SOC)/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.cpp \ - ../../$(TARGET_SOC)/libhwc2.1/libvirtualdisplay/ExynosVirtualDisplayModule.cpp + ../../$(TARGET_SOC)/libhwc2.1/libvirtualdisplay/ExynosVirtualDisplayModule.cpp \ + ../../$(TARGET_SOC)/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.cpp diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.cpp b/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.cpp new file mode 100644 index 0000000..ca0cc2f --- /dev/null +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExynosDisplayFbInterfaceModule.h" + +decon_idma_type getDPPChannel(ExynosMPP *otfMPP) { + if (otfMPP == NULL) + return MAX_DECON_DMA_TYPE; + + for (int i=0; i < MAX_DECON_DMA_TYPE; i++){ + if((IDMA_CHANNEL_MAP[i].type == otfMPP->mPhysicalType) && + (IDMA_CHANNEL_MAP[i].index == otfMPP->mPhysicalIndex)) + return IDMA_CHANNEL_MAP[i].channel; + } + return MAX_DECON_DMA_TYPE; +} + +//////////////////////////////////////////////////// ExynosPrimaryDisplayFbInterfaceModule ////////////////////////////////////////////////////////////////// +ExynosPrimaryDisplayFbInterfaceModule::ExynosPrimaryDisplayFbInterfaceModule(ExynosDisplay *exynosDisplay) +: ExynosPrimaryDisplayFbInterface(exynosDisplay) +{ +} + +ExynosPrimaryDisplayFbInterfaceModule::~ExynosPrimaryDisplayFbInterfaceModule() +{ +} + +decon_idma_type ExynosPrimaryDisplayFbInterfaceModule::getDeconDMAType(ExynosMPP *otfMPP) +{ + return getDPPChannel(otfMPP); +} + +//////////////////////////////////////////////////// ExynosExternalDisplayFbInterfaceModule ////////////////////////////////////////////////////////////////// +ExynosExternalDisplayFbInterfaceModule::ExynosExternalDisplayFbInterfaceModule(ExynosDisplay *exynosDisplay) +: ExynosExternalDisplayFbInterface(exynosDisplay) +{ +} + +ExynosExternalDisplayFbInterfaceModule::~ExynosExternalDisplayFbInterfaceModule() +{ +} + +decon_idma_type ExynosExternalDisplayFbInterfaceModule::getDeconDMAType(ExynosMPP *otfMPP) +{ + return getDPPChannel(otfMPP); +} diff --git a/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.h b/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.h new file mode 100644 index 0000000..509c39f --- /dev/null +++ b/libhwc2.1/libdisplayinterface/ExynosDisplayFbInterfaceModule.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef EXYNOS_DISPLAY_FB_INTERFACE_MODULE_H +#define EXYNOS_DISPLAY_FB_INTERFACE_MODULE_H + +#include "ExynosDisplayFbInterface.h" + +mpp_phycal_type_t getMPPTypeFromDPPChannel(uint32_t channel); +class ExynosPrimaryDisplayFbInterfaceModule : public ExynosPrimaryDisplayFbInterface { + public: + ExynosPrimaryDisplayFbInterfaceModule(ExynosDisplay *exynosDisplay); + virtual ~ExynosPrimaryDisplayFbInterfaceModule(); + virtual decon_idma_type getDeconDMAType(ExynosMPP *otfMPP); +}; + +class ExynosExternalDisplayFbInterfaceModule : public ExynosExternalDisplayFbInterface { + public: + ExynosExternalDisplayFbInterfaceModule(ExynosDisplay *exynosDisplay); + virtual ~ExynosExternalDisplayFbInterfaceModule(); + virtual decon_idma_type getDeconDMAType(ExynosMPP *otfMPP); +}; +#endif diff --git a/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.cpp b/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.cpp index bf14c6d..50fe6f8 100644 --- a/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.cpp +++ b/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.cpp @@ -36,26 +36,6 @@ ExynosExternalDisplayModule::~ExynosExternalDisplayModule () } -decon_idma_type ExynosExternalDisplayModule::getDeconDMAType(ExynosMPP *otfMPP) -{ - ExynosDisplay *primary_display = mDevice->getDisplay(HWC_DISPLAY_PRIMARY); - if (primary_display == NULL) { - DISPLAY_LOGE("There is no primary display"); - return MAX_DECON_DMA_TYPE; - } - return primary_display->getDeconDMAType(otfMPP); -} - -ExynosMPP* ExynosExternalDisplayModule::getExynosMPPForDma(decon_idma_type idma) -{ - ExynosDisplay *primary_display = mDevice->getDisplay(HWC_DISPLAY_PRIMARY); - if (primary_display == NULL) { - DISPLAY_LOGE("There is no primary display"); - return NULL; - } - return primary_display->getExynosMPPForDma(idma); -} - int32_t ExynosExternalDisplayModule::validateWinConfigData() { bool flagValidConfig = true; diff --git a/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.h b/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.h index aee6b4f..9e789a0 100644 --- a/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.h +++ b/libhwc2.1/libexternaldisplay/ExynosExternalDisplayModule.h @@ -23,8 +23,6 @@ class ExynosExternalDisplayModule : public ExynosExternalDisplay { public: ExynosExternalDisplayModule(uint32_t type, ExynosDevice *device); ~ExynosExternalDisplayModule(); - virtual decon_idma_type getDeconDMAType(ExynosMPP *otfMPP); - virtual ExynosMPP* getExynosMPPForDma(decon_idma_type idma); virtual int32_t validateWinConfigData(); }; diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp index 584b4ab..1d80105 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.cpp @@ -59,30 +59,6 @@ void ExynosPrimaryDisplayModule::usePreDefinedWindow(bool use) } } -decon_idma_type ExynosPrimaryDisplayModule::getDeconDMAType(ExynosMPP *otfMPP) -{ - return getDPPChannel(otfMPP); -} - -ExynosMPP* ExynosPrimaryDisplayModule::getExynosMPPForDma(decon_idma_type channel) -{ - mpp_phycal_type_t mppType = getMPPTypeFromDPPChannel((uint32_t)channel); - switch (mppType) { - case MPP_DPP_GF: - return ExynosResourceManager::getExynosMPP(MPP_LOGICAL_DPP_GF); - case MPP_DPP_VG: - return ExynosResourceManager::getExynosMPP(MPP_LOGICAL_DPP_VG); - case MPP_DPP_VGS: - return ExynosResourceManager::getExynosMPP(MPP_LOGICAL_DPP_VGS); - case MPP_DPP_VGF: - return ExynosResourceManager::getExynosMPP(MPP_LOGICAL_DPP_VGF); - case MPP_DPP_VGRFS: - return ExynosResourceManager::getExynosMPP(MPP_LOGICAL_DPP_VGRFS); - default: - return NULL; - } -} - int32_t ExynosPrimaryDisplayModule::validateWinConfigData() { bool flagValidConfig = true; @@ -128,16 +104,3 @@ void ExynosPrimaryDisplayModule::doPreProcessing() { mDisplayControl.adjustDisplayFrame = false; } } - -decon_idma_type ExynosPrimaryDisplayModule::getDPPChannel(ExynosMPP *otfMPP) { - if (otfMPP == NULL) - return MAX_DECON_DMA_TYPE; - - for (int i=0; i < MAX_DECON_DMA_TYPE; i++){ - if((IDMA_CHANNEL_MAP[i].type == otfMPP->mPhysicalType) && - (IDMA_CHANNEL_MAP[i].index == otfMPP->mPhysicalIndex)) - return IDMA_CHANNEL_MAP[i].channel; - } - - return MAX_DECON_DMA_TYPE; -} diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h index 5432454..a95813a 100644 --- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h +++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplayModule.h @@ -19,18 +19,13 @@ #include "ExynosDisplay.h" #include "ExynosPrimaryDisplay.h" -mpp_phycal_type_t getMPPTypeFromDPPChannel(uint32_t channel); class ExynosPrimaryDisplayModule : public ExynosPrimaryDisplay { public: ExynosPrimaryDisplayModule(uint32_t type, ExynosDevice *device); ~ExynosPrimaryDisplayModule(); void usePreDefinedWindow(bool use); - virtual decon_idma_type getDeconDMAType(ExynosMPP *otfMPP); - virtual ExynosMPP* getExynosMPPForDma(decon_idma_type idma); virtual int32_t validateWinConfigData(); void doPreProcessing(); - protected: - decon_idma_type getDPPChannel(ExynosMPP *otfMPP); }; #endif |