| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 1 | /* |
| 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 Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 35 | #include <HwcLayerList.h> |
| 36 | #include <PhysicalDevice.h> |
| 37 | |
| 38 | namespace android { |
| 39 | namespace intel { |
| 40 | |
| 41 | |
| 42 | class PrimaryDevice : public PhysicalDevice { |
| 43 | public: |
| 44 | PrimaryDevice(Hwcomposer& hwc, DisplayPlaneManager& dpm); |
| 45 | virtual ~PrimaryDevice(); |
| 46 | public: |
| Austin Hu | 466748a | 2014-01-23 17:43:41 -0800 | [diff] [blame] | 47 | virtual bool initialize(); |
| 48 | virtual void deinitialize(); |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 49 | |
| Austin Hu | 466748a | 2014-01-23 17:43:41 -0800 | [diff] [blame] | 50 | bool blank(bool blank); |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 51 | protected: |
| 52 | virtual IVsyncControl* createVsyncControl() = 0; |
| 53 | virtual IBlankControl* createBlankControl() = 0; |
| 54 | |
| Austin Hu | 466748a | 2014-01-23 17:43:41 -0800 | [diff] [blame] | 55 | private: |
| 56 | static void repeatedFrameEventListener(void *data); |
| 57 | void repeatedFrameListener(); |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | #endif /* PRIMARY_DEVICE_H */ |