| 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 VIRTUAL_DEVICE_H |
| 29 | #define VIRTUAL_DEVICE_H |
| 30 | |
| 31 | |
| 32 | #include <IDisplayDevice.h> |
| Ashish Singhi | 196e5bd | 2013-04-17 18:26:37 -0700 | [diff] [blame^] | 33 | #include "IFrameServer.h" |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 34 | |
| 35 | namespace android { |
| 36 | namespace intel { |
| 37 | |
| 38 | class Hwcomposer; |
| 39 | class DisplayPlaneManager; |
| 40 | |
| Ashish Singhi | 196e5bd | 2013-04-17 18:26:37 -0700 | [diff] [blame^] | 41 | class VirtualDevice : public IDisplayDevice, public BnFrameServer { |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 42 | public: |
| 43 | VirtualDevice(Hwcomposer& hwc, DisplayPlaneManager& dpm); |
| 44 | virtual ~VirtualDevice(); |
| 45 | |
| 46 | public: |
| 47 | virtual bool prePrepare(hwc_display_contents_1_t *display); |
| 48 | virtual bool prepare(hwc_display_contents_1_t *display); |
| 49 | virtual bool commit(hwc_display_contents_1_t *display, |
| Andy Qiu | 4b834ce | 2013-04-09 18:23:20 -0700 | [diff] [blame] | 50 | IDisplayContext *context); |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 51 | |
| 52 | virtual bool vsyncControl(int enabled); |
| 53 | virtual bool blank(int blank); |
| 54 | virtual bool getDisplayConfigs(uint32_t *configs, |
| 55 | size_t *numConfigs); |
| 56 | virtual bool getDisplayAttributes(uint32_t config, |
| 57 | const uint32_t *attributes, |
| 58 | int32_t *values); |
| 59 | virtual bool compositionComplete(); |
| 60 | virtual bool initialize(); |
| 61 | virtual bool isConnected() const; |
| 62 | virtual const char* getName() const; |
| 63 | virtual int getType() const; |
| 64 | virtual void dump(Dump& d); |
| 65 | |
| Ashish Singhi | 196e5bd | 2013-04-17 18:26:37 -0700 | [diff] [blame^] | 66 | // IFrameServer methods |
| 67 | virtual android::status_t start(sp<IFrameTypeChangeListener> frameTypeChangeListener); |
| 68 | virtual android::status_t stop(bool isConnected); |
| 69 | virtual android::status_t notifyBufferReturned(int index); |
| Andy Qiu | 8a42714 | 2013-04-05 17:41:58 -0700 | [diff] [blame] | 70 | protected: |
| 71 | virtual void deinitialize(); |
| 72 | |
| 73 | protected: |
| 74 | bool mInitialized; |
| 75 | Hwcomposer& mHwc; |
| 76 | DisplayPlaneManager& mDisplayPlaneManager; |
| 77 | }; |
| 78 | |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | #endif /* VIRTUAL_DEVICE_H */ |