1 /* 2 // Copyright (c) 2014 Intel Corporation 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 #ifndef EXTERNAL_DEVICE_H 17 #define EXTERNAL_DEVICE_H 18 19 #include <PhysicalDevice.h> 20 #include <IHdcpControl.h> 21 #include <SimpleThread.h> 22 23 namespace android { 24 namespace intel { 25 26 27 class ExternalDevice : public PhysicalDevice { 28 29 public: 30 ExternalDevice(Hwcomposer& hwc, DeviceControlFactory* controlFactory); 31 virtual ~ExternalDevice(); 32 public: 33 virtual bool initialize(); 34 virtual void deinitialize(); 35 virtual bool setDrmMode(drmModeModeInfo& value); 36 virtual void setRefreshRate(int hz); 37 virtual int getActiveConfig(); 38 virtual bool setActiveConfig(int index); 39 int getRefreshRate(); 40 41 private: 42 static void HdcpLinkStatusListener(bool success, void *userData); 43 void HdcpLinkStatusListener(bool success); 44 void setDrmMode(); 45 protected: 46 IHdcpControl *mHdcpControl; 47 48 private: 49 static void hotplugEventListener(void *data); 50 void hotplugListener(); 51 52 private: 53 Condition mAbortModeSettingCond; 54 drmModeModeInfo mPendingDrmMode; 55 bool mHotplugEventPending; 56 int mExpectedRefreshRate; 57 58 private: 59 DECLARE_THREAD(ModeSettingThread, ExternalDevice); 60 }; 61 62 } 63 } 64 65 #endif /* EXTERNAL_DEVICE_H */ 66