diff options
author | Manoj Kumar AVM <manojavm@codeaurora.org> | 2015-10-02 14:53:50 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-11-02 08:15:21 -0800 |
commit | f8ea9b579653756d5adb1f0f09cec41857923ae8 (patch) | |
tree | 8a4f886c433734640c801a1eac2143b5766118f4 /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | 81c57b314972b8f15e450b71fbafa1c826e914a2 (diff) | |
download | frameworks_native-f8ea9b579653756d5adb1f0f09cec41857923ae8.zip frameworks_native-f8ea9b579653756d5adb1f0f09cec41857923ae8.tar.gz frameworks_native-f8ea9b579653756d5adb1f0f09cec41857923ae8.tar.bz2 |
sf: vds: Avoid HWC for certain scenarios
Reserve HWC for VDS for WFD use case. During WFD usecase, sink usage
will contain GRALLOC_USAGE_PRIVATE_WFD flag.
When HWC is avoided, all virtual displays are composed using GLES.
This means that GLES composes directly into the sink buffer and
signals the consumer. Furthermore, it is expected that any color
conversion will be handled on the consumer side.
CRs-Fixed: 908380
Change-Id: I93ff54c79ece788b6caf3f4172835d8ac1362f62
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 21c8aa5..5f37b0b 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1430,6 +1430,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) if (state.surface != NULL) { int width = 0; + DisplayUtils* displayUtils = DisplayUtils::getInstance(); int status = state.surface->query( NATIVE_WINDOW_WIDTH, &width); ALOGE_IF(status != NO_ERROR, @@ -1442,11 +1443,19 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 || (width <= MAX_VIRTUAL_DISPLAY_DIMENSION && height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) { - hwcDisplayId = allocateHwcDisplayId(state.type); + int usage = 0; + status = state.surface->query( + NATIVE_WINDOW_CONSUMER_USAGE_BITS, &usage); + ALOGW_IF(status != NO_ERROR, + "Unable to query usage (%d)", status); + if ( (status == NO_ERROR) && + displayUtils->canAllocateHwcDisplayIdForVDS(usage)) { + hwcDisplayId = allocateHwcDisplayId(state.type); + } } - DisplayUtils::getInstance()->initVDSInstance(mHwc, hwcDisplayId, - state.surface, dispSurface, producer, bqProducer, bqConsumer, + displayUtils->initVDSInstance(mHwc, hwcDisplayId, state.surface, + dispSurface, producer, bqProducer, bqConsumer, state.displayName, state.isSecure, state.type); } |