/* * 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. */ //#define LOG_NDEBUG 0 #include "ExynosExternalDisplayModule.h" #include "ExynosPrimaryDisplayModule.h" #ifdef USES_VIRTUAL_DISPLAY #include "ExynosVirtualDisplayModule.h" #endif #include "ExynosHWCDebug.h" #include "ExynosHWCHelper.h" #define SKIP_FRAME_COUNT 3 using namespace gs101; ExynosExternalDisplayModule::ExynosExternalDisplayModule(uint32_t index, ExynosDevice *device) : ExynosExternalDisplay(index, device) { } ExynosExternalDisplayModule::~ExynosExternalDisplayModule () { } int32_t ExynosExternalDisplayModule::validateWinConfigData() { bool flagValidConfig = true; if (ExynosDisplay::validateWinConfigData() != NO_ERROR) flagValidConfig = false; for (size_t i = 0; i < mDpuData.configs.size(); i++) { struct exynos_win_config_data &config = mDpuData.configs[i]; if (config.state == config.WIN_STATE_BUFFER) { bool configInvalid = false; uint32_t mppType = config.assignedMPP->mPhysicalType; if ((config.src.w != config.dst.w) || (config.src.h != config.dst.h)) { if ((mppType == MPP_DPP_GF) || (mppType == MPP_DPP_VG) || (mppType == MPP_DPP_VGF)) { DISPLAY_LOGE("WIN_CONFIG error: invalid assign id : %zu, s_w : %d, d_w : %d, s_h : %d, d_h : %d, mppType : %d", i, config.src.w, config.dst.w, config.src.h, config.dst.h, mppType); configInvalid = true; } } if (configInvalid) { config.state = config.WIN_STATE_DISABLED; flagValidConfig = false; } } } if (flagValidConfig) return NO_ERROR; else return -EINVAL; }