Commit Graph

221 Commits

Author SHA1 Message Date
Mathias Agopian 28947d7fbf now able to set the layer stack on a DisplayDevice
Change-Id: Ia9691cf221b9444c243eb468d9e276a30e600b6b
2012-08-10 13:18:23 -07:00
Jamie Gennis 1a4d883dcc surfaceflinger: refactor FrambufferSurface
This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.

Bug: 6620200
Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
2012-08-06 18:55:01 -07:00
Mathias Agopian 4297734c11 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
2012-08-05 00:40:46 -07:00
Mathias Agopian 888c822c4c remove a dependency of DisplayDevice on the refresh rate
this remove a dependency (not all) on FramebufferSurface

Change-Id: Ie07ce70760cdcedfb41b5b41bea8da45637bf474
2012-08-04 21:23:47 -07:00
Mathias Agopian c1d359d42b break SF dependencies on libdvm and libandroid_runtime
these libraries are only needed for debugging and are now
linked at runtime if needed.

Change-Id: I03f138523c6de166a1e2700d4454d4a854aee145
2012-08-04 20:09:48 -07:00
Mathias Agopian 92efd84f37 screen-off animation won't be handled by SF anymore
Change-Id: Idc41386804ae7d7eb981c36e1bc55c270870c8d0
2012-08-03 13:22:58 -07:00
Mathias Agopian 92a979a92c 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
2012-08-02 22:24:12 -07:00
Mathias Agopian fcb239d3da don't filter when capturing a screenshot unless needed
bug: 6919952
Change-Id: Ia6fbe9bc7e533a64cfdd6ef7f0cd6b9f11feb947
2012-08-02 22:24:12 -07:00
Mathias Agopian d3ee231edd 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
2012-08-02 22:24:12 -07:00
Mathias Agopian 0f2f5ff75b rename DisplayHardware to DisplayDevice
Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
2012-08-02 22:24:12 -07:00
Mathias Agopian be246f86bd Layers are now sorted by layer-stack first, then by z-order
Change-Id: I7a82929df5ba87b9d88cc5be87e1a233bc4628e9
2012-08-02 22:24:12 -07:00
Mathias Agopian 52bbb1ae23 getting closer to final main composition loop
Change-Id: Icd63782366ffd11d9ea00c925ae5783ed7440cdb
2012-08-02 22:24:12 -07:00
Mathias Agopian 87baae104a get rid of global regions that should be tracked per display
Change-Id: I3b871860cc29f1b2fdcc22b0c577a6eae65d9296
2012-08-02 22:24:12 -07:00
Jesse Hall 34a09ba1ef Move eglSwapBuffers out of HWComposer
Commit 8630320 moved the eglSwapBuffers fallback (for devices with no
HWC implementation) from DisplayHardware to HWComposer. But HWComposer
only knows about the framebuffer EGL display and surface handles if
there is a HWC, so it was always passing bogus handles.

This change moves the eglSwapBuffers fallback up to SurfaceFlinger,
which has access to the framebuffer EGL handles.

Bug: 6886613
Change-Id: Iad3f5ff7c90ee48d7053999e6a4548d6794b6ebd
2012-07-30 16:10:49 -07:00
Mathias Agopian c666cae2d5 get rid of the shared-memory control block
Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
2012-07-25 21:13:10 -07:00
Mathias Agopian 028508cad5 hopefully fixe a race condition in sf initialization
if we received a vsync event during SF init, we could crash
as not all objects were ready to go.

Change-Id: Ie11b46e3eb1b37a709dd8757843d444f93dd0189
2012-07-25 21:13:10 -07:00
Mathias Agopian 8630320433 split HWComposer out of DisplayHardware
we will only ever have a single instance of HWComposer, so
it's now an attribute of SurfaceFlinger, instead of being part
of DisplayHardware.

DisplayHardware now just represents a "display" (it should be renamed).

Change-Id: Iec191e57686868e1df6daa8b880a286c9fefde56
2012-07-24 22:49:49 -07:00
Mathias Agopian 98a121aa91 get rid of ro.sf.hwrotation, it's not used anymore
Change-Id: I2ee469ac89ecd65d7187be5cab08b5cc18f67cbe
2012-07-24 21:42:27 -07:00
Mathias Agopian 8785578391 add a layerStack attribute to Layers.
this attribute can be set through a regular transaction using
SurfaceComposerClient (just like any other attribute, eg: position or size)

Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
2012-07-24 21:42:27 -07:00
Mathias Agopian 8b33f03232 update SF binder protocol to support setting display attributes
no change of functionality -- the old behavior is implemented
on top of this new protocol.
this new protocol will allow, eventually, to pass informations
about displays and layer stacks.

Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
2012-07-24 20:43:54 -07:00
Mathias Agopian 921e6ac4b7 SurfaceFlinger cleanup
mostly refactored SurfaceFlinger.h, but also removed dead code.
cleaned-up a few includes as well.

Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
2012-07-24 00:09:35 -07:00
Jesse Hall 6ee93c0d36 Increment iterator on early-out too
Bug: 6860046
Change-Id: I82f9e4062cb58d5479c9d8dc5f2f0770a1dcc605
2012-07-23 13:12:28 -07:00
Jesse Hall a6b32db164 Handle empty HWC layer list when composing
Bug: 6777877
Change-Id: I71e9b948d04dda33d45cfa986d9c7e28328cf749
2012-07-20 11:46:58 -07:00
Mathias Agopian a49126087b factor EGL/GL and surface creation out of DisplayHardware
Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
2012-07-19 14:14:58 -07:00
Mathias Agopian 3b1d2b6b2b mVisibleLayersSortedByZ is now maintained per display
Change-Id: Idcdb77eba1a3f99b3e4b2150128a82acaffcd2a8
2012-07-19 14:13:46 -07:00
Mathias Agopian 4fec873a98 one more step towards multiple display support
- remove dependency on cached state in validateVisibility
- get rid of mVertices and mTransformedBounds
- get rid of validateVisibility
- get rid of unlockPageFlip
- handleTransaction now returns a dirty region
- computevisibileregion now uses window-manager space
2012-07-10 14:29:27 -07:00
Jesse Hall c5c5a14c06 Only set acquire fences on overlay layers
Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
2012-07-02 16:49:28 -07:00
Mathias Agopian 1b03149f35 get rid of GraphicPlane
its functionality is now folded into DisplayHardware
there will be more changes in that area.
2012-06-28 17:27:19 -07:00
Mathias Agopian 3094df359d First prototype atttempting to support an external display
both API and implementation will change, this is just a prototype
intended to show feasability.

SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.

Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21
2012-06-28 15:51:08 -07:00
Jesse Hall ef19414bd8 Transfer HWC release fences to BufferQueue
After a HWC set, each SurfaceFlinger Layer retrieves the release fence
HWC returned and gives it to the layer's SurfaceTexture. The
SurfaceTexture accumulates the fences into a merged fence until the
next updateTexImage, then passes the merged fence to the BufferQueue
in releaseBuffer.

In a follow-on change, BufferQueue will return the fence along with
the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the
fence to signal before returning.

The releaseFence default value for BufferQueue::releaseBuffer() is
temporary to avoid transient build breaks with a multi-project
checkin. It'll disappear in the next change.

Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
2012-06-21 22:21:12 -07:00
Mathias Agopian aa049f0d19 am 8aaf3e47: am a67e418e: Exit boot animation cleanly.
* commit '8aaf3e47a51aa0beebecc8c536504d310d07cda9':
  Exit boot animation cleanly.
2012-06-20 13:39:58 -07:00
Mathias Agopian a67e418e1f Exit boot animation cleanly.
The desc.txt file can now mark parts as 'must finish cleanly' by using
'c' as the part line prefix rather than 'p'.  If so indicated, if the
bootanimation is asked to quit it will do so only after waiting to
finish that part.

I considered either making init.c service killing smarter or promoting
bootanim to be a bindable service with a requestExit method.  However,
these changes are probably too big/risky given our ship date.  So
I used a property as a mailbox between SurfaceFlinger and bootanim.

Bug: 6679877
Change-Id: Id7dca22caa50b450fff25ca94f7242d971034f41
2012-06-19 17:32:00 -07:00
Mathias Agopian 5df996211d fix typo in makefile LOCAL_CFLAGS was spelled LOCAL_CLFAGS
Change-Id: I58b96d28f608ce16fcad5ed0efb887e582779e03
2012-06-18 17:27:56 -07:00
Mathias Agopian db403e8ff0 split-up Client.h out of SurfaceFlinger.h
Change-Id: I1993bf23e417163749d886283563a93d50b361b4
2012-06-18 16:47:56 -07:00
Mathias Agopian 3e8b853d67 refactor HWComposer to break dependency with the HAL headers
HWComposer must abstract the HWC HAL entirely, so that the
HAL can continue to evolve (and break binary compatibility)
without breaking SurfaceFlinger. The HWC data structure had
leaked outside of HWComposer, this is now fixed.

We now have an abstract interface that provide all the
needed functionality, HWCompose provides concrete
implementations of it based on the the HWC version.

Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb
2012-06-14 11:56:55 -07:00
Colin Cross 8e533069e5 surfaceflinger: replace early suspend with binder call from PowerManager
SurfaceFlinger will no longer directly synchronize with early suspend.
Instead, PowerManagerService will synchronize with SurfaceFlinger to
ensure that a black frame has been drawn on the display, and then
trigger all early suspend handlers.

Change-Id: I07acdd628440d23fdb69db94319ec5d65d3f4919
2012-06-07 16:28:30 -07:00
Jamie Gennis a4c5b19dd7 SurfaceFlinger: remove all GLES scissor calls.
Bug: 6576505
Change-Id: I494b7627f2e271a234706bf49a9490f8ac56c77a
2012-06-05 19:14:44 -07:00
Mathias Agopian ed9807bd7d we need to wait for vsync when doing the screen-off animation
Bug: 6511421
Change-Id: I7a85a55e66a3a8d9937df575e98a5efec01a634f
2012-05-18 14:30:40 -07:00
Jamie Gennis f15a83f581 SurfaceFlinger: add a crop to the layer state
This change adds a crop rectangle specified in window coordinates to the layer
state.  The all window pixels outside this crop rectangle are treated as though
they were fully transparent.  This change also adds the plumbing necessary for
WindowManager to set that crop.

Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
2012-05-11 03:16:02 -07:00
Mathias Agopian 56a2bbe708 SF needs to render even if we don't have a h/w composer
Bug: 6350574, 6361055
Change-Id: Iab92cc31bab4771fca63619c8e3105c759535f72
2012-04-18 18:36:25 -07:00
Mathias Agopian b9494d5c9d make sure to clear the framebuffer when using overlays
Bug: 6354761, 6353719
Change-Id: I0739de3fee7c54c14b294ffd768b70ee1f541d9e
2012-04-18 02:28:45 -07:00
Mathias Agopian f74e8e0602 don't attempt to clip layers anymore using glScissor
this seems to hurt performance on some GPU. this change
might negatively affect performance on other GPUs though, but
probably in less time-sensitive cases. If this becomes a
problem it might become necessary to pre-clip the geometry
(so that we don't have to use glScissor).

This improves the rotation animation quite a bit.

Change-Id: I5dbe1286f7ad858ef2c1e1ad9a07ee3f26c0b1f3
2012-04-16 03:19:15 -07:00
Mathias Agopian a2f4e56fec get rid off preserve backbuffer optimization in SF
this optimization didn't improve performance and in fact
seemed to hurt more than anything else. it also made
things a lot more complex as it introduced edges cases
when switching to/from h/w composer.

Change-Id: Iaafc235e175f5740cd98bff914d706e02ab88bb8
2012-04-16 03:19:15 -07:00
Mathias Agopian 8acce2046a make sure to repaint the screen when screen turns on
Bug: 6336168
Change-Id: Ic6f11b6bf6c3d849f5cb6ac95961d10d7f88e4ec
2012-04-13 16:18:55 -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
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