• 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 
17 #ifndef _EXYNOSDISPLAYINTERFACE_H
18 #define _EXYNOSDISPLAYINTERFACE_H
19 
20 #include <sys/types.h>
21 #include <hardware/hwcomposer2.h>
22 #include <utils/Errors.h>
23 #include "ExynosHWCHelper.h"
24 
25 class ExynosDisplay;
26 
27 using namespace android;
28 class ExynosDisplayInterface {
29     protected:
30         ExynosDisplay *mExynosDisplay = NULL;
31     public:
32         virtual ~ExynosDisplayInterface();
init(ExynosDisplay * __unused exynosDisplay)33         virtual void init(ExynosDisplay* __unused exynosDisplay) {};
setPowerMode(int32_t __unused mode)34         virtual int32_t setPowerMode(int32_t __unused mode) {return NO_ERROR;};
setLowPowerMode()35         virtual int32_t setLowPowerMode() { return HWC2_ERROR_UNSUPPORTED; };
isDozeModeAvailable()36         virtual bool isDozeModeAvailable() const { return false; };
setVsyncEnabled(uint32_t __unused enabled)37         virtual int32_t setVsyncEnabled(uint32_t __unused enabled) {return NO_ERROR;};
38         virtual int32_t getDisplayConfigs(
39                 uint32_t* outNumConfigs,
40                 hwc2_config_t* outConfigs);
dumpDisplayConfigs()41         virtual void dumpDisplayConfigs() {};
supportDataspace(int32_t __unused dataspace)42         virtual bool supportDataspace(int32_t __unused dataspace) { return true; };
43         virtual int32_t getColorModes(uint32_t* outNumModes, int32_t* outModes);
setColorMode(int32_t __unused mode)44         virtual int32_t setColorMode(int32_t __unused mode) {return NO_ERROR;};
setActiveConfig(hwc2_config_t __unused config)45         virtual int32_t setActiveConfig(hwc2_config_t __unused config) {return NO_ERROR;};
46         virtual int32_t setActiveConfigWithConstraints(
47                 hwc2_config_t __unused config, bool __unused test = false)
48         {return NO_ERROR;};
49         virtual int32_t getDisplayVsyncPeriod(hwc2_vsync_period_t* outVsyncPeriod);
getConfigChangeDuration()50         virtual int32_t getConfigChangeDuration() {return 0;};
needRefreshOnLP()51         virtual bool needRefreshOnLP() { return false; };
setCursorPositionAsync(uint32_t __unused x_pos,uint32_t __unused y_pos)52         virtual int32_t setCursorPositionAsync(uint32_t __unused x_pos,
53                 uint32_t __unused y_pos) {return NO_ERROR;};
54         virtual int32_t updateHdrCapabilities();
deliverWinConfigData()55         virtual int32_t deliverWinConfigData() {return NO_ERROR;};
56         virtual int32_t clearDisplay(bool __unused needModeClear = false) {return NO_ERROR;};
triggerClearDisplayPlanes()57         virtual int32_t triggerClearDisplayPlanes() { return NO_ERROR; }
disableSelfRefresh(uint32_t __unused disable)58         virtual int32_t disableSelfRefresh(uint32_t __unused disable) {return NO_ERROR;};
setForcePanic()59         virtual int32_t setForcePanic() {return NO_ERROR;};
getDisplayFd()60         virtual int getDisplayFd() {return -1;};
getMaxWindowNum()61         virtual uint32_t getMaxWindowNum() {return 0;};
setColorTransform(const float * __unused matrix,int32_t __unused hint)62         virtual int32_t setColorTransform(const float* __unused matrix,
63                 int32_t __unused hint) {return HWC2_ERROR_UNSUPPORTED;}
getRenderIntents(int32_t __unused mode,uint32_t * __unused outNumIntents,int32_t * __unused outIntents)64         virtual int32_t getRenderIntents(int32_t __unused mode, uint32_t* __unused outNumIntents,
65                 int32_t* __unused outIntents) {return 0;}
setColorModeWithRenderIntent(int32_t __unused mode,int32_t __unused intent)66         virtual int32_t setColorModeWithRenderIntent(int32_t __unused mode, int32_t __unused intent) {return 0;}
67         virtual int32_t getReadbackBufferAttributes(int32_t* /*android_pixel_format_t*/ outFormat,
68                 int32_t* /*android_dataspace_t*/ outDataspace);
69         /* HWC 2.3 APIs */
getDisplayIdentificationData(uint8_t * __unused outPort,uint32_t * __unused outDataSize,uint8_t * __unused outData)70         virtual int32_t getDisplayIdentificationData(uint8_t* __unused outPort,
71                 uint32_t* __unused outDataSize, uint8_t* __unused outData) {return 0;}
72         bool isPrimary();
73         /* For HWC 2.4 APIs */
getVsyncAppliedTime(hwc2_config_t __unused config,int64_t * __unused actualChangeTime)74         virtual int32_t getVsyncAppliedTime(hwc2_config_t __unused config, int64_t* __unused actualChangeTime) {return NO_ERROR;}
destroyLayer(ExynosLayer * __unused layer)75         virtual void destroyLayer(ExynosLayer* __unused layer){};
76         /* For HWC 3.0 APIs */
getDisplayIdleTimerSupport(bool & outSupport)77         virtual int32_t getDisplayIdleTimerSupport(bool& outSupport) {
78             outSupport = false;
79             return NO_ERROR;
80         }
getDefaultModeId(int32_t * __unused modeId)81         virtual int32_t getDefaultModeId(int32_t* __unused modeId) {
82             return HWC2_ERROR_UNSUPPORTED;
83         }
getActiveModeId()84         virtual uint32_t getActiveModeId() { return UINT_MAX; }
85 
waitVBlank()86         virtual int32_t waitVBlank() { return 0; };
87 
readHotplugStatus()88         virtual bool readHotplugStatus() { return true; };
89 
90     public:
91         uint32_t mType = INTERFACE_TYPE_NONE;
92 };
93 
94 #endif
95