Commit Graph

152 Commits

Author SHA1 Message Date
Mathias Agopian 55882dea1b fix a problem where all hwc layers would have the SKIP flags set
the problem was that LayerBase::setPerFrameData() was always setting
this flag. in fact there was no reason to do this at that point since
the layer is initialized to a default state in setGeometry().

Bug: 7111259
Change-Id: Ib37b0dd7391a6163070e9aca025512159c1705f9
2012-09-05 16:49:04 -07:00
Jesse Hall e25d005d91 Always reset layer acquireFenceFd after commit
If SurfaceFlinger needs to refresh the screen but the dirty region is
empty, it won't set the layer acquire fences, and stale file
descriptors will be passed to HWC commit(). Now we make sure to clear
the stale file descriptors for each layer right after commit().

Bug: 7078301
Change-Id: I6953ff91fc5488f105b30b07306f9c45a4c3f780
2012-09-05 13:03:10 -07:00
Mathias Agopian c397360883 the visible region sent to HWC was garbage
we used to have a visibleRegion object per layer, but now
it's per screen; so at somepoint the code got changed to
calculate the per-screen visible region on the stack and that's
what got passed to HWC.

we're now setting the visibleRegionScreen at each frame and
freeing at after the HWC set() call. We use the underlaying
SharedBuffer so that in most cases we don't have to allocate,
free or copy memory around.

Bug: 7089478
Change-Id: I24fa556c76613a225d9fe7a6c6b727bb476144d8
2012-08-31 18:41:22 -07:00
Jesse Hall 1bd20e0f9e HWC 1.1: hook up hotplug event, use new display config queries
Change-Id: I2fd359e5fc7e1948072c6bc6b6fe47ea5e8025c1
2012-08-31 09:25:24 -07:00
Jesse Hall 9eb1eb5bb5 Handle new device api version encoding
Change-Id: I3d36058bd5d31c23b3cc4a7eb5aa033b6f3c1955
2012-08-29 10:39:38 -07:00
Andy McFadden 13a082e160 Added display initialization method
The primary display device was being configured to "blank" by
default, which prevented the boot animation from appearing
(unless you got lucky with the hardware composer state).

Bug 6975688

Change-Id: I0fa52e9e719c6e997c5725a7baf15d9718461b78
2012-08-24 11:50:34 -07:00
Mathias Agopian f435863467 teach HWC about multiple displays
Change-Id: I5e72a83d419a729835cb0e1ec45557b4d3fb56b1
2012-08-23 17:41:38 -07:00
Mathias Agopian 30bcc61431 remove support for HWC < 1.0
Change-Id: If7e676a6e3524afeb9af3875125d2131d95db38b
2012-08-23 16:30:12 -07:00
Mathias Agopian e60b0687c8 HWComposer now has its own concept of display IDs
HWComposer can now create IDs representing a display
it can deal with. IDs MAIN and HDMI are reserved.
SurfaceFlinger associate HWComposer IDs with a
DisplayDevice and uses that when it talks to HWComposer.

A DisplayDevice doesn't have to have a HWComposer ID,
in that case it just can't use h/w composer composition.

Change-Id: Iec3d7ac92e0c22bf975052ae2847402f58bade71
2012-08-23 16:03:37 -07:00
Jesse Hall bbd164a3c7 Update for cleanups in hwc interface
Change-Id: I363fd8b085167a1af6c14b68012bda5c62bfe59f
2012-08-22 12:09:39 -07:00
Jesse Hall 8f971ff666 Pass the correct number of displays based on HWC version
Change-Id: I27372f5d3102ad56f6d67722d631ae18d37f8330
2012-08-22 12:08:18 -07:00
Mathias Agopian 5f20e2d446 reimplement wifi display hack with new external display SF framework
fix a few bugs with external displays

- HWComposer doesn't really handle multiple displays yet
  so there is a lot of ugliness there

- We also need to make sure that external displays are not
  blanked by default

- due to some EGL limitations surfaces being swapped need
  to be current

Change-Id: I82bff05b43bcebd8da863c7c76b4edbc3bc223a9
2012-08-16 20:58:58 -07:00
Mathias Agopian 8b736f138c xdpi / ydpi were reported as 0
Bug: 6975723
Change-Id: Ia7fa37ec11e2308804f5034959a37e508d292d31
2012-08-13 17:54:26 -07:00
Mathias Agopian 748f3df66f avoid crashing when we don't have an h/w composer
should fix the emulator

Bug: 6956162
Change-Id: I38247b59d276b8db078c4dc2caba7d3fb545912c
2012-08-10 14:36:40 -07:00
Mathias Agopian 1e26087493 Add a display parameter to HWComposer where needed
- also replace C casts with C++ casts
- only the interface is changed, HWComposer still doesn't
  fully handle multiple displays

Change-Id: I48eb89bff2edb76bf1d4d41f46802b9b2a7166a8
2012-08-10 13:18:24 -07:00
Jesse Hall b685c54283 Changes to support multi-display HWC
Change-Id: I07efff54f2980dcb013935747b03e099b8f1181b
2012-08-07 12:16:36 -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 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
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 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 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
Colin Cross 10fbdb6059 surfaceflinger: call into hardware composer to blank screen
Call into the new HWC blank operation to blank or unblank the screen.
Legacy systems may have already blanked the screen via early suspend,
and can choose to not implement the blank operation in their hardware
composer implementation.

Change-Id: Ib403c8c0e36367a2cfef3e1d124872fcfeb9e7cb
2012-07-13 15:48:50 -07:00
Jesse Hall dc5b485f74 Pass fence to HWC on first use of buffer
Also do a CPU-wait on the fence before using it for GL composition.

Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
2012-06-30 21:38:51 -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
Jesse Hall 5880cc5738 Add support for HWC_DEVICE_API_VERSION_1_0
The acquire and release fences aren't yet used; this is just support
for the new version and temporary backwards compatibility for older
versions.

Change-Id: Ia5ccc05a97c86f649042b9a35e11042fa0187e84
2012-06-14 12:35:32 -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
Mathias Agopian 03e407270c set vsync power hint
Change-Id: I28c2faf9ff584df3e74392712971cbcf75eb9e98
2012-04-26 19:52:22 -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 e2c4f4ec23 Added vsync debugging information in dumpsys log
Change-Id: I20ef05a73d89caaf6a70dc9ca25ada6e6a1f6ff9
2012-04-10 21:04:12 -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
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
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 31d2843b45 Add HWC vsync hook. Currently unused.
Change-Id: I849d56f375813a044c5e2d0b25f791476a60fa01
2012-04-03 18:30:35 -07: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
Mathias Agopian e2c2f9213f Force a repaint when hwc invalidate hook is called
without this prepare() would be called but not set() since the
dirty region is empty.

Change-Id: I038acfbdad4c16015357ccde4d1949391d6f989d
2011-10-05 15:00:22 -07:00
Mathias Agopian aebac5f34a improve hwc log output
we now print the handle of each buffer

Change-Id: I70884ae458a9dcf10cfc403258d48eaa4618b7f4
2011-09-29 18:07:08 -07:00
Mathias Agopian fc60b94db9 fix dumpsys wording for h/w composer
Change-Id: Iaa1094964f2fb83da491e23b9309f7690079c17e
2011-09-22 16:26:39 -07:00
Mathias Agopian 9c6e297271 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
2011-09-20 17:53:33 -07:00
Mathias Agopian fb4d5d5726 improve hwc dumpsys
we now log the buffer's format

Change-Id: I9d3ad8018e884240a153de3baefb6331cb014d0f
2011-09-20 17:53:33 -07:00
Mathias Agopian 22da60c3e6 Improve SF dumpsys output wrt HWC
Change-Id: Ibdb7930fa3b521bfd3f44750ed98cfd75f9a01fe
2011-09-09 00:49:44 -07:00
Mathias Agopian 7ee4cd5556 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
2011-09-02 12:22:39 -07:00
Mathias Agopian c7d14e2471 Add a h/w composer API to allow the HAL to trigger a redraw
This is useful in various situations, for instance if the HAL
wants to change its compositing strategy.

Bug: 4488017
Change-Id: I5afc14e5917c6db7926d7417d48677d5aba50caa
2011-08-01 20:48:05 -07:00
Erik Gilling 1d21a9cafc surfaceflinger: add support for gralloc dump hooks
Change-Id: Ib6f539ed0132b70d040d653c03d52cc04249ac3c
2010-12-08 15:40:11 -08:00
Mathias Agopian 58959343db Fix a null dereference
Change-Id: I3df446b90c1607782778749de7ba0f8c00698c33
2010-10-07 14:57:04 -07:00
Mathias Agopian 8372785879 dump HWC state in dumpsys
Change-Id: Ifbb38ca1ac9685776250e01c8d02021b35af72cf
2010-09-23 18:13:21 -07:00
Antti Hatala f5f2712854 surfaceflinger: give hwcomposer a chance to release buffers
Change-Id: I605fa779702022865dd58df3b36f37c2644ade36
2010-09-09 12:06:48 -07:00
Mathias Agopian 45721773e1 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
2010-08-12 15:03:26 -07:00
Mathias Agopian f1352df47f should fix sim build, hopefully
Change-Id: I5390bd34dcca36fef43b5169386fff1b04cc842b
2010-08-11 17:31:33 -07:00
Mathias Agopian a350ff9869 call into hwcomposer HAL when present
Change-Id: I70f31c69a9436a43860e78977442863ecba6d27b
2010-08-11 16:08:45 -07:00