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 _EXYNOSDEVICEDRMINTERFACE_H 18 #define _EXYNOSDEVICEDRMINTERFACE_H 19 20 #include "resourcemanager.h" 21 #include "ExynosDeviceInterface.h" 22 23 using namespace android; 24 25 class ExynosDevice; 26 class ExynosDeviceDrmInterface : public ExynosDeviceInterface { 27 public: 28 ExynosDeviceDrmInterface(ExynosDevice *exynosDevice); 29 virtual ~ExynosDeviceDrmInterface(); 30 virtual void init(ExynosDevice *exynosDevice) override; 31 virtual void postInit() override; 32 virtual int32_t initDisplayInterface( 33 std::unique_ptr<ExynosDisplayInterface> &dispInterface) override; 34 virtual void updateRestrictions() override; 35 virtual int32_t registerSysfsEventHandler( 36 std::shared_ptr<DrmSysfsEventHandler> handler) override; 37 virtual int32_t unregisterSysfsEventHandler(int sysfsFd) override; 38 39 protected: 40 class ExynosDrmEventHandler : public DrmEventHandler, 41 public DrmHistogramEventHandler, 42 public DrmHistogramChannelEventHandler, 43 public DrmTUIEventHandler, 44 public DrmPanelIdleEventHandler { 45 public: 46 void handleEvent(uint64_t timestamp_us) override; 47 void handleHistogramEvent(uint32_t crtc_id, void *bin) override; 48 void handleHistogramChannelEvent(void *event) override; 49 void handleTUIEvent() override; 50 void handleIdleEnterEvent(char const *event) override; 51 void init(ExynosDevice *exynosDevice, DrmDevice *drmDevice); 52 53 private: 54 ExynosDevice *mExynosDevice; 55 DrmDevice *mDrmDevice; 56 }; 57 ResourceManager mDrmResourceManager; 58 DrmDevice *mDrmDevice; 59 ExynosDrmEventHandler mExynosDrmEventHandler; 60 }; 61 62 #endif //_EXYNOSDEVICEDRMINTERFACE_H 63