Files
android_vendor_qcom_opensou…/libhwcomposer/hwc_virtual.h
Tatenda Chipeperekwa 523eac5717 hwc: vds: Add support to dump layers, FB and WB output buffer
1. Add hook to dump the layers going to VDS based virtual display.

2. Furthermore, add utility function to dump the frame buffer and
   WB output buffer. This will be enabled via a system property

   debug.hwc.enable_vds_dump

   Once dumping is enabled, the dumps can be extracted from

   /data/vds.fb.FORMAT.XRESxYRES.raw
   /data/vds.wb.FORMAT.XRESxYRES.raw

   e.g. vds.fb.MDP_RGBA_8888.1152x1920.raw

Change-Id: I2435c5507961a52929411206892c005492d5c193
2014-06-10 10:52:44 -07:00

100 lines
4.0 KiB
C++

/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are retained
* for attribution purposes only.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef HWC_VIRTUAL
#define HWC_VIRTUAL
#include <hwc_utils.h>
#include <virtual.h>
namespace qhwc {
namespace ovutils = overlay::utils;
// Base and abstract class for VDS and V4L2 wfd design.
class HWCVirtualBase {
public:
explicit HWCVirtualBase(){};
virtual ~HWCVirtualBase(){};
// instantiates and returns the pointer to VDS or V4L2 object.
static HWCVirtualBase* getObject(bool isVDSEnabled);
virtual int prepare(hwc_composer_device_1 *dev,
hwc_display_contents_1_t* list) = 0;
virtual int set(hwc_context_t *ctx, hwc_display_contents_1_t *list) = 0;
virtual void init(hwc_context_t *ctx) = 0;
virtual void destroy(hwc_context_t *ctx, size_t numDisplays,
hwc_display_contents_1_t** displays) = 0;
virtual void pause(hwc_context_t* ctx, int dpy) = 0;
virtual void resume(hwc_context_t* ctx, int dpy) = 0;
};
class HWCVirtualVDS : public HWCVirtualBase {
public:
explicit HWCVirtualVDS();
virtual ~HWCVirtualVDS(){};
// Chooses composition type and configures pipe for each layer in virtual
// display list
virtual int prepare(hwc_composer_device_1 *dev,
hwc_display_contents_1_t* list);
// Queues the buffer for each layer in virtual display list and call display
// commit.
virtual int set(hwc_context_t *ctx, hwc_display_contents_1_t *list);
// instantiates mdpcomp, copybit and fbupdate objects and initialize those
// objects for virtual display during virtual display connect.
virtual void init(hwc_context_t *ctx);
// Destroys mdpcomp, copybit and fbupdate objects and for virtual display
// during virtual display disconnect.
virtual void destroy(hwc_context_t *ctx, size_t numDisplays,
hwc_display_contents_1_t** displays);
virtual void pause(hwc_context_t* ctx, int dpy);
virtual void resume(hwc_context_t* ctx, int dpy);
private:
// If WFD is enabled through VDS solution
// we can dump the frame buffer and WB
// output buffer by setting the property
// debug.hwc.enable_vds_dump
bool mVDSDumpEnabled;
};
class HWCVirtualV4L2 : public HWCVirtualBase {
public:
explicit HWCVirtualV4L2(){};
virtual ~HWCVirtualV4L2(){};
// Chooses composition type and configures pipe for each layer in virtual
// display list
virtual int prepare(hwc_composer_device_1 *dev,
hwc_display_contents_1_t* list);
// Queues the buffer for each layer in virtual display list and call
// display commit.
virtual int set(hwc_context_t *ctx, hwc_display_contents_1_t *list);
// instantiates mdpcomp, copybit and fbupdate objects and initialize those
// objects for virtual display during virtual display connect. This function
// is no-op for V4L2 design
virtual void init(hwc_context_t *) {};
// Destroys mdpcomp, copybit and fbupdate objects and for virtual display
// during virtual display disconnect. This function is no-op for V4L2 design
virtual void destroy(hwc_context_t *, size_t ,
hwc_display_contents_1_t** ) {};
virtual void pause(hwc_context_t* ctx, int dpy);
virtual void resume(hwc_context_t* ctx, int dpy);
};
}; //namespace
#endif