Commit Graph

46348 Commits

Author SHA1 Message Date
Mathias Agopian
fca660cf73 don't wake-up eventthread every 16ms if there are no vsync requests
Bug: 6332534
Change-Id: Idf79ad913770c6180969f6c95a9b125fff580231
2012-04-12 20:43:16 -07:00
Mathias Agopian
b364be8e55 fix a typo causing pre-rotation to never work
Change-Id: I8d698ec52d53ef1a553b887c7329413e1f49cc72
2012-04-12 19:40:28 -07:00
Daniel Lam
016c8cbce4 Enabled cropping support in SurfaceTexture
SurfaceTexture will modify the crop rect so it matches
the desired output aspect ratio when the scaling
mode is NATIVE_WINDOW_SCALING_MODE_CROP.  Added a test
for this new scaling mode.

Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
2012-04-12 17:49:03 -07:00
Ramanan Rajeswaran
3bc59682cd add com.android.nfc_extras to native/ for pdk.
Change-Id: Ife40ac33241878814f5d9e027e43cd176c57fb56
2012-04-12 13:11:23 -07:00
Mathias Agopian
948f390bfd Merge "Revert "handle surfaces posts independently from composition"" 2012-04-11 20:45:32 -07:00
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
Jamie Gennis
a96b6bdea3 SurfaceTexture: work around a compiler bug
This change works around a compiler bug with the GCC 4.6 toolchain.

Bug: 6292211
Change-Id: I004c4750d92a29f193a37d8e605a28fdc3b7f076
2012-04-11 18:37:54 -07:00
Jamie Gennis
c2c380259b SurfaceTexture: add a test for user sizes & prerotation
This change adds 3 tests for:
- User-overridden buffer size
- Transform hint
- User-overridden buffer size with transform hint

Change-Id: Ib15ea354685e436822c506099613b2bffa7b68c9
2012-04-11 18:37:54 -07:00
Michael I. Gold
55a701459d SurfaceTextureClient: support for application buffer dimensions
Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.

Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
2012-04-11 18:37:54 -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
ea0c6c9396 Merge "make sure to disable VSYNC while screen is off" 2012-04-11 18:13:55 -07:00
Mathias Agopian
ceb8c19325 Merge "rework screen on/off code" 2012-04-11 15:35:21 -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
Jeff Sharkey
f573e9f5ca Merge "Add sdcard_r group to dumpstate." 2012-04-11 12:31:43 -07:00
Jeff Sharkey
4287cb4595 Add sdcard_r group to dumpstate.
Bug: 6321962
Change-Id: I318cd88493396f3d8adb5d4d0fc7a12ee40ba737
2012-04-11 12:27:48 -07:00
Mathias Agopian
b60314a12f rework screen on/off code
Change-Id: I13f71e850592a588bbd4805b1830c503bd4decb4
2012-04-10 22:18:43 -07:00
Mathias Agopian
e2c4f4ec23 Added vsync debugging information in dumpsys log
Change-Id: I20ef05a73d89caaf6a70dc9ca25ada6e6a1f6ff9
2012-04-10 21:04:12 -07:00
Mathias Agopian
f0bc2f1d8d use in/out structures for queueBuffer() IPC
Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
2012-04-10 21:04:12 -07:00
Mathias Agopian
cac72cdbdf Merge "BufferQueue returns proper code on acquire" 2012-04-10 18:53:50 -07:00
Daniel Lam
fbcda930dd BufferQueue returns proper code on acquire
Also removed unnecessary debug messages from
SurfaceTextureClient.

Change-Id: I291897a44170142f9d42a007b008823fad4683e0
2012-04-09 23:21:33 -07:00
Jesse Hall
258385978c Hibernate the EGL implementation when idle
If the EGL implementation supports the EGL_IMG_hibernate_process
extension, use it to hibernate (and hopefully release memory or other
resources) when the process isn't actively using EGL or OpenGL ES. The
idleness heuristic used in this change is:

(a) Wake up when entering any EGL API call, and remain awake for the
    duration of the call.
(b) Do not hibernate when any window surface exists; this means the
    application is very likely in the foreground.
(c) Do not hibernate while any context is made current to a thread.
    The app may be using a client API without the EGL layer knowing,
    so it is not safe to hibernate.
(d) Only check these conditions and attempt to hibernate after a
    window surface is destroyed or a thread's context is detached. By
    not attempting to hibernate at the end of every EGL call, we avoid
    some transient wakeups/hibernate cycles when the app is mostly idle,
    or is starting to become active but hasn't created its window
    surface yet.

On a Galaxy Nexus, hibernating frees 1567 VM pages from the process.
Both hibernating and waking can take anywhere from 30ms to over 100ms
-- measurements have been very inconsistent.

Change-Id: Ib555f5d9d069aefccca06e8173a89625b5f32d7e
2012-04-09 21:36:17 -07:00
Jesse Hall
b29e5e8c26 Increment/decrement a counter around EGL calls
This is in preparation for a change that will hibernate the underlying
EGL when idle. Instead of a bare egl_display_t*, get_display() now
returns a egl_display_ptr, which acts like a smart pointer. The
"wakecount" counter managed by the smart pointer isn't used for
anything in this change. It will be used to make sure we don't
hibernate when any thread is in an EGL call, without having to hold a
mutex for the duration of the call.

Change-Id: Iee52f3549a51162efc3800e1195d3f76bba2f2ce
2012-04-09 21:35:17 -07:00
Mathias Agopian
d5caca1d0d Merge "BufferQueue no longer hardcodes buffer counts" 2012-04-09 17:35:00 -07:00
Mathias Agopian
3a77871383 start VSYNC thread when HWC doesn't handle it
Change-Id: I853a822ea9ec13870ae25af55a89ad9a8cc3936a
2012-04-09 14:16:47 -07:00
Mathias Agopian
2965b26022 VSYNC handling cleanup
Change-Id: I1376bf864c4e03c11fb6d1333a8b7cfdda08c9e4
2012-04-08 20:54:47 -07:00
Mathias Agopian
d94d3b890a avoid turning vsync off/on at each frame
always keep vsync active for an extra frame before
deciding if it should be turned off.

Change-Id: I55b03265b7851b33a595e46a013f2ab55e66c964
2012-04-08 15:01:31 -07:00
Daniel Lam
abe61bfda4 BufferQueue no longer hardcodes buffer counts
BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.

Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
2012-04-06 21:02:13 -07:00
Jamie Gennis
c522a6a5bf Merge "EGL: add GPU frame completion tracing" 2012-04-06 15:58:55 -07:00
Nick Kralevich
cb9be123ab Merge "dumpstate: don't follow symlinks when creating /data/anr/traces.txt" 2012-04-06 15:34:02 -07:00
Glenn Kasten
485744e694 Merge "Add a log tag" 2012-04-06 14:50:42 -07:00
Erik Gilling
1a3bf41b71 Fix SurfaceFlinger crash in HWC::eventControl
eventControl was not checking if there was a hwc before callingi
hwc->eventControl

Change-Id: I4d739fc9c0d47da131f4ffc5d50e274de156d012
2012-04-06 14:13:32 -07:00
Nick Kralevich
a344c2bb4d Merge "Ensure that /data/anr/traces.txt is world-writable" 2012-04-06 10:51:11 -07:00
Nick Kralevich
d51820e8de dumpstate: don't follow symlinks when creating /data/anr/traces.txt
Make Android more robust against symlink attacks when /data/anr
is world-writable.

Bug: 5614000
Change-Id: I9a7e4c4ec9aa4300ac30a968db0dcd276f364ab6
2012-04-06 09:53:45 -07:00
Nick Kralevich
c7f1fe2680 Ensure that /data/anr/traces.txt is world-writable
The umask changed for init. We have to force /data/anr to be world
readble and /data/anr/traces.txt to be world writable so dalvik
processes can write to it.

Hopefully this is a short term change while we investigate tightening
up these permissions.

Bug: 6300296
Change-Id: Iacb4c9f1bc69d2ac679697f9cf9a52694f888489
2012-04-06 09:46:10 -07:00
Jamie Gennis
28ef8d7911 EGL: add GPU frame completion tracing
This change adds a debug option to EGL to use an EGLSyncKHR each frame to
determine when the GPU finishes rendering the frame.

Change-Id: I09ce071db904b44f07ca814c586c291c8b59385a
2012-04-06 09:23:13 -07:00
Jamie Gennis
8cce8a9a75 Merge "Fixed disconnect bug in SurfaceTexture" 2012-04-06 09:05:49 -07:00
Glenn Kasten
84ed8001d4 Add a log tag
Change-Id: If30aa8536130cf6ff9918ce97c5e4e8651ae2fef
2012-04-05 13:43:57 -07:00
Mathias Agopian
3eb38cb33e SurfaceFlinger now uses the new VSYNC HAL API.
If h/w composer doesn't support vsync (version < 0.3) we
"fake" it with a timer.

Change-Id: I1e3be79f43c9631d1293ad7d6cf52f9bfc42d65b
2012-04-04 19:01:20 -07:00
Mathias Agopian
9d61b955db Merge "Add HWC vsync hook. Currently unused." 2012-04-03 18:32:39 -07:00
Mathias Agopian
31d2843b45 Add HWC vsync hook. Currently unused.
Change-Id: I849d56f375813a044c5e2d0b25f791476a60fa01
2012-04-03 18:30:35 -07:00
Mathias Agopian
cb9732a951 refactor / simplify EventThread
Change-Id: I3981c6fba93b7b985174b2a7045e24db2c0b4428
2012-04-03 18:28:25 -07:00
Mathias Agopian
9b71221171 Merge "use a socketpair instead of a pipe in BitTube" 2012-04-03 15:38:10 -07:00
Andreas Huber
cf0db31c32 New Crypto "HAL" API.
Change-Id: I225cdfeffb7663a2d639a01cfe704aa12f9014b8
related-to-bug: 6275919
2012-04-03 14:15:05 -07:00
Mathias Agopian
7b5be95cb3 use a socketpair instead of a pipe in BitTube
Bug: 6252830
Change-Id: Ia7a7b08409517214136261c05569dc5959a597ab
2012-04-02 18:41:10 -07:00
Yang Chuang
a1ec30ef26 Add Japanese specific key codes
These keys are specific to Japanese hardware keyboard which can be
used by input method.

Patch ported from AOSP, with the addition of KANA.

Change-Id: I1474f0eb8971ed5d632822b1f9825c426f4817eb
2012-04-02 15:20:24 -07:00
Daniel Lam
9abe1ebc95 Fixed disconnect bug in SurfaceTexture
BufferQueue's disconnect could race with updateTexImage
where invalid buffers could be released.  Additionally
fixed similar bug with setBufferCount.  Tests were added
to stress the disconnect mechanism.

Change-Id: I9afa4c64f3e025984e8a9e8d924852a71d044716
2012-04-02 14:55:01 -07:00
Jamie Gennis
0e1080f887 Merge "SurfaceTexture: add context attach & detach" 2012-04-01 15:41:24 -07:00
Jamie Gennis
74bed55fff SurfaceTexture: add context attach & detach
This change adds the detachFromContext and attachToContext methods to
SurfaceTexture.  These methods allow the SurfaceTexture to switch from
one consumer GLES context to another.  This change also includes a few
cleanups to the error return codes in updateTexImage.

Change-Id: I0df1eb599aa7b6f58f07431f242f8f09269559ed
2012-03-30 16:47:28 -07:00
Mathias Agopian
851ef8f1bf reduce IPC with BufferQueue
collapse setCrop, setTransform and setScalingMode to queueBuffer()
this ends up simplifying things quite a bit and reducing the numnber
of IPC needed per frame.

Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
2012-03-30 15:16:30 -07:00
Jamie Gennis
9285a16450 Merge "Refactored DummyConsumer" 2012-03-29 13:57:10 -07:00