blob: 525ae2a2d97796ffb4937bb7196fd374be06f4b8 [file] [log] [blame]
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 * Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
4 *
5 * Not a Contribution, Apache license notifications and license are retained
6 * for attribution purposes only.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21#ifndef HWC_VIRTUAL
22#define HWC_VIRTUAL
23
24#include <hwc_utils.h>
25
26namespace qhwc {
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080027
Manoj Kumar AVM9591a5e2014-08-21 22:50:21 -070028class HWCVirtualVDS {
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080029public:
Manoj Kumar AVM9591a5e2014-08-21 22:50:21 -070030 HWCVirtualVDS(){};
31 ~HWCVirtualVDS(){};
32 // Chooses composition type and configures pipe for each layer in virtual
33 // display list
34 int prepare(hwc_composer_device_1 *dev,
35 hwc_display_contents_1_t* list);
36 // Queues the buffer for each layer in virtual display list and call display
37 // commit.
38 int set(hwc_context_t *ctx, hwc_display_contents_1_t *list);
39 // instantiates mdpcomp, copybit and fbupdate objects and initialize those
40 // objects for virtual display during virtual display connect.
41 void init(hwc_context_t *ctx);
42 // Destroys mdpcomp, copybit and fbupdate objects and for virtual display
43 // during virtual display disconnect.
44 void destroy(hwc_context_t *ctx, size_t numDisplays,
45 hwc_display_contents_1_t** displays);
46 void pause(hwc_context_t* ctx, int dpy);
47 void resume(hwc_context_t* ctx, int dpy);
Tatenda Chipeperekwacb2a2432014-08-06 17:45:58 -070048 int getScalingHeight() const { return mScalingHeight; };
49 int getScalingWidth() const { return mScalingWidth; };
Tatenda Chipeperekwa06af9cb2014-08-26 14:51:05 -070050 // We can dump the frame buffer and WB
51 // output buffer by dynamically enabling
52 // dumping via a binder call:
53 // adb shell service call display.qservice 15 i32 3 i32 1
54 static bool sVDDumpEnabled;
55 static void dynamicDebug(bool enable) {sVDDumpEnabled = enable;};
Tatenda Chipeperekwacb2a2432014-08-06 17:45:58 -070056
57private:
58 // These variables store the resolution that WB is being configured to
59 // in the current draw cycle.
60 int mScalingWidth, mScalingHeight;
61 void setMDPScalingMode(hwc_context_t* ctx,
62 private_handle_t* ohnd, int dpy);
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080063};
64
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080065}; //namespace
66#endif