Commit Graph

177 Commits

Author SHA1 Message Date
Mathias Agopian 69a655caef Revert "handle surfaces posts independently from composition"
This reverts commit 562f4b2c1e.

Change-Id: I96efe11c2f0494ed2d57fc580e49c598d913830e
2012-04-11 20:43:40 -07:00
Mathias Agopian 562f4b2c1e handle surfaces posts independently from composition
surfaceflinger will now handle each surface post
as soon as possible and handle the composition
itself at VSYNC time as usual.

Change-Id: I6b1ae33fd56062d86e5419ebab8def0ca5803fbf
2012-04-11 18:17:30 -07:00
Mathias Agopian 22ffb117b0 make sure to disable VSYNC while screen is off
Change-Id: If1894c43b0a39a2851e1280a35ae77bccd6d9abd
2012-04-11 15:31:40 -07:00
Mathias Agopian b60314a12f rework screen on/off code
Change-Id: I13f71e850592a588bbd4805b1830c503bd4decb4
2012-04-10 22:18:43 -07:00
Mathias Agopian cb9732a951 refactor / simplify EventThread
Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
2012-04-03 18:28:25 -07:00
Mathias Agopian 4b2ba53423 better workaround for bug: 6020860
this prevents the GPU from running when composition
is fully handled by overlays. this should improve
animations a bit.

Change-Id: If4ae584b7a3976e6bdd36e318686ac3940b6b075
2012-03-29 12:23:51 -07:00
Colin Cross 3854ed5490 surfaceflinger: disable ddms debugging on pdk builds
DDMS debugging depends on non-pdk apis, disable it when a pdk
build is selected.

Change-Id: I6376b5c4cf49f2c51f35f8d567f7c6d18daf893f
2012-03-23 15:54:21 -07:00
Mathias Agopian b5dd9c0fee rewrite density calculation code so it's understandable
Change-Id: I1016cd5fd75355abe4ab879d04f4849bd2dd4122
2012-03-22 12:20:06 -07:00
Daniel Lam b267579ba8 SurfaceTexture: Fully refactored from BufferQueue
SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
2012-03-13 14:39:07 -07:00
Mathias Agopian fddc28d871 add ATRACE logs for screenshots
Change-Id: Ie8146c4d7608159e9d28b7338f9109b8fcdf955f
2012-03-13 16:50:39 -04:00
Mathias Agopian 35aadd6be2 fix surfaceflinger's dumpsys
Change-Id: I7b95c3e04f145003f9c0eef321a21f3f36dfe835
2012-03-08 22:01:51 -08:00
Mathias Agopian 841cde5554 add more ATRACE
Change-Id: I6cc5759fb0a05427680488fd12ae797e77644f3d
2012-03-01 20:16:39 -08:00
Jamie Gennis 1c8e95cf86 Add tracing to various graphics components.
This change adds ATRACE call tracing to BufferQueue,
SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL.

Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
2012-02-27 17:50:35 -08:00
Mathias Agopian 90ac799241 fix libgui header location
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-27 13:03:08 -08:00
Mathias Agopian ff615cc7a1 deprecate L_8, LA_88 and RGB_332 in sdk
re-add support for pixelformats L_8, LA_88 and RGB_332 in libui
for backward compatibility.

This may or may not fix 6058926

Bug: 6049685
Change-Id: Ic1b8b4cc994522f7fe664da64c0ef76b98bc6d53
2012-02-24 14:58:36 -08:00
Mathias Agopian fbc7922ec8 workaround for an issue where the screen would flicker sometimes
bug: 6020860
Change-Id: I97807db66b66c5f4dcbed0df79d5d257cfc7c0bd
2012-02-23 21:20:01 -08:00
Mathias Agopian 4d143eed99 fix an issue in SF where we could miss some updates
Change-Id: I7d350bc05d1596655baddff3deaebaba58c9bcc0
2012-02-23 21:17:01 -08:00
Mathias Agopian 751d0bb9b2 Merge "SurfaceFlinger: set wrap mode on screenshot texture" 2012-02-20 22:50:36 -08:00
Dianne Hackborn 1676828d11 Merge "Return information about whether overlays are disabled." 2012-02-07 13:46:46 -08:00
Dianne Hackborn 12839bee29 Return information about whether overlays are disabled.
Change-Id: I85ae42e9f28461f5142cc6b3c8e25ff3f195805a
2012-02-06 21:21:05 -08:00
Mathias Agopian f6de1c04ff fix a crasher when starting SF with the screen off
SF could end-up in an infinite crash-loop during startup if it
was stopped while the screen was off. This happened because
the thread that manages screen blanking was started before
other important pieces of SF were initialized.

Change-Id: I0dded11dbf2395fdd57b673859a7aa0fa9eb32b6
2012-02-05 02:15:28 -08:00
Mathias Agopian 303d538bb0 ui freeze workaround: reenable triple buffering mode
we're seeing UI freezes when window updates and
composition are separated. for now we workaround this
by always doing a composition after window updates on
vsync. triple buffering is reenabled for performance.

Change-Id: I693d705000b7452489bb0b4918fbeadb9879315c
2012-02-05 01:49:16 -08:00
Mathias Agopian c95dbdc236 improve SF dumpsys 2012-02-05 00:19:27 -08:00
Mathias Agopian b048cef231 fix UI freezes
In some situations SF would mark a window as "has a pending update"
but would never process that update because the window is not
visible (fully transparent, hidden by another window, etc...), this
window would then be "stuck" until some other window updated.

Change-Id: Ifa18a9aef3a53f2593b473556702688ae62d9503
2012-02-04 15:44:04 -08:00
Mathias Agopian c9ca701150 attempt to fix an ANR in various apps
recent changes in SF introduced a hang where some windows would
stop being refreshed.
This is an attemp to fix that.

Change-Id: I6aa32ac0d6f1c0a6aea8f6195825dc4f4e6f93f9
2012-02-03 17:22:09 -08:00
Mathias Agopian 99ce5cdeb3 separate transactions from updates
with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
2012-02-01 20:43:06 -08:00
Mathias Agopian 8aedd4737d SF now synchronizes to VSYNC
Change-Id: Ic5e4f2ea9927ce133eef9499c03161325e9d02c5
2012-01-30 15:21:23 -08:00
Mathias Agopian ad8d13c885 remove unneeded code
Change-Id: I07e2fca7274d2e12bf5b4aee0050794bdb97a8b3
2012-01-29 23:11:06 -08:00
Mathias Agopian 25e66fc324 added a few more commands to SF's dumpsys
--latency-clear [name]
clears the latency data for the specified layer or for
all layers if none is specified

--list
prints the list of all layers regardless of their visibility

Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
2012-01-28 22:31:55 -08:00
Mathias Agopian 82d7ab6c7e improve SurfaceFlinger dumpsys
It is now possible to say:

dumpsys SurfaceFlinger --latency

to print latency information about all windows

dumpsys SurfaceFlinger --latency window-name

to print the latency stats of the specified window

for instance: dumpsys SurfaceFlinger --latency SurfaceView

The data consists of one line containing global stats, followed by
128 lines of tab separated timestamps in nanosecond.

The first line currently contains the refresh period in nanosecond.
Each 128 following line contains 3 timestamps, of respectively
the app draw time, the vsync timestamp just prior the call to set and
the timestamp of the call to set.

Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
2012-01-24 18:22:56 -08:00
Jamie Gennis e8696a40e0 hack up frame latency measurement
Change-Id: I6d9a466a23285304f0e229a5649815636ab5d6af
2012-01-24 15:41:50 -08:00
Glenn Kasten 1db13d7951 Get AID_GRAPHICS from right place
Change-Id: I97b1754dc7260fec083275c71a8f71ebfb2cefa8
2012-01-13 13:45:39 -08:00
Michael I. Gold b1d1c6d4c2 SurfaceFlinger: set wrap mode on screenshot texture
Some implementations of NPOT, particular those derived from core
GLES2, require the wrap mode to be CLAMP_TO_EDGE.  Set the required
wrap mode for the screenshot texture so it passes the completeness
check.

Change-Id: I735016123e4acaf54b40d1435bd70281cef88a31
2012-01-13 00:36:45 -08:00
Mathias Agopian 55ef343331 remove dead/usnused code
Change-Id: I6fa2bc6ee01790abd2c1533f043d61a5e5c8d26e
2012-01-11 22:03:41 -08:00
Steve Block e6f43ddce7 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block 32397c1cd3 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Steve Block c267bab3d1 Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE" 2012-01-05 14:07:02 -08:00
Glenn Kasten 2adea706d4 Merge "Use the standard CC_LIKELY and CC_UNLIKELY macros" 2012-01-05 07:38:29 -08:00
Glenn Kasten 99ed22412d Use the standard CC_LIKELY and CC_UNLIKELY macros
Several source files privately defined macros LIKELY and UNLIKELY in terms
of __builtin_expect. But <cutils/compiler.h> already has CC_LIKELY and
CC_UNLIKELY which are intended for this purpose.  So rename the private
uses to use the standard names.

In addition, AudioFlinger was relying on the macro expanding to extra ( ).

Change-Id: I2494e087a0c0cac0ac998335f5e9c8ad02955873
2012-01-05 07:33:45 -08:00
Steve Block a19954ab37 Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block 9d45368352 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Mathias Agopian 478ae5eb5a Improve the VSYNC api a bit.
- add the ability to set the vsync delivery rate, when the rate is
set to N>1 (ie: receive every N vsync), SF process' is woken up for
all of vsync, but clients only see the every N events.

- add the concept of one-shot vsync events, with a call-back
to request the next one. currently the call-back is a binder IPC.

Change-Id: I09f71df0b0ba0d88ed997645e2e2497d553c9a1b
2011-12-06 22:43:10 -08:00
Jesse Hall 43bfe7f047 am a91e54fe: am f57c1388: Merge "SurfaceFlinger: fix layer removal race condition" into ics-mr1
* commit 'a91e54fed6a0690d59c97bab9b081b2614880563':
  SurfaceFlinger: fix layer removal race condition
2011-12-02 18:35:54 -08:00
Jesse Hall 2f4b68d21c 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
2011-12-02 10:03:25 -08:00
Mathias Agopian 79544364aa am e2970700: am e8ba2aba: Merge "add a way to access the version string of the h/w implementation of EGL" into ics-mr1
* commit 'e2970700e921da4226061988a6e8953b1fbfb5a9':
  add a way to access the version string of the h/w implementation of EGL
2011-11-30 13:57:46 -08:00
Mathias Agopian bc2d79ed7a 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
2011-11-29 18:00:35 -08:00
Mathias Agopian d0566bc26f Add support for sending VSYNC events to the framework
use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: Ia720f64d1b950328b47b22c6a86042e481d35f09
2011-11-29 13:10:25 -08:00
Mathias Agopian 439cf8576d Fix build.
Revert "Add support for sending VSYNC events to the framework"

This reverts commit f3918c5bd4bc9f02f74da42995564150ca2dd382.

Change-Id: I998e3e1aa3fa310829ae973b64fe11b01f6f468f
2011-11-29 13:07:40 -08:00
Mathias Agopian 461afeb9fd Add support for sending VSYNC events to the framework
use gui/DisplayEvent to receive the events. Events are
dispatched through a unix pipe, so the API is compatible
with utils/Looper. see gui/DisplayEvent.h for more info.

Bug: 1475048
Change-Id: If4126023fc9c067e56087ec7d16a8fd542ce1794
2011-11-29 11:44:05 -08:00
Mathias Agopian f61c57fe2e rewrite SF's message loop on top of Looper
Change-Id: Ib56139f87a5c0b124e34da5c8151207219b2577b
2011-11-28 15:21:57 -08:00