Commit Graph

47 Commits

Author SHA1 Message Date
Mathias Agopian
1b5e1021b8 more surfaceflinger cleanups
get rid of the "fake rtti" code, and use polymorphism instead.
also simplify how we log SF's state (using polymorphism)

Change-Id: I2bae7c98de4dd207a3e2b00083fa3fde7c467922
2010-04-21 22:28:20 -07:00
Mathias Agopian
285dbde2e0 Added a name to Surface created by SurfaceFlinger
Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
2010-03-01 18:34:50 -08:00
Mathias Agopian
9cce325fae split libsurfaceflinger_client and libcamera_client out of libui 2010-02-11 13:16:22 -08:00
Mathias Agopian
2b92d89e23 Add support for physically rotated displays
This feature is currently controled by a system property.
"ro.sf.hwrotation" can be set to either 90 or 270. It'll cause
SF to rotate the screen by 90 and 270 degres respectively.

That is, if the driver reports 800x480 for instance, and
ro.sf.hwrotation is set to 90, applications will "see" a
480x800 display and will run in portrait.

This is implemented by introducing an extra "display"
transformation in the GraphicPlane.
2010-02-08 15:49:35 -08:00
Mathias Agopian
0408772e34 fix [2297155] SurfaceFlinger's freeze-timeout doesn't work
There was bug in the logic that calculated the relative timeout, the start time was
reset each time an event was received, which caused the timeout to never occur if
an application was constantly redrawing.

Now we always check for a timeout when we come back from the waitEvent() and
process the "anti-freeze" if needed, regardless of whether an event was received.
2009-12-01 17:23:28 -08:00
Andy McFadden
550a11455a DO NOT MERGE: Another gcc 4.0.3 workaround.
Temporarily make a function public that doesn't need to be.  When
host gcc-4.0.3 is gone from the build servers we can undo this.

(Cherry-picked from eclair-mr2.)
2009-10-30 10:24:06 -07:00
Mathias Agopian
3330b20303 fix [2167050] glTexImage2D code path buggy in SurfaceFlinger
When EGLImage extension is not available, SurfaceFlinger will fallback to using
glTexImage2D and glTexSubImage2D instead, which requires 50% more memory and an
extra copy. However this code path has never been exercised and had some bugs
which this patch fix.

Mainly the scale factor wasn't computed right when falling back on glDrawElements.
We also fallback to this mode of operation if a buffer doesn't have the adequate
usage bits for EGLImage usage.

This changes only code that is currently not executed. Some refactoring was needed to
keep the change clean. This doesn't change anything functionaly.
2009-10-06 17:00:25 -07:00
Mathias Agopian
8c0a3d75c8 fix [2133214] STOPSHIP: revert I4a06bb4f: workaround for [2113743] Sholes: frozen then runtime restart going to list view
Revert "workaround for [2113743] Sholes: frozen then runtime restart going to list view"

This reverts commit 4a06bb4f3355b0ef2b76aa883704da9d154c44ae.
2009-09-23 16:59:57 -07:00
Andy McFadden
2944a2b360 Work around gcc 4.0.3 bug.
This appears to fix the sim-eng build on the gDapper build machines.

Basic problem is that LayerBuffer::OverlaySource has a constructor that
calls SurfaceFlinger.signalEvent().  SurfaceFlinger lists LayerBuffer
as a friend, but that's not enough to convince gcc that the embedded
OverlaySource class is also a friend.  I don't see a way to make them
friendly, so I marked signalEvent() as public.
2009-09-21 14:33:20 -07:00
Mathias Agopian
1f0ffc46fd workaround for [2113743] Sholes: frozen then runtime restart going to list view 2009-09-20 17:08:45 -07:00
Mathias Agopian
cbb288bfe8 fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.

The main new feature is to be able to dequeue all buffers at once (very important when there are only two). 

A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.

The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.

eg. Allowed sequence:   DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
2009-09-07 16:32:45 -07:00
Mathias Agopian
9795c42e55 dumpsys SurfaceFlinger will now always dump SF's state, even if SF is deadlocked
(in this case the state is dumped without the proper locks held which could result to a crash)

in addition, the last transaction and swap times are printed to the dump as well as the time spent
*currently* in these function. For instance, if SF is unresponsive because eglSwapBuffers() is stuck,
this will show up here.
2009-08-26 16:55:50 -07:00
Mathias Agopian
1c97d2ebe1 fix a bug that caused the PixelFormat viewed by Surface to be wrong.
what happened is that the efective pixel format is calculated by SF but Surface nevew had access to it directly.
in particular this caused query(FORMAT) to return the requested format instead of the effective format.
2009-08-19 17:46:26 -07:00
Mathias Agopian
5d7126b625 resolved conflicts for merge of ac38dfc5 to master 2009-07-28 14:20:21 -07:00
Mathias Agopian
970112231e fix [2017532] Partial Update leaves residual image. 2009-07-28 10:57:27 -07:00
Mathias Agopian
1df3bbb8d8 trying to fix the sim, I'm not even sure this syntaxe is valid, but my compilo doesn't complain 2009-07-06 19:04:55 -07:00
Mathias Agopian
7303c6bf1a get rid of references to MemoryDealer in SurfaceFlinger 2009-07-02 18:50:51 -07:00
Mathias Agopian
759fdb2ef7 free gralloc buffers as soon as possible (when a surface is not visible any longer), client who have the buffers still mapped won't crash, btu may see garbage data 2009-07-02 18:45:29 -07:00
Mathias Agopian
f9d932774e fix a memory corruption where a SF Client could be used after it's been destroyed 2009-06-19 17:00:27 -07:00
Mathias Agopian
945ebbfd3d implement dimming with a texture on msm7k so it uses copybit 2009-06-18 18:48:39 -07:00
Mathias Agopian
375f56363a new Permission class used to improve permission checks speed (by caching results) 2009-06-15 21:56:51 -07:00
Mathias Agopian
3d57964a81 fix a bunch of problems with destroying surfaces.
now, all destruction path, go through the purgatory which is emptied when ~ISurface is called, but we also make sure to remove the surface from the current list from there (in case a client forgot to request the destruction explicitely).
2009-06-04 18:46:21 -07:00
Mathias Agopian
310f8da0c3 merge master to master_gl 2009-05-22 02:16:08 -07:00
Android (Google) Code Review
bdbf6b094d am 69a6c3eb: Merge change 2292 into donut
Merge commit '69a6c3ebd46a8de0e896747757f364322c12608d'

* commit '69a6c3ebd46a8de0e896747757f364322c12608d':
  split boot animation out of SurfaceFlinger
2009-05-21 19:36:53 -07:00
Mathias Agopian
a1ecca920e split boot animation out of SurfaceFlinger
Conflicts:

	data/etc/platform.xml
2009-05-21 19:21:59 -07:00
Mathias Agopian
c5b2c0bf80 move libbinder's header files under includes/binder 2009-05-20 12:55:03 -07:00
Mathias Agopian
0926f50664 update surfaceflinger, libui and libagl to the new gralloc api
- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually.
- factor all the lock/unlock code in SurfaceBuffer.
- fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers().
- improved the situation with the dirty-region and fixed a problem that caused GL apps to not update.
- make use of LightRefBase() where needed, instead of duplicating its implementation
- add LightRefBase::getStrongCount()
- renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp

- disabled copybits test, since it clashes with the new gralloc api

- Camera/Video will be fixed later when we rework the overlay apis
2009-05-04 14:17:04 -07:00
Mathias Agopian
cbc93ca800 get rid of the "show fps" debug option 2009-04-24 16:31:11 -07:00
Mathias Agopian
f1d8e87b09 a brand new MessageQueue for SurfaceFlinger. 2009-04-24 16:22:36 -07:00
Mathias Agopian
9a11206fe7 more Surface lifetime management
Surfaces are now destroyed once all references from the clients are gone, but they go through a partial destruction as soon as the window manager requests it.
This last part is still buggy. see comments in SurfaceFlinger::destroySurface()
2009-04-24 15:00:41 -07:00
Mathias Agopian
01b766839e more splitting of Surface/SurfaceControl. Surface.java is now implemented in terms of Surface and SurfaceControl.
The WindowManager side of Surface.java holds a SurfaceControl, while the client-side holds a Surface. When the client is in the system process, Surface.java holds both (which is a problem we'll try to fix later).
2009-04-16 20:04:08 -07:00
Mathias Agopian
076b1cc3a9 Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2009-04-10 14:24:30 -07:00
Mathias Agopian
c08731e756 AI 143320: am: CL 143171 am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
  Merged from: //branches/cupcake/...
  Original author: android-build
  Merged from: //branches/donutburger/...

Automated import of CL 143320
2009-03-27 18:11:38 -07:00
Mathias Agopian
0d1318b974 AI 143309: am: CL 143160 am: CL 142856 new-new-new-new rotation animation. it may still change one more time.
Original author: mathias
  Merged from: //branches/cupcake/...
  Original author: android-build
  Merged from: //branches/donutburger/...

Automated import of CL 143309
2009-03-27 17:58:20 -07:00
Mathias Agopian
24fd77d440 AI 143171: am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
  Merged from: //branches/cupcake/...

Automated import of CL 143171
2009-03-27 16:10:37 -07:00
Mathias Agopian
ecbeaa0cf1 AI 143160: am: CL 142856 new-new-new-new rotation animation. it may still change one more time.
Original author: mathias
  Merged from: //branches/cupcake/...

Automated import of CL 143160
2009-03-27 15:36:09 -07:00
Mathias Agopian
7c143aab44 Automated import from //branches/master/...@142447,142447 2009-03-24 22:50:50 -07:00
Mathias Agopian
74c770be33 Automated import from //branches/donutburger/...@142446,142446 2009-03-24 22:43:22 -07:00
Mathias Agopian
e74be0afd9 Automated import from //branches/master/...@141504,141504 2009-03-24 20:25:55 -07:00
Mathias Agopian
3df5e433a2 Automated import from //branches/donutburger/...@141502,141502 2009-03-24 20:25:29 -07:00
The Android Open Source Project
edbf3b6af7 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d5193d9394 auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
ac65e0b172 auto import from //branches/cupcake/...@131421 2009-02-13 12:57:50 -08:00
The Android Open Source Project
a6938bab1f auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
276293246e auto import from //branches/cupcake/...@125939 2009-01-09 17:51:23 -08:00
The Android Open Source Project
e09fd9e819 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
7c1b96a165 Initial Contribution 2008-10-21 07:00:00 -07:00