From 1c569c4d45f89ec05abf8f8fe3a560e68bf39a8e Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 5 Apr 2013 13:44:52 -0700 Subject: Tell HWComposer the dimensions of virtual displays HWComposer queries the HWC for dimensions of physical displays, but can't do that for virtual displays. The dimensions are used to set the display frame of the framebuffer target layer passed to HWC, and implicitly the dimensions of the virtual display. Bug: 8316155 Change-Id: I9cbd2530d2fa878f86128a1472def520b5d694a5 --- services/surfaceflinger/SurfaceFlinger.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9102f5c1f3..a4426cde15 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1187,8 +1187,15 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) state.viewport, state.frame); hw->setDisplayName(state.displayName); mDisplays.add(display, hw); - if (state.type < DisplayDevice::NUM_DISPLAY_TYPES) + if (state.isVirtualDisplay()) { + if (hwcDisplayId >= 0) { + mHwc->setVirtualDisplayProperties(hwcDisplayId, + hw->getWidth(), hw->getHeight(), + hw->getFormat()); + } + } else { mEventThread->onHotplugReceived(state.type, true); + } } } } -- cgit v1.2.3-59-g8ed1b