Commit Graph

1643 Commits

Author SHA1 Message Date
Jeff Brown
66fbde3050 Add a basic hashtable data structure, with tests!
The basic hashtable is intended to be used to support a variety
of different datastructures such as map, set, multimap,
multiset, linkedmap, generationcache, etc.

Consequently its interface is fairly primitive.

The basic hashtable supports copy-on-write style functionality
using SharedBuffer.

The change introduces a simple generic function in TypeHelpers for
specifying hash functions.  The idea is to add template
specializations of hash_type<T> next to the relevant data structures
such as String8, String16, sp<T>, etc.

Change-Id: I2c479229e9d4527b4fbfe3b8b04776a2fd32c973
2011-11-22 17:12:22 -08:00
Jeff Brown
4265ed75f7 Merge "Use libcorkscrew to format the stack trace." 2011-11-22 12:57:08 -08:00
Mathias Agopian
6b7c5da722 am cc4d02e0: am 07a2d831: Merge "don\'t report an error when disconnecting from an abandoned surfacetexture" into ics-mr1
* commit 'cc4d02e0cbb99341a0508838c88eeef53180fdfd':
  don't report an error when disconnecting from an abandoned surfacetexture
2011-11-21 21:08:47 -08:00
Mathias Agopian
93a098fb6e am 8390cf39: am 8646cd42: Merge "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices" into ics-mr1
* commit '8390cf39f8a4f74f7baa91d23cba06894a3fb9b5':
  enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
2011-11-21 21:08:44 -08:00
Jamie Gennis
185a0a0420 am c2597295: am 53cf2020: Merge changes I37fd43b5,I91eb29db,I0491ce35 into ics-mr1
* commit 'c25972950c2ea62fb085524dbe737c2bf0f08f4a':
  SurfaceTexture: fix a couple tests
  EGL: default to swap interval 1
  SurfaceTexture: clean up some tests
2011-11-21 21:08:21 -08:00
Jeff Brown
504f982fd3 Use libcorkscrew to format the stack trace.
Change-Id: I3a5439ada76bc77c2dd491eaed2272e16a811cc7
2011-11-21 21:04:55 -08:00
Mathias Agopian
7723773df3 Merge "don't report an error when disconnecting from an abandoned surfacetexture" into ics-mr1 2011-11-21 17:57:31 -08:00
Mathias Agopian
75cf5a7480 Merge "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices" into ics-mr1 2011-11-21 17:57:20 -08:00
Jamie Gennis
e3603d7d09 SurfaceTexture: fix a couple tests
This change fixes some robustness issues with the
EglDestroySurfaceUnrefsBuffers and
EglDestroySurfaceAfterAbandonUnrefsBuffers tests.  The tests previously
depended upon GL implementation details that should not have been relied
upon.

Change-Id: I37fd43b56568efe1dbe69d85e892be8a1cf44d20
2011-11-21 14:38:15 -08:00
Jamie Gennis
59769469e4 EGL: default to swap interval 1
This change explicitly sets swap interval 1 on the window when an
EGLSurface is created to render to it.

Change-Id: I91eb29dbee3ae4a55076b921f084d503fbe94e03
2011-11-21 14:37:29 -08:00
Jamie Gennis
6f4cdfe0db SurfaceTexture: clean up some tests
This change cleans a few things up in the SurfaceTexture tests:
- Wraps a few long lines.
- Refactors the multithreading portions of SurfaceTextureGLToGLTest into
  a new test fixture called SurfaceTextureGLThreadToGLTest.
- Changes some of the tests that were creating their own EGLSurface to
  use the SurfaceTextureGLToGLTest fixture.
- Reorders the test functions so that they are immediately below to the
  test fixture that they use.

Change-Id: I0491ce3528a7ff2b4f1e83602ba290269c087297
2011-11-21 11:52:02 -08:00
Mathias Agopian
8bee68fac2 am d0df44b5: am 4d71053b: Merge "attempt to fix bug 5313580" into ics-mr1
* commit 'd0df44b5c979e00a19187cea35768ba26557e447':
  attempt to fix bug 5313580
2011-11-18 15:22:59 -08:00
Mathias Agopian
8b8a004148 don't report an error when disconnecting from an abandoned surfacetexture
this happens often with CPU Surfaces, which disconnect long
after their surfacetexture has been abandoned.

Change-Id: If49da03b72f99130e01b2b9bcbd444bb38f7ed4e
2011-11-18 14:32:35 -08:00
Mathias Agopian
7c6eba6669 enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
this flag should be enabled for all targets, but currently
some have issues with it, so we're turning it on only for
tested targets.

this will hopefully resolve some performance issues.

Bug: 5553562, 5631630
Change-Id: I54c7a9e2068586898ab13e405d95534669260537
2011-11-18 13:50:35 -08:00
Mathias Agopian
6285c6cf10 Merge "attempt to fix bug 5313580" into ics-mr1 2011-11-18 12:11:15 -08:00
Jamie Gennis
b963e22ca2 am 9da22d2c: am 2ba13186: Merge "SurfaceTexture: fix a bug with buffer reallocation" into ics-mr1
* commit '9da22d2cc31069d86a92021d8540bb5a77c9591b':
  SurfaceTexture: fix a bug with buffer reallocation
2011-11-18 02:37:41 -08:00
Mathias Agopian
a36bcd53ac attempt to fix bug 5313580
the working theory here is that a Surface object has become non-promotable
because it lost its last reference; later Surface::readFromParcel is called
the previous surface is found in the cache, but can't be promoted. this causes
a new Surface object to be created which will promptly try to connect to the
CPU_API -- this in turn will fail because the previous (now dead) surface is
still connected.

To fix this, we make sure to disconnect from the SurfaceTexture when
Surface[TextureClient] is destroyed.

Change-Id: I422234868a05d7b7d283e9d5a85f7ab79e65d8a9
2011-11-17 18:46:09 -08:00
Jamie Gennis
e984dd11c1 Merge "SurfaceTexture: fix a bug with buffer reallocation" into ics-mr1 2011-11-17 17:10:47 -08:00
Jamie Gennis
aaa3ecff4b SurfaceTexture: fix a bug with buffer reallocation
This change fixes an issue involving buffer reallocation and the
ALLOW_DEQUEUE_CURRENT_BUFFER mode in SurfaceTexture.  The bug happened
when the buffer slot currently attached to the GL texture was selected
for dequeuing, but the dequeue operation caused the buffer to be
reallocated.  Because the buffer is new, the image producer could fill
the buffer and queue it before an updateTexImage call, which would
result in the "slot %d is current" error in queueBuffer.

Bug: 5631630
Change-Id: Icdd8bc5cad3c7db43953446d9be2603aaea11a8d
2011-11-17 16:00:44 -08:00
Mathias Agopian
1c46c42c16 am abdade71: am 69c17a11: Merge "Revert "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices"" into ics-mr1
* commit 'abdade71bc17153696fe2abe281c5a3b0c2e5abe':
  Revert "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices"
2011-11-17 07:48:10 -08:00
Jamie Gennis
ccf5b9febc am 7765fc65: am fd6b64f6: Merge "SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call" into ics-mr1
* commit '7765fc651a9519dd2f0ac9d3374a50e9865c5c99':
  SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call
2011-11-17 05:46:00 -08:00
Mathias Agopian
c554d2b8ad Merge "Revert "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices"" into ics-mr1 2011-11-16 16:13:38 -08:00
Mathias Agopian
c21180ee67 Revert "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices"
This reverts commit e7758be6da85728df6b4215f413660c67c5a9740.

Seemed to cause failures un SurfaceTexture.

Bug: 5627450
2011-11-16 15:59:13 -08:00
Jamie Gennis
c1ef3c4d7d Merge "SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call" into ics-mr1 2011-11-16 11:34:30 -08:00
Jeff Brown
0c5ccc081a am 4c0e0dd2: am 3e7497b4: Merge "Eliminate hw.keyboards system properties." into ics-mr1
* commit '4c0e0dd29dcce33e7521b11d01d21d9431f3b264':
  Eliminate hw.keyboards system properties.
2011-11-15 19:43:35 -08:00
Jeff Brown
032458cbab Merge "Eliminate hw.keyboards system properties." into ics-mr1 2011-11-15 19:17:09 -08:00
Jeff Brown
882b0a59d8 Eliminate hw.keyboards system properties.
Stop using system properties to publish information about
the key character map path.  Instead, we can retrieve it
on demand by asking the window manager.

It was possible to exhaust the supply of system properties
when repeatedly adding and removing input devices.

Bug: 5532806
Change-Id: Idd361a24ad7db2edc185c8546db7fb05f9c28669
2011-11-15 18:00:10 -08:00
Mathias Agopian
029f760674 am 556a406c: am 3aa684ec: Merge "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices" into ics-mr1
* commit '556a406cf4dd8a7faa318e0d522d899f8b9da7dc':
  enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
2011-11-15 13:11:19 -08:00
Sunita Nadampalli
a929748ddb SurfaceTexture: Fix to return the oldest of free buffers to Client on Dequeue call
Surface Texture dequeue logic is modified to return the oldest of the
free buffers to Client on dequeue call.

Currently dequeue method is returning the first buffer index which is free.
The parsing is done in ascending order of the buffer slot indices.
This leads to returning the buffer which has been just queued to composer,
and hence display, and this defeats the purpose of having minimum dequeue count
as 2 in asynchrnouse mode.

This is fixed by checking all the free slots and returning the oldest buffer.

Change-Id: Ibbac10593c3994c278c601af0480b171635ecdd4
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
2011-11-15 11:43:35 -08:00
Mathias Agopian
251ce852cc enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
this flag should be enabled for all targets, but currently
some have issues with it, so we're turning it on only for
tested targets.

this will hopefully resolve some performance issues.

Bug: 5553562
Change-Id: I939992b4cd0debea980dec0127c72be2dff33af8
2011-11-14 19:17:37 -08:00
Mathias Agopian
8c11963dda am 738d8cae: am c93a151f: Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1
* commit '738d8cae2239d194429676f2889cfae3c8f7ba08':
  Define, document, and test the behavior of very large SurfaceTextures
2011-11-14 11:54:38 -08:00
Mathias Agopian
194c76c047 Define, document, and test the behavior of very large SurfaceTextures
updateTexImage() now throws a runtime exception when its native
counterpart fails

Bug: 5506633

Change-Id: I151a6f685d465966e7df4df624412ab2da62e95f
2011-11-11 18:44:35 -08:00
Jeff Brown
d341c7178f Fix possible leak in Parcel::writeDupFileDescriptor.
Also, check the result of dup() just in case we got EMFILE
or something.

Change-Id: I18e627bd84f4c7941813fe1c2bad2cdd9e5afa83
2011-11-07 12:22:39 -08:00
Jeff Brown
c17f56fdf1 am 88061d6b: am 5462bc63: Fix a leak in Parcel::writeBlob.
* commit '88061d6b38cfb4bf374039846b753a3b21ac61e1':
  Fix a leak in Parcel::writeBlob.
2011-11-07 15:51:31 +00:00
Jeff Brown
343c59cc8d Merge "Slight change to the unwinder API." 2011-11-04 20:06:42 -07:00
Jeff Brown
efd912c05c am 5462bc63: Fix a leak in Parcel::writeBlob.
* commit '5462bc6318b4b70e7a58c66994e2bd79f59d9739':
  Fix a leak in Parcel::writeBlob.
2011-11-05 02:35:57 +00:00
Jeff Brown
93ff1f985e Fix a leak in Parcel::writeBlob.
Was mistakenly assuming that Parcel::writeFileDescriptor took
ownership of the fd that was passed in.  It does not!
Added some comments and a default parameter to allow the caller
to specify whether it wishes the Parcel to take ownership.

Bug: 5563374
Change-Id: I5a12f51d582bf246ce90133cce7690bb9bca93f6
2011-11-04 19:26:03 -07:00
Jeff Brown
2ab79e755b Slight change to the unwinder API.
Change-Id: I5424de76a21b74842e004e0281936b3f492d3c7a
2011-11-03 17:30:54 -07:00
Jamie Gennis
eade85c60c am c5ce130f: Merge "SurfaceTexture: various logging improvements" into ics-mr1
* commit 'c5ce130f658303299bf55091373951f7fd33ae36':
  SurfaceTexture: various logging improvements
2011-11-03 18:57:21 +00:00
Jamie Gennis
7fbb39960e am 236aea35: Merge changes Ibc99cb1c,Ie1f4f6f8 into ics-mr1
* commit '236aea3579787961fdd41d87574760b63323c0c1':
  BlobCache: implement cache serialization
  BlobCache: remove the mutex locking
2011-11-03 18:55:14 +00:00
Jamie Gennis
9f8b1cecc8 Merge "SurfaceTexture: various logging improvements" into ics-mr1 2011-11-03 11:51:38 -07:00
Jamie Gennis
6ee96ad6a3 SurfaceTexture: various logging improvements
Change-Id: I1f7216276547a1e9f9343c88c6cc1c24efcdcdbc
2011-11-01 15:48:42 -07:00
Jamie Gennis
0e1bc17429 BlobCache: implement cache serialization
This change adds serialization and deserialization functionality to
BlobCache, conforming to the Flattenable interface.

Change-Id: Ibc99cb1c3d015f363d57d0713eabccec07ff975e
2011-10-31 18:49:32 -07:00
Jamie Gennis
93ca6fb91c BlobCache: remove the mutex locking
This change removes the mutex from the BlobCache class.  The caller must
be responsible for thread synchronization in order to properly implement
the Flattenable interface, which is coming soon.  Otherwise would be the
potential for the cache contents to change between the call to the
getFlattenedSize and flatten methods.  Because the caller must do this
synchronization anyway there's no reason to also some synchronization
inside BlobCache.

Change-Id: Ie1f4f6f82b78744f46a41ce863cac0cad276a20e
2011-10-31 18:48:31 -07:00
Jeff Brown
9897b46138 resolved conflicts for merge of 2d280f75 to ics-mr1
Change-Id: I459e1cb0b60fb94dfb12862fedb9f8d949c226a7
2011-10-30 14:24:02 -07:00
Jeff Brown
27a852b620 Improve the slow query instrumentation.
On user-debug and eng builds, you can set the
"db.log.slow_query_threshold" system property to queries that
take longer than the specified number of milliseconds.
Set it to 0 to log all queries.

This property has been around for a while but it was implemented
poorly.  In particular, it *changed* the behavior of the query
by calling getCount() while holding the Db connection.
In normal operation, the query will not actually run until later.

By putting the timing logic into fillWindow() instead, we ensure
that we only measure queries that actually ran.  We also capture
cases where the cursor window gets filled multiple times.

Bug: 5520301
Change-Id: I174f5e1ea15831a1d22a36e9a804d7755f230b38
2011-10-28 14:58:39 -07:00
Jeff Brown
20b3da9a01 Optimize fillWindow to improve reverse-seek performance.
Bug: 5520301

When an application requests a row from a SQLiteCursor that
is not in the window, instead of filling from the requested
row position onwards, fill from a little bit ahead of the
requested row position.

This fixes a problem with applications that seek backwards
in large cursor windows.  Previously the application could
end up refilling the window every time it moved back
one position.

We try to fill about 1/3 before the requested position and
2/3 after which substantially improves scrolling responsiveness
when the list is bound to a data set that does not fit
entirely within one cursor window.

Change-Id: I168ff1d3aed1a41ac96267be34a026c108590e52
2011-10-28 01:46:18 -07:00
Mathias Agopian
7796e962da Merge "Rename SensorChannel to BitTube" 2011-10-26 12:51:44 -07:00
Steve Block
6807e59e0f Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-10-26 09:57:54 +01:00
Steve Block
9f760150f6 Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: I42575e7c29cf1c0f465c357a5c97ab118df6f473
2011-10-25 16:28:24 +01:00