Commit Graph

2107 Commits

Author SHA1 Message Date
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
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
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
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
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
53dc9044bf Merge "Updated comments" into jb-mr2-dev 2013-04-11 17:15:52 +00: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
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
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
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
2bb716871c replace eglWaitSyncANDROID by eglWaitSyncKHR
Change-Id: I22f1b3588011c88389e249f738f1e6915cc97e72
2013-03-28 14:31:09 -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
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
13f01cbdbd Pass sp<Fence>s around instead of file descriptors
Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
2013-03-22 09:56:58 -07: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
aaebffd52f Merge "CpuConsumer: Properly track acquired buffers" into jb-mr2-dev 2013-03-21 16:39: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
7c1a487ba8 fix build. update test to new API
Change-Id: I31ca84c85edff3e2ff90c554769e058110f27d49
2013-03-20 15:56:04 -07: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
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
ca987c8775 Merge "A few tweaks to RefBase debugging" into jb-mr2-dev 2013-03-19 23:00:40 +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
e81421e1cb Add Vector::resize()
Bug: 8384764
Change-Id: Icee83d389f3e555eba7d419b64c8d52a9aa21b8b
2013-03-15 12:40:39 -07: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
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
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
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
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
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
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
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
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
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
dbf146f1d6 Fix RefBase debugging. O_CREAT must specify the mode.
Change-Id: I51c6df3cfd59b20ca73c3edee86bc2f74dbde1b1
2013-03-06 17:52:34 -08:00