1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _EXYNOS_RESOURCE_MANAGER_MODULE_ZUMA_H 18 #define _EXYNOS_RESOURCE_MANAGER_MODULE_ZUMA_H 19 20 #include "../../gs201/libhwc2.1/libresource/ExynosResourceManagerModule.h" 21 22 namespace zuma { 23 24 class ExynosResourceManagerModule : public gs201::ExynosResourceManagerModule { 25 public: 26 ExynosResourceManagerModule(ExynosDevice *device); 27 ~ExynosResourceManagerModule(); 28 29 /* TDM (Time-Division Multiplexing) based Resource Management */ 30 virtual bool isHWResourceAvailable(ExynosDisplay *display, ExynosMPP *currentMPP, 31 ExynosMPPSource *mppSrc); 32 virtual uint32_t setDisplaysTDMInfo(); 33 virtual uint32_t initDisplaysTDMInfo(); 34 virtual uint32_t calculateHWResourceAmount(ExynosDisplay *display, ExynosMPPSource *mppSrc); 35 virtual int32_t otfMppReordering(ExynosDisplay *display, ExynosMPPVector &otfMPPs, 36 struct exynos_image &src, struct exynos_image &dst); 37 38 bool isOverlapped(ExynosDisplay *display, ExynosMPPSource *current, 39 ExynosMPPSource *compare); 40 uint32_t getAmounts(ExynosDisplay* display, uint32_t currentBlockId, uint32_t currentAXIId, 41 ExynosMPP* compOtfMPP, ExynosMPPSource* curSrc, 42 ExynosMPPSource* compSrc, 43 std::array<uint32_t, TDM_ATTR_MAX>& DPUFAmounts, 44 std::array<uint32_t, TDM_ATTR_MAX>& AXIAmounts); 45 bool checkTDMResource(ExynosDisplay *display, ExynosMPP *currentMPP, 46 ExynosMPPSource *mppSrc); 47 const std::map<HWResourceIndexes, HWResourceAmounts_t> *mHWResourceTables = nullptr; 48 void setupHWResource(const tdm_attr_t &tdmAttrId, const String8 &name, 49 const DPUblockId_t &blkId, const AXIPortId_t &axiId, 50 ExynosDisplay *display, ExynosDisplay *addedDisplay, 51 const ConstraintRev_t &constraintsRev); 52 53 private: 54 ConstraintRev_t mConstraintRev; 55 }; 56 57 } // namespace zuma 58 59 #endif // _EXYNOS_RESOURCE_MANAGER_MODULE_ZUMA_H 60