summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-10-30 20:58:42 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-30 20:58:42 +0000
commitd77021637e28e66be3fcc097b16869df69717df9 (patch)
tree8bf26dbd0b651b7c8a0bdf2e834f340ba58d72fc /services/surfaceflinger/SurfaceFlinger.cpp
parentd23b34b3ac591d2c7bfb58bfc3ab673e775df496 (diff)
parent1f3efb11ff8c884a254f4272f0d1ee0b77ceff2f (diff)
downloadframeworks_native-d77021637e28e66be3fcc097b16869df69717df9.zip
frameworks_native-d77021637e28e66be3fcc097b16869df69717df9.tar.gz
frameworks_native-d77021637e28e66be3fcc097b16869df69717df9.tar.bz2
am 1f3efb11: Don\'t run large virtual displays through HWC
* commit '1f3efb11ff8c884a254f4272f0d1ee0b77ceff2f': Don't run large virtual displays through HWC
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 6b662cb..a19c4df 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1332,7 +1332,22 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
// etc.) but no internal state (i.e. a DisplayDevice).
if (state.surface != NULL) {
- hwcDisplayId = allocateHwcDisplayId(state.type);
+ int width = 0;
+ int status = state.surface->query(
+ NATIVE_WINDOW_WIDTH, &width);
+ ALOGE_IF(status != NO_ERROR,
+ "Unable to query width (%d)", status);
+ int height = 0;
+ status = state.surface->query(
+ NATIVE_WINDOW_HEIGHT, &height);
+ ALOGE_IF(status != NO_ERROR,
+ "Unable to query height (%d)", status);
+ if (MAX_VIRTUAL_DISPLAY_DIMENSION == 0 ||
+ (width <= MAX_VIRTUAL_DISPLAY_DIMENSION &&
+ height <= MAX_VIRTUAL_DISPLAY_DIMENSION)) {
+ hwcDisplayId = allocateHwcDisplayId(state.type);
+ }
+
sp<VirtualDisplaySurface> vds = new VirtualDisplaySurface(
*mHwc, hwcDisplayId, state.surface,
bqProducer, bqConsumer, state.displayName);