blob: c54fd5e1a39b531268d160865d7ce1413ed099c9 [file] [log] [blame]
Andy Qiu8a427142013-04-05 17:41:58 -07001/*
2 * Copyright © 2012 Intel Corporation
3 * All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 * IN THE SOFTWARE.
23 *
24 * Authors:
25 * Jackie Li <yaodong.li@intel.com>
26 *
27 */
28#ifndef PRIMARY_DEVICE_H
29#define PRIMARY_DEVICE_H
30
31#include <DisplayPlane.h>
32#include <IVsyncControl.h>
33#include <IBlankControl.h>
34#include <VsyncEventObserver.h>
Andy Qiu8a427142013-04-05 17:41:58 -070035#include <HwcLayerList.h>
36#include <PhysicalDevice.h>
37
38namespace android {
39namespace intel {
40
41
42class PrimaryDevice : public PhysicalDevice {
43public:
44 PrimaryDevice(Hwcomposer& hwc, DisplayPlaneManager& dpm);
45 virtual ~PrimaryDevice();
46public:
Austin Hu466748a2014-01-23 17:43:41 -080047 virtual bool initialize();
48 virtual void deinitialize();
Andy Qiu8a427142013-04-05 17:41:58 -070049
Austin Hu466748a2014-01-23 17:43:41 -080050 bool blank(bool blank);
Andy Qiu8a427142013-04-05 17:41:58 -070051protected:
52 virtual IVsyncControl* createVsyncControl() = 0;
53 virtual IBlankControl* createBlankControl() = 0;
54
Austin Hu466748a2014-01-23 17:43:41 -080055private:
56 static void repeatedFrameEventListener(void *data);
57 void repeatedFrameListener();
Andy Qiu8a427142013-04-05 17:41:58 -070058};
59
60}
61}
62
63#endif /* PRIMARY_DEVICE_H */