• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 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 //#define LOG_NDEBUG 0
17 #include "ExynosExternalDisplayModule.h"
18 #include "ExynosPrimaryDisplayModule.h"
19 
20 #ifdef USES_VIRTUAL_DISPLAY
21 #include "ExynosVirtualDisplayModule.h"
22 #endif
23 
24 #include "ExynosHWCDebug.h"
25 #include "ExynosHWCHelper.h"
26 
27 #define SKIP_FRAME_COUNT        3
28 
29 using namespace gs101;
30 
ExynosExternalDisplayModule(uint32_t index,ExynosDevice * device,const std::string & displayName)31 ExynosExternalDisplayModule::ExynosExternalDisplayModule(uint32_t index, ExynosDevice *device,
32                                                          const std::string &displayName)
33       : ExynosExternalDisplay(index, device, displayName) {}
34 
~ExynosExternalDisplayModule()35 ExynosExternalDisplayModule::~ExynosExternalDisplayModule ()
36 {
37 
38 }
39 
validateWinConfigData()40 int32_t ExynosExternalDisplayModule::validateWinConfigData()
41 {
42     bool flagValidConfig = true;
43 
44     if (ExynosDisplay::validateWinConfigData() != NO_ERROR)
45         flagValidConfig = false;
46 
47     for (size_t i = 0; i < mDpuData.configs.size(); i++) {
48         struct exynos_win_config_data &config = mDpuData.configs[i];
49         if (config.state == config.WIN_STATE_BUFFER) {
50             bool configInvalid = false;
51             uint32_t mppType = config.assignedMPP->mPhysicalType;
52             if ((config.src.w != config.dst.w) ||
53                 (config.src.h != config.dst.h)) {
54                 if ((mppType == MPP_DPP_GF) ||
55                     (mppType == MPP_DPP_VG) ||
56                     (mppType == MPP_DPP_VGF)) {
57                     DISPLAY_LOGE("WIN_CONFIG error: invalid assign id : %zu,  s_w : %d, d_w : %d, s_h : %d, d_h : %d, mppType : %d",
58                             i, config.src.w, config.dst.w, config.src.h, config.dst.h, mppType);
59                     configInvalid = true;
60                 }
61             }
62             if (configInvalid) {
63                 config.state = config.WIN_STATE_DISABLED;
64                 flagValidConfig = false;
65             }
66         }
67     }
68     if (flagValidConfig)
69         return NO_ERROR;
70     else
71         return -EINVAL;
72 }
73