• 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 _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 int32_t initDisplayInterface(
32                 std::unique_ptr<ExynosDisplayInterface> &dispInterface) override;
33         virtual void updateRestrictions() override;
34     protected:
35         class ExynosDrmEventHandler : public DrmEventHandler,
36                                       public DrmHistogramEventHandler,
37                                       public DrmTUIEventHandler,
38                                       public DrmPanelIdleEventHandler {
39         public:
40             void handleEvent(uint64_t timestamp_us) override;
41             void handleHistogramEvent(uint32_t crtc_id, void *bin) override;
42             void handleTUIEvent() override;
43             void handleIdleEnterEvent(char const *event) override;
44             void init(ExynosDevice *exynosDevice, DrmDevice *drmDevice);
45 
46         private:
47             ExynosDevice *mExynosDevice;
48             DrmDevice *mDrmDevice;
49         };
50         ResourceManager mDrmResourceManager;
51         DrmDevice *mDrmDevice;
52         ExynosDrmEventHandler mExynosDrmEventHandler;
53 };
54 
55 #endif //_EXYNOSDEVICEDRMINTERFACE_H
56