Commit Graph

92 Commits

Author SHA1 Message Date
Dan Stoza f10c46ef85 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
2014-11-11 14:28:22 -08:00
Dan Stoza d77021637e am 1f3efb11: Don\'t run large virtual displays through HWC
* commit '1f3efb11ff8c884a254f4272f0d1ee0b77ceff2f':
  Don't run large virtual displays through HWC
2014-10-30 20:58:42 +00:00
Dan Stoza 1f3efb11ff Don't run large virtual displays through HWC
This change watches for a MAX_VIRTUAL_DISPLAY_DIMENSION value, which
will be set (if necessary) in BoardConfig.mk. If the value is set,
any virtual displays that have a width or a height greater than that
dimension will bypass the hardware composer HAL and be handled only
by SurfaceFlinger.

Bug: 17701816
Change-Id: Ia6ca44dfd6a7a9bc0f054493d3f13006bc32fa14
2014-10-28 16:01:47 -07:00
Dmitriy Ivanov 8b81ce563f am cb8a9fcc: Merge "Switch to libsigchain.a"
* commit 'cb8a9fcc56288378d05d80c55396db7981e3828d':
  Switch to libsigchain.a
2014-10-21 03:30:55 +00:00
Dmitriy Ivanov 4340a14fbf Switch to libsigchain.a
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
  to export symbols from the static library.

Change-Id: I0e41cf173be96c52cdad72b1ef4a1bf819e65dd2
2014-10-20 14:17:26 -07:00
Dmitriy Ivanov 2b1f2dac93 Link sigchain to surfaceflinger main executable
And export necessary symbols to preempt calls from libart.so

Bug: 15345057
Bug: 15426766

(cherry picked from commit f3da24d8cf)

Change-Id: I03b632e0bf2cbaf4a0e68cd0af4e991f7f6b08e4
2014-10-16 11:43:19 -07:00
Dmitriy Ivanov 88e5118f07 am 26a28149: Merge "Link sigchain to surfaceflinger main executable"
* commit '26a2814963de75f14dfbe7cf3d45e993727891cf':
  Link sigchain to surfaceflinger main executable
2014-10-14 18:21:24 +00:00
Dmitriy Ivanov f3da24d8cf Link sigchain to surfaceflinger main executable
And export necessary symbols to preempt calls from libart.so

Bug: 15345057
Bug: 15426766
Change-Id: If0b7f59a59824e30aa0c33dad76c7a44932180de
2014-10-09 15:20:25 -07:00
Michael Lentine 7306c670eb Add error for format and make sure setActiveConfig fails with an invalid mode.
Change-Id: Iacdb5cbad125787f96c64c88d432fc541c4cad1a
2014-07-30 14:36:25 -07:00
Jesse Hall e9b23b6588 surfaceflinger: Make all sources depend on Android.mk
This forces all SurfaceFlinger sources to be recompiled when the
Makefile changes; that's overkill sometimes but makes sure everything
gets recompiled when compile options (or similar) changes.

Change-Id: I2b3c3090fc1c35078e13c77fbb1a78d447c39158
2014-07-14 15:32:59 -07:00
Jesse Hall 24cd98eef8 Compile libsurfaceflinger with Clang and -std=c++11 [DO NOT MERGE]
This is necessary to use C11/C++11 stdlib atomics, which the next
change will do. This change also fixes a couple bits of syntax that
both GCC and Clang refuse to compile in -std=c++11 mode.

Change-Id: Ia14d9d6b537a3bb106c23e19a277e48be180754c
2014-07-14 12:18:00 -07:00
Ruchi Kandoi ef472ec40a SurfaceFlinger: send VSYNC power hints to IPowerManager
VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.

Change-Id: Ia5a839ab3c857cffae7089f810b4315d4ed23fcf
2014-06-18 18:51:24 -07:00
Wengang Wu 1210f2ab82 am 20071e50: am e3d37a7b: Enable support RGBX_8888 for omap3
* commit '20071e5028adb6d7ced81843d33e4d0baa0768ed':
  Enable support RGBX_8888 for omap3
2014-06-11 21:38:55 +00:00
Wengang Wu 20071e5028 am e3d37a7b: Enable support RGBX_8888 for omap3
* commit 'e3d37a7b55f86f5d005dd67f828dcf51fe60c0f6':
  Enable support RGBX_8888 for omap3
2014-06-11 18:17:19 +00:00
Wengang Wu e3d37a7b55 Enable support RGBX_8888 for omap3
Bug: 14995811
Change-Id: Iaeb5a5ad0e3bcf215613f24f2570ae0d8267c016
2014-06-11 11:13:40 -07:00
Ruchi Kandoi 4098f03d5c Revert "SurfaceFlinger: send VSYNC power hints to IPowerManager"
This reverts commit d469a1c328.
2014-04-04 18:09:30 -07:00
Ruchi Kandoi d469a1c328 SurfaceFlinger: send VSYNC power hints to IPowerManager
VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.

Change-Id: Icc2eee5df56135bd24dc244a84e7c12dd5511fec
2014-04-04 20:22:31 +00:00
Dan Stoza b9b088375d Remove deprecated BufferQueue constructor
Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
2014-03-18 10:08:44 -07:00
Wonsik Kim 29fa9590ad Revert "Implement video plane layer"
This reverts commit f837c93a1b.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
2014-03-17 11:17:28 +00:00
Wonsik Kim f837c93a1b Implement video plane layer
Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
2014-02-27 00:08:22 +00:00
Colin Cross 89450d45ac surfaceflinger: add BoardConfig.mk variable to force 32-bit
Individual devices may need to force surfaceflinger to compile for
32-bit if they don't have 64-bit GL libraries.

Change-Id: I3703b2f8e36e90cf125d9ed5e6318c3506861948
2014-02-20 15:37:14 -08:00
Jesse Hall c354effe97 Fix handling of undefined TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS
related to b/8316155 - Implement HWComposer 1.3 w/ virtual display support
Change-Id: I2dc8d65a74174aa833cc491264f97f1f2df49307
2013-10-25 17:48:09 +00:00
Naseer Ahmed 6a968462f9 Add a boardconfig to force HWC composition of virtual displays
When this boardconfig is defined, even when all virtual display
composition is done by GLES, the HWC will be forced to copy from the
GLES framebuffer to the output buffer. On some hardware this allows
HWC to do format conversions that would otherwise have to be done by
the consumer, with worse power and/or performance.

Bug: 8316155
Change-Id: If980ecc589f138cef063eafa757f7f748196713e
2013-10-17 13:57:58 -07:00
Jamie Gennis 0a645cc5a9 SurfaceFlinger: give SF its own vsync phase
This change allows SurfaceFlinger to run at a different vsync phase offset from
that used by external listeners.

Bug: 11175503
Change-Id: I561c53a5659fa6dc1e3e4ae30340f3c1a6adceb4
2013-10-15 14:31:41 -07:00
Jamie Gennis d1700756ec SurfaceFlinger: Add EventControlThread
This change adds a new thread for calling HWComposer's eventControl
asynchronously.  The DispSync-based vsync approach ends up enabling and
disabling HWComposer's vsync callbacks at arbitrary times, and some HWComposer
implementations do not have these calls optimized.

Bug: 11175503
Change-Id: I719be82bd200b391c61d40863b991c7b59acdfd6
2013-10-15 14:31:41 -07:00
Jamie Gennis faf77cce9d SurfaceFlinger: SW-based vsync events
This change adds the DispSync class, which models the hardware vsync event
times to allow vsync event callbacks to be done at an arbitrary phase offset
from the hardware vsync.  This can be used to reduce the minimum latency from
Choreographer wake-up to on-screen image presentation.

Bug: 10624956
Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
2013-10-07 17:59:53 -07:00
Mathias Agopian ff2ed70fa3 color blindness enhancement
This is an attempt at improving the experience of
users with color vision impairement.

At this time this feature can only be enabled for
debugging:

  adb shell service call SurfaceFlinger 1014 i32 PARAM

  with PARAM:
   0 : disabled
   1 : protanomaly/protanopia simulation
   2 : deuteranomaly/deuteranopia simulation
   3 : tritanopia/tritanomaly simulation
  11, 12, 13: same as above w/ attempted correction/enhancement

The enhancement algorithm tries to spread the "error"
such that tones that would otherwise appear similar can be
distinguished.

Bug: 9465644

Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
2013-09-04 22:11:15 -07:00
Mathias Agopian 9414d67f46 make sure SF initialization is ran at target priority and correct thread group
SF can spawn threads (indirectly) during initialization
and we want those to be spawned at URGENT_DISPLAY_PRIORITY
(in theory they should set their own, but some code lives
in vendor libraries and doesn't).

Bug: 10430209
Change-Id: I5b3a8f979297de287614c8eafd8267bef1176e4b
2013-08-23 17:10:32 -07:00
Mathias Agopian 4f4f094348 SurfaceFlinger now runs in the process's main thread
it used to spawn its own thread and return the main thread
to the binder thread pool -- this was confusing the naming
of things in the kernel.

Bug: 10331839

Change-Id: I2d13a6d73409a38109300fcbe6a04b4c41cb5d00
2013-08-20 11:16:45 -07:00
Mathias Agopian 49457ac092 Encapsulate textures into their own Texture class
the main reason for doing this is so that we can have
access to informations about a texture (like its dimension)
close to where we generate and use shaders in ES 2.0.
Previously, there wasn't any way to get to a texture's size
from a RenderEngine implementation.

Bug: 8679321

Change-Id: I388b338a70d07e3e8177dde248710ea1e4c82dff
2013-08-16 16:29:02 -07:00
Mathias Agopian 3f84483382 SurfaceFlinger now uses GLES 2.x when available
Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
2013-08-13 16:07:45 -07:00
Mathias Agopian 7ffaa7c60d move services executables sources in their respective src folder
Change-Id: Ic65434a26c7fed1699abf0851fec6faa40e09c0c
2013-07-22 12:25:18 -07:00
Mathias Agopian 595264f1af BufferQueue improvements and APIs changes
this is the first step of a series of improvements to
BufferQueue. A few things happen in this change:

- setSynchronousMode() goes away as well as the SynchronousModeAllowed flag
- BufferQueue now defaults to (what used to be) synchronous mode
- a new "controlled by app" flag is passed when creating consumers and producers
  those flags are used to put the BufferQueue in a mode where it
  will never block if both flags are set. This is achieved by:
  - returning an error from dequeueBuffer() if it would block
  - making sure a buffer is always available by replacing
    the previous buffer with the new one in queueBuffer()
    (note: this is similar to what asynchrnous mode used to be)

Note: in this change EGL's swap-interval 0 is broken; this will be
fixed in another change.

Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
2013-07-18 22:28:18 -07:00
Mathias Agopian 875d8e1323 Refactor SF. Move all GL operations in their own class.
this is the first step to add support for GLES 2.x, this
change breaks the dependency of SF on GLES 1.x by moving
all operation into their own class.

Bug: 8679321

Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
2013-07-03 14:39:27 -07:00
Mathias Agopian 85cce376cb Basic binary event-log helpers
EventLog can be used from SurfaceFlinger to log jank
statistics events to the binary event log.

Change-Id: If0fbbe7d7111f10957697166d37fd0c3418109bb
2013-06-05 13:37:49 -07:00
Mathias Agopian b6df7d0e4c make all libsurfaceflinger and libsensorservice symbols's visibility hidden
we only export the main entry-point.
this saves about 150KB.

Change-Id: I55eb2b6705386fdfa43860deb62f9cdd2a0982aa
2013-05-09 16:51:37 -07:00
Jesse Hall e737c11cd8 Remove experimental HWC virtual display support
Bug: 8384764
Change-Id: I97b52ed83ad85466bd91cb9291308994048568a1
2013-05-07 11:58:47 -07:00
Ying Wang 8a0cb4ee0b Add liblog
Bug: 8580410
Change-Id: I2ca4fa00dde0b574df3619134836bcb9315bd506
2013-04-09 21:55:39 -07:00
Jesse Hall 80e0a397a4 Add BufferQueueInterposer and use it for virtual displays
BufferQueueInterposer allows a client to tap into a
IGraphicBufferProducer-based buffer queue, and modify buffers as they
pass from producer to consumer. VirtualDisplaySurface uses this to
layer HWC composition on top of GLES composition before passing the
buffer to the virtual display consumer.

Bug: 8384764
Change-Id: I61ae54f3d90de6a35f4f02bb5e64e7cc88e1cb83
2013-03-18 14:21:45 -07:00
Jesse Hall 99c7dbb249 Add DisplaySurface abstraction
DisplayDevice now has a DisplaySurface instead of using
FramebufferSurface directly. FramebufferSurface implements
DisplaySurface, and so does the new VirtualDisplaySurface class.
DisplayDevice now always has a surface, not just for virtual displays.

In this change VirtualDisplaySurface is just a stub; buffers still go
directly from GLES to the final consumer.

Bug: 8384764
Change-Id: I57cb668edbc6c37bfebda90b9222d435bf589f37
2013-03-18 14:21:16 -07:00
Mathias Agopian 13127d8921 Get rid of LayerBase.
The functionality of LayerBase and Layer is folded
into Layer. There wasn't a need for this abstraction
anymore.

Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
2013-03-05 19:52:30 -08:00
Mathias Agopian 089a15298e Remove support for ScreenshotLayer
Change-Id: I5b571a4cf3faa77d2c4aca916fa4bd00a1065bb9
2013-03-05 19:52:29 -08:00
Jamie Gennis 392edd88cb SurfaceFlinger: Move GraphicBufferAlloc to libgui
This change moves the GraphicBufferAlloc class from SurfaceFlinger to libgui.

Change-Id: Idf31d2004efa2651b60590733f73c4a7b831e8a9
2012-12-11 17:54:29 -08:00
Andy McFadden bf974abe92 Refactor SurfaceTexture a bit.
Rearranges updateTexImage() so that the SurfaceFlinger-specific
behavior is in a new SurfaceFlingerConsumer subclass.

SurfaceTexture behavior should not be altered.  Instead of
acquire-bind-release we now do acquire-release-bind, but since
it's all done with the lock held there shouldn't be any
externally-visible change.

Change-Id: Ia566e4727945e2cfb9359fc6d2a8f8af64d7b7b7
2012-12-11 09:42:51 -08:00
Jamie Gennis 82dbc7429f SurfaceFlinger: refactor frame time tracking
This change moves the frame time history tracking code out of Layer and into a
new class called FrameTracker.  It also changes the tracking to use signal
timestamps from fences when available for more accurate results.

Change-Id: I323c5f075c58bf86ce363b52af885ad0f6365f2b
2012-11-19 17:45:09 -08:00
Jamie Gennis cdbaecb541 SurfaceFlinger: make the num FBs a board config
Bug: 7283132
Change-Id: I38116f39fc18212f2daab94bbfc3daaf89439fc4
2012-10-12 14:29:12 -07:00
Mathias Agopian 1b3aeb4844 fix SurfaceFlinger DDMS debugging
DdmHandleAppName.setAppName() signature changed which broke
this debugging feature.

Needed for debugging b\7267680

Change-Id: I4482bf5a441e91bef89d1ddea9a4152333be7f88
2012-10-07 16:41:12 -07:00
Mathias Agopian f33e4b6f13 GraphicBufferAlloc class was declared twice
this was confusing because the one in FramebufferSurface
wasn't in fact being used

Change-Id: Ied45aec20d804cfbe52440f9b2f2852a85c757cf
2012-09-20 17:13:58 -07:00
Keun young Park 63f165fd6b add libsurfaceflinger_ddmconnection for PDK build
- the library is dlopened from libsurfaceflinger
- the library built only when libnativehelper exists

Bug: 7089510
Change-Id: Ib3ea1029d7e8f6e055f4b759d0bf68f5123fa8a1
2012-08-31 20:08:33 -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