/* * 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. */ #ifndef _EXYNOSDISPLAYINTERFACE_H #define _EXYNOSDISPLAYINTERFACE_H #include #include #include #include "ExynosHWCHelper.h" class ExynosDisplay; using namespace android; class ExynosDisplayInterface { protected: ExynosDisplay *mExynosDisplay = NULL; public: virtual ~ExynosDisplayInterface(); virtual void init(ExynosDisplay* __unused exynosDisplay) {}; virtual int32_t setPowerMode(int32_t __unused mode) {return NO_ERROR;}; virtual int32_t setLowPowerMode() { return HWC2_ERROR_UNSUPPORTED; }; virtual bool isDozeModeAvailable() const { return false; }; virtual int32_t setVsyncEnabled(uint32_t __unused enabled) {return NO_ERROR;}; virtual int32_t getDisplayConfigs( uint32_t* outNumConfigs, hwc2_config_t* outConfigs); virtual void dumpDisplayConfigs() {}; virtual bool supportDataspace(int32_t __unused dataspace) { return true; }; virtual int32_t getColorModes(uint32_t* outNumModes, int32_t* outModes); virtual int32_t setColorMode(int32_t __unused mode) {return NO_ERROR;}; virtual int32_t setActiveConfig(hwc2_config_t __unused config) {return NO_ERROR;}; virtual int32_t setActiveConfigWithConstraints( hwc2_config_t __unused config, bool __unused test = false) {return NO_ERROR;}; virtual int32_t getDisplayVsyncPeriod(hwc2_vsync_period_t* outVsyncPeriod); virtual int32_t getConfigChangeDuration() {return 0;}; virtual int32_t setCursorPositionAsync(uint32_t __unused x_pos, uint32_t __unused y_pos) {return NO_ERROR;}; virtual int32_t updateHdrCapabilities(); virtual int32_t deliverWinConfigData() {return NO_ERROR;}; virtual int32_t clearDisplay(bool __unused needModeClear = false) {return NO_ERROR;}; virtual int32_t disableSelfRefresh(uint32_t __unused disable) {return NO_ERROR;}; virtual int32_t setForcePanic() {return NO_ERROR;}; virtual int getDisplayFd() {return -1;}; virtual uint32_t getMaxWindowNum() {return 0;}; virtual int32_t setColorTransform(const float* __unused matrix, int32_t __unused hint) {return HWC2_ERROR_UNSUPPORTED;} virtual int32_t getRenderIntents(int32_t __unused mode, uint32_t* __unused outNumIntents, int32_t* __unused outIntents) {return 0;} virtual int32_t setColorModeWithRenderIntent(int32_t __unused mode, int32_t __unused intent) {return 0;} virtual int32_t getReadbackBufferAttributes(int32_t* /*android_pixel_format_t*/ outFormat, int32_t* /*android_dataspace_t*/ outDataspace); /* HWC 2.3 APIs */ virtual int32_t getDisplayIdentificationData(uint8_t* __unused outPort, uint32_t* __unused outDataSize, uint8_t* __unused outData) {return 0;} /* frameUpdate: true if the brightness change needs to sync with next frame update */ virtual int32_t updateBrightness(bool __unused syncFrame) { return HWC2_ERROR_UNSUPPORTED; } virtual float getSdrDimRatio() { return 1.0; } bool isPrimary(); /* For HWC 2.4 APIs */ virtual int32_t getVsyncAppliedTime(hwc2_config_t __unused config, int64_t* __unused actualChangeTime) {return NO_ERROR;} virtual void destroyLayer(ExynosLayer* __unused layer){}; virtual int32_t waitVBlank() { return 0; }; public: uint32_t mType = INTERFACE_TYPE_NONE; }; #endif