Commit Graph

48557 Commits

Author SHA1 Message Date
The Android Open Source Project
4e9d899a03 am 0371fd02: (-s ours) Reconcile with jb-mr2-release - do not merge
* commit '0371fd021f2f445b4041dc38f91ec25f10253455':
  am 7212ff29: am 20e154f1: Merge "Second try at adding a compatibility symbol for the MemoryBase constructor."
  size IMemoryHeap properly for screenshots
2013-03-20 16:46:48 +00:00
The Android Open Source Project
0371fd021f Reconcile with jb-mr2-release - do not merge
Change-Id: I9b1d766e6519a720cee8327d1ec71d9f69dd7387
2013-03-20 09:32:41 -07:00
The Android Automerger
dbff8227e2 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-20 05:55:54 -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
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
656a6780b5 am 9cd766a5: disable RefBase consistency checks (NDEBUG)
* commit '9cd766a517caeb58669722fad7fdf623a8c1b83c':
  disable RefBase consistency checks (NDEBUG)
2013-03-20 00:42:21 +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
dd3fcd2e58 am 4e37ddff: Fix a crasher with RefBase debugging and vectors of wp<>
* commit '4e37ddff43784a5a784beb4b62ea3f3136e1634b':
  Fix a crasher with RefBase debugging and vectors of wp<>
2013-03-20 00:27:46 +00: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
364a1f9578 am ca987c87: Merge "A few tweaks to RefBase debugging" into jb-mr2-dev
* commit 'ca987c877549b0d5472e91ded98f3ba6fea8a96d':
  A few tweaks to RefBase debugging
2013-03-19 23:02:47 +00:00
Mathias Agopian
ca987c8775 Merge "A few tweaks to RefBase debugging" into jb-mr2-dev 2013-03-19 23:00:40 +00:00
Jeff Sharkey
5a93003d3f Move screenshots near beginning of dumpstate.
Bug: 8420215
Change-Id: I6adffd1182ed8f99b8d11d43785a4eb4a388ceb5
2013-03-19 15:19:48 -07:00
Jesse Hall
69383e45d3 am 4af2b42b: am ef64b75a: Don\'t log an error on HWC1.1+ devices with no FB HAL
* commit '4af2b42b588c817a1a0d2fc4b78f86c450b33212':
  Don't log an error on HWC1.1+ devices with no FB HAL
2013-03-19 20:51:45 +00:00
Jesse Hall
4af2b42b58 am ef64b75a: Don\'t log an error on HWC1.1+ devices with no FB HAL
* commit 'ef64b75a936ffd194673dbce6766995f86b42ba9':
  Don't log an error on HWC1.1+ devices with no FB HAL
2013-03-19 20:49:09 +00:00
Jesse Hall
ef64b75a93 Don't log an error on HWC1.1+ devices with no FB HAL
Change-Id: I015e5a1a1f926181e51f82525f69beff71bd70cd
2013-03-19 11:22:57 -07: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
Jesse Hall
88f70a2167 am fae23b87: Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-dev
* commit 'fae23b8757a6e1b70997db28a2eaf34f9ddc9b84':
  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:47:30 +00:00
Jesse Hall
fae23b8757 Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-dev
* changes:
  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:45:29 +00:00
The Android Automerger
7d2c10419a merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-19 05:55:29 -07: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
Jamie Gennis
a4c8323e15 am 0bb2d18a: am 79fb99d0: Merge "atrace: add support for tracing kernel functions" into jb-mr2-dev
* commit '0bb2d18a82960557608f8152fdd51f845fbc1892':
  atrace: add support for tracing kernel functions
2013-03-18 21:58:11 +00:00
Jamie Gennis
0bb2d18a82 am 79fb99d0: Merge "atrace: add support for tracing kernel functions" into jb-mr2-dev
* commit '79fb99d0dea4d301d1bf25273c6af4907ca124bc':
  atrace: add support for tracing kernel functions
2013-03-18 21:56:43 +00:00
Jamie Gennis
79fb99d0de Merge "atrace: add support for tracing kernel functions" into jb-mr2-dev 2013-03-18 21:54:44 +00: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
Jesse Hall
4c00cc1114 Fix argument types in IGraphicBufferProducer methods
Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
2013-03-18 14:16:02 -07:00
Jesse Hall
7adb0f8a9f Minor cleanups/fixes before virtual display refactoring
None of these should change behavior, except for removing some
incorrect log messages when using a virtual display.

- HWComposer::getAndResetReleaseFenceFd() checks the HWC version, so
  no need to do that in the DisplayDevice::onSwapBuffersCompleted().
  However, it should check that mFramebufferSurface is not NULL like
  it is for virtual displays.
- Comment that FramebufferSurface::dump() overrides the non-virtual
  ConsumerBase::dump(), and fix it so the right thing happens
  regardless of the static type of the pointer/reference the callee
  has. FramebufferSurface::dump() could be removed right now, but I'd
  need to bring it back in a later change.
- Use the right enum for validating display type ids.
- Don't try to send hotplug events for virtual displays.
- Mark virtual displays as connected so HWComposer::prepare() doesn't
  think something is wrong when it gets a non-NULL layer list.
- Remove unused FramebufferSurface methods.

Bug: 8384764
Change-Id: Id28a2f9be86b45f4bb7915fdf7752157035f4294
2013-03-18 14:16:02 -07:00
Jamie Gennis
e9b8cfb632 atrace: add support for tracing kernel functions
This change adds support for tracing specific kernel function calls using the
function_graph tracer.  It adds a '-k' option to atrace that accepts a comma
separated list of kernel function names for which tracing will be enabled.

Change-Id: I872b2f1d474b8ebb904053853fc8cf8c0a98089c
2013-03-18 13:56:18 -07:00
The Android Automerger
152eb67787 merge in jb-mr2-release history after reset to jb-mr2-dev 2013-03-18 05:55:58 -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
Mathias Agopian
92509c779e am df6c6e97: am 041a0752: don\'t allow screenshots without the READ_FRAMEBUFFER permission
* commit 'df6c6e97b52cbd84f04d1be9a03f44816919dc37':
  don't allow screenshots without the READ_FRAMEBUFFER permission
2013-03-17 16:27:56 +00:00
Mathias Agopian
17a25a0dc7 am 0714d09e: am 7670d3cb: Merge "get rid of purgatory and fix QueuesToWindowComposer query" into jb-mr2-dev
* commit '0714d09e47d86cf9c437f670b0cb043b1fe28631':
  get rid of purgatory and fix QueuesToWindowComposer query
2013-03-17 16:18:35 +00:00
Jesse Hall
df608eb15d am ce7e2781: Merge "Add Vector::resize()" into jb-mr2-dev
* commit 'ce7e278151d268f3cf55bcecd05f6be8c7e82e0f':
  Add Vector::resize()
2013-03-17 16:18:34 +00:00
Mathias Agopian
df6c6e97b5 am 041a0752: don\'t allow screenshots without the READ_FRAMEBUFFER permission
* commit '041a075262ef5fc886e46fd4eec3dd79ee2e60c0':
  don't allow screenshots without the READ_FRAMEBUFFER permission
2013-03-17 16:18:34 +00:00
Jesse Hall
ce7e278151 Merge "Add Vector::resize()" into jb-mr2-dev 2013-03-16 03:23:13 +00:00
Mathias Agopian
041a075262 don't allow screenshots without the READ_FRAMEBUFFER permission
the recent screenshot rework allowed the older screenshot
interface to work without that permission

Change-Id: I6c4743f4591c81106e3b823d55a055f7b4907de1
2013-03-15 18:39:16 -07:00
Mathias Agopian
0714d09e47 am 7670d3cb: Merge "get rid of purgatory and fix QueuesToWindowComposer query" into jb-mr2-dev
* commit '7670d3cb2b5d38c60135f34a2446e1ae809d1b32':
  get rid of purgatory and fix QueuesToWindowComposer query
2013-03-16 01:16:22 +00:00
Mathias Agopian
7670d3cb2b Merge "get rid of purgatory and fix QueuesToWindowComposer query" into jb-mr2-dev 2013-03-16 01:14:35 +00:00
Mathias Agopian
6f880c32bf am 28e89fed: am a493be58: don\'t capture hidden layers in screenshots
* commit '28e89fed092dfc1d4a182e98a59f4ec5c3148625':
  don't capture hidden layers in screenshots
2013-03-15 23:17:45 +00:00
Mathias Agopian
28e89fed09 am a493be58: don\'t capture hidden layers in screenshots
* commit 'a493be5825d15f6a94d1afb5910db075a2a7abc1':
  don't capture hidden layers in screenshots
2013-03-15 23:16:30 +00:00
Mathias Agopian
a493be5825 don't capture hidden layers in screenshots
Bug: 8389956
Change-Id: I9ed836395258732c743c6fd44092bd01020dde13
2013-03-15 16:08:10 -07: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
5f72d05a01 am 1791eefd: fix a couple race-conditions in RefBase::promote()
* commit '1791eefd69e07a7d8a311ee8a298bbd2de77f046':
  fix a couple race-conditions in RefBase::promote()
2013-03-15 04:33:06 +00:00
Mathias Agopian
6710604286 get rid of purgatory and fix QueuesToWindowComposer query
the purgatory list wasn't needed anymore; in fact it had no effect as
buffer life-time management is now handled by the BufferQueue.

For QueuesToWindowComposer we keep a list of wp<> on the IBinder
for IGraphicBufferProducers we hand over to clients so we can
easily check if an IGraphicBufferProducer is ours. We clean-up the
list when our IGraphicBufferProducer are destroyed.

Bug: 8349142
Change-Id: I1aa06652ade8c72d0004a3f5e6c3d6e8a82fc2ae
2013-03-14 19:18:13 -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
284414bf4f 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 15:12:53 -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