blob: bd1833c5132583b40916b54578614285bb29f618 [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);
Tatenda Chipeperekwacb2a2432014-08-06 17:45:58 -070046 int getScalingHeight() const { return mScalingHeight; };
47 int getScalingWidth() const { return mScalingWidth; };
Tatenda Chipeperekwa06af9cb2014-08-26 14:51:05 -070048 // We can dump the frame buffer and WB
49 // output buffer by dynamically enabling
50 // dumping via a binder call:
51 // adb shell service call display.qservice 15 i32 3 i32 1
52 static bool sVDDumpEnabled;
53 static void dynamicDebug(bool enable) {sVDDumpEnabled = enable;};
Tatenda Chipeperekwacb2a2432014-08-06 17:45:58 -070054
55private:
56 // These variables store the resolution that WB is being configured to
57 // in the current draw cycle.
58 int mScalingWidth, mScalingHeight;
59 void setMDPScalingMode(hwc_context_t* ctx,
60 private_handle_t* ohnd, int dpy);
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080061};
62
Ramkumar Radhakrishnan8bb48d32013-12-30 23:11:27 -080063}; //namespace
64#endif