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 17 #include "ExynosDeviceModule.h" 18 19 #include "ExynosDisplayDrmInterfaceModule.h" 20 21 extern struct exynos_hwc_control exynosHWCControl; 22 23 using namespace gs101; 24 ExynosDeviceModule()25ExynosDeviceModule::ExynosDeviceModule() : ExynosDevice(), mDisplayColorLoader(DISPLAY_COLOR_LIB) { 26 exynosHWCControl.skipStaticLayers = false; 27 28 std::vector<displaycolor::DisplayInfo> display_info; 29 for (uint32_t i = 0; i < mDisplays.size(); i++) { 30 ExynosDisplay* display = mDisplays[i]; 31 ExynosDisplayDrmInterfaceModule* moduleDisplayInterface = 32 (ExynosDisplayDrmInterfaceModule*)(display->mDisplayInterface.get()); 33 34 if (display->mType == HWC_DISPLAY_PRIMARY) { 35 moduleDisplayInterface->getDisplayInfo(display_info); 36 } 37 } 38 initDisplayColor(display_info); 39 } 40 ~ExynosDeviceModule()41ExynosDeviceModule::~ExynosDeviceModule() { 42 } 43 initDisplayColor(const std::vector<displaycolor::DisplayInfo> & display_info)44int ExynosDeviceModule::initDisplayColor( 45 const std::vector<displaycolor::DisplayInfo>& display_info) { 46 mDisplayColorInterface = mDisplayColorLoader.GetDisplayColorGS101(display_info); 47 if (mDisplayColorInterface == nullptr) { 48 ALOGW("%s failed to load displaycolor", __func__); 49 } 50 51 return NO_ERROR; 52 } 53