History log of /frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8a7c940effda8651e205eab62334d4e58b1eaeb5 02-Dec-2011 Jesse Hall <jessehall@google.com> SurfaceFlinger: fix layer removal race condition

Layer::lockPageFlip() and layer::onRemove() could be called on
different threads and race such that lockPageFlip() successfully
called mSurfaceTexture->updateTexImage() but then gets NULL back from
mSurfaceTexture->getCurrentBuffer(), leading to a crash.

This change moves Layer::onRemove() calls to
SurfaceFlinger::commitTransaction() so they happen after the Layer is
done being drawn from and only happen on the main surfaceflinger
thread.

Change-Id: I4b550caadff4cc1878d7c3bca6129193fb0c713e
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
cadd325aff7354be23d3bccb4f53b603f1506c9f 30-Nov-2011 Mathias Agopian <mathias@google.com> add a way to access the version string of the h/w implementation of EGL

we use a hidden egl extension. the version string is printed
in SF's dumpsys log.

Change-Id: I123eb4bde6de462bb2404c67b74d6d6219a48d6a
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
a06c06b9c079f98538cfbd1c06123383a0e38e32 08-Nov-2011 Mathias Agopian <mathias@google.com> Fix an issue where we could wait for a non-existing transaction

This fixes the issue:
"Call not sent" dialog takes too long to dismiss after hitting OK"

Note: the system would recover after a 5 second timeout.

Bug: 5534520
Change-Id: Ifa37e594b50581f498479a5858672441b3d7dd87
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e65beaabe4be554683417839594dd41b6c979cbb 01-Nov-2011 Mathias Agopian <mathias@google.com> Fix rotation displays frame N-1 briefly while rotating

The ScreenShot layer is now created hidden. The screenshot itself
is aquired during the transaction when the layer is made visible.
This guarantees the screenshot and the layer happen atomically
with respect to screen updates.

Bug: 5534521
Change-Id: Ida23e1f13d5716ec83b78a15712e0646d6cf8729
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
01d650ed424fa07e864ee11d63f3982a0b266fe6 27-Oct-2011 Mathias Agopian <mathias@google.com> fix Corrupted graphics while playing You Tube on orientation change

Bug: 5432124
Change-Id: If948b9797b1ec6fff80ca5ea94508abcaced9f31
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
9ec98cd134a3d698bc3ee7a62c02c7818e8b02af 22-Oct-2011 Mathias Agopian <mathias@google.com> am aa938c8d: Merge "mDirtyRegion is single threaded, but could be accessed from a hwc thread" into ics-mr0

* commit 'aa938c8d9c0e71c9b556657cb33794210ce6ebf8':
mDirtyRegion is single threaded, but could be accessed from a hwc thread
6497eabf0eaba7eb239431043b32365fb0daa7a1 22-Oct-2011 Mathias Agopian <mathias@google.com> mDirtyRegion is single threaded, but could be accessed from a hwc thread

We now have mInvalidateRegion which holds the region to invalidate, it
can be set from any thread as long as mInvalidateLock is held. We use
fine-grained locking here because mInvalidateRegion can be set from anywhere,
in particular frmo HWC callbacks.

Bug: 5466774
Change-Id: Iafca20aa3f5b25a87755e65bde7b769aa8f997bc
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
10b4503f2b3c3ad365a7adc73095a3280fc6bdfb 21-Oct-2011 Mathias Agopian <mathias@google.com> am 16bece04: Merge "added dpi and refresh rate info in SF\'s dumpsys" into ics-mr0

* commit '16bece04bdbac9af5228436f70267ec5763315de':
added dpi and refresh rate info in SF's dumpsys
abf88bead4e15a316753c878736dc73475a2310a 21-Oct-2011 Mathias Agopian <mathias@google.com> added dpi and refresh rate info in SF's dumpsys

Change-Id: I2327248eb1993689367e3daeaccba74c172dfceb
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
2696d0520f9b928264caa5f98c2e6b1e749f9a11 19-Oct-2011 Dave Burke <daveburke@google.com> am 70ac412b: Merge "Add a LayerScreenshot" into ics-mr0

* commit '70ac412b2fe7be2507189a9fdfb30c43b36d56ac':
Add a LayerScreenshot
960a0b4813a9099d2c96a54b11920d8bf6ba87d3 19-Oct-2011 Mathias Agopian <mathias@google.com> am f7613743: Merge "Don\'t call hwc set() if there is nothing new to do" into ics-mr0

* commit 'f7613743f29f38cbbaf4ae09996c380845a17daf':
Don't call hwc set() if there is nothing new to do
43d109c2c8a278c4d2a316d70a929f961837da8f 19-Oct-2011 Mathias Agopian <mathias@google.com> am 23bf2505: Merge "Make sure set GL state properly" into ics-mr0

* commit '23bf250522b7dff9acd14c5900b66b1df9c76745':
Make sure set GL state properly
0ab84ef507f23505a72798fbe25cf4bb2c507ea3 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0d0fba4587df36846baa80463490befdcef38e98 19-Oct-2011 Mathias Agopian <mathias@google.com> Don't call hwc set() if there is nothing new to do

there was situations where SF's main loop would run (as if there was
an invalidate), but the dirty region was empty (so no new buffers
were retired). In this case we return early and don't swap, which
would cause drawing artifacts.

Bug: 5476838
Change-Id: Id3b7bf4b7aabec7919c50d9278eb2165973a4c3d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
9044ef05d542a4f99b4be7ecefbe5e676bd3ea7f 18-Oct-2011 Mathias Agopian <mathias@google.com> Make sure set GL state properly

when taking a screenshot, in particular, we could end up
with stale GL state when drawing LayerDim which resulted
in incortect rendering.

Bug: 5467587
Change-Id: Id9fbed2843481d31063620f3662b364c7e3ac781
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
a3dca6fdaacf9ffea4a844848a53c1adeb089897 17-Oct-2011 Mathias Agopian <mathias@google.com> am 840b8a67: Revert "Add a LayerScreenshot"

* commit '840b8a678537519c27ddf2f818494eaa20a135d4':
Revert "Add a LayerScreenshot"
f7ae86f61ba7b326a33e53c3bbb87ebf212f543d 17-Oct-2011 Mathias Agopian <mathias@google.com> am 4fb6416e: Merge "we need to guarantee that h/w comp set() is called when a buffer has been retired" into ics-mr0

* commit '4fb6416e3a21031a88921a784ae62b13d8a1a39f':
we need to guarantee that h/w comp set() is called when a buffer has been retired
f21dd1eabe5bf4da0dc0d9c23144aa997c05a56d 17-Oct-2011 Elliott Hughes <enh@google.com> Merge branch 'master' of ssh://android-git:29418/platform/frameworks/base
840b8a678537519c27ddf2f818494eaa20a135d4 17-Oct-2011 Mathias Agopian <mathias@google.com> Revert "Add a LayerScreenshot"

This reverts commit d6809f40cf61203573ec5dbc437f695cd132cc18.
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e757a87ff15668749e2ecbd572c69f1c24e28535 17-Oct-2011 Mathias Agopian <mathias@google.com> we need to guarantee that h/w comp set() is called when a buffer has been retired

removed a test that could violate this guarantee. note that we
have no proof tha this ever happened, but consequences could be
hard lock-ups.

the code here was intended to track the region to update for displays
that can do partial update. the logic discarded the update entirely
if that region was empty. instead we just redraw the whole thing
(note that we should never be there with an empty region and retired
buffers though).

Bug: 5466259

Change-Id: I91ccab3b1a599e729e438eb833939e2236da6854
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
de14ecaebcb958f542f50cff08109926aad2c685 15-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Remove display freezing code

This change removes the dead code from SurfaceFlinger that resulted from
disabling support for freezing the display.

Change-Id: I4e5ff00c94b4c7a79af2f65c9850c135210068ed
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
122aa6bae9f72015e6d50e78d4d47a95e05d3f49 13-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: make sync transactions explicit

This change enables a layer or orientation update transaction sent to
SurfaceFlinger to explicitly request a synchronous transaction.

Change-Id: I97cbba610c13679849f66114b216fa6dbf12f2a9
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d6809f40cf61203573ec5dbc437f695cd132cc18 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Bug: 5446982
Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e2909e121c45d58fe587849b1474c80745fcd2b9 11-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: update orientation via transactions

This change merges the ISurfaceComposer::setOrientation functionality
into ISurfaceComposer::setTransactionState. It enables the window
manager to atomically update both the display orientation and the
position and size of the windows in a single transaction with
SurfaceFlinger.

Bug: 5439574
Change-Id: I18a8ccc564d7d760ef8afb2d015ccdb7a7963900
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
919139247ccf5ade7c24ec1a9499a377be5498c2 11-Oct-2011 Mathias Agopian <mathias@google.com> fix an issue where the screen could stay off

this would happen when toggling on/off/on very fast, the screen
could stay black (while the panel is on).

Bug: 5429724
Change-Id: Ic8aa6aff066e6267923c0d47ef65e314e7bb6d41
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
b946a56b696674f6d6f399f68df38ec18adebe87 11-Oct-2011 Mathias Agopian <mathias@google.com> Fix screen off animation when in landscape

Change-Id: I4bc5b12d7a64a4bf8b9a851594be4d60b790d1ed
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
830d083bf75f1dfe3753f9565f0c90b1dbcc264f 07-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: screenshots w/ protected buffers

This change modifies SurfaceFlinger's screenshot behavior when a layer
with a protected buffer is visible. The previous behavior was to simply
fail the screenshot. The new behavior is to render the screenshot using
a placeholder texture where the protected buffer would have been.

Change-Id: I5e50cb2f3b31b2ea81cfe291c9b4a42e9ee71874
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0c92e4d7474be3acf08038073d0e3b26ea643884 23-Sep-2011 Mathias Agopian <mathias@google.com> Merge "don't clear the framebuffer when the framebuffer is not used"
9fe96541c349f87caae10f3c94ed30e8153b15e5 23-Sep-2011 Mathias Agopian <mathias@google.com> don't clear the framebuffer when the framebuffer is not used

when areas of the FB are undefined (transparent windows on top of
nothing), we clear those areas before composition.
however, it makes no sense to do this when the FB is not in use
(case where hwc handles all layers)

Bug: 5360529
Change-Id: If51bb669307e8419bbe1f3a89d1c88e0ec1f216c
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
01a98ddbdfbaf1f0d2bc602537e6e314364902a3 21-Sep-2011 Jeff Brown <jeffbrown@google.com> Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager. Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out. For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes. The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise. We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened. We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
88cde07df05c275da4e6d5746d79847eea723855 21-Sep-2011 Mathias Agopian <mathias@google.com> fix transition from full overlays to fb

we need to clear the whole framebuffer in that situation because
we can't trust the content of the FB when partial (fb preserving)
updates are used.

Bug: 5318492

Change-Id: I3f0e01b0fb665a34e44d88ad9f0f54a5d990060b
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d0f2f0d46114d4858cd1d3d5f6cff4f245f104b5 21-Sep-2011 Mathias Agopian <mathias@google.com> rename mInvalidRegion to mSwapRegion

Change-Id: I946cbc782c0c84645843ea44c3d8b04a0a2fe658
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
880ac7a86501e72428b52228cc4b5003e866f5a9 21-Sep-2011 Mathias Agopian <mathias@google.com> improve hwc dumpsys

we now log the buffer's format

Change-Id: I9d3ad8018e884240a153de3baefb6331cb014d0f
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0a5abdb3161510d6f0c88fbe75140325620ac366 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix another problem with refreshing the screen when switching to/from overlay

the previous fix was incorrect. See comment in setupHardwareComposer for
full explanations.

Change-Id: Ib24a9af000b8f95cf7319f9272d34997064ceb6d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
5bd1b2794b227e25fbd7e4c919bcefc3510e0761 09-Sep-2011 Mathias Agopian <mathias@google.com> Improve SF dumpsys output wrt HWC

Change-Id: Ibdb7930fa3b521bfd3f44750ed98cfd75f9a01fe
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
4bacc9dc674792c745f362962883a19f4a35c88c 09-Sep-2011 Mathias Agopian <mathias@google.com> Fix an issue is SF that caused drawing artifacts when hwc changed mode

we were not redrawing and/or clearing the FB properly when
hwc moved a layer from/to FB to/from OVERLAY.

In these cases we needed to expand the dirty region to include
the layer that changed mode.

Also split composeSurfaces() which was becoming quite large.

Change-Id: Id6fa1acfc4ff694037fddf7efd037a4405732073
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
7f97258ab379b3bcf14846c4eb65022d2b39f390 02-Sep-2011 Mathias Agopian <mathias@google.com> fix a bug that caused the off animation to not show sometimes

this happened when the overlays were in use, since the animation
is rendered in the FB and the FB is not used.

we now have a way to turn hwc off temporarily.

Change-Id: I3385f0c25bb9cc91948e7b26e7cd31ed18c36ace
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
ff57415bdb4590478f294f7b45805f80d2aac441 02-Sep-2011 Mathias Agopian <mathias@google.com> Fix various flickering / artifacts

these were due to the "preserve backbuffer" optimization
interfering with hw composer. basically the screen needed
to be redrawn in the areas that move from GL to
overlay.

Bug: 5245513
Change-Id: I9bf75c4fe905f3ef62005e52108b94edae692304
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
ec49d8970125b3da422f93bf6f6b32ac62230a83 25-Aug-2011 Mathias Agopian <mathias@google.com> Fix screenshots

Change-Id: If904634e64b154bbe336d5789dd1209b8ae871fb
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e328134b8fa4e5bfe0277a1fa55a9fbd99d27ef0 25-Aug-2011 Mathias Agopian <mathias@google.com> Fix Recent thumbnails aren't taken when leaving an activity via notification

When taking screenshots we need to use the full drawing state list
instead of the visible list.

Bug: 5186823
Change-Id: I214ee0203aaf8e2c038e44581f7f1ae36edf08c5
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
2143fe05e3a1aeae641ca126e76db82d17e8b8e6 24-Aug-2011 Mathias Agopian <mathias@google.com> Add a debug option to turn the "transformation hint" off

transformation hint is disabled with:

adb shell service call SurfaceFlinger 1009 i32 1

Change-Id: I9aafe6f280f88ce41569ed69a06dc522b10e3a88
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
7f76a3cf667b95caccb3e6d3f5cf160180717340 23-Aug-2011 Mathias Agopian <mathias@google.com> fix "show screen update" debug option.

Change-Id: I7d8b24124768b5f7d59d3bb0b019e9baaa0dfc4f
NOTE: from now on, this also disable the h/w composer
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
9b8fc65b0353db3a962ab52dc556c356d556fcc1 18-Aug-2011 Jamie Gennis <jgennis@google.com> SurfaceTexture: fix queues-to-composer

This change fixes the NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER query of
Surface and SurfaceTextureClient. Surface now uses the inherited
SurfaceTextureClient implementation of this query. SurfaceTextureClient
now queries SurfaceFlinger to determine whether buffers that are queued
to its ISurfaceTexture will be sent to SurfaceFlinger (as opposed to
some other process).

Change-Id: Iff187e72f30d454229f07f896b438198978270a8
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
93d75ec3714d829a41947a29b5c4028b282622c4 16-Aug-2011 Mathias Agopian <mathias@google.com> as a debug option SrufaceFlinger can now connect to DDMS

this is disabled by default. To enable:
setprop debug.sf.ddms 1

this debug option requires to restart SurfaceFlinger

Change-Id: Ic2f8050b29911b55bcd21721648b6978700c277d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
91b539801833012798b1998c30440136add7e7d4 12-Aug-2011 Mathias Agopian <mathias@google.com> SurfaceFlinger doesn't rely on having a custom RefBase destructor

we just use a message to the main thread to
destroy our GLES state.
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
50c24a2000c785f8be2367e1fc7938a5eda5c9e8 21-Jul-2011 Mathias Agopian <mathias@google.com> clean-up. get rid ofunused code and members in Surface[Control].cpp

Change-Id: Ia7790ae28af2c2ac99eae01c2c5044ace4a490a4
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
ab95117be00ea8a207aaeefb4cb328db7d0f8848 15-Jul-2011 Mathias Agopian <mathias@google.com> dump GLES strings in SF dumpsys log

Change-Id: I438d511159b2bd915c84954f30574340017d4f47
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
3a831d24e9147d737c6aaed72d84c1126c232368 08-Jul-2011 Mathias Agopian <mathias@google.com> fix screen on/off animation (again)

- surfaceflinger now uses the GL-convention of
placing the origin in the left-bottom corner

- map texture coordinates of the screen capture
properly

- add the ability to control the animation
speed through a debug property

Bug: 4989276

Change-Id: Ifb3297bb578078b47146fff666c01f85417e0d6f
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
55aaccd7e8e3f5a4b0f4333c6bd2404eeac7bbb1 06-Jul-2011 Mathias Agopian <mathias@google.com> Merge "don't kill surfaceflinger when system process dies"
0c63ef5091def41e91a2202560c57b2f6caabfbe 02-Jul-2011 Mathias Agopian <mathias@google.com> don't kill surfaceflinger when system process dies

Change-Id: I2d3ed87b590f9ccea3fa4af41d92911de070b315
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
eec0f7ebac85d3d1b1151e62b2ed0f25c138d447 01-Jul-2011 Mathias Agopian <mathias@google.com> return an error code with gralloc buffer allocation failures

Change-Id: I471e5d37ea7a42fc8a0f93446ee3b4229da37807
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
753db22423bedf3a2d1b1f892da230a818ab60ac 01-Jul-2011 Mathias Agopian <mathias@google.com> fix screen on/off animation, which was flipped

Bug: 4673549
Change-Id: Ia9766754687b89c1ee24b2dbe918c11290ebe038
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
439863f3b3e725b5de1cba4940a21900369961c0 29-Jun-2011 Mathias Agopian <mathias@google.com> SF transactions are now O(1) wrt IPC instead of O(N).

Change-Id: I57669852cbf6aabae244ea86940a08a5a27ffc43
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0dd593f22352a0863223fa4ea7e37e926b99282e 28-Jun-2011 Mathias Agopian <mathias@google.com> PermissionCache caches permission checks

This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
7bb843ca0777111dae7daf8f1b0705817cf523c4 20-Apr-2011 Mathias Agopian <mathias@google.com> unify SurfaceTexture and Surface

Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
6960811d15eb66e8469330d3bc574c32c481db05 20-May-2011 Mathias Agopian <mathias@google.com> Fix a race that could cause GL commands to be executed from the wrong thread.

Change-Id: Ia3d407f7bf2f5553f46cfdade70b7b0badb35beb
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
6dcb1557efc546b74323b4367d9b7f674821e1e9 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race in SurfaceFlinger that could cause layers to be leaked forever.

The transaction flags were atomically read-and-cleared to determine if
a transaction was needed, in the later case, mStateLock was taken to
keep the current state still during the transaction. This left a small
window open, where a layer could be removed after the transaction flags
were checked but before the transaction was started holding the lock.
In that situation eTraversalNeeded would be set but only seen during the
next transaction cycle; however, because we're handling this transaction
(because of another flag) it will be commited, "loosing" the information
about the layer being removed -- so when the next transaction cycle due
to eTraversalNeeded starts, it won't notice that layers have been removed
and won't populated the ditchedLayers array.

Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
5fa7ad6fa1316036819ec506205888eac5512f68 04-May-2011 Mathias Agopian <mathias@google.com> Fix a race-condtion in SurfaceFlinger that could lead to a crash.

Client::mLayers could be accessed from different threads.
On one side from Client::attachLayer() which is currently
called from a binder thread; on the other side from
Client::detachLayer() which is always called from the main
thread.

This could lead to a corruption of Client::mLayers.

We fix this issue by adding an internal lock to Client.

Change-Id: Ib1317d7750ed5030e6f577efe34b69fc10198bd3
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
9638e5c167be321643bf3f3ee39e3fb45541fb3b 20-Apr-2011 Mathias Agopian <mathias@google.com> Get rid of the "pid" parameter from createSurface

Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
5f05f99aaedaba18c426fac287bcb18d56dbe881 09-Apr-2011 Mathias Agopian <mathias@google.com> Fix a GraphicBuffer leak in SurfaceTexture

This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.

In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.

this allows the public facing API to not expose the previous hack.

Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
f0ff906fa427ddc3293dc061e2ee34ce39c1336e 12-Mar-2011 Mathias Agopian <mathias@google.com> Fix some const-ness and comments

mDrawingState doesn't need to be accessed by the
mStateLock, because by definition it's only accessed
from the main thread.

Similarily, the list of layers in the drawing state
cannot change (ie: is const).

Change-Id: I2e5da7f4d8caee7af7802b432cd45cc81c7c08b0
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
f72606ce3ea8cb787e5c71325f08b1898e0718d9 10-Mar-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: Respect the PROTECTED gralloc bit.

This change makes SurfaceFlinger treat layers for which the active
buffer has the GRALLOC_USAGE_PROTECTED bit set as if they have the
'secure' flag set.

Change-Id: Ic60b6513a63e4bb92ec6ce9fd12fd39b4ba5f674
Bug: 4081304
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d2acedf18c9a3527f6e3dc5d578a85fdc0ad4338 08-Mar-2011 Jamie Gennis <jgennis@google.com> ANativeWindow: add queues-to-window-composer check.

This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
32ae094d87cbb35f8b31acb7b83b430db62d5925 03-Mar-2011 Mathias Agopian <mathias@google.com> remove some logs

Change-Id: Ia476184048ee419e19330a56dc8e6553189f6a24
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0dc5fdb9b2fd3b3e2ede5e9607bc21423f357a01 28-Feb-2011 Jamie Gennis <jgennis@google.com> am e630e5f4: am 919853ce: Merge "Prevent SurfaceFlinger from using layer token 31." into gingerbread

* commit 'e630e5f49ba15005172dceeda7299569b2d2351f':
Prevent SurfaceFlinger from using layer token 31.
c86d904b71be950ad973d803d1a19c6cd13be669 11-Feb-2011 Jamie Gennis <jgennis@google.com> Prevent SurfaceFlinger from using layer token 31.

Bug: 2964479
Change-Id: I81e948924bff35b8b300d409f2c09f3779bcdeec
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
6e138fb682fb84bfebff7f4ae4b88cef1996708c 03-Feb-2011 Mathias Agopian <mathias@google.com> [3418265] apply layer transformations to the DimLayer.

with this change DimLayers will behave just like any other layer,
in particular they'll respect the layer transformations.

Change-Id: Icb4a1275e8bca9e3deb5f57c9f9219aaa69f9877
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d35c6667c8233385f31aa203f486b2cb826bf6be 26-Jan-2011 Mathias Agopian <mathias@google.com> fix [3385504] Surface flinger hang when adding dim surface

Change-Id: I8e0cda414bcad5854d2ca5dde8370bfd8b2e5ea4
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
21956040a77808909ebda426fbd3cce6c8ed059f 19-Jan-2011 Mathias Agopian <mathias@google.com> fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)

Generally we never want to lock a buffer for write access if it is at
the "head" on the surfaceflinger side. The only exception (1) is when
the buffer is not currently in use AND there is at least one queued
buffer -- in which case, SurfaceFlinger will never use said buffer
anymore, because on the next composition around, it will be able to
retire the first queued buffer.

The logic above relies on SurfaceFlinger always retiring
and locking a buffer before composition -- unfortunately this
didn't happen during a screenshot.

This could leave us in a situation where a buffer is locked by the
application for write, and used by SurfaceFlinger for texturing,
causing a hang.

Here, we fix this issue by never assuming the exception (1), it was
intended as an optimization allowing ANativeWindow::lockBuffer() to
return sooner and was justified when most of SF composition was
done in software. The actual buffer locking is now ensured by
gralloc. We could have handled screenshots in a similar way to
a regular composition, but it could have caused glitches on screen,
essentially, taking a screenshot could cause to skip a frame.

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
68d3478860fecc9b8fbf256796a832a037434555 15-Jan-2011 Mathias Agopian <mathias@google.com> partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)

We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.

So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.

NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.

also improve SurfaceFlinger 'dumpsys' log

list the purgatory, which shows windows that have been closed,
but for which the client still has references.
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
8aa11d82f33be8089a53feb3ba3c40fd8a33ad95 17-Dec-2010 Mathias Agopian <mathias@google.com> fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)

we were not clearing the screen entirely, which caused garbage when
the screen wasn't entirely covered by windows.

Change-Id: Ia7aa13c36a8a314e0e8427d419b16b9aa2165ddf
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
84c6f5a44c431a36a9e4395a7e23ab26480ba689 15-Dec-2010 Mathias Agopian <mathias@google.com> workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)

we make sure to call compositionComplete after everytime we do
composition with the GPU (even for the screenshot case), which is
where the buffer locks are released.

Change-Id: I450430d1e4d1ee9ce1023970642378c42cdcfa4c
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
3431f47b47436210d441befb39f2d011b00bcdf2 25-Jan-2011 Mathias Agopian <mathias@google.com> tone down the log spew regarding taking screenshots.

Change-Id: I673806bda23eba6aab25f7505b7e0170afc9920b
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
35e4a497f4463adb78d35a57f22847bec0eaab1a 20-Jan-2011 Mathias Agopian <mathias@google.com> Merge "fix [3369743] SurfaceFlinger reads hardware composer hints before calling hwc.prepare()" into honeycomb
1d4549ab0312319a79fb37068a3fc63bbb0a3adc 20-Jan-2011 Mathias Agopian <mathias@google.com> clean-up unneeded code

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.

Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
06a61e2fa830fcd66c12741a52cc5d9b4b214f94 20-Jan-2011 Mathias Agopian <mathias@google.com> improve SurfaceFlinger 'dumpsys' log

list the purgatory, which shows windows that have been closed,
but for which the client still has references.

Change-Id: I5168bb88cb328d5d77d71d0871deb9190f493126
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
45491690d8f21d2648cad9247115720fa90046b4 20-Jan-2011 Mathias Agopian <mathias@google.com> fix [3369743] SurfaceFlinger reads hardware composer hints before calling hwc.prepare()

Change-Id: If3277c7b9d4cb8ef20d1706155fac7b87e64fb20
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
cd2cfb6a15975af02a02c34783480eb858ee2928 16-Jan-2011 Mathias Agopian <mathias@google.com> Add logs when taking a screenshot to help tracking issue 3361121

Change-Id: I61d1e072ebe7061ee1d7255f6121b684e2923d1b
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
fd7a411aef7e1c7722456de09b3f3234bbb914d4 15-Jan-2011 Mathias Agopian <mathias@google.com> Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout" into honeycomb
f4dfe1bee6223add052b6f0ebc4cdb1f46606acc 15-Jan-2011 Mathias Agopian <mathias@google.com> partially fix [3306150] HTML5 video with H/W acceleration blackout

We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.

So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.

NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.

Change-Id: I305c830dd722b30a6d53cbf3a9c714fd3cf7eb06
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
010719c2fff4ab40757984f29d7755ff7f79e3de 14-Jan-2011 Mathias Agopian <mathias@google.com> Merge "fix [3312683] Camera mirroring problem after switching from back to front camera" into honeycomb
fb4dcb1a679000c029bb8e76fea7066d002235d5 14-Jan-2011 Mathias Agopian <mathias@google.com> fix [3312683] Camera mirroring problem after switching from back to front camera

the crop as well as buffer orientation can change at every frame, when that happens
we need to reset the hwc HAL (ie: set the GEOMETRY_CHANGED flag).
currently we achieve this by taking the same code path than an actual geometry change
which is a bit more heavy than necessary.

Change-Id: I751f9ed1eeec0c27db7df2e77d5d17c6bcc17a24
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
f7acf162f8d682c6ebc9af41ca76795b79509193 13-Jan-2011 Jamie Gennis <jgennis@google.com> Fix remote GraphicBuffer allocation in SurfaceFlinger.

This change fixes a horrible hack that I did to allow application
processes to create GraphicBuffer objects by making a binder call to
SurfaceFlinger. This change introduces a new binder interface
specifically for doing this, and does it in such a way that
SurfaceFlinger will maintain a reference to the buffers until the app is
done with them.

Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0a53d5c81b5553d6063b8133492275ce88186978 20-Dec-2010 Jamie Gennis <jgennis@google.com> Add the ISurfaceComposer::createGraphicBuffer IPC.

This change adds a new binder method to the ISurfaceComposer interface.
This IPC is intended to allow SurfaceFlinger clients to allocate gralloc
buffers using SurfaceFlinger as a proxy to gralloc.

Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
1c4e4fc0490c6f07111365cfe21116c31254d5ff 17-Dec-2010 Mathias Agopian <mathias@google.com> fix a small bug that caused screenshot to show garbage in some cases

we were not clearing the screen entirely, which caused garbage when
the screen wasn't entirely covered by windows.

Change-Id: Ie9ab9b94eabfa6cafddf45bb14bc733bdc8d35c0
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
a6b8c1c3bd1d9b84bbeb1820c0239742f50d3edb 15-Dec-2010 Mathias Agopian <mathias@google.com> workaround [3201922] display not on: log full of gralloc errors

while we're waiting for the real fix in the gralloc/gpu driver,
this workaround should resolve the issue.

we make sure to call compositionComplete after everytime we do
composition with the GPU (even for the screenshot case), which is
where the buffer locks are released.

Change-Id: I3cb5ad67d48c81a23100172bab77e86a70e29152
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
04a709e459db6f15c04b00bcd3b030c90ca52949 15-Dec-2010 Mathias Agopian <mathias@google.com> fix debug.sf.showbackground

Change-Id: Ie4eeca006ad6d8030900d8cb0029e4d1c22474fb
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
3dd25a6bf71bd535bf9dbbe16234229ff45414a0 11-Dec-2010 Mathias Agopian <mathias@google.com> [3258939] Need snapshot to limit which layers are included

Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
c3802d22f11b4e513ba776277d18f315c5c769f7 09-Dec-2010 Mathias Agopian <mathias@google.com> More clean-up. Get rid off the "blur" effect in SurfaceFlinger

For multiple reason, this effect is not maintainable and was never
used due to its abysmal performance. it'll be resurected when it can be
implemented efficiently.

Change-Id: Id4222c9b86c629275cdec18873ef07be8723b6d2
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d2112306330ce0c162bee4b864991962ca2b655a 08-Dec-2010 Mathias Agopian <mathias@google.com> remove support for PUSH_BUFFER surfaces and overlays

the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
94720d7ec40d2b5ee200d95a46588cdb0fb30e66 02-Dec-2010 Erik Gilling <konkers@android.com> surfaceflinger: add support for gralloc dump hooks

Change-Id: Ib6f539ed0132b70d040d653c03d52cc04249ac3c
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
ee5a3aca5752f201b69fe0307414ca16ca492f0e 08-Dec-2010 Mathias Agopian <mathias@google.com> [317580] fix issue where the screen wouldn't be rotated properly in bypass mode

In some situations, the screen transformation would not be
applied while in bypass mode.

Change-Id: I3d6dd52e4c12b11aae97b54bf8e2322536eee37f
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
025005f562f695c3b1785745c2e5c184fc3a2330 02-Nov-2010 Mathias Agopian <mathias@google.com> [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE)

This is a poor's man precursor to the h/w composer HAL.
Basically we detect when a window is full screen and in
that case we bypass surfaceflinger's composition step, which
yields to much improved performance.

Change-Id: Ie03796ae81a1c951949b771c9323044b980cb347
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d267d2a2f11e0dd8a14ad05180114c656b73d483 10-Nov-2010 Jamie Gennis <jgennis@google.com> Remove a problematic empty update optimization.

This change removes an optimization from SurfaceFlinger that skipped
composition when it got window updates that had an empty dirty region.
This optimization caused problems because it would skip the hwcomposer
set call, which could leave the window's previous frame buffer bound to
an overlay plane. When the application subsequently dequeued and tried
to lock its next buffer (which would be the buffer currently bound to
the overlay), the lock call would block until the next hwcomposer set
call (which may never happen).

Change-Id: I563b626a1d52c1f30eb82489eae0ceb4edc79936
Bug: 3138752
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
7ece231e4acebd3c70b33fe2ba5f194268569155 16-Oct-2010 Mathias Agopian <mathias@google.com> am 9f6d18ca: am 04358138: Merge "[3095807] screen takes a long time to turn on" into gingerbread

Merge commit '9f6d18cadf9ac50062063f5f5ff5de7f6895696a'

* commit '9f6d18cadf9ac50062063f5f5ff5de7f6895696a':
[3095807] screen takes a long time to turn on
596e590b472dc33a522f32a74e1f3bacb57534ab 16-Oct-2010 Mathias Agopian <mathias@google.com> am 7e9a54d4: am d4e03f37: addresses parts of 3096779 and 3097475

Merge commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8'

* commit '7e9a54d460030a871a4f05e61e943c6a694e9ef8':
addresses parts of 3096779 and 3097475
1cf3e2d0029e3f93d0c22a1b7a37025464c6c660 16-Oct-2010 Mathias Agopian <mathias@google.com> am a8faf91f: am 6d71f6a0: Merge "fix [3095607] Gingerbread screen turn-on animation does not show the last frame" into gingerbread

Merge commit 'a8faf91fa558be1235d508e776eb24be4429585c'

* commit 'a8faf91fa558be1235d508e776eb24be4429585c':
fix [3095607] Gingerbread screen turn-on animation does not show the last frame
3577e98ffac36e3961597cbb0341501ccac3be4a 15-Oct-2010 Mathias Agopian <mathias@google.com> am 3d4a9774: am b0e020ab: Merge "may fix 3097381 and 3097482. don\'t abort on/off if the animation fails" into gingerbread

Merge commit '3d4a9774ced0c704da455c5bd9989127e90ba133'

* commit '3d4a9774ced0c704da455c5bd9989127e90ba133':
may fix 3097381 and 3097482. don't abort on/off if the animation fails
99e3fab534d3a489726665cb8c71edecd5798b04 15-Oct-2010 Mathias Agopian <mathias@google.com> am 5bfa3a34: am 011b5bcc: Merge "implement part of [3094280] New animation for screen on and screen off add support for screen on animation" into gingerbread

Merge commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f'

* commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f':
implement part of [3094280] New animation for screen on and screen off
dfa08fbfd8a5ebd013c122e391282b7f21f6342f 14-Oct-2010 Mathias Agopian <mathias@google.com> [3095807] screen takes a long time to turn on

turn on animation is now ~200 ms (12 frames).

Change-Id: I49ca9e8d0afa566349d360b3b6c88f0d55aa6e75
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d4e03f37423bee383d17f7292753a5f67e497a28 14-Oct-2010 Mathias Agopian <mathias@google.com> addresses parts of 3096779 and 3097475

3097475: Animation setting should control the screen on animation
3096779: CRT power-on animation can briefly show the top app instead of lockscreen

There is now a parameter that controls wether the ON and/or OFF animation are
performed. we also always clear the screen to black on power off, to make
sure it won't briefly appear on power on.
HOWEVER, 3096779 is not 100% fixed in the case where we're doing the animation
because there is a race, where SF doesn't wait (b/c it doesn't know) for the
framework to have redrawn the lockscreen.

Change-Id: Ie0f02c9225fcdf24b1e8907e268eb7da2c5b0a03
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
8b6a0545adb968f15ba8bb8c7587ff9ba356db13 14-Oct-2010 Mathias Agopian <mathias@google.com> fix [3095607] Gingerbread screen turn-on animation does not show the last frame

always redraw the screen entirely after the power-on animation, because:
- the animation may not run (ie: on the emu)
- the animation may not contain the video planes
- the interpolation may not be perfect and not land exactly on the last frame

Change-Id: I9ba40f537b1e94464f8a3ed6f81e7c2f552df51d
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
a6cd6d310473e9896c5148946fe9a5fc57db173b 14-Oct-2010 Mathias Agopian <mathias@google.com> may fix 3097381 and 3097482. don't abort on/off if the animation fails

now that sf handles more of the screen on/off state, we don't want to abort
because/if the animation fails for some reason (which will be the case on the
emulator).

Change-Id: I239e0a39cf8aff3074647e82db92de4a0bf0e494
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
eb86aaaab34687a77454fa130b08788db1317d74 14-Oct-2010 Joe Onorato <joeo@google.com> am 9a12a3c8: am ba799098: Merge changes I76513387,I335fb671 into gingerbread

Merge commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96'

* commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96':
Remove dead code, and make the animation a setting.
turn off the electron beam
2d2b803a92ba531cf6c4bb7042326653255b8780 13-Oct-2010 Mathias Agopian <mathias@google.com> implement part of [3094280] New animation for screen on and screen off
add support for screen on animation

Change-Id: If50cf52ae04b95b42da7d74cf7fa96d5cb54d238
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
aab758e87991d1460ca94d4a5f22c0ef34641e2d 11-Oct-2010 Mathias Agopian <mathias@google.com> turn off the electron beam

Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
597c7f67b5f2491c6098a1de241a3f0fd274688a 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
38ed2e39c54a42dda8f00620f960788f569a3698 29-Sep-2010 Mathias Agopian <mathias@google.com> refactored screenshot code

the core screenshot function now can capture the screen at any lower resolution
performing bilinear filtering.

we also now have some client code to interface with the screenshot service.

it's now possible to request a screenshot at a lower resolution.

Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
d95fec08916698f7bdd9f4b293d418ae4b4f60c5 25-Sep-2010 Mathias Agopian <mathias@google.com> am 495ad4f2: am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbread

Merge commit '495ad4f22096aa172d025c16c25497e7dad8f2bd'

* commit '495ad4f22096aa172d025c16c25497e7dad8f2bd':
simple test app for screen capture API
add support for [1974164] Be able to take a screen shot on the device
ca5edbeba92b96913291792a4df984e158853b6d 24-Sep-2010 Mathias Agopian <mathias@google.com> add support for [1974164] Be able to take a screen shot on the device

screenshots are taken using ISurfaceComposer::captureScreen() which returns
the size of the screenshot and an IMemoryHeap containing the data.
screenshots have limitations:
- they will always fail if a secure window is up on screen
- require GL_OES_framebuffer_object extension
- in some situation, video planes won't been captured

Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
90da4dd2a20c11fa2f9b860905c867a64b2b299e 24-Sep-2010 Mathias Agopian <mathias@google.com> dump HWC state in dumpsys

Change-Id: Ifbb38ca1ac9685776250e01c8d02021b35af72cf
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
6a9692424a88bf87b80870915946af401fd8dc1f 23-Sep-2010 Mathias Agopian <mathias@google.com> add a way to toggle the h/w composer at runtime

to DISABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 1

to ENABLE the h/w composer:
adb shell service call SurfaceFlinger 1008 i32 0

the state is dumped in "dumpsys SurfaceFlinger"

Change-Id: I23e2242d42c6e3fd5261a83332dd900b189e38ce
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
10a96daf7fefb2c1e6381ea233f2aac3fae2869c 17-Sep-2010 Mathias Agopian <mathias@google.com> am 793b2293: am 1bcb8b1a: Merge "surfaceflinger / GL extensions cleanup" into gingerbread

Merge commit '793b2293797ea930078640c4827d3cbdf449c227'

* commit '793b2293797ea930078640c4827d3cbdf449c227':
surfaceflinger / GL extensions cleanup
e20a56d929fc8fedc2b468ea6d1900bd2aa6e81a 16-Sep-2010 Michael I. Gold <gold@nvidia.com> surfaceflinger / GL extensions cleanup

Add correct enumerants for OES_EGL_image_external to glext.h.
SurfaceFlinger now checks for the correct extension name.

Change-Id: I2ba2728a01fa2260bd086d2df4316c68f694a9b1
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
a5ab8ce602ecfd897805e185c89a6eff0c78aabe 15-Sep-2010 Mathias Agopian <mathias@google.com> resolved conflicts for merge of 48a86240 to master

Change-Id: I2305fef9f4dd46183337217d822df3c675b6b6e5
04262e9f842edf20168399b6a70f0d67e518fe69 14-Sep-2010 Mathias Agopian <mathias@google.com> Add logging of various important graphics events

There are 16 events logged in the event log:
SF_APP_DEQUEUE_BEFORE
SF_APP_DEQUEUE_AFTER
SF_APP_LOCK_BEFORE
SF_APP_LOCK_AFTER
SF_APP_QUEUE

SF_REPAINT
SF_COMPOSITION_COMPLETE
SF_UNLOCK_CLIENTS
SF_SWAP_BUFFERS
SF_REPAINT_DONE

SF_FB_POST_BEFORE
SF_FB_POST_AFTER
SF_FB_DEQUEUE_BEFORE
SF_FB_DEQUEUE_AFTER
SF_FB_LOCK_BEFORE
SF_FB_LOCK_AFTER

all events log the buffer conserned and a timestamp in microseconds.

by default the logging is not enabled, to turn it on:
adb shell service call SurfaceFlinger 1006 i31 1
adb shell setprop debug.graphic_log 1

The effect is immediate in SurfaceFlinger, but applications need to be
restarted.

Change-Id: Ifc2e31f7aed072d9a7dede20ff2ce59231edbec1
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
982f58bdccce7e4e537cffb2410ad78d73398461 09-Sep-2010 Antti Hatala <ahatala@nvidia.com> surfaceflinger: composite HWC_SKIP_LAYER layers

Change-Id: I363ede63287ae903d66d0d419343f4ecd81bcc00
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
4c0a4a2b74db9d4a439a0aaa39d80586f7eb1258 08-Sep-2010 Antti Hatala <ahatala@nvidia.com> surfaceflinger: unlock clients only after flip

Change-Id: I039291a36f05bbaa02b29325d4012114abd784b9
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
85cfdd011241a5f2fb7fabc65b5943a39af7e1de 11-Aug-2010 Jamie Gennis <jgennis@google.com> Change the framework to use the new camera preview path.

This change makes the camera HAL interface take an ANativeWindow interface from
which all the camera preview buffers will be allocated. The framework code
running in application processes now passes a Surface object rather than an
ISurface to the camera server via Binder when setting the preview surface. The
camera server then forwards that Surface object (which implements the
ANativeWindow interface) to the camera HAL, which uses it to communicate with
SurfaceFlinger to allocate the camera preview buffers.

Change-Id: Ie438f721559cd7de5e4f848a26d96360dda07b5f
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e3c01832fc741e9908f047d86cd40db1ea5d78c8 16-Aug-2010 Andreas Huber <andih@google.com> Squashed commit of the following:

commit 35cc68814a9537c31fde146e171e7b0bbdfe211e
Author: Andreas Huber <andih@google.com>
Date: Mon Aug 16 08:48:42 2010 -0700

Only enable support for yuv to yuv conversion on passion, where it's available, use the slower yuv->rgb565 path everywhere else.

commit d8ac5a8814103e60d11d2acf61997fc31a1dc58d
Author: Andreas Huber <andih@google.com>
Date: Fri Aug 13 13:56:44 2010 -0700

The software renderer takes over all rendering, converting from yuv to yuv if possible and rgb565 otherwise.

commit 684972074b74318bdcb826ed9b5b0864d2d2e273
Author: Andreas Huber <andih@google.com>
Date: Fri Aug 13 09:34:35 2010 -0700

A first shot at supporting the new rendering APIs.

Change-Id: Iea9b32856da46950501f1a700f616b5feac710fd
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
cfa275908a220c5e1cf496f7fdde1c04e24e95da 18-Aug-2010 Mathias Agopian <mathias@google.com> revert hwcomposer HAL changes. DO NOT MERGE.

This reverts commit:
94364b91a2894bf037b8beb027132fbb812e1434
f8e705dea48f77f1c2532fdbadd4997dd1851af0
b59beb5ca68d0228f60dda60d85e2d0226b33215
e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
94364b91a2894bf037b8beb027132fbb812e1434 13-Aug-2010 Erik Gilling <konkers@android.com> surfaceflinger: don't check HWComposer numLayers unless one exists

Change-Id: I4b83f7bf7ba1318c70054117f14e759fe0ad105c
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
0cf2f4354bf8952d822fa4ee9b9588a73999c2f4 13-Aug-2010 Erik Gilling <konkers@android.com> surfaceflinger: don't check HWComposer numLayers unless one exists

Change-Id: I6524f46910b761cff3ef696edf5a65a424879faa
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
f8e705dea48f77f1c2532fdbadd4997dd1851af0 13-Aug-2010 Mathias Agopian <mathias@google.com> Fix a couple issues with the new hwcomposer HAL

- we now clear the framebuffer upon request from the HAL
- the HAL list size could get out of sync with reality
- there was also an issue where sometime we could run past the list

Change-Id: Ic3a34314aed24181f2d8cc787096af83c046ef27
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
e0d5f5bcf5a8b26f4ad75f549cbf380b2c9faf20 11-Aug-2010 Mathias Agopian <mathias@google.com> call into hwcomposer HAL when present

Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
1efba9a61716356014f4c452fd9e099c5ebe9bd0 11-Aug-2010 Mathias Agopian <mathias@google.com> get rid of our LayerVector implementation

we now use SortedVector<> with a special compare implementation.

Change-Id: I910459cf3b3c8993b55ad0786a8c348369262de5
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
ff1d4102882ae9641a61fc4a3937866521bb72dc 11-Aug-2010 Mathias Agopian <mathias@google.com> keep a list of visible sorted surfaces

Change-Id: Ib815eeff894f8a3b1e79fbbf8186d5d91bb60285
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
24651682edaf71e8a826f23a7ea09bc97c8072c4 15-Jul-2010 Mathias Agopian <mathias@google.com> added BinderService<> template to help creating native binder services

Change-Id: Id980899d2647b56479f8a27c89eaa949f9209dfe
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp
08e83bb3b7cc41f603867acbeb1168019cf535fe 15-Jul-2010 Mathias Agopian <mathias@google.com> move native services under services/

moved surfaceflinger, audioflinger, cameraservice

all native services should now reside in this location.

Change-Id: Iee42b83dd2a94c3bf5107ab0895fe2dfcd5337a8
/frameworks/base/services/surfaceflinger/SurfaceFlinger.cpp