summaryrefslogtreecommitdiff
path: root/libhwc2.1/libresource/ExynosResourceManagerModule.h
blob: cf6c4fe0a06b503580e47ea9248b955539226b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (C) 2022 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_RESOURCE_MANAGER_MODULE_ZUMA_H
#define _EXYNOS_RESOURCE_MANAGER_MODULE_ZUMA_H

#include "../../gs201/libhwc2.1/libresource/ExynosResourceManagerModule.h"

namespace zuma {

class ExynosResourceManagerModule : public gs201::ExynosResourceManagerModule {
    public:
        ExynosResourceManagerModule(ExynosDevice *device);
        ~ExynosResourceManagerModule();

        /* TDM (Time-Division Multiplexing) based Resource Management */
        virtual bool isHWResourceAvailable(ExynosDisplay *display, ExynosMPP *currentMPP,
                                           ExynosMPPSource *mppSrc);
        virtual uint32_t setDisplaysTDMInfo();
        virtual uint32_t initDisplaysTDMInfo();
        virtual uint32_t calculateHWResourceAmount(ExynosDisplay *display, ExynosMPPSource *mppSrc);
        virtual int32_t otfMppReordering(ExynosDisplay *display, ExynosMPPVector &otfMPPs,
                                         struct exynos_image &src, struct exynos_image &dst);

        bool isOverlapped(ExynosDisplay *display, ExynosMPPSource *current,
                          ExynosMPPSource *compare);
        uint32_t getAmounts(ExynosDisplay* display, uint32_t currentBlockId, uint32_t currentAXIId,
                            ExynosMPP* compOtfMPP, ExynosMPPSource* curSrc,
                            ExynosMPPSource* compSrc,
                            std::array<uint32_t, TDM_ATTR_MAX>& DPUFAmounts,
                            std::array<uint32_t, TDM_ATTR_MAX>& AXIAmounts);
        bool checkTDMResource(ExynosDisplay *display, ExynosMPP *currentMPP,
                              ExynosMPPSource *mppSrc);
        const std::map<HWResourceIndexes, HWResourceAmounts_t> *mHWResourceTables = nullptr;
        void setupHWResource(const tdm_attr_t &tdmAttrId, const String8 &name,
                             const DPUblockId_t &blkId, const AXIPortId_t &axiId,
                             ExynosDisplay *display, ExynosDisplay *addedDisplay,
                             const ConstraintRev_t &constraintsRev);

    private:
        ConstraintRev_t mConstraintRev;
};

}  // namespace zuma

#endif // _EXYNOS_RESOURCE_MANAGER_MODULE_ZUMA_H