1 /* 2 * Copyright (C) 2012 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 EXYNOS_EXTERNAL_DISPLAY_H 18 #define EXYNOS_EXTERNAL_DISPLAY_H 19 20 #include "ExynosDisplay.h" 21 #include <cutils/properties.h> 22 23 #define EXTERNAL_DISPLAY_SKIP_LAYER 0x00000100 24 #define SKIP_EXTERNAL_FRAME 0 25 26 class ExynosExternalDisplay : public ExynosDisplay { 27 public: 28 /* Methods */ 29 ExynosExternalDisplay(uint32_t index, ExynosDevice* device, const std::string& displayName); 30 ~ExynosExternalDisplay(); 31 32 virtual void init(); 33 virtual void deInit(); 34 35 int getDisplayConfigs(uint32_t* outNumConfigs, hwc2_config_t* outConfigs); 36 virtual int enable(); 37 int disable(); 38 39 /* validateDisplay(..., outNumTypes, outNumRequests) 40 * Descriptor: HWC2_FUNCTION_VALIDATE_DISPLAY 41 * HWC2_PFN_VALIDATE_DISPLAY 42 */ 43 virtual int32_t validateDisplay(uint32_t* outNumTypes, uint32_t* outNumRequests); 44 virtual int32_t canSkipValidate(); 45 virtual int32_t presentDisplay(int32_t* outRetireFence); 46 virtual int openExternalDisplay(); 47 virtual void closeExternalDisplay(); 48 virtual int32_t getActiveConfig(hwc2_config_t* outconfig); 49 virtual int32_t startPostProcessing(); 50 setColorTransform(const float *,int32_t)51 virtual int32_t setColorTransform(const float *, int32_t) { return HWC2_ERROR_NONE; } 52 53 virtual int32_t setClientTarget( 54 buffer_handle_t target, 55 int32_t acquireFence, int32_t /*android_dataspace_t*/ dataspace); 56 virtual int32_t setPowerMode(int32_t /*hwc2_power_mode_t*/ mode); 57 virtual void initDisplayInterface(uint32_t interfaceType); 58 bool checkRotate(); 59 bool handleRotate(); 60 virtual void handleHotplugEvent(bool hpdStatus); 61 62 bool mEnabled; 63 bool mBlanked; 64 bool mVirtualDisplayState; 65 bool mIsSkipFrame; 66 int mExternalHdrSupported; 67 Mutex mExternalMutex; 68 69 int mSkipFrameCount; 70 int mSkipStartFrame; 71 72 protected: 73 virtual bool getHDRException(ExynosLayer *layer); 74 private: 75 void reportUsage(bool enabled); 76 }; 77 78 #endif 79 80