History log of /frameworks/native/services/surfaceflinger/DisplayDevice.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4f20f9cf3268dad96d9064dcb0e4a11aae96f6f3 06-Apr-2017 Courtney Goeltzenleuchter <courtneygo@google.com> ifdef HWC2 functionality

Fix build issue for devices that are not using HWC2.
Test: lunch hikey-userdebug; make

Change-Id: I47e9aa09b8db3f0dca6d733e2c8f3b59c45547b2
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
ebeed4917b6a341a6287141f3755a750ab4431cb 06-Apr-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Make sure all HWC2 functionality is ifdef'd

Fix build issue for devices that are not using HWC2.
Test: lunch bat_land, make

Change-Id: If94222cd00f2c8b0b1f7a464ad0378224fc059e7
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
5d94389241cc651e6bd327ab80eba3ad476f3724 22-Mar-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Add wide-color support to SurfaceFlinger

Test: manual testing
Bug: 29940137

Change-Id: I9358b3c982e0205e598fd20cbf8d2e956591b3ac
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
1971b63aa4d82db37794f19e0eb01feb1826e422 10-Mar-2017 Fabien Sanglard <sanglardf@google.com> Use max acquired buffer setting to configStore

Change-Id: I48454243bcac12f5a83d080cd9115686f9f728ca
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
62caf7cf7620d89a80247abc786b437597fbcbfb 14-Mar-2017 Courtney Goeltzenleuchter <courtneygo@google.com> Set default color mode to trigger update

Start with invalid color mode so that we are sure
to call downstream for any setColorMode.

Test: manually verify display is in sRGB mode
Change-Id: Iaf511fac1e4cd8acef149528877188708c96856f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
720a72479292406b821cbb17b93e6e1659ce0c3e 31-Jan-2017 Jaesoo Lee <jaesoo@google.com> configstore: removing BoardConfig variables (NUM_FRAMEBUFFER_SURFACE_BUFFERS)

This change removes the use of NUM_FRAMEBUFFER_SURFACE_BUFFERS from
SurfaceFlinger.

Instead of using it, the implementation is changed so that it retrieves
corresponding configuration value (useTripleFramebuffer) from
configstore.

Design doc: go/design-confighal
Bug: 34723491
Test: build, run, log message "SurfaceFlinger FrameBuffer: ?" should be seen.

Change-Id: If6f6d13738d894b4880f42576f4ce8220b4a8bef
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
9d96de49673cb6c916bfb797aad4f4e024ea73ca 11-Oct-2016 Fabien Sanglard <sanglardf@google.com> Revert "Delete HWC1"

This reverts commit 90f923493fa053655a203c34ea491086aeb07602.

Change-Id: If9da49e3bc85f8ff21ac1bd22a6bab97e9aa3103
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
90f923493fa053655a203c34ea491086aeb07602 03-Oct-2016 Fabien Sanglard <sanglardf@google.com> Delete HWC1

After 10 years of good service, HWC1 is not needed anymore since HWC2
is now mandatory.

Change-Id: I5768b50c89854688ba31032f01ea231699393e5b
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
ffc9efc4b55df38ac524f20cdd1a2fca8e259fae 28-Jul-2016 Irvel <irvel@google.com> Add display tracing to SurfaceInterceptor

Change-Id: Iaae5a840ca7dca7a9a70dde1ccab0fa3944cd863
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
28f24d0ab481bd9c6fd5618414fee694e837c5c6 12-Jul-2016 Michael Wright <michaelwr@google.com> Color transforms are now color modes.

Rename color transforms to color modes for all interfaces exposed to
surfaceflinger clients. Also split it out to be a separate
configuration value from display modes.

Bug: 29044347

Change-Id: I87e937f7c954a50c946e8e2c606797caa416c5d8
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
021623b5a82e44e8dc1a7def1abfed351187593c 16-Apr-2016 Pablo Ceballos <pceballos@google.com> SF: Fix camera orientation on virtual displays

Camera uses NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY to make the camera
preview always look upright on the device display. This commit changes
the behavior of this flag slightly. Instead of applying the inverse
transform of the current display when compositing, apply the inverse
transform of the primary display to all displays. This assumes that
the camera orientation is tied to the primary display.

Bug 2628180

Change-Id: I0da22423490a93fe943fd59e6c122aa6aaf30b11
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
40845df1285b387bcbf8f43ac72228eee2606d80 26-Jan-2016 Pablo Ceballos <pceballos@google.com> SF: Add FenceTracker

FenceTracker tracks all fences in SurfaceFlinger. These timestamps
could be used for debugging, profiling, or be exposed to the
application.

Change-Id: I4297a661c0a7530e744168ac7a2a66c4bca92fd5
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
9e56aa0fdb5f7121b9b975c6c16db103ea4d2fe9 02-Nov-2015 Dan Stoza <stoza@google.com> Switch SurfaceFlinger to HWC 2.0

Enables SurfaceFlinger to speak to version 2.0 of the Hardware Composer
HAL instead of version 1.x (also removing support for the framebuffer
HAL). By default, however, this functionality is disabled. In order to
enable it, USE_HWC2 must be set to true in Android.mk.

Change-Id: I4589e02ac2165236b10ff2f7cb772f87e0d3daab
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
b5b3563058c178811d434ab6e8c4ead4a519701b 23-Feb-2016 Pablo Ceballos <pceballos@google.com> SF: check secure layers in screenshot message handler

- Instead of checking for the presence of secure layers on the Binder
thread, check in the message handler. Transactions may have occurred
in between when the check is done and when the screen shot message
is handled.

Bug 23757877

Change-Id: Iec74193996ca72c60f86f7c0f0b2a5dea8d19543
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
5e8eb5ead16fa1136d769d7f8625b882e6465afc 01-Dec-2015 james.zhang <james.zhang@spreadtrum.com> bug#460672 framebuffer surface can't keep triple buffer if define NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3

[root cause ] framebuffer surface is in the same process of surface flinger
[changes ] call IGraphicBufferProducer::allocateBuffers on producer inside the DisplayDevice constructor to force-allocate all three buffers.
[side effects] none
[self test ]<tshark, enter and exit mainmenu>: ok
[reviewers ] zhongjun.chen
[change_type ] AOB --> google_original
[tag_product ] common

Change-Id: Ideb75d3aa1ed23b2fa4d263a120ea3ca39d01361
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
41a0ef3e28c4d2494f6cdd1c831dd3ded7c5af4a 14-Nov-2014 Dan Albert <danalbert@google.com> resolved conflicts for merge of 4037c458 to master

Change-Id: I8a2e73b7ba48b790054e0ab99f81b2693244389e
89fd4f7fa6bd17ce5400979c3b9e5ba0bf7e919e 13-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/native: Wall Werror in surfaceflinger

Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
f10c46ef855b6410b20ebd8b1351d4d78d8eca8e 11-Nov-2014 Dan Stoza <stoza@google.com> Enable clang for libui/libgui/surfaceflinger

Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
c3ebe66b49cfba035e1fd0e160a13db38eb81b0e 05-Sep-2014 Riley Andrews <riandrews@google.com> Add rotation to surfaceflingers screen cap.

+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d4548dd0272f5a4edee1d7ff070458728848b35c 20-Aug-2014 Jesse Hall <jessehall@google.com> am 514e30a9: am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev

* commit '514e30a96cefad109509ce01622fa7f82f3f318c':
surfaceflinger: skip composition for empty frames
514e30a96cefad109509ce01622fa7f82f3f318c 20-Aug-2014 Jesse Hall <jessehall@google.com> am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev

* commit 'c3d1889e508038efe240ed1974ed377a2e12835c':
surfaceflinger: skip composition for empty frames
f2568dea419562ad75b2e79dcbd358af34e9f8ad 20-Aug-2014 Michael Lentine <mlentine@google.com> Destroy eglSurface before recreating.

Bug: 16856208

Change-Id: Ifb5c8997afab4bc922356a3542d1f899a2546855
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
b7a0549c983bef103ce07eb3af5905febc6e538e 15-Aug-2014 Jesse Hall <jessehall@google.com> surfaceflinger: skip composition for empty frames

By not committing the results of composition for empty frames, we
avoid spitting out series of black frames for virtual displays that
don't have visible layers. We still draw one black frame when going
from having layers to not having any. In particular, this avoids
having a series of empty frames due to re-compositing the primary
display in the period between creating the virtual display and adding
layers to it.

Bug: 16786752
Change-Id: I7e9b2ed2e407d8d49c7af736b447d4c6181b0ad8
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
47e45405d1533aa73307014f7bf371e118695cf3 19-Jul-2014 Michael Lentine <mlentine@google.com> Allow for resizing of Virtual Displays.

Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.

Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
6c9e34a98a63033b80bd1c24c7aa1304f912f10a 14-Jul-2014 Michael Lentine <mlentine@google.com> Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.

This can be used to change the current display mode of the device.

Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa94635a96d653038fb389a0dd827338f8d3)
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
2c9b11f0291210c9b9513a1a0cce6afebd361b3b 25-May-2014 Prashant Malani <pmalani@google.com> surfaceflinger: Replace blank/unblank with setPowerMode

We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.

Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.

Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL

HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.

If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.

As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.

We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.

Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
c18790018be5d7ea7061ccbc81f3044e74adc823 23-May-2014 Dan Stoza <stoza@google.com> SurfaceFlinger: Add sourceCrop to screenshot

Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.

Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
bba1385d1cfdbe80d7e5f441d943edd4c5708eca 23-Apr-2014 Dan Stoza <stoza@google.com> am f3c07d4f: Fix virtual display nesting

* commit 'f3c07d4f70f33c2fe5b14ca8fbcdfa4133cc72c7':
Fix virtual display nesting
f3c07d4f70f33c2fe5b14ca8fbcdfa4133cc72c7 05-Feb-2014 Dan Stoza <stoza@google.com> Fix virtual display nesting

This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

(cherry-pick from master I600365c0fd5d3ad93e04295d26cf9de177ffc79b)

Bug: 12101046
Change-Id: I6182993d53537781aedb522f97a50f06eed8b80f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
55886cb12828a2cb57b82efaf30050ea9dc418bb 08-Mar-2014 Greg Hackmann <ghackmann@google.com> am 7429e4f7: am 112aa42e: Merge "SurfaceFlinger: fix 64-bit format string warnings"

* commit '7429e4f7d43cd42563ce77a3a4a861a392bc750f':
SurfaceFlinger: fix 64-bit format string warnings
86efcc0cbc1d94250b72ef1f2ea8700a04cd2781 07-Mar-2014 Greg Hackmann <ghackmann@google.com> SurfaceFlinger: fix 64-bit format string warnings

Change-Id: Idacfbf0601743fba1c5de7632201a66a307a2710
Signed-off-by: Greg Hackmann <ghackmann@google.com>
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
a9d27063a1d5586116acb50c5a37ff29684993eb 25-Feb-2014 Jesse Hall <jessehall@google.com> am 9d65631f: am c9bf3ba4: Merge "Virtual Display async mode is overridden"

* commit '9d65631f5de153b50331d9f63225fe60ba70f8bc':
Virtual Display async mode is overridden
4ee5696dfbcea1078b24e7c089de74e7cf4e55ca 21-Feb-2014 John Dong <johnd@broadcom.com> Virtual Display async mode is overridden

Virtual Display async setting is overridden by eglApi.c causing
stall during composition.

Set the async mode after eglCreateWindowSurface()

b/13139121

Change-Id: I336ca145552e387217cd8bea6e4b7f5f490a274d
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
c701401f8cec2e5309f8b57e2b97baced5093274 15-Feb-2014 Dan Stoza <stoza@google.com> Allow disabling layer rotation during screenshots

Add the ability to ignore layers' transformation matrices during
screenshot capture, which will allow the window manager to capture
unrotated images for recents during the device rotation animation.

Bug: 11805195
Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
7143316af216fa92c31a60d4407b707637382da1 05-Feb-2014 Dan Stoza <stoza@google.com> Fix virtual display nesting

This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

Bug: 12101046
Change-Id: I600365c0fd5d3ad93e04295d26cf9de177ffc79b
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
19e872912af66c53a4350afcc333bbafaf6a2294 24-Dec-2013 Jesse Hall <jessehall@google.com> Implement per-display EGLConfig and configless EGLContext

Bug: 12230666
Change-Id: Icca608b108cbdcab9cf01a9236d8cdbda000a836
Signed-off-by: Jesse Hall <jessehall@google.com>
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
c1c05de415854eb7a13a16b7e22a22de8515123a 18-Sep-2013 Mathias Agopian <mathias@google.com> fix camera API 2.0 orientation

we add a flag to ANativeWindow::setBufferTransform that means
"apply the inverse rotation of the display this buffer is displayed
onto to".

Bug: 10804238
Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
83cafffeac037ab2f9d00f98f8d2f3da8fc9b857 17-Sep-2013 Jesse Hall <jessehall@google.com> Stop using default value for Surface producerControlledByApp parameter

Bug: 10785749
Change-Id: Ifbf9340e5eabe621a69e990ec3e05ac51f8db66a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
931bda1c472ba8c8e965bdba6757ff94154df903 29-Aug-2013 Mathias Agopian <mathias@google.com> reset the gl viewport at each frame for each display

Bug: 10097128, 9506003
Change-Id: Ie0403a631e339a9134216224f3366f46ece58b53
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d2cf8c2f07b4285a224acd262e6f052c37dbc0b0 21-Aug-2013 Jesse Hall <jessehall@google.com> Merge "Provide HWC prepare with a valid output buffer" into klp-dev
028dc8f2d72bc7cd4fbe7808781443125a742f78 21-Aug-2013 Jesse Hall <jessehall@google.com> Provide HWC prepare with a valid output buffer

We weren't dequeing and setting the output buffer until just before
set(). This didn't allow HWC to make decisions in prepare() based on
the output buffer format, dimensions, etc.

Now we dequeue the output buffer at the beginning of the composition
loop and provide it to HWC in prepare. In GLES-only rendering, we may
have to cancel the buffer and acquire a new one if GLES requests a
buffer with properties different than the one we already dequeued.

Bug: 10365313
Change-Id: I96b4b0a851920e4334ef05080d58097d46467ab8
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
22a99f0fc2884227b9d7e46959fcbe6270667efb 21-Aug-2013 Andy McFadden <fadden@android.com> Fix virtual displays for HWC 1.0

We weren't swapping the buffers.

Bug 10366404

Change-Id: I43eb7648231bedf24899da6fc0d9acc09e0b047e
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
3f84483382be2d528918cc1a6fbc6a7d68e0b181 08-Aug-2013 Mathias Agopian <mathias@google.com> SurfaceFlinger now uses GLES 2.x when available

Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
ff866e7642033d8f68c11eaa16d0afcecf0bab5b 07-Aug-2013 Jesse Hall <jessehall@google.com> Merge "Set the swap interval of virtual display surfaces to 0"
f460f55c84b0a75de749b8a784059f5ff423ed93 07-Aug-2013 Jesse Hall <jessehall@google.com> Set the swap interval of virtual display surfaces to 0

This prevents slow/malicious virtual display consumers from
backpressuring SurfaceFlinger and preventing it from updating other
displays.

Bug: 10193714
Change-Id: I3e877d97202628d2d9abea24b66576f38299c14d
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
db89edc94bd2a78226b407f9f7261e202e7fa325 02-Aug-2013 Mathias Agopian <mathias@google.com> All consumers now take an IGraphicBufferConsumer instead of a BufferQueue

this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
38efe86d9459cf5c96a24a34cc5cbf31fdba7e19 07-Apr-2013 Jesse Hall <jessehall@google.com> Rewrite VirtualDisplaySurface

The previous implementation assumed that the HWC could read and write
the same buffer on frames that involved both GLES and HWC composition.
It turns out some hardware can't do this. The new implementation
maintains a scratch buffer pool to use on these mixed frames, but on
GLES-only or HWC-only frames still does composition directly into the
output buffer.

Bug: 8384764
Change-Id: I7a3addb34fad9bfcbdabbb8b635083e10223df69
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
875d8e1323536e16dcfc90c9674d7ad32116a69a 08-Jun-2013 Mathias Agopian <mathias@google.com> Refactor SF. Move all GL operations in their own class.

this is the first step to add support for GLES 2.x, this
change breaks the dependency of SF on GLES 1.x by moving
all operation into their own class.

Bug: 8679321

Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
6c7f25afb75ac155bad0b3bc17c0089d0337d060 10-May-2013 Mathias Agopian <mathias@google.com> reformat Rect.{cpp|h}

Change-Id: I45b1f6646541a1abacce1e70df00a770e47b820e
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
74d211ae26a0257c6075a823812e40b55aa1e653 22-Apr-2013 Mathias Agopian <mathias@google.com> clean-up/simplify all dump() APIs

remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
02d86567d95b99e1142941ed7ec23a4465822813 25-Mar-2013 Jesse Hall <jessehall@google.com> Clean up HWC state when releasing a DisplayDevice

DisplayDevices can be released when DisplayManager removes them from
the display list, or (for virtual displays) when the surface is set to
NULL. We were only cleaning up HWC resources associated with the
display in the first case.

Bug: 8384764
Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
ffe1f19ca9707f84cb9fdb06209bf36cd8c2ef0a 22-Mar-2013 Jesse Hall <jessehall@google.com> Fix virtual displays for HWC<=1.1

If we're using a HWC that doesn't support virtual displays, or we have
more virtual displays than HWC supports concurrently, the
VirtualDisplaySurface should simply be a passthrough from source
(GLES) to sink.

This change also tries to distinguish between display types and HWC
display IDs a little better, though there's more to do here. Probably
needs a higher-level rethink; it's too error-prone now.

Bug: 8446838
Change-Id: I708d2cf262ec30177042304f174ca5b8da701df1
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
851cfe834295224cd64bdd499872b95b19c4de8c 20-Mar-2013 Jesse Hall <jessehall@google.com> Isolate knowledge that fb target == output buffer

HWComposer didn't allow the virtual display output buffer to be set
directly, instead it always used the framebuffer target buffer.
DisplayDevice was only providing the framebuffer release fence to
DisplaySurfaces after a commit.

This change fixes both of these, so both HWComposer and DisplayDevice
should continue to work if VirtualDisplaySurface changes to use
separate framebuffer and output buffers. It's also more correct since
VirtualDisplaySurface uses the correct release fence when queueing the
buffer to the sink.

Bug: 8384764
Change-Id: I95c71e8d4f67705e23f122259ec8dd5dbce70dcf
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
13f01cbdbd34779a234bc674df79e23672fd5c0b 20-Mar-2013 Jesse Hall <jessehall@google.com> Pass sp<Fence>s around instead of file descriptors

Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
7414965606f82ac2bcace5d3e2c8a4810517bf1e 20-Mar-2013 Jesse Hall <jessehall@google.com> Release virtual display buffer immediately after HWC set

Previously we only queued a virtual display buffer to the sink when
the next frame was about to be displayed. This may delay the "last"
frame of an animation indefinitely. Now we queue the buffer as soon as
HWC set() returns and gives us the release fence.

Bug: 8384764
Change-Id: I3844a188e0f6ef6ff28f3e11477cfa063a924b1a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
99c7dbb24994df2f3e175f7b25dd2c9dd92a72f0 14-Mar-2013 Jesse Hall <jessehall@google.com> Add DisplaySurface abstraction

DisplayDevice now has a DisplaySurface instead of using
FramebufferSurface directly. FramebufferSurface implements
DisplaySurface, and so does the new VirtualDisplaySurface class.
DisplayDevice now always has a surface, not just for virtual displays.

In this change VirtualDisplaySurface is just a stub; buffers still go
directly from GLES to the final consumer.

Bug: 8384764
Change-Id: I57cb668edbc6c37bfebda90b9222d435bf589f37
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
7adb0f8a9fdb961692ffd2f0c65cacb155143f64 07-Mar-2013 Jesse Hall <jessehall@google.com> Minor cleanups/fixes before virtual display refactoring

None of these should change behavior, except for removing some
incorrect log messages when using a virtual display.

- HWComposer::getAndResetReleaseFenceFd() checks the HWC version, so
no need to do that in the DisplayDevice::onSwapBuffersCompleted().
However, it should check that mFramebufferSurface is not NULL like
it is for virtual displays.
- Comment that FramebufferSurface::dump() overrides the non-virtual
ConsumerBase::dump(), and fix it so the right thing happens
regardless of the static type of the pointer/reference the callee
has. FramebufferSurface::dump() could be removed right now, but I'd
need to bring it back in a later change.
- Use the right enum for validating display type ids.
- Don't try to send hotplug events for virtual displays.
- Mark virtual displays as connected so HWComposer::prepare() doesn't
think something is wrong when it gets a non-NULL layer list.
- Remove unused FramebufferSurface methods.

Bug: 8384764
Change-Id: Id28a2f9be86b45f4bb7915fdf7752157035f4294
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
13127d8921356dff794250e04208c3ed60b3a3df 06-Mar-2013 Mathias Agopian <mathias@google.com> Get rid of LayerBase.

The functionality of LayerBase and Layer is folded
into Layer. There wasn't a need for this abstraction
anymore.

Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
eabe3140f11e515639e7a70a1286dd6af7352c9e 05-Mar-2013 Jesse Hall <jessehall@google.com> Merge "Init displays to null layer stack" into jb-mr2-dev
01e29054e672301e4adbbca15b3562a59a20f267 20-Feb-2013 Jesse Hall <jessehall@google.com> Init displays to null layer stack

When a display is added, initialize it to use an empty layer stack, so
if it is somehow visible it will show black. It will be assigned the
real layer stack -- along with a projection and other properties -- by
window manager soon. Normally a display remains blanked until window
manager has decided what to show on it, but for HDMI connected at boot
that isn't currently the case.

Bug: 7258935
Change-Id: Ic9bb25f7a9b8d9d3772b097ab1d6fa03bc8780a1
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
f5f714aa188884098aaecbe39d0bc61b40311c0d 27-Feb-2013 Mathias Agopian <mathias@google.com> apply the projection's viewport to the visibleregion passed to hwc

each desplay's projection's viewport essentially clips each layer,
so this should be reflected in the visibleregion passed to
h/w composer.

DisplayDevice getViewport and getFrame are now guaranteed to return
valid Rects.

Change-Id: I4c25f34fb26af10179eb26d429ca6c384c671e91
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
e3c697fb929c856b59fa56a8e05a2a7eba187c3d 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
7dd35a165d7b689c8a2c79b4e136669103b32232 14-Jan-2013 Jesse Hall <jessehall@google.com> am fc866eb8: am 845ed8fd: Merge "DisplayDevice: initialize mDisplayToken correctly"

* commit 'fc866eb8423cd1d720683946f7d102547718b6c9':
DisplayDevice: initialize mDisplayToken correctly
27e2562868dcd3ad26f9b4677b64ae272941704e 07-Jan-2013 Chih-Wei Huang <cwhuang@android-x86.org> DisplayDevice: initialize mDisplayToken correctly

mDisplayToken should be initialized by displayToken.

Change-Id: I0a5fec1f1732200a32d10b1575239dceffe6dee4
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
766dc49c17dda977bf7b93a5fd8da41c0b737611 31-Oct-2012 Mathias Agopian <mathias@google.com> rework a bit how we scissor the display

the scissor rect is now computed once by DisplayDevice
and is combined with the "undefined" region so that
the letter-boxed area of the screen get cleared in
drawWormhole.

Bug: 7149437
Change-Id: Id2f30516a5786f32eace7f876ff32028f954f357
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
dd3cb84cfbe8068790c6233b5829fae9c4a0ee93 20-Oct-2012 Jamie Gennis <jgennis@google.com> SurfaceFlinger: add support for secure displays

This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set. All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
b8fc00bfb41a61aeda186eec8f14522ff32f23f8 10-Oct-2012 Mathias Agopian <mathias@google.com> fix typo that prevented proper loging of EGL error code

needed for investigating 7309949

Bug: 7309949
Change-Id: If29a5c08d0e87f46b44ba2e1030be61cb4d1403b
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
135e5899f70a67e62baaf6dbec7ba2ce611ca16a 01-Oct-2012 Mathias Agopian <mathias@google.com> save/restore viewport properly when taking screenshot

Bug: 7241739
Change-Id: Iba8b9ffc75ab47fbc56169e65da26d96850a9297
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
bae92d0d605e99a14731add4f11b72413b2835e5 28-Sep-2012 Mathias Agopian <mathias@google.com> reset GL viewport and project when caputring the screen

Bug: 7241739
Change-Id: I3bb5214b070384de9be2026647865c6c236a4331
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
32341381c9493d7953e40f7f79653cfc52868863 26-Sep-2012 Mathias Agopian <mathias@google.com> only abort when errors happen on the main display

Bug: 7232690
Change-Id: I2c4b35a82f131da26deea738ef294e100e536d15
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
52e21483fa48baeb4a88372d75e083bca2e92923 25-Sep-2012 Mathias Agopian <mathias@google.com> handle EGL errors

for now we just restart the runtime.

bug: 7225248
Change-Id: I7638ffe82075a4db9e7e6f9e35cf48afcb5a387a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
9e2463e71796964cfaa06bf09a880875ac3537bc 22-Sep-2012 Mathias Agopian <mathias@google.com> add/remove displays properly on hotplug events

Bug: 7191563
Change-Id: I8f0fbf3b29658c9479443141798e6f288a1f2d52
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
eba8c688f633f3f3f1b75c2bc64faf799dd2b5f2 20-Sep-2012 Mathias Agopian <mathias@google.com> calculate wether we filter on a per-display basis

Change-Id: I79d80b432b20b3d02428da19add464ac1e2b9378
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d56eff2f49e64bb71863ffb866af8c3f686b96e9 20-Sep-2012 Mathias Agopian <mathias@google.com> fix typo in DisplayDevice logs

Change-Id: I593ef674f12073bd9d690946447031394ef9044e
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
1d12d8a8e61163b35cf42c51c558a67138014e82 18-Sep-2012 Mathias Agopian <mathias@google.com> improve logging of external displays

Change-Id: I041aebb7fc655aeca98bbf698d15e05d7c12cac9
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
8dfa92fef9759a881e96ee58d59875d35023aab9 18-Sep-2012 Andy McFadden <fadden@android.com> Plumb display name into SurfaceFlinger

The Surface createDisplay() call takes a display name for debugging.
This change carries it through SurfaceFlinger and displays it in
the "dumpsys SurfaceFlinger" output.

Bug 7058158

Change-Id: I79f3474a8656ff1beb7b478e0dbf2c5de666118a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d870703d5566490cfdfb389d9336b2b8d3c6cc7a 18-Sep-2012 Mathias Agopian <mathias@google.com> fix external displays

we were not calling eglSwapBuffers() on external displays
because they can't use HWC which caused us to think they
didn't have GLES composition.

Change-Id: I6cef4ae40b138412d2e6f2acda33c9d222b03a83
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
da27af9832a0170f1fc40ef3f21371c4d30d21b3 14-Sep-2012 Mathias Agopian <mathias@google.com> add support hwc 1.1

Bug: 7124069

Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
6e220a6ce6971555b883f4852c6e5d4c7a617815 14-Sep-2012 Jeff Brown <jeffbrown@google.com> Fix display projections when translated.

There are two different translations to apply in the logical
orientation, one before scaling and one after.
So translate, scale, translate then rotate.

Bug: 7139798
Change-Id: I0726991cadb62988390e77503dbbaed54f07bfe3
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
6360ec42d414b1351ecb6c5fc4b8afa30d8f4ebf 12-Sep-2012 Jesse Hall <jessehall@google.com> Fix display projection transforms

Bug: 7139798
Change-Id: I61aafe99180d85563c6880d16bc367fce80e6022
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
00e8c7a88a5b9c4104a71013a713acd3e4d3b77b 05-Sep-2012 Mathias Agopian <mathias@google.com> display projection API now has a single function instead of 3

Change-Id: I9bf46d372b77d547486d4bbe6f1953ec8c65e98f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
da8d0a5c0cf9d41915d3b106cad4aaec3e767c11 05-Sep-2012 Mathias Agopian <mathias@google.com> implement display viewport and frame

note: viewport clipping is not implemented yet

Change-Id: I7fde7c4de075d409d95c48bb20ba8ee017f6f00a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
3ee454a7bef8bd3d1c9cdd9d17108eb80ebadf2a 28-Aug-2012 Mathias Agopian <mathias@google.com> Eradicate DisplayID.

DisplayDevices are now keyed of the wp<IBinder> the client uses.
DisplayID has now become DisplayType which is just used to identify
physical displays (as opposed to virtual displays such as wifi displays).

Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
e60b0687c8d49871d0c8786cabe6851f7a7783b5 22-Aug-2012 Mathias Agopian <mathias@google.com> HWComposer now has its own concept of display IDs

HWComposer can now create IDs representing a display
it can deal with. IDs MAIN and HDMI are reserved.
SurfaceFlinger associate HWComposer IDs with a
DisplayDevice and uses that when it talks to HWComposer.

A DisplayDevice doesn't have to have a HWComposer ID,
in that case it just can't use h/w composer composition.

Change-Id: Iec3d7ac92e0c22bf975052ae2847402f58bade71
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
cd60f99aba9e750700a967db30b74a29145739cf 17-Aug-2012 Mathias Agopian <mathias@google.com> refactor compositing code to avoid multiple eglMakeCurrent() calls

when multiple displays are connected, we ended-up having to
call eglMakeCurrent() twice per display due to a limitation
in EGL. this fixes that.

Change-Id: I11e4584df50f8c24bbecee74e37b28b3ee031d2f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
5f20e2d4462da3471f59152b32cd8640fa4a21da 11-Aug-2012 Mathias Agopian <mathias@google.com> reimplement wifi display hack with new external display SF framework

fix a few bugs with external displays

- HWComposer doesn't really handle multiple displays yet
so there is a lot of ugliness there

- We also need to make sure that external displays are not
blanked by default

- due to some EGL limitations surfaces being swapped need
to be current

Change-Id: I82bff05b43bcebd8da863c7c76b4edbc3bc223a9
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
8b736f138cfd9b239a2c7073347a13c489534ae1 14-Aug-2012 Mathias Agopian <mathias@google.com> xdpi / ydpi were reported as 0

Bug: 6975723
Change-Id: Ia7fa37ec11e2308804f5034959a37e508d292d31
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
ef7b9c7eac036cc1230c64821039d18f8cbd2c1c 11-Aug-2012 Mathias Agopian <mathias@google.com> screenshots could stop working after camera was used

once a secure window is put on screen the display
would retain its "secure" flag forever, preventing
screenshots from being taken.

Bug: 6933967
Change-Id: I5be8355145ca7d580d84552311642f8fa912fe6a
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
3165cc21cfea781988407b19bd83292b19f05f55 09-Aug-2012 Mathias Agopian <mathias@google.com> libgui includes refactoring

Change-Id: I1d24ec17f5003ec2abab5f7472daaff4cc4cc2d3
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
28947d7fbf9f486539322e8e12dd057568e180c2 09-Aug-2012 Mathias Agopian <mathias@google.com> now able to set the layer stack on a DisplayDevice

Change-Id: Ia9691cf221b9444c243eb468d9e276a30e600b6b
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
1a4d883dcc1725892bfb5c28dec255a233186524 03-Aug-2012 Jamie Gennis <jgennis@google.com> surfaceflinger: refactor FrambufferSurface

This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.

Bug: 6620200
Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
4297734c1156fd8ede7e9c61b1e439f9e1c18cd9 05-Aug-2012 Mathias Agopian <mathias@google.com> turn DisplayDevice into a reference-counted object

it's safer this way because this object owns an
EGLSurface which cannot be easily reference-counted.

it also gives us the ability to sub-class it, which
we might want to do soon.

Change-Id: I07358bb052dc5a13b4f2196b2c2b6e6e94c4bb4f
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d8552d796cbcb9a89711fc8f97b34838da5cbdb7 05-Aug-2012 Mathias Agopian <mathias@google.com> DisplayDevice only needs ANativeWindow not SurfaceTextureClient

Change-Id: Ib5be5af8bede435c8d5d9fabf586d28d0e74c2cb
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
888c822c4cb6976aab9256c58bae9e17e3e55c5c 05-Aug-2012 Mathias Agopian <mathias@google.com> remove a dependency of DisplayDevice on the refresh rate

this remove a dependency (not all) on FramebufferSurface

Change-Id: Ie07ce70760cdcedfb41b5b41bea8da45637bf474
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
92a979a92c34b7de609ce2b1662c73bb8a2728b9 03-Aug-2012 Mathias Agopian <mathias@google.com> We now have a real list of displays.

displays can be dynamically added or removed, and the
list is part of the SF's transaction.

Change-Id: I4186ea39f1317c0e7c044f869004017738968fab
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
d3ee231eddce0b69ec5e35188dbd0f4a2c3b9ac3 02-Aug-2012 Mathias Agopian <mathias@google.com> cleanups in preparation of bigger changes

- fix typo drawForSreenshot misspelled
- get rid of DisplayDeviceBase
- removed unused or unneeded code
- always pass a DisplayDevice to Layer methods that are called
on a per-display basis (to make it clear that this could be
called more than once per composition).

Change-Id: Id948b7e09fe5c06db0e42d40d6ed75dd095c7f44
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
0f2f5ff75b7b48ceb64270655ee6b62d09bf4d00 01-Aug-2012 Mathias Agopian <mathias@google.com> rename DisplayHardware to DisplayDevice

Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
/frameworks/native/services/surfaceflinger/DisplayDevice.cpp