Ramkumar Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 26 | namespace qhwc { |
Ramkumar Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 27 | |
Manoj Kumar AVM | 9591a5e | 2014-08-21 22:50:21 -0700 | [diff] [blame] | 28 | class HWCVirtualVDS { |
Ramkumar Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 29 | public: |
Manoj Kumar AVM | 9591a5e | 2014-08-21 22:50:21 -0700 | [diff] [blame] | 30 | 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 Chipeperekwa | cb2a243 | 2014-08-06 17:45:58 -0700 | [diff] [blame] | 46 | int getScalingHeight() const { return mScalingHeight; }; |
| 47 | int getScalingWidth() const { return mScalingWidth; }; |
Tatenda Chipeperekwa | 06af9cb | 2014-08-26 14:51:05 -0700 | [diff] [blame] | 48 | // 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 Chipeperekwa | cb2a243 | 2014-08-06 17:45:58 -0700 | [diff] [blame] | 54 | |
| 55 | private: |
| 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 Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 61 | }; |
| 62 | |
Ramkumar Radhakrishnan | 8bb48d3 | 2013-12-30 23:11:27 -0800 | [diff] [blame] | 63 | }; //namespace |
| 64 | #endif |