summaryrefslogtreecommitdiff
path: root/hwc2/include/PrimaryDevice.h (plain)
blob: 7cb8fefdeb739f7a8afdbe0dbe6cf0d360eb32c9
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
35namespace android {
36namespace amlogic {
37
38
39class PrimaryDevice : public PhysicalDevice {
40public:
41 PrimaryDevice(Hwcomposer& hwc, IComposeDeviceFactory *composer);
42 virtual ~PrimaryDevice();
43public:
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
50private:
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 void changeModeDetectThread();
57 static void* changeModeDetect(void * data);
58
59 const char* pConfigPath;
60 int mDisplayType;
61};
62
63}
64}
65
66#endif /* PRIMARY_DEVICE_H */
67