hqd: virtual display code clean up
Remove V4L2 based virtual display functions as it is
no longer used.
Change-Id: Ibd7685791de6baa1bbf12ffe343443fcd7725269
diff --git a/Android.mk b/Android.mk
index 3fd19c1..772b66e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-display-hals := libgralloc libgenlock libcopybit liblight libvirtual
+display-hals := libgralloc libgenlock libcopybit liblight
display-hals += libhwcomposer liboverlay libqdutils libexternal libqservice
display-hals += libmemtrack
ifeq ($(call is-vendor-board-platform,QCOM),true)
diff --git a/common.mk b/common.mk
index 774050e..44bef71 100644
--- a/common.mk
+++ b/common.mk
@@ -6,7 +6,6 @@
common_includes += $(LOCAL_PATH)/../libhwcomposer
common_includes += $(LOCAL_PATH)/../libexternal
common_includes += $(LOCAL_PATH)/../libqservice
-common_includes += $(LOCAL_PATH)/../libvirtual
ifeq ($(TARGET_USES_POST_PROCESSING),true)
common_flags += -DUSES_POST_PROCESSING
diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk
index ef7778b..c8229a8 100644
--- a/libhwcomposer/Android.mk
+++ b/libhwcomposer/Android.mk
@@ -11,7 +11,7 @@
LOCAL_SHARED_LIBRARIES := $(common_libs) libEGL liboverlay \
libexternal libqdutils libhardware_legacy \
libdl libmemalloc libqservice libsync \
- libbinder libmedia libvirtual
+ libbinder libmedia
ifeq ($(TARGET_USES_QCOM_BSP),true)
LOCAL_SHARED_LIBRARIES += libskia
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 3b480e8..6f4f9c6 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -70,17 +70,6 @@
}
};
-/* In case of non-hybrid WFD session, we are fooling SF by piggybacking on
- * HDMI display ID for virtual. This helper is needed to differentiate their
- * paths in HAL.
- * TODO: Not needed once we have WFD client working on top of Google API's */
-
-static int getDpyforExternalDisplay(hwc_context_t *ctx, int dpy) {
- if(dpy == HWC_DISPLAY_EXTERNAL && ctx->mVirtualonExtActive)
- return HWC_DISPLAY_VIRTUAL;
- return dpy;
-}
-
/*
* Save callback functions registered to HWC
*/
@@ -344,9 +333,8 @@
ctx->mRotMgr->configBegin();
overlay::Writeback::configBegin();
- for (int32_t i = ((int32_t)numDisplays-1); i >=0 ; i--) {
- hwc_display_contents_1_t *list = displays[i];
- int dpy = getDpyforExternalDisplay(ctx, i);
+ for (int32_t dpy = ((int32_t)numDisplays-1); dpy >=0 ; dpy--) {
+ hwc_display_contents_1_t *list = displays[dpy];
resetROI(ctx, dpy);
switch(dpy) {
case HWC_DISPLAY_PRIMARY:
@@ -415,13 +403,6 @@
Locker::Autolock _l(ctx->mDrawLock);
int ret = 0, value = 0;
- /* In case of non-hybrid WFD session, we are fooling SF by
- * piggybacking on HDMI display ID for virtual.
- * TODO: Not needed once we have WFD client working on top
- * of Google API's.
- */
- dpy = getDpyforExternalDisplay(ctx,dpy);
-
ALOGD_IF(BLANK_DEBUG, "%s: %s display: %d", __FUNCTION__,
blank==1 ? "Blanking":"Unblanking", dpy);
if(blank) {
@@ -454,31 +435,12 @@
ctx->dpyAttr[dpy].isActive = !blank;
- if(ctx->mVirtualonExtActive) {
- /* if mVirtualonExtActive is true, display hal will
- * receive unblank calls for non-hybrid WFD solution
- * since we piggyback on HDMI.
- * TODO: Not needed once we have WFD client working on top
- of Google API's */
- break;
- }
case HWC_DISPLAY_VIRTUAL:
- /* There are two ways to reach this block of code.
-
- * Display hal has received unblank call on HWC_DISPLAY_EXTERNAL
- and ctx->mVirtualonExtActive is true. In this case, non-hybrid
- WFD is active. If so, getDpyforExternalDisplay will return dpy
- as HWC_DISPLAY_VIRTUAL.
-
- * Display hal has received unblank call on HWC_DISPLAY_PRIMARY
+ /* Display hal has received unblank call on HWC_DISPLAY_PRIMARY
and since SF is not aware of VIRTUAL DISPLAY being handle by HWC,
it wont send blank / unblank events for it. We piggyback on
PRIMARY DISPLAY events to release mdp pipes and
activate/deactivate VIRTUAL DISPLAY.
-
- * TODO: This separate case statement is not needed once we have
- WFD client working on top of Google API's.
-
*/
if(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected) {
@@ -707,9 +669,8 @@
{
int ret = 0;
hwc_context_t* ctx = (hwc_context_t*)(dev);
- for (int i = 0; i < (int)numDisplays; i++) {
- hwc_display_contents_1_t* list = displays[i];
- int dpy = getDpyforExternalDisplay(ctx, i);
+ for (int dpy = 0; dpy < (int)numDisplays; dpy++) {
+ hwc_display_contents_1_t* list = displays[dpy];
switch(dpy) {
case HWC_DISPLAY_PRIMARY:
ret = hwc_set_primary(ctx, list);
@@ -739,7 +700,6 @@
uint32_t* configs, size_t* numConfigs) {
int ret = 0;
hwc_context_t* ctx = (hwc_context_t*)(dev);
- disp = getDpyforExternalDisplay(ctx, disp);
//in 1.1 there is no way to choose a config, report as config id # 0
//This config is passed to getDisplayAttributes. Ignore for now.
switch(disp) {
@@ -769,7 +729,6 @@
uint32_t /*config*/, const uint32_t* attributes, int32_t* values) {
hwc_context_t* ctx = (hwc_context_t*)(dev);
- disp = getDpyforExternalDisplay(ctx, disp);
//If hotpluggable displays(i.e, HDMI, WFD) are inactive return error
if( (disp != HWC_DISPLAY_PRIMARY) && !ctx->dpyAttr[disp].connected) {
return -1;
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 7d00d9c..d5139f4 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -26,7 +26,6 @@
#include "hwc_fbupdate.h"
#include "mdp_version.h"
#include "external.h"
-#include "virtual.h"
using namespace qdutils;
using namespace overlay;
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 0d968c8..5df0fa0 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -20,7 +20,6 @@
#include "hwc_mdpcomp.h"
#include <sys/ioctl.h>
#include "external.h"
-#include "virtual.h"
#include "qdMetaData.h"
#include "mdp_version.h"
#include "hwc_fbupdate.h"
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index efe6e16..d09411f 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -233,7 +233,7 @@
if (debug_type != IQService::DEBUG_ALL)
break;
case IQService::DEBUG_VD:
- HWCVirtualBase::dynamicDebug(enable);
+ HWCVirtualVDS::dynamicDebug(enable);
if (debug_type != IQService::DEBUG_ALL)
break;
}
diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp
index f887ccc..7061991 100644
--- a/libhwcomposer/hwc_uevents.cpp
+++ b/libhwcomposer/hwc_uevents.cpp
@@ -31,7 +31,6 @@
#include "hwc_copybit.h"
#include "comptype.h"
#include "external.h"
-#include "virtual.h"
#include "hwc_virtual.h"
#include "mdp_version.h"
using namespace overlay;
@@ -62,8 +61,6 @@
{
if(strcasestr("change@/devices/virtual/switch/hdmi", strUdata))
return HWC_DISPLAY_EXTERNAL;
- if(strcasestr("change@/devices/virtual/switch/wfd", strUdata))
- return HWC_DISPLAY_VIRTUAL;
return -1;
}
@@ -99,64 +96,6 @@
return -1;
}
-void handle_pause(hwc_context_t* ctx, int dpy) {
- if(ctx->mHWCVirtual) {
- ctx->mHWCVirtual->pause(ctx, dpy);
- }
- return;
-}
-
-void handle_resume(hwc_context_t* ctx, int dpy) {
- if(ctx->mHWCVirtual) {
- ctx->mHWCVirtual->resume(ctx, dpy);
- }
- return;
-}
-
-static void teardownWfd(hwc_context_t* ctx) {
- // Teardown WFD display
- ALOGD_IF(UEVENT_DEBUG,"Received HDMI connection request when WFD is "
- "active");
- {
- Locker::Autolock _l(ctx->mDrawLock);
- clear(ctx, HWC_DISPLAY_VIRTUAL);
- ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected = false;
- ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = false;
- }
-
- ctx->mVirtualDisplay->teardown();
-
- /* Need to send hotplug only when connected WFD in proprietary path */
- if(ctx->mVirtualonExtActive) {
- ALOGE_IF(UEVENT_DEBUG,"%s: Sending EXTERNAL OFFLINE"
- "hotplug event for wfd display", __FUNCTION__);
- ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL,
- EXTERNAL_OFFLINE);
- {
- Locker::Autolock _l(ctx->mDrawLock);
- ctx->mVirtualonExtActive = false;
- }
- }
-
- if(ctx->mVDSEnabled) {
- ctx->mWfdSyncLock.lock();
- ALOGD_IF(HWC_WFDDISPSYNC_LOG,
- "%s: Waiting for wfd-teardown to be signalled",__FUNCTION__);
- ctx->mWfdSyncLock.wait();
- ALOGD_IF(HWC_WFDDISPSYNC_LOG,
- "%s: Teardown signalled. Completed waiting in uevent thread",
- __FUNCTION__);
- ctx->mWfdSyncLock.unlock();
- } else {
- /*TODO: Remove this else block and have wait rather than usleep
- once wfd module issues binder call on teardown.*/
-
- /* For now, Wait for few frames for SF to tear down the WFD session.*/
- usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period
- * 2 / 1000);
- }
-}
-
static void handle_uevent(hwc_context_t* ctx, const char* udata, int len)
{
bool bpanelReset = getPanelResetStatus(ctx, udata, len);
@@ -191,22 +130,13 @@
ctx->dpyAttr[dpy].connected = false;
ctx->dpyAttr[dpy].isActive = false;
- if(dpy == HWC_DISPLAY_EXTERNAL) {
- ctx->mExtDisplay->teardown();
- } else {
- ctx->mVirtualDisplay->teardown();
- }
+ ctx->mExtDisplay->teardown();
/* We need to send hotplug to SF only when we are disconnecting
- * (1) HDMI OR (2) proprietary WFD session */
- if(dpy == HWC_DISPLAY_EXTERNAL ||
- ctx->mVirtualonExtActive) {
- ALOGE_IF(UEVENT_DEBUG,"%s:Sending EXTERNAL OFFLINE hotplug"
- "event", __FUNCTION__);
- ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL,
- EXTERNAL_OFFLINE);
- ctx->mVirtualonExtActive = false;
- }
+ * HDMI */
+ ALOGE_IF(UEVENT_DEBUG,"%s:Sending EXTERNAL OFFLINE hotplug"
+ "event", __FUNCTION__);
+ ctx->proc->hotplug(ctx->proc, dpy, EXTERNAL_OFFLINE);
break;
}
case EXTERNAL_ONLINE:
@@ -234,62 +164,26 @@
usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period
* 2 / 1000);
- if(dpy == HWC_DISPLAY_EXTERNAL) {
- if(isVDConnected(ctx)) {
- // Do not initiate WFD teardown if WFD architecture is based
- // on VDS mechanism.
- // WFD Stack listens to HDMI intent and initiates virtual
- // display teardown.
- // ToDo: Currently non-WFD Virtual display clients do not
- // involve HWC. If there is a change, we need to come up
- // with mechanism of how to address non-WFD Virtual display
- // clients + HDMI
- if(isVDSEnabled(ctx)) {
- ctx->mWfdSyncLock.lock();
- ALOGD_IF(HWC_WFDDISPSYNC_LOG,
- "%s: Waiting for wfd-teardown to be signalled",
- __FUNCTION__);
- ctx->mWfdSyncLock.wait();
- ALOGD_IF(HWC_WFDDISPSYNC_LOG,
- "%s: Teardown signalled. Completed waiting in"
- "uevent thread", __FUNCTION__);
- ctx->mWfdSyncLock.unlock();
- } else {
- // Triple Display is supported on 8084 target
- // WFD can be initiated by Wfd-client or Settings app
- // 1. wfd-client use hdmi hotplug mechanism.
- // If wfd is connected via wfd-client and if HDMI is
- // connected, we have to teardown wfd session.
- // (as SF support only one active External display
- // at a given time).
- // (ToDo: Once wfd-client migrates using virtual
- // display apis, second condition is redundant).
- // 2. Settings app use virtual display mechanism.
- // In this approach, there is no limitation of
- // supporting triple display.
- if(!(qdutils::MDPVersion::getInstance().is8084() &&
- !ctx->mVirtualonExtActive)) {
- teardownWfd(ctx);
- }
- }
- }
- ctx->mExtDisplay->configure();
- } else {
- {
- Locker::Autolock _l(ctx->mDrawLock);
- /* TRUE only when we are on proprietary WFD session */
- ctx->mVirtualonExtActive = true;
- char property[PROPERTY_VALUE_MAX];
- if((property_get("persist.sys.wfd.virtual",
- property, NULL) > 0) &&
- (!strncmp(property, "1", PROPERTY_VALUE_MAX ) ||
- (!strncasecmp(property,"true", PROPERTY_VALUE_MAX )))) {
- // This means we are on Google's WFD session
- ctx->mVirtualonExtActive = false;
- }
- }
- ctx->mVirtualDisplay->configure();
+ if(isVDConnected(ctx)) {
+ // Do not initiate WFD teardown if WFD architecture is based
+ // on VDS mechanism.
+ // WFD Stack listens to HDMI intent and initiates virtual
+ // display teardown.
+ // ToDo: Currently non-WFD Virtual display clients do not
+ // involve HWC. If there is a change, we need to come up
+ // with mechanism of how to address non-WFD Virtual display
+ // clients + HDMI
+ ctx->mWfdSyncLock.lock();
+ ALOGD_IF(HWC_WFDDISPSYNC_LOG,
+ "%s: Waiting for wfd-teardown to be signalled",
+ __FUNCTION__);
+ ctx->mWfdSyncLock.wait();
+ ALOGD_IF(HWC_WFDDISPSYNC_LOG,
+ "%s: Teardown signalled. Completed waiting in"
+ "uevent thread", __FUNCTION__);
+ ctx->mWfdSyncLock.unlock();
}
+ ctx->mExtDisplay->configure();
Locker::Autolock _l(ctx->mDrawLock);
setup(ctx, dpy);
@@ -297,37 +191,12 @@
ctx->dpyAttr[dpy].connected = true;
ctx->dpyAttr[dpy].isConfiguring = true;
- if(dpy == HWC_DISPLAY_EXTERNAL ||
- ctx->mVirtualonExtActive) {
- /* External display is HDMI or non-hybrid WFD solution */
- ALOGE_IF(UEVENT_DEBUG, "%s: Sending EXTERNAL ONLINE"
- "hotplug event", __FUNCTION__);
- ctx->proc->hotplug(ctx->proc,HWC_DISPLAY_EXTERNAL,
- EXTERNAL_ONLINE);
- } else {
- /* We wont be getting unblank for VIRTUAL DISPLAY and its
- * always guaranteed from WFD stack that CONNECT uevent for
- * VIRTUAL DISPLAY will be triggered before creating
- * surface for the same. */
- ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = true;
- }
+ /* External display is HDMI */
+ ALOGE_IF(UEVENT_DEBUG, "%s: Sending EXTERNAL ONLINE"
+ "hotplug event", __FUNCTION__);
+ ctx->proc->hotplug(ctx->proc, dpy, EXTERNAL_ONLINE);
break;
}
- case EXTERNAL_PAUSE:
- { // pause case
- ALOGD("%s Received Pause event",__FUNCTION__);
- handle_pause(ctx, dpy);
- break;
- }
- case EXTERNAL_RESUME:
- { // resume case
- ALOGD("%s Received resume event",__FUNCTION__);
- //Treat Resume as Online event
- //Since external didnt have any pipes, force primary to give up
- //its pipes; we don't allow inter-mixer pipe transfers.
- handle_resume(ctx, dpy);
- break;
- }
default:
{
ALOGE("%s: Invalid state to swtich:%d", __FUNCTION__, switch_state);
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index e57e573..dcd9cf3 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -38,7 +38,6 @@
#include "hwc_copybit.h"
#include "hwc_dump_layers.h"
#include "external.h"
-#include "virtual.h"
#include "hwc_qclient.h"
#include "QService.h"
#include "comptype.h"
@@ -219,8 +218,7 @@
}
ctx->mExtDisplay = new ExternalDisplay(ctx);
- ctx->mVirtualDisplay = new VirtualDisplay(ctx);
- ctx->mVirtualonExtActive = false;
+ ctx->mHWCVirtual = new HWCVirtualVDS();
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].isActive = false;
ctx->dpyAttr[HWC_DISPLAY_EXTERNAL].connected = false;
ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = false;
@@ -240,14 +238,6 @@
ctx->mViewFrame[HWC_DISPLAY_PRIMARY].bottom =
(int)ctx->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
- ctx->mVDSEnabled = false;
- if((property_get("persist.hwc.enable_vds", value, NULL) > 0)) {
- if(atoi(value) != 0) {
- ctx->mVDSEnabled = true;
- }
- }
- ctx->mHWCVirtual = HWCVirtualBase::getObject(ctx->mVDSEnabled);
-
for (uint32_t i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
ctx->mHwcDebug[i] = new HwcDebug(i);
ctx->mLayerRotMap[i] = new LayerRotMap();
@@ -542,10 +532,7 @@
}
if(ctx->dpyAttr[dpy].mDownScaleMode) {
int extW, extH;
- if(dpy == HWC_DISPLAY_EXTERNAL)
- ctx->mExtDisplay->getAttributes(extW, extH);
- else
- ctx->mVirtualDisplay->getAttributes(extW, extH);
+ ctx->mExtDisplay->getAttributes(extW, extH);
fbWidth = (float)ctx->dpyAttr[dpy].xres;
fbHeight = (float)ctx->dpyAttr[dpy].yres;
//Calculate the position...
@@ -623,10 +610,7 @@
float fbWidth = (float)ctx->dpyAttr[dpy].xres;
float fbHeight = (float)ctx->dpyAttr[dpy].yres;
// query MDP configured attributes
- if(dpy == HWC_DISPLAY_EXTERNAL)
- ctx->mExtDisplay->getAttributes(extW, extH);
- else
- ctx->mVirtualDisplay->getAttributes(extW, extH);
+ ctx->mExtDisplay->getAttributes(extW, extH);
//Calculate the ratio...
float wRatio = ((float)extW)/fbWidth;
float hRatio = ((float)extH)/fbHeight;
@@ -2370,4 +2354,18 @@
return t_roi;
}
+void handle_pause(hwc_context_t* ctx, int dpy) {
+ if(ctx->mHWCVirtual) {
+ ctx->mHWCVirtual->pause(ctx, dpy);
+ }
+ return;
+}
+
+void handle_resume(hwc_context_t* ctx, int dpy) {
+ if(ctx->mHWCVirtual) {
+ ctx->mHWCVirtual->resume(ctx, dpy);
+ }
+ return;
+}
+
};//namespace qhwc
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 98e53a6..51742be 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -68,7 +68,7 @@
class CopyBit;
class HwcDebug;
class AssertiveDisplay;
-class HWCVirtualBase;
+class HWCVirtualVDS;
struct MDPInfo {
@@ -539,7 +539,6 @@
qhwc::IFBUpdate *mFBUpdate[HWC_NUM_DISPLAY_TYPES];
// External display related information
qhwc::ExternalDisplay *mExtDisplay;
- qhwc::VirtualDisplay *mVirtualDisplay;
qhwc::MDPInfo mMDP;
qhwc::VsyncState vstate;
qhwc::DisplayAttributes dpyAttr[HWC_NUM_DISPLAY_TYPES];
@@ -550,7 +549,7 @@
hwc_rect_t mViewFrame[HWC_NUM_DISPLAY_TYPES];
qhwc::AssertiveDisplay *mAD;
eAnimationState mAnimationState[HWC_NUM_DISPLAY_TYPES];
- qhwc::HWCVirtualBase *mHWCVirtual;
+ qhwc::HWCVirtualVDS *mHWCVirtual;
// stores the #numHwLayers of the previous frame
// for each display device
@@ -560,8 +559,6 @@
int deviceOrientation;
//Securing in progress indicator
bool mSecuring;
- //WFD on proprietary stack
- bool mVirtualonExtActive;
//Display in secure mode indicator
bool mSecureMode;
//Lock to protect drawing data structures
@@ -586,10 +583,6 @@
// Downscale feature switch, set via system property
// sys.hwc.mdp_downscale_enabled
bool mMDPDownscaleEnabled;
- // Is WFD enabled through VDS solution ?
- // This can be set via system property
- // persist.hwc.enable_vds
- bool mVDSEnabled;
struct gpu_hint_info mGPUHintInfo;
//App Buffer Composition
bool enableABC;
@@ -627,11 +620,6 @@
ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected);
}
-/* Return true if HWC supports VirtualDisplaySurface mechanism */
-static inline bool isVDSEnabled(hwc_context_t* ctx) {
- return ctx->mVDSEnabled;
-}
-
/* Return Virtual Display connection status */
static inline bool isVDConnected(hwc_context_t* ctx) {
return ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected;
diff --git a/libhwcomposer/hwc_virtual.cpp b/libhwcomposer/hwc_virtual.cpp
index a3a7612..b1dde9d 100644
--- a/libhwcomposer/hwc_virtual.cpp
+++ b/libhwcomposer/hwc_virtual.cpp
@@ -36,19 +36,7 @@
using namespace qhwc;
using namespace overlay;
-bool HWCVirtualBase::sVDDumpEnabled = false;
-HWCVirtualBase* HWCVirtualBase::getObject(bool isVDSEnabled) {
-
- if(isVDSEnabled) {
- ALOGD_IF(HWCVIRTUAL_LOG, "%s: VDS is enabled for Virtual display",
- __FUNCTION__);
- return new HWCVirtualVDS();
- } else {
- ALOGD_IF(HWCVIRTUAL_LOG, "%s: V4L2 is enabled for Virtual display",
- __FUNCTION__);
- return new HWCVirtualV4L2();
- }
-}
+bool HWCVirtualVDS::sVDDumpEnabled = false;
void HWCVirtualVDS::init(hwc_context_t *ctx) {
const int dpy = HWC_DISPLAY_VIRTUAL;
@@ -270,153 +258,3 @@
}
return;
}
-
-/* Implementation for HWCVirtualV4L2 class */
-
-int HWCVirtualV4L2::prepare(hwc_composer_device_1 *dev,
- hwc_display_contents_1_t *list) {
- ATRACE_CALL();
-
- hwc_context_t* ctx = (hwc_context_t*)(dev);
- const int dpy = HWC_DISPLAY_VIRTUAL;
-
- if (LIKELY(list && list->numHwLayers > 1) &&
- ctx->dpyAttr[dpy].isActive &&
- ctx->dpyAttr[dpy].connected) {
- reset_layer_prop(ctx, dpy, (int)list->numHwLayers - 1);
- if(!ctx->dpyAttr[dpy].isPause) {
- ctx->dpyAttr[dpy].isConfiguring = false;
- setListStats(ctx, list, dpy);
- if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) {
- const int fbZ = 0;
- if(not ctx->mFBUpdate[dpy]->prepareAndValidate(ctx, list, fbZ))
- {
- ctx->mOverlay->clear(dpy);
- ctx->mLayerRotMap[dpy]->clear();
- }
- }
- } else {
- /* Virtual Display is in Pause state.
- * Mark all application layers as OVERLAY so that
- * GPU will not compose.
- */
- for(size_t i = 0 ;i < (size_t)(list->numHwLayers - 1); i++) {
- hwc_layer_1_t *layer = &list->hwLayers[i];
- layer->compositionType = HWC_OVERLAY;
- }
- }
- }
- return 0;
-}
-
-int HWCVirtualV4L2::set(hwc_context_t *ctx, hwc_display_contents_1_t *list) {
- ATRACE_CALL();
- int ret = 0;
-
- const int dpy = HWC_DISPLAY_VIRTUAL;
-
- if (LIKELY(list) && ctx->dpyAttr[dpy].isActive &&
- ctx->dpyAttr[dpy].connected &&
- !ctx->dpyAttr[dpy].isPause) {
- uint32_t last = (uint32_t)list->numHwLayers - 1;
- hwc_layer_1_t *fbLayer = &list->hwLayers[last];
- int fd = -1; //FenceFD from the Copybit(valid in async mode)
- bool copybitDone = false;
- if(ctx->mCopyBit[dpy])
- copybitDone = ctx->mCopyBit[dpy]->draw(ctx, list, dpy, &fd);
-
- if(list->numHwLayers > 1)
- hwc_sync(ctx, list, dpy, fd);
-
- // Dump the layers for virtual
- if(ctx->mHwcDebug[dpy])
- ctx->mHwcDebug[dpy]->dumpLayers(list);
-
- if (!ctx->mMDPComp[dpy]->draw(ctx, list)) {
- ALOGE("%s: MDPComp draw failed", __FUNCTION__);
- ret = -1;
- }
-
- private_handle_t *hnd = (private_handle_t *)fbLayer->handle;
- if(copybitDone) {
- hnd = ctx->mCopyBit[dpy]->getCurrentRenderBuffer();
- }
-
- if(hnd) {
- if (!ctx->mFBUpdate[dpy]->draw(ctx, hnd)) {
- ALOGE("%s: FBUpdate::draw fail!", __FUNCTION__);
- ret = -1;
- }
- }
-
- if(!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) {
- ALOGE("%s: display commit fail for %d dpy!", __FUNCTION__, dpy);
- ret = -1;
- }
- }
-
- closeAcquireFds(list);
-
- if (list && list->outbuf && (list->retireFenceFd < 0) ) {
- // SF assumes HWC waits for the acquire fence and returns a new fence
- // that signals when we're done. Since we don't wait, and also don't
- // touch the buffer, we can just handle the acquire fence back to SF
- // as the retire fence.
- list->retireFenceFd = list->outbufAcquireFenceFd;
- }
-
- return ret;
-}
-
-void HWCVirtualV4L2::pause(hwc_context_t* ctx, int dpy) {
- {
- Locker::Autolock _l(ctx->mDrawLock);
- ctx->dpyAttr[dpy].isActive = true;
- ctx->dpyAttr[dpy].isPause = true;
- ctx->proc->invalidate(ctx->proc);
- }
- usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period
- * 2 / 1000);
- // At this point all the pipes used by External have been
- // marked as UNSET.
- {
- Locker::Autolock _l(ctx->mDrawLock);
- // Perform commit to unstage the pipes.
- if (!Overlay::displayCommit(ctx->dpyAttr[dpy].fd)) {
- ALOGE("%s: display commit fail! for %d dpy",
- __FUNCTION__, dpy);
- }
- }
- return;
-}
-
-void HWCVirtualV4L2::resume(hwc_context_t* ctx, int dpy){
- //Treat Resume as Online event
- //Since external didnt have any pipes, force primary to give up
- //its pipes; we don't allow inter-mixer pipe transfers.
- {
- Locker::Autolock _l(ctx->mDrawLock);
-
- // A dynamic resolution change (DRC) can be made for a WiFi
- // display. In order to support the resolution change, we
- // need to reconfigure the corresponding display attributes.
- // Since DRC is only on WiFi display, we only need to call
- // configure() on the VirtualDisplay device.
- //TODO: clean up
- if(dpy == HWC_DISPLAY_VIRTUAL)
- ctx->mVirtualDisplay->configure();
-
- ctx->dpyAttr[dpy].isConfiguring = true;
- ctx->dpyAttr[dpy].isActive = true;
- ctx->proc->invalidate(ctx->proc);
- }
- usleep(ctx->dpyAttr[HWC_DISPLAY_PRIMARY].vsync_period
- * 2 / 1000);
- //At this point external has all the pipes it would need.
- {
- Locker::Autolock _l(ctx->mDrawLock);
- ctx->dpyAttr[dpy].isPause = false;
- ctx->proc->invalidate(ctx->proc);
- }
- return;
-}
diff --git a/libhwcomposer/hwc_virtual.h b/libhwcomposer/hwc_virtual.h
index 5f7b20f..5ca99f7 100644
--- a/libhwcomposer/hwc_virtual.h
+++ b/libhwcomposer/hwc_virtual.h
@@ -22,26 +22,29 @@
#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 {
+class HWCVirtualVDS {
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;
+ HWCVirtualVDS(){};
+ ~HWCVirtualVDS(){};
+ // Chooses composition type and configures pipe for each layer in virtual
+ // display list
+ 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.
+ 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.
+ void init(hwc_context_t *ctx);
+ // Destroys mdpcomp, copybit and fbupdate objects and for virtual display
+ // during virtual display disconnect.
+ void destroy(hwc_context_t *ctx, size_t numDisplays,
+ hwc_display_contents_1_t** displays);
+ void pause(hwc_context_t* ctx, int dpy);
+ void resume(hwc_context_t* ctx, int dpy);
// We can dump the frame buffer and WB
// output buffer by dynamically enabling
// dumping via a binder call:
@@ -50,50 +53,5 @@
static void dynamicDebug(bool enable) {sVDDumpEnabled = enable;};
};
-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);
-};
-
-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
diff --git a/libvirtual/Android.mk b/libvirtual/Android.mk
deleted file mode 100644
index a41ef33..0000000
--- a/libvirtual/Android.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(LOCAL_PATH)/../common.mk
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libvirtual
-LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
-LOCAL_SHARED_LIBRARIES := $(common_libs) liboverlay libqdutils
-LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdvirtual\"
-LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
-LOCAL_SRC_FILES := virtual.cpp
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/libvirtual/virtual.cpp b/libvirtual/virtual.cpp
deleted file mode 100644
index 44d0603..0000000
--- a/libvirtual/virtual.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-* Copyright (c) 2013 The Linux Foundation. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of The Linux Foundation. nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#define DEBUG 0
-#include <ctype.h>
-#include <fcntl.h>
-#include <media/IAudioPolicyService.h>
-#include <media/AudioSystem.h>
-#include <utils/threads.h>
-#include <utils/Errors.h>
-#include <utils/Log.h>
-
-#include <linux/msm_mdp.h>
-#include <linux/fb.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/resource.h>
-#include <cutils/properties.h>
-#include "hwc_utils.h"
-#include "virtual.h"
-#include "overlayUtils.h"
-#include "overlay.h"
-#include "qd_utils.h"
-
-using namespace android;
-using namespace qdutils;
-
-namespace qhwc {
-
-int VirtualDisplay::configure() {
- if(!openFrameBuffer())
- return -1;
-
- if(ioctl(mFd, FBIOGET_VSCREENINFO, &mVInfo) < 0) {
- ALOGD("%s: FBIOGET_VSCREENINFO failed with %s", __FUNCTION__,
- strerror(errno));
- return -1;
- }
- setAttributes();
- return 0;
-}
-
-void VirtualDisplay::getAttributes(int& width, int& height) {
- width = mVInfo.xres;
- height = mVInfo.yres;
-}
-
-int VirtualDisplay::teardown() {
- closeFrameBuffer();
- memset(&mVInfo, 0, sizeof(mVInfo));
- // Reset the resolution when we close the fb for this device. We need
- // this to distinguish between an ONLINE and RESUME event.
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres = 0;
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres = 0;
- return 0;
-}
-
-VirtualDisplay::VirtualDisplay(hwc_context_t* ctx):mFd(-1),
- mHwcContext(ctx)
-{
- memset(&mVInfo, 0, sizeof(mVInfo));
-}
-
-VirtualDisplay::~VirtualDisplay()
-{
- closeFrameBuffer();
-}
-
-/* Initializes the resolution attributes of the virtual display
- that are reported to SurfaceFlinger.
- Cases:
- 1. ONLINE event - initialize to frame buffer resolution
- 2. RESUME event - retain original resolution
-*/
-void VirtualDisplay::initResolution(uint32_t &extW, uint32_t &extH) {
- // On ONLINE event, display resolution attributes are 0.
- if(extW == 0 || extH == 0){
- extW = mVInfo.xres;
- extH = mVInfo.yres;
- }
-}
-
-/* Sets the virtual resolution to match that of the primary
- display in the event that the virtual display currently
- connected has a lower resolution. NB: we always report the
- highest available resolution to SurfaceFlinger.
-*/
-void VirtualDisplay::setToPrimary(uint32_t maxArea,
- uint32_t priW,
- uint32_t priH,
- uint32_t &extW,
- uint32_t &extH) {
- // for eg., primary in 1600p and WFD in 1080p
- // we wont use downscale feature because MAX MDP
- // writeback resolution supported is 1080p (tracked
- // by SUPPORTED_DOWNSCALE_AREA).
- if((maxArea == (priW * priH))
- && (maxArea <= SUPPORTED_DOWNSCALE_AREA)) {
- // tmpW and tmpH will hold the primary dimensions before we
- // update the aspect ratio if necessary.
- uint32_t tmpW = priW;
- uint32_t tmpH = priH;
- // If WFD is in landscape, assign the higher dimension
- // to WFD's xres.
- if(priH > priW) {
- tmpW = priH;
- tmpH = priW;
- }
- // The aspect ratios of the external and primary displays
- // can be different. As a result, directly assigning primary
- // resolution could lead to an incorrect final image.
- // We get around this by calculating a new resolution by
- // keeping aspect ratio intact.
- hwc_rect r = {0, 0, 0, 0};
- qdutils::getAspectRatioPosition(tmpW, tmpH, extW, extH, r);
- extW = r.right - r.left;
- extH = r.bottom - r.top;
- }
-}
-
-/* Set External Display MDP Downscale mode indicator. Only set to
- TRUE for the following scenarios:
- 1. Valid DRC scenarios i.e. when the original WFD resolution
- is greater than the new/requested resolution in mVInfo.
- 2. WFD down scale path i.e. when WFD resolution is lower than
- primary resolution.
- Furthermore, downscale mode is only valid when downscaling from
- SUPPORTED_DOWNSCALE_AREA to a lower resolution.
- (SUPPORTED_DOWNSCALE_AREA represents the maximum resolution that
- we can configure to the virtual display)
-*/
-void VirtualDisplay::setDownScaleMode(uint32_t maxArea) {
- if((maxArea > (mVInfo.xres * mVInfo.yres))
- && (maxArea <= SUPPORTED_DOWNSCALE_AREA)) {
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].mDownScaleMode = true;
- }else {
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].mDownScaleMode = false;
- }
-}
-
-void VirtualDisplay::setAttributes() {
- if(mHwcContext) {
- uint32_t &extW = mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres;
- uint32_t &extH = mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres;
- uint32_t priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
- uint32_t priH = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
-
- // Dynamic Resolution Change depends on MDP downscaling.
- // MDP downscale property will be ignored to exercise DRC use case.
- // If DRC is in progress, ext WxH will have non-zero values.
- bool isDRC = (extW > mVInfo.xres) && (extH > mVInfo.yres);
-
- initResolution(extW, extH);
-
- if(mHwcContext->mOverlay->isUIScalingOnExternalSupported()
- && (mHwcContext->mMDPDownscaleEnabled || isDRC)) {
-
- // maxArea represents the maximum resolution between
- // primary and virtual display.
- uint32_t maxArea = max((extW * extH), (priW * priH));
-
- setToPrimary(maxArea, priW, priH, extW, extH);
-
- setDownScaleMode(maxArea);
- }
- //Initialize the display viewFrame info
- mHwcContext->mViewFrame[HWC_DISPLAY_VIRTUAL].left = 0;
- mHwcContext->mViewFrame[HWC_DISPLAY_VIRTUAL].top = 0;
- mHwcContext->mViewFrame[HWC_DISPLAY_VIRTUAL].right =
- (int)mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].xres;
- mHwcContext->mViewFrame[HWC_DISPLAY_VIRTUAL].bottom =
- (int)mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].yres;
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].vsync_period =
- 1000000000l /60;
- ALOGD_IF(DEBUG,"%s: Setting Virtual Attr: res(%d x %d)",__FUNCTION__,
- mVInfo.xres, mVInfo.yres);
- }
-}
-
-bool VirtualDisplay::openFrameBuffer()
-{
- if (mFd == -1) {
- int fbNum = overlay::Overlay::getInstance()->
- getFbForDpy(HWC_DISPLAY_VIRTUAL);
-
- char strDevPath[qdutils::MAX_SYSFS_FILE_PATH];
- snprintf(strDevPath,sizeof(strDevPath), "/dev/graphics/fb%d", fbNum);
-
- mFd = open(strDevPath, O_RDWR);
- if(mFd < 0) {
- ALOGE("%s: Unable to open %s ", __FUNCTION__,strDevPath);
- return -1;
- }
-
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].fd = mFd;
- }
- return 1;
-}
-
-bool VirtualDisplay::closeFrameBuffer()
-{
- if(mFd >= 0) {
- if(close(mFd) < 0 ) {
- ALOGE("%s: Unable to close FD(%d)", __FUNCTION__, mFd);
- return -1;
- }
- mFd = -1;
- mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].fd = mFd;
- }
- return 1;
-}
-};
diff --git a/libvirtual/virtual.h b/libvirtual/virtual.h
deleted file mode 100644
index a6aec40..0000000
--- a/libvirtual/virtual.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-* Copyright (c) 2013 The Linux Foundation. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of The Linux Foundation. nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#ifndef HWC_VIRTUAL_DISPLAY_H
-#define HWC_VIRTUAL_DISPLAY_H
-
-#include <linux/fb.h>
-
-struct hwc_context_t;
-
-namespace qhwc {
-
-class VirtualDisplay
-{
-public:
- VirtualDisplay(hwc_context_t* ctx);
- ~VirtualDisplay();
- int configure();
- void getAttributes(int& width, int& height);
- int teardown();
- bool isConnected() {
- return mHwcContext->dpyAttr[HWC_DISPLAY_VIRTUAL].connected;
- }
-private:
- bool openFrameBuffer();
- bool closeFrameBuffer();
- void setAttributes();
- void initResolution(uint32_t &extW, uint32_t &extH);
- void setToPrimary(uint32_t maxArea, uint32_t priW, uint32_t priH,
- uint32_t &extW, uint32_t &extH);
- void setDownScaleMode(uint32_t maxArea);
-
- int mFd;
- hwc_context_t *mHwcContext;
- fb_var_screeninfo mVInfo;
-};
-}; //qhwc
-// ---------------------------------------------------------------------------
-#endif //HWC_VIRTUAL_DISPLAY_H