Commit Graph

2270 Commits

Author SHA1 Message Date
Jeff Brown
af0f8c0a56 am 255405eb: am 86b2ecdd: Merge "fix mem leak on error handling"
* commit '255405eb19e6a3fa7f7bb4de9b07beacdf65ece9':
  fix mem leak on error handling
2013-05-30 14:23:58 -07:00
Jeff Sharkey
8cb8925921 Bring back overloading to print String8/16.
Change-Id: Iecab20db2b8574d5f1e6fdefdc2c8d4ce6c37121
2013-05-30 14:04:28 -07:00
Jeff Brown
255405eb19 am 86b2ecdd: Merge "fix mem leak on error handling"
* commit '86b2ecdd311fca2e1e4a3504bf96bb23c5630492':
  fix mem leak on error handling
2013-05-29 19:01:17 -07:00
Hyejin Kim
3f727c0ea3 fix mem leak on error handling
Change-Id: I40d8e371c46184aa701fa676246201a9d8f6e27d
2013-05-28 18:39:02 -07:00
Lajos Molnar
9e3cb55b8f BufferQueue: remove freeAllBuffersExceptHeadLocked()
Now that we are having separate buffer-instances for the buffer-
queue, we can free all buffers; we don't have to keep the head
alive.

Change-Id: I023e9161a2501d99333f8868ce438afa914ec50f
Signed-off-by: Lajos Molnar <lajos@google.com>
Related-to-bug: 7093648
2013-05-23 22:21:13 +00:00
Lajos Molnar
c5d7b7d323 BufferQueue: track buffer-queue by instance vs. by reference
Instead of representing the buffer-queue as a vector of buffer
indices, represent them as a vector of BufferItems (copies).
This allows modifying the buffer slots independent of the queued
buffers.

As part of this change, BufferSlot properties that are only
been relevant in the buffer-queue have been removed.

Also, invalid scalingMode in queueBuffer now returns an error.

ConsumerBase has also changed to allow reuse of the same
buffer slots by different buffers.

Change-Id: If2a698fa142b67c69ad41b8eaca6e127eb3ef75b
Signed-off-by: Lajos Molnar <lajos@google.com>
Related-to-bug: 7093648
2013-05-23 22:17:54 +00:00
Nick Kralevich
058219f51d Merge "Remove unnecessary header file." 2013-05-17 21:58:50 +00:00
Nick Kralevich
06a582e8b5 Remove unnecessary header file.
In b2cac4ff37, the last
reference to property_get was removed, but the include
file remained. Remove it.

This is causing me unrelated problems.

Change-Id: I87bbfbfa5871f6da4a1b00037a225f67bbd75881
2013-05-17 11:06:39 -07:00
Mathias Agopian
2381033ad0 am e6eef6c1: am ea74d3b7: make the warning timout of Fence::waitForever() implicit and longer
* commit 'e6eef6c136b007f3a7e1e19884875b855c0c5f95':
  make the warning timout of Fence::waitForever() implicit and longer
2013-05-17 10:18:45 -07:00
Mathias Agopian
ea74d3b78d make the warning timout of Fence::waitForever() implicit and longer
- timeout is now 3 seconds instead of 1
- simplifies the API a bit
- allows us to change/tweak this timeout globaly

Bug: 8988871

Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
2013-05-16 18:15:57 -07:00
Mathias Agopian
f3e85d4327 take the "transparent region" into account for blending
until now it was only used to discard a layer entirely.
we're now reducing the size of the layer if it is still
visible, if possible.

this works for instance when a surfaceView is used and
only the menu bar is displayed over it.

Change-Id: I3f5527c5cd1e69ecc968272c8948f1513ada8c55
2013-05-10 18:35:43 -07:00
Mathias Agopian
6c7f25afb7 reformat Rect.{cpp|h}
Change-Id: I45b1f6646541a1abacce1e70df00a770e47b820e
2013-05-10 18:03:31 -07:00
Mathias Agopian
a6cb0397da remove reserved virtual slots
these consume small amount of space (plt) in every library that
links against libutils.

Change-Id: I1b6b3dd9098aa5a051243f7a5dbf91cd7dcb8b2c
2013-05-09 14:57:05 -07:00
Eino-Ville Talvala
d487ca1ab3 am 87ab83d9: am f743e3db: Merge "Add support for HAL_PIXEL_FORMAT_YCbCr_420_888" into jb-mr2-dev
* commit '87ab83d96b9d826e94a7169a6205bcf9c2ee633a':
  Add support for HAL_PIXEL_FORMAT_YCbCr_420_888
2013-05-09 10:19:01 -07:00
Eino-Ville Talvala
f743e3db27 Merge "Add support for HAL_PIXEL_FORMAT_YCbCr_420_888" into jb-mr2-dev 2013-05-09 17:13:22 +00:00
Mathias Agopian
8050299f5b new String8, String16 ctors to initialize empty static strings with static linkage
when libutils is statically linked, the ordering of the static
initializer is not guaranteed and therefore it's unsafe to use
empty static strings: e.g.:

static String8 sThisStaticStringIsNotSafe;

instead, this new constructor can be used:

static String8 sThisStaticStringIsSafe(kEmptyString);

Change-Id: Ia3daf1cab1c97d021c0ee9c2b394b5e27e8d6c0d
2013-05-08 18:13:07 -07:00
Mathias Agopian
002e1e58df libutils clean-up
Change-Id: I6ff4cfc736751de2912c697f954e45e275f2d386
2013-05-07 18:28:11 -07:00
Todd Poynor
b4f1a027cb Merge "String8: ensure static init done prior to empty string reference" 2013-05-07 23:30:22 +00:00
Dianne Hackborn
ffad7d1fdc Add new Looper API to check whether the looper is idle.
This is just to support the watchdog to give it a faster
way to determine if a thread is deadlocked without having
to post a message to it.

Change-Id: I068dc8b9387caf94fe5811fb4aeb0f9b57b1a080
2013-05-07 15:05:34 -07:00
Todd Poynor
1bf3b4a06d String8: ensure static init done prior to empty string reference
Avoid NULL deref on static initialization of empty String8 objects prior
to libutils static init.

Change-Id: I3d420041ba62b97ed8c2dfd2532a2dcd72b84ff1
2013-05-07 12:09:46 -07:00
Eino-Ville Talvala
c43946b931 Add support for HAL_PIXEL_FORMAT_YCbCr_420_888
- Add fields to CpuConsumer::LockedBuffer for new information
- New lock methods for GraphicBuffer and GraphicBufferMapper for
  the format

Bug: 8734880
Change-Id: If31f82c62d64b6942cf4cc6e5715585c03273f12
2013-05-06 17:24:05 -07:00
Marco Nelissen
98b50774ae am 3755dbec: am 3d3cc6e1: Merge "Report actual disk space used" into jb-mr2-dev
* commit '3755dbec6f16330fb57b18c09319d209a3f8474f':
  Report actual disk space used
2013-05-06 13:56:06 -07:00
Marco Nelissen
7719b85bf8 Report actual disk space used
Report size based on blocks used, not the "nominal" size.
b/8744465

Change-Id: Idbb72f47af6d475b51305a14be291bf01acb14bb
2013-05-01 10:10:59 -07:00
Bjorn Bringert
b1b307ec3f Merge "Build a static device libutils" 2013-04-29 10:10:41 +00:00
Bjorn Bringert
f19c4ae816 Build a static device libutils
This is needed to make tools such as aapt more compatible when
built for the device.

Change-Id: I1261d47b6e24595f1be547b9202892863f66a1de
2013-04-26 15:12:47 +01:00
Jamie Gennis
748b696c05 am 83ad8957: am 5b6ebd71: Merge "libgui_test: fix a couple minor test issues" into jb-mr2-dev
* commit '83ad89579e22228c1a48a2a488b86fc0d41057a6':
  libgui_test: fix a couple minor test issues
2013-04-25 13:50:38 -07:00
Mathias Agopian
bdcf1fe2ba Merge changes I0d9f18d1,Ib96c9161
* changes:
  Add a --color option to dumpsys SurfaceFlinger
  clean-up/simplify all dump() APIs
2013-04-24 10:25:34 +00:00
Jamie Gennis
ea2d942dda libgui_test: fix a couple minor test issues
This change fixes how the MultiTextureConsumerTest.EGLImageTargetWorks checks
for pixels.  It removes the call to eglSwapBuffers so that the test does not
rely on EGL swap-preserve behavior, and it makes the test use checkPixel()
rather than doing glReadPixels itself.

Bug: 8349336
Change-Id: I0f446a0083eebd07af6fd208762878b4e367725a
2013-04-24 01:08:02 +00:00
Mathias Agopian
6bbd8e30b5 am 3cf76aff: am e692ab9a: fix uninitialized variables in GLConsumer
* commit '3cf76affd3ef28759789622e9e0134bdb045418b':
  fix uninitialized variables in GLConsumer
2013-04-23 11:16:44 -07:00
Mathias Agopian
74d211ae26 clean-up/simplify all dump() APIs
remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
2013-04-22 21:51:28 +02:00
Mathias Agopian
e692ab9a6b fix uninitialized variables in GLConsumer
mDefaultWidth, mDefaultHeight and mCurrentScallingMode are now
initialized to the same default value that BufferQueue uses.

Change-Id: I0d4da2022b06419d12745716d8ddbd48c8869953
2013-04-22 11:24:02 +02:00
Igor Murashkin
6ca04ca755 am f3d93d43: am 187edf93: Merge "BufferItemConsumer: add functions to set default buffer format/size" into jb-mr2-dev
* commit 'f3d93d436373dcc39ff0b7f4aac938f4619421a2':
  BufferItemConsumer: add functions to set default buffer format/size
2013-04-17 12:48:23 -07:00
Igor Murashkin
187edf93c6 Merge "BufferItemConsumer: add functions to set default buffer format/size" into jb-mr2-dev 2013-04-17 19:39:53 +00:00
Mathias Agopian
e7e37a97a1 am cf73e1fd: am f31510a2: Add a test that checks multi-texturing works with GL_TEXTURE_EXTERNAL_OES
* commit 'cf73e1fd8a0a3372ff91e0485b37680262f5df95':
  Add a test that checks multi-texturing works with GL_TEXTURE_EXTERNAL_OES
2013-04-16 23:40:05 -07:00
Mathias Agopian
f31510a2ac Add a test that checks multi-texturing works with GL_TEXTURE_EXTERNAL_OES
Bug: 8395618
Change-Id: I160d29699593b11058533ca753e275d5deeb3b54
2013-04-16 23:32:38 -07:00
Igor Murashkin
87d1e3427b BufferItemConsumer: add functions to set default buffer format/size
Bug: 8629088
Change-Id: I06f2e26a70d6dbcfcd70b08b4461e8e401f6e83f
2013-04-16 11:24:40 -07:00
Andy McFadden
91f056e4a9 am 12ff91b0: am 53dc9044: Merge "Updated comments" into jb-mr2-dev
* commit '12ff91b05a055e6adffaad9bf7661a5d251c5b6c':
  Updated comments
2013-04-11 10:23:27 -07:00
Andy McFadden
53dc9044bf Merge "Updated comments" into jb-mr2-dev 2013-04-11 17:15:52 +00:00
Ying Wang
63e13c8545 am 46f19772: resolved conflicts for merge of c76e8a20 to jb-mr2-dev-plus-aosp
* commit '46f19772ae5659c1659a0ac8f1f72389e94a85d4':
  Add liblog
2013-04-09 22:33:16 -07:00
Ying Wang
c76e8a20e2 Merge "Add liblog" into jb-mr2-dev 2013-04-10 05:17:07 +00:00
Ying Wang
8a0cb4ee0b Add liblog
Bug: 8580410
Change-Id: I2ca4fa00dde0b574df3619134836bcb9315bd506
2013-04-09 21:55:39 -07:00
Jamie Gennis
e3808ed677 am 13c9a949: am 8758a3e3: Merge changes I82e361a6,I83694682 into jb-mr2-dev
* commit '13c9a949b5d74f36edbdbfda764fe554cdbaefa9':
  libgui_test: increase the tolerance for a YUV test
  libgui: fix an EGLImage leak
2013-04-09 14:49:54 -07:00
Jamie Gennis
8758a3e394 Merge changes I82e361a6,I83694682 into jb-mr2-dev
* changes:
  libgui_test: increase the tolerance for a YUV test
  libgui: fix an EGLImage leak
2013-04-09 21:43:20 +00:00
Jamie Gennis
e6a0f5028b libgui_test: increase the tolerance for a YUV test
This change increases the pixel difference tolerance of the
SurfaceTextureGLTest.TexturingFromCpuFilledYV12BufferNpot test from 2 to 3.

Bug: 8349135
Change-Id: I82e361a689335f49065cacd8a3fc145d67b125f1
2013-04-08 14:42:22 -07:00
Jamie Gennis
ad669b04f4 libgui: fix an EGLImage leak
This moves the call to ConsumerBase::abandon from the ConsumerBase dtor to
ConsumerBase::onLastStrongRef.  The abandon call relies on virtual methods to
perform the clean-up, so calling it from the ConsumerBase dtor after the
derived classes dtors ran was skipping some of the clean-up.  The
onLastStrongRef method should get called just before the most derived class's
dtor gets called.

Bug: 8349135
Change-Id: I836946826927cc1ed69c049049f525f92b17a269
2013-04-08 14:42:22 -07:00
Andy McFadden
753e3415cd Updated comments
Updated many comments.  Added one minor error check.

Change-Id: Ib935dd99d417bada91d2e198008a50dd94269316
2013-04-05 10:44:23 -07:00
Mathias Agopian
d2006981e4 am a22f783b: am 2ca79399: latch transparent region hint only when we get a new frame
* commit 'a22f783b141a9da1950f8426bbf87535495856eb':
  latch transparent region hint only when we get a new frame
2013-04-03 18:05:45 -07:00
Mathias Agopian
2ca79399b9 latch transparent region hint only when we get a new frame
since the transparent region hint really depends on the
content of the window containing the SurfaceView
(it's calculated by the view hierarchy based on
overlapping views), it makes sense to latch it only when
the content of the window (the app) changes.

This should help fixing drawing artifacts when changing the
layout of a window containing a SurfaceView.

Bug: 8511430
Change-Id: Ic3aa668495293cb4d82a2cd7dcf3b6a337287678
2013-04-02 18:30:32 -07:00
Mathias Agopian
b1ca30a609 am 46c21a6d: am 86e392e9: Merge "don\'t use compile-time configuration of libgui as much as possible" into jb-mr2-dev
* commit '46c21a6d89286abe9fae6f39db9da138dcfee0a8':
  don't use compile-time configuration of libgui as much as possible
2013-03-29 16:39:45 -07:00
Mathias Agopian
ca08833d5e don't use compile-time configuration of libgui as much as possible
We now detect at runtime which sync features to use, which
allows us to remove a lot of the compile-time configuration
options. There  is still one option though, to disable
KHR_fence_sync on some devices (which are more efficient
without it).

- added a backdoor to get the vendor's EGL strings

the new logic is:
- use always ANDROID_native_fence_sync if available
- fallback to KHR_fence_sync if available and not disabled
  by the compile-time option
- use KHR_wait_sync if available and either of the above is
  enabled

Change-Id: I9c4b49d9ff1151faf902cc93bd53ea5f205aaabf
2013-03-29 15:33:47 -07:00
Mathias Agopian
2906075a95 am a6e3962f: am bf667e31: Merge changes I22f1b358,I5496d0de,Ifd98966b into jb-mr2-dev
* commit 'a6e3962f539e287ffe7f03c67654e50214ff1404':
  replace eglWaitSyncANDROID by eglWaitSyncKHR
  update EGL headers to most recent
  cleanup EGL extensions strings and entry-points
2013-03-28 15:55:53 -07:00
Mathias Agopian
2bb716871c replace eglWaitSyncANDROID by eglWaitSyncKHR
Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72
2013-03-28 14:31:09 -07:00
Mathias Agopian
018c4e19b7 am 4fbb8191: am caa81f0e: Merge "make sure to unlock the screenshot\'s buffer on destruction" into jb-mr2-dev
* commit '4fbb8191d8f92230e39f1c4541938d5f18247579':
  make sure to unlock the screenshot's buffer on destruction
2013-03-26 18:34:12 -07:00
Mathias Agopian
caa81f0ed8 Merge "make sure to unlock the screenshot's buffer on destruction" into jb-mr2-dev 2013-03-27 01:30:36 +00:00
Mathias Agopian
8000d0694b make sure to unlock the screenshot's buffer on destruction
this fixes a memory leak on various devices

Bug: 8475134
Change-Id: I25924674c803a0cb22371a95c60664c36acb0340
2013-03-26 18:15:35 -07:00
Keun-young Park
4e06e0bcb9 am adb6aa13: am 9dd8d897: am 1cd763f1: am cd91024c: Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles."
* commit 'adb6aa130aa6e3a343c0fb1a1e1cfdf6f86cca52':
  [MIPS] Avoid unaligned load/store for 64-bit doubles.
2013-03-26 12:17:56 -07:00
Keun-young Park
9dd8d897d3 am 1cd763f1: am cd91024c: Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles."
* commit '1cd763f123b9f1a2772ddff15ace81ec07b7660c':
  [MIPS] Avoid unaligned load/store for 64-bit doubles.
2013-03-26 11:45:01 -07:00
Keun-young Park
cd91024ca1 Merge "[MIPS] Avoid unaligned load/store for 64-bit doubles." 2013-03-26 17:47:19 +00:00
Jesse Hall
1e2c3a9037 am 501553a0: am 13f01cbd: Pass sp<Fence>s around instead of file descriptors
* commit '501553a055d4891760aee161a771fa55f0817a57':
  Pass sp<Fence>s around instead of file descriptors
2013-03-22 22:38:19 +00:00
Jesse Hall
13f01cbdbd Pass sp<Fence>s around instead of file descriptors
Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
2013-03-22 09:56:58 -07:00
Mathias Agopian
2342085d3c am dbbf209e: am 7133f863: Merge "improved CallStack a bit" into jb-mr2-dev
* commit 'dbbf209e66947b7c1f52d90558873ed3ec0591d7':
  improved CallStack a bit
2013-03-22 04:34:32 +00:00
Mathias Agopian
7133f8638e Merge "improved CallStack a bit" into jb-mr2-dev 2013-03-22 04:15:33 +00:00
Mathias Agopian
cab25d680e improved CallStack a bit
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()

Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
2013-03-21 17:12:40 -07:00
Eino-Ville Talvala
905c2d7a2f am a010749b: am aaebffd5: Merge "CpuConsumer: Properly track acquired buffers" into jb-mr2-dev
* commit 'a010749b41d20152389faa5832f1fc34c17cd930':
  CpuConsumer: Properly track acquired buffers
2013-03-21 16:41:40 +00:00
Eino-Ville Talvala
aaebffd52f Merge "CpuConsumer: Properly track acquired buffers" into jb-mr2-dev 2013-03-21 16:39:14 +00:00
Ramanan Rajeswaran
8948a2efc9 am eda14c1b: am ac006439: Merge "Revert "Revert "Change SurfaceControl setPosition to take floats""" into jb-mr2-dev
* commit 'eda14c1bef20d853f2e661244ec6a0f38c3192b7':
  Revert "Revert "Change SurfaceControl setPosition to take floats""
2013-03-21 15:55:14 +00:00
Ramanan Rajeswaran
ac006439bb Merge "Revert "Revert "Change SurfaceControl setPosition to take floats""" into jb-mr2-dev 2013-03-21 15:52:49 +00:00
Ramanan Rajeswaran
d6480c020b Revert "Revert "Change SurfaceControl setPosition to take floats""
This reverts commit bbb57f3331

Change-Id: Ib8f039f530d6b8175b5205c6c0008b135d4001a2
2013-03-21 15:49:59 +00:00
Mathias Agopian
c167b20194 am 890b345f: am 7c1a487b: fix build. update test to new API
* commit '890b345f061f2df74d4ac52c1cf7d56f1432f480':
  fix build. update test to new API
2013-03-20 23:01:24 +00:00
Mathias Agopian
7c1a487ba8 fix build. update test to new API
Change-Id: I31ca84c85edff3e2ff90c554769e058110f27d49
2013-03-20 15:56:04 -07:00
Mathias Agopian
df6e9c7744 am 89016cbf: am ff7c2342: Merge "rework how we take screenshots for a CPU consumer" into jb-mr2-dev
* commit '89016cbf4fa8681dde1c6f45c03685a0a0d69f3f':
  rework how we take screenshots for a CPU consumer
2013-03-20 22:19:08 +00:00
Mathias Agopian
abe815dd69 rework how we take screenshots for a CPU consumer
We're not using IMemoryHeap as a transport anymore,
instead we're providing a CpuConsumer and use the
IGraphicBufferProducer version of the screenshot API.

However, some GPU drivers don't support properly
a GPU to CPU path, to work around this, we use a
temporary BufferQueue on the server side for the
GL rendering, and we use glReadPixels into the
CpuConsumer (we're now using a CPU to CPU path
which is always supported).

Currently this "wrapping" is always performed,
but it can be bypassed on devices that support
the GPU to CPU path.

This also addresses a DoS attack vector on
SurfaceFlinger, where an application could
consume all of SF's filedescriptors by creating
a lot of screenshots in a row.

Bug: 8390553

Change-Id: I9e81514c2a7711b9bb393f74305be7d2abe08f1c
2013-03-19 22:22:21 -07:00
Mathias Agopian
d5db7a1826 am 656a6780: am 9cd766a5: disable RefBase consistency checks (NDEBUG)
* commit '656a6780b5714c8667f604d7925729325d1cbcef':
  disable RefBase consistency checks (NDEBUG)
2013-03-20 00:54:41 +00:00
Mathias Agopian
3adfa01354 am dd3fcd2e: am 4e37ddff: Fix a crasher with RefBase debugging and vectors of wp<>
* commit 'dd3fcd2e583f5aff7ef390442fe4ed6395d4cc4c':
  Fix a crasher with RefBase debugging and vectors of wp<>
2013-03-20 00:54:41 +00:00
Mathias Agopian
9cd766a517 disable RefBase consistency checks (NDEBUG)
Bug: 8328715
Change-Id: Ib57646ff909fd8744610f37f3b50d90d884dff31
2013-03-19 17:36:57 -07:00
Mathias Agopian
4e37ddff43 Fix a crasher with RefBase debugging and vectors of wp<>
background:
we have some code to fix-up the IDs of references when
using RefBase's DEBUG_REFS when those refs are managed by
arrays wp<> or sp<> (this is because wp<> / sp<> don't have
a trivial ctor when DEBUG_REFS is enabled, and Vector
treats them as trivial for obvious performance reasons)

this is complicated by the fact that we don't want to have
to recompile everything when enabling DEBUG_REFs (i.e.: the
Vector code cannot know wheter it's enabled or not for its
template stuff).

problem:
there was a bug in the fix-up code for wp<> which was trying
to access the weakref_impl from the RefBase* however, this was
moronic since RefBase could have been destroyed if there wasn't
any more strong refs -- and this happned. Instead we need to get
the weakref_impl directly from the wp<>

Change-Id: Ie16e334204205fdbff142acb9faff8479a78450b
2013-03-19 16:41:56 -07:00
Mathias Agopian
0095ee53ad am 364a1f95: am ca987c87: Merge "A few tweaks to RefBase debugging" into jb-mr2-dev
* commit '364a1f95786746118d62c90279aa3dd8eb93db8d':
  A few tweaks to RefBase debugging
2013-03-19 23:06:06 +00:00
Mathias Agopian
ca987c8775 Merge "A few tweaks to RefBase debugging" into jb-mr2-dev 2013-03-19 23:00:40 +00:00
Jesse Hall
3b7d254344 am 88f70a21: am fae23b87: Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-dev
* commit '88f70a2167528ec849845e1203cfd9c6ff35a67d':
  Add BufferQueueInterposer and use it for virtual displays
  Add DisplaySurface abstraction
  Fix argument types in IGraphicBufferProducer methods
  Minor cleanups/fixes before virtual display refactoring
2013-03-19 17:49:21 +00:00
Mathias Agopian
19437cb84c A few tweaks to RefBase debugging
- stacks are now saved in /data/debug which must be
  created and writable by the user.

- removed "always fatal" DEBUG_REFS option, it wasn't
  really needed.

- DEBUG_REFS_ENABLED_BY_DEFAULT is not the default anymore
  (usually people want to target which refs they're tracking)

Change-Id: I37fae72e9dacde6ce1fa8f7dbe2bc01b1a1b95e5
2013-03-18 22:59:40 -07:00
Jesse Hall
4c00cc1114 Fix argument types in IGraphicBufferProducer methods
Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
2013-03-18 14:16:02 -07:00
Jesse Hall
647a92aa69 am df608eb1: am ce7e2781: Merge "Add Vector::resize()" into jb-mr2-dev
* commit 'df608eb15d3b90d2e71e07baaa6de423c29769c8':
  Add Vector::resize()
2013-03-17 16:27:56 +00:00
Jesse Hall
e81421e1cb Add Vector::resize()
Bug: 8384764
Change-Id: Icee83d389f3e555eba7d419b64c8d52a9aa21b8b
2013-03-15 12:40:39 -07:00
Dianne Hackborn
470378f3c0 am 5f72d05a: am 1791eefd: fix a couple race-conditions in RefBase::promote()
* commit '5f72d05a01d9b7a1bd6d2a2a269b80facd206066':
  fix a couple race-conditions in RefBase::promote()
2013-03-15 04:35:16 +00:00
Dianne Hackborn
1791eefd69 fix a couple race-conditions in RefBase::promote()
Bug: 8390295
Change-Id: I7a48e3bf5b213cc1da2b8e844c6bb37ee24cb047
2013-03-14 16:47:41 -07:00
Elliott Hughes
31004a63db am 9bd5c827: am 5b00af24: am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor."
* commit '9bd5c8274c822540473dfc646b47b4121785c727':
  Second try at adding a compatibility symbol for the MemoryBase constructor.
2013-03-14 17:36:01 +00:00
Elliott Hughes
5b00af2435 am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor."
* commit '7212ff29c6f4e4cd192fee6f072e80b36d8a728b':
  Second try at adding a compatibility symbol for the MemoryBase constructor.
2013-03-14 10:31:38 -07:00
Elliott Hughes
e88dfd3fc5 am f1d38fb2: am c47f0988: Revert "Add a compatibility symbol for the MemoryBase constructor."
* commit 'f1d38fb2ff9c11ddc1b0618c90e10abbe43b0939':
  Revert "Add a compatibility symbol for the MemoryBase constructor."
2013-03-14 11:11:37 +00:00
Elliott Hughes
c47f0988a3 Revert "Add a compatibility symbol for the MemoryBase constructor."
Cherry pick from AOSP to fix the build.
See https://android-review.googlesource.com/#/c/53690/

This reverts commit 7f974ff2f3

Change-Id: I1b123f446d0ff41e11ff81d4ef5f1472b59cac93
2013-03-14 10:51:17 +00:00
Elliott Hughes
d319ab41f6 am 830f71c3: am 5ca39ea5: am 9b57ad73: am 8facd1b2: Merge "Add a compatibility symbol for the MemoryBase constructor."
* commit '830f71c30ed8d72ef0682c01e9deb6a5284eca9b':
  Add a compatibility symbol for the MemoryBase constructor.
2013-03-14 06:15:23 +00:00
Elliott Hughes
5ca39ea57a am 9b57ad73: am 8facd1b2: Merge "Add a compatibility symbol for the MemoryBase constructor."
* commit '9b57ad737bceba9f8d4f5be303c70fa72be00eaf':
  Add a compatibility symbol for the MemoryBase constructor.
2013-03-13 23:11:00 -07:00
Elliott Hughes
ddd286301b Second try at adding a compatibility symbol for the MemoryBase constructor.
Third-party libraries are currently trying to use the
MemoryBase constructor but failing because we fixed the
definition of ssize_t. This is a stop-gap for users of
this private API until we can get them fixed.

Bug: 8253769
Change-Id: Ie7c86f45fa39cb53539cab0ffe8585a585656714
2013-03-13 20:54:01 -07:00
Elliott Hughes
6dbf07d7d5 Revert "Add a compatibility symbol for the MemoryBase constructor."
This reverts commit 7f974ff2f3

Change-Id: I28ebfc5ac88bd025471b613aa7958d23749e6991
2013-03-14 02:56:34 +00:00
Mathias Agopian
74620c556a am 1ffc0e7a: am 35ffa6a8: Surface can now be created only from an IGraphicBufferProducer
* commit '1ffc0e7a3b2e9911e020ca5fce0bb088f33d85d9':
  Surface can now be created only from an IGraphicBufferProducer
2013-03-14 02:34:13 +00:00
Mathias Agopian
75c207ae85 am ad84fa33: am 4d9b822e: get rid of ISurface
* commit 'ad84fa334c5baec53b1607a23483f40907e964de':
  get rid of ISurface
2013-03-14 02:34:12 +00:00
Elliott Hughes
7f974ff2f3 Add a compatibility symbol for the MemoryBase constructor.
Third-party libraries are currently trying to use the
MemoryBase constructor but failing because we fixed the
definition of ssize_t. This is a stop-gap for users of
this private API until we can get them fixed.

Bug: 8253769
Change-Id: I8a19770f3252d88ee87023fde625cc6289924b0d
2013-03-13 18:19:20 -07:00
Mathias Agopian
35ffa6a868 Surface can now be created only from an IGraphicBufferProducer
it can't write itself to a parcel, nor can it be created from a
parcel.

Change-Id: I69165d5c54d6024b3e546e80d8b57e3dedda7893
2013-03-12 18:45:09 -07:00
Mathias Agopian
4d9b822e2c get rid of ISurface
ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.

Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.

Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
2013-03-12 17:11:48 -07:00
Mathias Agopian
21dd0236e8 am 9ac559b5: am f795852b: temporary: enable ASSERTs in RefBase
* commit '9ac559b58c49a43ed9468422feef0ae500340efe':
  temporary: enable ASSERTs in RefBase
2013-03-12 04:36:53 +00:00
Mathias Agopian
f795852b54 temporary: enable ASSERTs in RefBase
this is in an attempt to get more data on
bug 8328715.

Change-Id: I9333a67c2d7f67f4d9b2fc5eb1ad8a7b2d1c6dcb
2013-03-11 21:27:16 -07:00
Mathias Agopian
6d74bd6acc am 5e80aa10: am d2d5a64a: workaround a deadlock when taking screenshots into a surface
* commit '5e80aa10d37dc066b2e079037a0564703be92ebb':
  workaround a deadlock when taking screenshots into a surface
2013-03-12 01:15:43 +00:00
Mathias Agopian
d2d5a64aa2 workaround a deadlock when taking screenshots into a surface
When disconnecting from BufferQueue, we now drain the queue
except the head (which means in the screenshot case we won't
have to block, but we might not have a buffer to show, this
will appear as an error in the log).

Bug: 8362363
Change-Id: If80989aac3c917beea2ebddf3cbb502849d394da
2013-03-11 17:59:59 -07:00
Romain Guy
47e83a14d0 am c75412dc: am dbca4a0e: Merge "Add Thread::isRunning and Condition::signal(WakeUpType)" into jb-mr2-dev
* commit 'c75412dcdd617423a033e4a647f43b35af1fc0c4':
  Add Thread::isRunning and Condition::signal(WakeUpType)
2013-03-11 21:41:18 +00:00
Romain Guy
dbca4a0ee5 Merge "Add Thread::isRunning and Condition::signal(WakeUpType)" into jb-mr2-dev 2013-03-11 21:38:26 +00:00
Romain Guy
9447be65c3 Add Thread::isRunning and Condition::signal(WakeUpType)
The signal() method is useful to choose whether to wake up one or
all threads.

Change-Id: I062ab6d3ddd306a9fb735549ea140e2a76eed75a
2013-03-11 14:34:56 -07:00
Mathias Agopian
9f13b4f694 am e491ec7c: am 7589b2a7: add two libgui tests
* commit 'e491ec7c93adb9ec9cfab0f6c7604383aa58d08c':
  add two libgui tests
2013-03-08 22:50:24 +00:00
Mathias Agopian
7589b2a797 add two libgui tests
we check that the order in which we destroy GLConsumer wrt.
releasing the corresponding EGLSurface via eglMake(Un)Current
doesn't leak a buffer.

On at least 2 devices this test doesn't pass.

Change-Id: I63ab83951b4b0a977f38571158f948cbd9dc7cec
2013-03-08 13:22:03 -08:00
Mathias Agopian
336dda6b93 am 3f27f950: am 6b2b7009: Merge changes Ibb3b6ff0,I2341e20c into jb-mr2-dev
* commit '3f27f9503356f8f60246dd188c4dd899e8999150':
  rename binder services main thread to Binder_*
  limit number of extra binder threads in SF to 4
2013-03-08 20:31:57 +00:00
Mathias Agopian
e3e43b384e rename binder services main thread to Binder_*
When a binder service's main thread joins the thread pool
it retains its name (whatever the exec name was), which is
very confusing in systrace.

we now rename that thread just like its friends in the
thread pool.

Change-Id: Ibb3b6ff07304b247cfc6fb1694e72350c579513e
2013-03-07 15:34:28 -08:00
Mathias Agopian
e8e7c46ae5 am 483fbb3b: am 1f758231: Merge changes I7f696e42,I51c6df3c into jb-mr2-dev
* commit '483fbb3befcfc5d113cf5931cbf32e59a99c21c6':
  Make GraphicBuffer a RefBase
  Fix RefBase debugging. O_CREAT must specify the mode.
2013-03-07 17:34:33 +00:00
Mathias Agopian
dbf146f1d6 Fix RefBase debugging. O_CREAT must specify the mode.
Change-Id: I51c6df3cfd59b20ca73c3edee86bc2f74dbde1b1
2013-03-06 17:52:34 -08:00
Glenn Kasten
03cacfd29b Merge "Continue removing property debug.sys.noschedgroups" 2013-03-05 23:37:49 +00:00
Eino-Ville Talvala
042ecee2ab CpuConsumer: Properly track acquired buffers
CpuConsumer cannot simply assume a slot's buffer is the same buffer
between acquire and release, and therefore it could be possible for
the same slot to get used for a second acquired buffer, if there's a
producer disconnect in between. This would cause a problem when the
first buffer is released by the consumer.

Instead, use an independent list of acquired buffers to properly track
their state.

Bug: 8291751
Change-Id: I0241ad8704e53d47318c7179b13daed8181b1fab
2013-03-05 15:25:06 -08:00
Igor Murashkin
f082323c0d Merge "CpuConsumer_test: Extend test with new formats RGBA8888 and optional Y8/Y16" into jb-mr2-dev 2013-03-05 21:58:00 +00:00
Igor Murashkin
29e2047cb4 CpuConsumer_test: Extend test with new formats RGBA8888 and optional Y8/Y16
Change-Id: I0a0f6ce73516883bf50c749a1759abbdb3748e08
2013-03-05 13:55:31 -08:00
Mathias Agopian
306f18c5fb Merge "rework screenshot API and implementation" into jb-mr2-dev 2013-03-05 02:30:13 +00:00
Jesse Hall
006a601f22 Fix reading NULL Surfaces from Parcels
Writing a NULL Surface was being read as a non-NULL Surface with NULL
mGraphicBufferProducer. Before the SurfaceTextureClient -> Surface
refactoring, you'd get a NULL Surface, and some code relies on that.

Bug: 8291161
Change-Id: I477bfe8882693e53a5f604a3d2c9e3cfe24473b4
2013-03-02 20:06:42 -08:00
Mathias Agopian
2a9fc493df rework screenshot API and implementation
- SurfaceFlinger now supports to take a screenshot
  directly into an IGraphicBufferProducer

- reimplement the IMemoryHeap screenshot on top
  of the above

- reimplement LayerScreenshot such that its
  BufferQueue is directly used as the destination
  of the screenshot. LayerScreenshot is now a thin
  wrapper around Layer

Bug: 6940974

Change-Id: I69a2096b44b91acbb99eba16f83a9c78d94e0d10
2013-03-01 22:53:39 -08:00
Dave Burke
bbb57f3331 Revert "Change SurfaceControl setPosition to take floats"
Temporary, to fix weekend build, until we get Nvidia code drop.

This reverts commit 9a867a8798

DO NOT MERGE

Change-Id: I7b5dbc4db46ef3d97dc8598057d5487d6971178b
2013-03-01 16:06:48 -08:00
Eino-Ville Talvala
eb0d12963d CpuConsumer: Add optional asynchronous mode
Bug: 8290146
Bug: 8291751

Change-Id: I9c8ac4bff38b0411e987a204e540d018dba6d0b4
2013-02-28 15:51:24 -08:00
Eino-Ville Talvala
64d8b1903e CpuConsumer: Don't unlock buffers on producer disconnect
Bug: 8291751

Change-Id: I062a3d34b41183d07fb6b9109cdb6bf0c0c75672
2013-02-28 14:20:28 -08:00
Chris Craik
3e010f3138 Add createTJunctionFreeRegion
T-junction free regions are useful for rendering regions with various
geometric transformations, and the Region's span-ordered, sorted rect
list supports T-junction free storage without modification.

This approach creates a T-junction free region by splitting each
rectangle that is part of a vertical T-junction. This approach is two
pass (up and down) so that divisions can trickle up/down to other
adjacent spans.

Change-Id: Ifcf5e6fe0034c96b00ef09a4433b2b0fce8f4300
2013-02-27 11:13:03 -08:00
Mathias Agopian
993e14fe10 Added a test that checks the error behavior of ConsumerBase::abandon
We check that calling eglSwapBuffers() on an abandonned BufferQueue
return EGL_BAD_SURFACE -- this is to ensure consistancy between
drivers.

Change-Id: Ibb548e0cf767ceee69f2fc4a85811d15a6522277
2013-02-25 16:51:31 -08:00
Michael Wright
9a867a8798 Change SurfaceControl setPosition to take floats
Bug: 8153162
Change-Id: If3c4b7a3e124ace25999eb9a569dc9a806a1fbc2
2013-02-21 22:42:07 -08:00
Mathias Agopian
a7121cf44b Merge "get rid of Surface::getISurfaceTexture()" 2013-02-21 23:23:21 +00:00
Mathias Agopian
cf0b8c85fb get rid of Surface::getISurfaceTexture()
this was there just for legacy reasons.

Change-Id: I0a48d6e04d7efa65033f9f10c91bba557f16ae8b
2013-02-19 18:24:40 -08:00
Eino-Ville Talvala
e88a85e0d0 Fixes to native app ops services
Bug: 8181262
Change-Id: I3d3f20453f6c6f2756c988363c5b5453ef309cb6
2013-02-19 18:10:05 -08:00
Mathias Agopian
e3c697fb92 Refactoring: Rename SurfaceTextureClient to Surface
Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
2013-02-14 19:19:05 -08:00
Mathias Agopian
ac9fa427d4 get rid of Surface identity and token
we use the IBinder instead.

Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
2013-02-13 15:27:08 -08:00
Jamie Gennis
b997f6ef0f Merge changes I50831d4e,I5360aebe
* changes:
  flatland: remove an unneeded #include
  libgui: disallow NULL Fence pointers
2013-02-13 23:22:04 +00:00
Jamie Gennis
1df8c34585 libgui: disallow NULL Fence pointers
This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required.  Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.

Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
2013-02-12 18:15:38 -08:00
Dianne Hackborn
5da5ca520c App ops: new native access API.
This is to help implementation of bug #8181262 and maybe
bug #8181261

Note the current code has not yet been tested; it is only
known to compile at this point.

Change-Id: I489674c96d0d3fc0ddacc92611931a19a9ee5230
2013-02-12 15:13:37 -08:00
Nick Kralevich
c4fd05b172 Revert "try to fix win_sdk build."
A better change was checked into system/core. See commit
941daef629bd571032851edf7ae1dce24266640e

This reverts commit fa99d30ec7.
2013-02-02 18:09:15 -08:00
Nick Kralevich
fa99d30ec7 try to fix win_sdk build.
Change-Id: I55e78e339874a6d6a3381c2550556b65c7ec1ca0
2013-02-01 16:09:23 -08:00
Douglas Leung
cc1a4bb1e1 [MIPS] Avoid unaligned load/store for 64-bit doubles.
Change-Id: Iefdcac8742f23fef31f63730b48698fc4205c3ad
Signed-off-by: Douglas Leung <douglas@mips.com>
2013-01-17 13:03:43 -08:00
Jesse Hall
7c36cd2315 Fix memory leak when getting signal time for unsignaled fences
Bug: 8000983
Change-Id: Ie88ed23fc5e8c95bfade364e090e90b7f070fa8e
2013-01-14 16:33:29 -08:00
Andy McFadden
466a192d20 Minor tweaks.
Change-Id: I9f82f574112141b6aa074c42303056cd52d5c478
2013-01-08 11:25:51 -08:00
Andy McFadden
2adaf04fab Rename ISurfaceTexture and SurfaceTexture
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
2012-12-18 13:10:48 -08:00
Marco Nelissen
cce6230b3c Merge "Add NULL check to CallStack::toString" 2012-12-17 13:42:05 -08:00
Marco Nelissen
32130635f6 Add NULL check to CallStack::toString
CallStack::toString() has a 0 default argument, which ends up getting
passed to strlen(), resulting in a crash.

Change-Id: If706aff8c400983670f49cdbb66e11191ac76e0e
2012-12-17 10:28:20 -08:00
Jamie Gennis
c911ea5318 stop using a deprecated SurfaceTextureClient ctor
Change-Id: I8c8282a0debd551db290dd6849faf272a88c704c
2012-12-12 12:38:36 -08:00
Jamie Gennis
3c1ada9822 Merge "SurfaceTextureClient: remove a deprecated ctor" 2012-12-12 12:16:21 -08:00
Jamie Gennis
4def860030 SurfaceTextureClient: remove a deprecated ctor
Change-Id: Ibf2746fdca26851677cd90199c60eab80f6d0c73
2012-12-12 12:13:54 -08:00
Jamie Gennis
c6f04666c2 Merge "SurfaceFlinger: Move GraphicBufferAlloc to libgui" 2012-12-12 10:56:42 -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
97eba8904c Avoid unnecessary texture bind
In SurfaceFlingerConsumer, check to see if native fence sync is
enabled.  If so, defer the texture binding step to Layer::onDraw.

Change-Id: I7d4034a31c0143207eea2509dfa13ef3820f9b8c
2012-12-11 16:26:51 -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
884e3bc29e am 6426bd62: am f53f9c6d: [DO NOT MERGE] GraphicBufferAllocator: stall alloc for async frees
* commit '6426bd62676c743b0b5bdc397bcab5c669c6e51f':
  [DO NOT MERGE] GraphicBufferAllocator: stall alloc for async frees
2012-12-10 17:58:33 -08:00
Jamie Gennis
f53f9c6d36 [DO NOT MERGE] GraphicBufferAllocator: stall alloc for async frees
This change makes GraphicBufferAllocator::alloc wait for pending async frees to
complete before attempting to allocate a gralloc buffer if there are more than
8 pending async frees.

Bug: 7696861
Change-Id: I1fae86e13edefcaa153b8ce9fd057f335716059e
2012-12-10 17:19:37 -08:00
Jamie Gennis
a436799668 am 50f8d285: am d4e70620: am 72c3f7d8: Revert "ConsumerBase: free buffers outside the lock"
* commit '50f8d2856b6644059b31684687842bf9c1f2e814':
  Revert "ConsumerBase: free buffers outside the lock"
2012-12-07 11:09:12 -08:00