diff options
| author | myfluxi <linflux@arcor.de> | 2016-12-02 08:36:12 +0100 |
|---|---|---|
| committer | droidfivex <droidfivex@gmail.com> | 2016-12-04 23:23:05 +0900 |
| commit | eba71d4e39c7406febadb2170b1613d9a364845c (patch) | |
| tree | 9f0618822b553cf84d94d1a42fb3762a7bc37f04 | |
| parent | 934f3e57efba38bb12a6a0d0b6c9035db5186c5e (diff) | |
hammerheadcaf: display: Render cached and dropped layers on GPU
Cached and dropped layers with a negative z-order
that appear visible to the user must be filtered
and sent to the GPU as we are unable to draw these
with MDP composition. Handle remaining layers in
FB cache.
Change-Id: If48b81ac550494099bbe16faa5b09db5cb1148d6
| -rwxr-xr-x | display/libhwcomposer/hwc_mdpcomp.cpp | 23 | ||||
| -rw-r--r-- | display/libhwcomposer/hwc_mdpcomp.h | 1 |
2 files changed, 23 insertions, 1 deletions
diff --git a/display/libhwcomposer/hwc_mdpcomp.cpp b/display/libhwcomposer/hwc_mdpcomp.cpp index 8346337..549d0cd 100755 --- a/display/libhwcomposer/hwc_mdpcomp.cpp +++ b/display/libhwcomposer/hwc_mdpcomp.cpp @@ -366,6 +366,15 @@ bool MDPComp::isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer) { return true; } +bool MDPComp::isDroppedCachedLayer(int index) { + if(mCurrentFrame.isFBComposed[index] + && (mCurrentFrame.layerToMDP[index] < 0) + && mCurrentFrame.drop[index]) { + return true; + } + return false; +} + bool MDPComp::isValidDimension(hwc_context_t *ctx, hwc_layer_1_t *layer) { const int dpy = HWC_DISPLAY_PRIMARY; private_handle_t *hnd = (private_handle_t *)layer->handle; @@ -692,6 +701,10 @@ bool MDPComp::fullMDPComp(hwc_context_t *ctx, hwc_display_contents_1_t* list) { ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__); return false; } + if(isDroppedCachedLayer(numAppLayers-1)) { + reset(ctx); + return false; + } } mCurrentFrame.fbCount = 0; @@ -745,6 +758,10 @@ bool MDPComp::fullMDPCompWithPTOR(hwc_context_t *ctx, ALOGD_IF(isDebug(), "%s: Unsupported layer in list",__FUNCTION__); return false; } + if(isDroppedCachedLayer(numAppLayers-1)) { + reset(ctx); + return false; + } } /* We cannot use this composition mode, if: @@ -976,8 +993,8 @@ bool MDPComp::cacheBasedComp(hwc_context_t *ctx, //If an MDP marked layer is unsupported cannot do partial MDP Comp for(int i = 0; i < numAppLayers; i++) { + hwc_layer_1_t* layer = &list->hwLayers[i]; if(!mCurrentFrame.isFBComposed[i]) { - hwc_layer_1_t* layer = &list->hwLayers[i]; if(not isSupportedForMDPComp(ctx, layer)) { ALOGD_IF(isDebug(), "%s: Unsupported layer in list", __FUNCTION__); @@ -985,6 +1002,10 @@ bool MDPComp::cacheBasedComp(hwc_context_t *ctx, return false; } } + if(isDroppedCachedLayer(numAppLayers-1)) { + reset(ctx); + return false; + } } updateYUV(ctx, list, false /*secure only*/, mCurrentFrame); diff --git a/display/libhwcomposer/hwc_mdpcomp.h b/display/libhwcomposer/hwc_mdpcomp.h index b50219a..f5ff338 100644 --- a/display/libhwcomposer/hwc_mdpcomp.h +++ b/display/libhwcomposer/hwc_mdpcomp.h @@ -221,6 +221,7 @@ protected: hwc_display_contents_1_t* list); void reset(hwc_context_t *ctx); bool isSupportedForMDPComp(hwc_context_t *ctx, hwc_layer_1_t* layer); + bool isDroppedCachedLayer(int index); bool resourceCheck(hwc_context_t *ctx, hwc_display_contents_1_t *list); bool canDoPartialUpdate(hwc_context_t *ctx, hwc_display_contents_1_t* list); // Checks if only videocontent is updating |
