blob: 0039497dc6aad61710b244693fc237b0f05e02ec [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 VIRTUAL_DEVICE_H
29#define VIRTUAL_DEVICE_H
30
31
32#include <IDisplayDevice.h>
Ashish Singhi196e5bd2013-04-17 18:26:37 -070033#include "IFrameServer.h"
Andy Qiu8a427142013-04-05 17:41:58 -070034
35namespace android {
36namespace intel {
37
38class Hwcomposer;
39class DisplayPlaneManager;
40
Ashish Singhi196e5bd2013-04-17 18:26:37 -070041class VirtualDevice : public IDisplayDevice, public BnFrameServer {
Andy Qiu8a427142013-04-05 17:41:58 -070042public:
43 VirtualDevice(Hwcomposer& hwc, DisplayPlaneManager& dpm);
44 virtual ~VirtualDevice();
45
46public:
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 Qiu4b834ce2013-04-09 18:23:20 -070050 IDisplayContext *context);
Andy Qiu8a427142013-04-05 17:41:58 -070051
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 Singhi196e5bd2013-04-17 18:26:37 -070066 // 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 Qiu8a427142013-04-05 17:41:58 -070070protected:
71 virtual void deinitialize();
72
73protected:
74 bool mInitialized;
75 Hwcomposer& mHwc;
76 DisplayPlaneManager& mDisplayPlaneManager;
77};
78
79}
80}
81
82#endif /* VIRTUAL_DEVICE_H */