blob: 423e7056f7913426de96a09d9071bdff56fd3c11
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 | // This file is modified by Amlogic, Inc. 2017.01.17. |
17 | */ |
18 | |
19 | #ifndef PRIMARY_DEVICE_H |
20 | #define PRIMARY_DEVICE_H |
21 | |
22 | #include <utils/KeyedVector.h> |
23 | #include <PhysicalDevice.h> |
24 | #include <IComposeDeviceFactory.h> |
25 | |
26 | #define DEVICE_STR_MBOX "MBOX" |
27 | #define DEVICE_STR_TV "TV" |
28 | |
29 | #if PLATFORM_SDK_VERSION >= 26 //8.0 |
30 | #define DISPLAY_CFG_FILE "/vendor/etc/mesondisplay.cfg" |
31 | #else |
32 | #define DISPLAY_CFG_FILE "/system/etc/mesondisplay.cfg" |
33 | #endif |
34 | |
35 | namespace android { |
36 | namespace amlogic { |
37 | |
38 | |
39 | class PrimaryDevice : public PhysicalDevice { |
40 | public: |
41 | PrimaryDevice(Hwcomposer& hwc, IComposeDeviceFactory *composer); |
42 | virtual ~PrimaryDevice(); |
43 | public: |
44 | virtual bool initialize(); |
45 | virtual void deinitialize(); |
46 | virtual int32_t createVirtualDisplay(uint32_t width, uint32_t height, int32_t* format, hwc2_display_t* outDisplay){ return HWC2_ERROR_NONE; } |
47 | virtual int32_t destroyVirtualDisplay(hwc2_display_t display) { return HWC2_ERROR_NONE; } |
48 | virtual int32_t setOutputBuffer(buffer_handle_t buffer, int32_t releaseFence) { return HWC2_ERROR_NONE; } |
49 | |
50 | private: |
51 | |
52 | static void hotplugEventListener(void *data, bool status); |
53 | static void modeChangeEventListener(void *data, bool status); |
54 | void hotplugListener(bool connected); |
55 | int parseConfigFile(); |
56 | |
57 | const char* pConfigPath; |
58 | int mDisplayType; |
59 | bool mSignalHpd; |
60 | }; |
61 | |
62 | } |
63 | } |
64 | |
65 | #endif /* PRIMARY_DEVICE_H */ |
66 |