hwc: Common Display HAL to support VDS & V4L2 WFD solutions
1. Define classes for VDS and V4L2 based WFD solutions.
2. Overload the functionalities for VDS and V4L2 WFD solutions.
3. Instantiate VDS object or V4L2 object during hwc init based on the
property persist.hwc.enable_vds set by the user.
4. VDS solution is not verified as it requires some dependent changes.
Change-Id: I74bf944d532da138c850d4ec0c20b4a881489efa
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index fa021cc..bec51d6 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -43,6 +43,7 @@
#include "hwc_qclient.h"
#include "QService.h"
#include "comptype.h"
+#include "hwc_virtual.h"
using namespace qClient;
using namespace qService;
@@ -170,6 +171,7 @@
ctx->mMDPComp[HWC_DISPLAY_PRIMARY] =
MDPComp::getObject(ctx, HWC_DISPLAY_PRIMARY);
ctx->dpyAttr[HWC_DISPLAY_PRIMARY].connected = true;
+ ctx->mHWCVirtual = HWCVirtualBase::getObject();
for (uint32_t i = 0; i < HWC_NUM_DISPLAY_TYPES; i++) {
ctx->mHwcDebug[i] = new HwcDebug(i);
@@ -259,6 +261,10 @@
ctx->mLayerRotMap[i] = NULL;
}
}
+ if(ctx->mHWCVirtual) {
+ delete ctx->mHWCVirtual;
+ ctx->mHWCVirtual = NULL;
+ }
if(ctx->mAD) {
delete ctx->mAD;
ctx->mAD = NULL;
@@ -1143,12 +1149,19 @@
}
void closeAcquireFds(hwc_display_contents_1_t* list) {
- for(uint32_t i = 0; list && i < list->numHwLayers; i++) {
- //Close the acquireFenceFds
- //HWC_FRAMEBUFFER are -1 already by SF, rest we close.
- if(list->hwLayers[i].acquireFenceFd >= 0) {
- close(list->hwLayers[i].acquireFenceFd);
- list->hwLayers[i].acquireFenceFd = -1;
+ if(LIKELY(list)) {
+ for(uint32_t i = 0; i < list->numHwLayers; i++) {
+ //Close the acquireFenceFds
+ //HWC_FRAMEBUFFER are -1 already by SF, rest we close.
+ if(list->hwLayers[i].acquireFenceFd >= 0) {
+ close(list->hwLayers[i].acquireFenceFd);
+ list->hwLayers[i].acquireFenceFd = -1;
+ }
+ }
+ //Writeback
+ if(list->outbufAcquireFenceFd >= 0) {
+ close(list->outbufAcquireFenceFd);
+ list->outbufAcquireFenceFd = -1;
}
}
}
@@ -1207,6 +1220,11 @@
}
//Accumulate acquireFenceFds for MDP
+ if(list->outbufAcquireFenceFd >= 0) {
+ //Writeback output buffer
+ acquireFd[count++] = list->outbufAcquireFenceFd;
+ }
+
for(uint32_t i = 0; i < list->numHwLayers; i++) {
if((list->hwLayers[i].compositionType == HWC_OVERLAY ||
list->hwLayers[i].compositionType == HWC_BLIT) &&
@@ -1847,7 +1865,7 @@
bool canUseRotator(hwc_context_t *ctx, int dpy) {
if(qdutils::MDPVersion::getInstance().is8x26() &&
- ctx->mVirtualDisplay->isConnected() &&
+ isSecondaryConnected(ctx) &&
!ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isPause) {
/* 8x26 mdss driver supports multiplexing of DMA pipe
* in LINE and BLOCK modes for writeback panels.
@@ -1883,6 +1901,15 @@
return false;
}
+//clear prev layer prop flags and realloc for current frame
+void reset_layer_prop(hwc_context_t* ctx, int dpy, int numAppLayers) {
+ if(ctx->layerProp[dpy]) {
+ delete[] ctx->layerProp[dpy];
+ ctx->layerProp[dpy] = NULL;
+ }
+ ctx->layerProp[dpy] = new LayerProp[numAppLayers];
+}
+
void BwcPM::setBwc(hwc_context_t *ctx, const hwc_rect_t& crop,
const hwc_rect_t& dst, const int& transform,
ovutils::eMdpFlags& mdpFlags) {