OSDN Git Service

android-x86/frameworks-native.git
12 years agoadd some comments
Mathias Agopian [Thu, 28 Jun 2012 01:51:43 +0000 (18:51 -0700)]
add some comments

Change-Id: Ia2e2c9531715fc2bd5b51c4dc58389e01abfe7e6

12 years agoget rid of GraphicPlane
Mathias Agopian [Thu, 21 Jun 2012 00:51:20 +0000 (17:51 -0700)]
get rid of GraphicPlane

its functionality is now folded into DisplayHardware
there will be more changes in that area.

12 years agoFirst prototype atttempting to support an external display
Mathias Agopian [Tue, 19 Jun 2012 01:06:45 +0000 (18:06 -0700)]
First prototype atttempting to support an external display

both API and implementation will change, this is just a prototype
intended to show feasability.

SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.

Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21

12 years agomove sensorservice from frameworks/base to frameworks/native
Mathias Agopian [Thu, 28 Jun 2012 21:47:54 +0000 (14:47 -0700)]
move sensorservice from frameworks/base to frameworks/native

this commit also imports all of sensorservice history.

Change-Id: Iadffcc92be600c48175b8afadcb15b6648532b3f

12 years agosmall improvement to sensor fusion
Mathias Agopian [Tue, 19 Jun 2012 01:49:08 +0000 (18:49 -0700)]
small improvement to sensor fusion

1) there was a typo when computing the system covariance
a term in dT^3 was ommitted; the impact was was very limited
because of how small this term is.

2) initialize the system covariance matrix with non-zero
values for the gyro-bias part. this improves the initial
bias estimation speed significantly.

3) added comments here and there

Change-Id: I4328c9cca73e089889d5e74b9fda99d7831762dc

12 years agofix a potential buffer overflow in sensorservice
Mathias Agopian [Thu, 31 May 2012 01:08:30 +0000 (18:08 -0700)]
fix a potential buffer overflow in sensorservice

Bug: 6580560
Change-Id: Icf6cafbca09174515a964a7cd69d8cc589ad52de

12 years agoFix a stack corruption in sensorservice
Mathias Agopian [Wed, 30 May 2012 02:46:14 +0000 (19:46 -0700)]
Fix a stack corruption in sensorservice

Bug: 6576732
Change-Id: If0f2fb0d0c35b932fb77cd262e676042145b28f9

12 years agofix a typo causing sensor event to be sorted in reverse chronological order
Mathias Agopian [Fri, 20 Apr 2012 01:18:24 +0000 (18:18 -0700)]
fix a typo causing sensor event to be sorted in reverse chronological order

Change-Id: I041c64616d88ed1abb5efc90ed9eb0d9baeb4832

12 years agousea socketpair instead of a pipe in BitTube
Mathias Agopian [Tue, 3 Apr 2012 01:38:02 +0000 (18:38 -0700)]
usea socketpair instead of a pipe in BitTube

Bug: 6252830
Change-Id: I363cc7e9f73a5b7d8bbccee312c6d8938c84e99a

12 years agoRename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
Steve Block [Fri, 6 Jan 2012 19:20:56 +0000 (19:20 +0000)]
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c

12 years agoRename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
Steve Block [Thu, 5 Jan 2012 23:22:43 +0000 (23:22 +0000)]
Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69

12 years agoRename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
Steve Block [Wed, 4 Jan 2012 20:05:49 +0000 (20:05 +0000)]
Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea

12 years agoRename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
Steve Block [Tue, 20 Dec 2011 16:23:08 +0000 (16:23 +0000)]
Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298

12 years agohandle EINTR when calling sensor HAL's poll function
Mathias Agopian [Thu, 10 Nov 2011 01:50:15 +0000 (17:50 -0800)]
handle EINTR when calling sensor HAL's poll function

some sensor HALs don't handle EINTR, make sure to catch it in the
sensorservice.

also if we ever encounter an error that we can't handle, we abort
which will restart us (or the whole system process if we're running
in it)

Bug: 5511741
Change-Id: I7051882b06980f778736b53d6cd021a99b5ca8d2

12 years agoSensorService now always clamps the requested rate
Mathias Agopian [Tue, 8 Nov 2011 05:21:47 +0000 (21:21 -0800)]
SensorService now always clamps the requested rate

Requested rate will be clamped to the minimum rate and then
to 1ms. Previously we would return an error if a lower
rate was asked. The SensorManager documentation wording
allows this change.

We do this to get more consistancy between all the sensor
drivers / HALs

Change-Id: I199f76486fb76ccbb11e7280460a03726c767e84

12 years agofix an issue where SensorService could request an invalid sensor delay
Mathias Agopian [Wed, 2 Nov 2011 00:37:49 +0000 (17:37 -0700)]
fix an issue where SensorService could request an invalid sensor delay

When the app requests "fastest", the java layer encodes this as a
delay of 0. SensorService was passing this unchanged to the HAL.
However the HAL is required to reject delays lower that the
advertised lower delay.

Change-Id: I92be77acd3af62ffeb49e4b31e24ddcd203510e2

12 years agoRename SensorChannel to BitTube
Mathias Agopian [Fri, 21 Oct 2011 01:42:02 +0000 (18:42 -0700)]
Rename SensorChannel to BitTube

12 years agoimprove sensorservice dumpsys
Mathias Agopian [Wed, 14 Sep 2011 23:43:34 +0000 (16:43 -0700)]
improve sensorservice dumpsys

Change-Id: I8b53d5cab884c3aca16d95df5fbf288368d52e8b

12 years agoimprove sensorservice_test output
Mathias Agopian [Tue, 13 Sep 2011 05:16:01 +0000 (22:16 -0700)]
improve sensorservice_test output

Change-Id: I6248b6f1f001fedec1bddcddfcd2b381d9bb4bf4

12 years agoFix a few style issues and remove LOG spam
Mathias Agopian [Thu, 25 Aug 2011 01:40:33 +0000 (18:40 -0700)]
Fix a few style issues and remove LOG spam

Change-Id: I6b6f75373f4ac28f98dea6a6f1c2567a6aa02243

12 years agoMore error checks to avoid div by zero.
Michael Johnson [Fri, 19 Aug 2011 18:47:08 +0000 (11:47 -0700)]
More error checks to avoid div by zero.

Change-Id: I18e5b72d02bf5420c14334d3a03f18fa40572d31

12 years agoFix occasional fusion divergence by detecting it and resetting the fusion.
Max Braun [Thu, 18 Aug 2011 01:22:52 +0000 (18:22 -0700)]
Fix occasional fusion divergence by detecting it and resetting the fusion.

Change-Id: I51186e12fb9b2316e3671e3908174f4495df89a0

12 years agohave the sensorsevice test print the delay of the first received event
Mathias Agopian [Tue, 16 Aug 2011 00:10:23 +0000 (17:10 -0700)]
have the sensorsevice test print the delay of the first received event

Change-Id: I89d63122574c3f8790f00512c76d59b463acf18f

12 years agosilence sensorservice when it's dropping events
Mathias Agopian [Thu, 21 Jul 2011 01:51:15 +0000 (18:51 -0700)]
silence sensorservice when it's dropping events

Change-Id: Ib05862e545aa780821aa605e45ab189f530494b7

12 years agosensorservice: be more robust when there are no sensor h/w
Mathias Agopian [Thu, 14 Jul 2011 23:39:46 +0000 (16:39 -0700)]
sensorservice: be more robust when there are no sensor h/w

Bug: 5030108
Change-Id: I45b85b3c492b9268cb0ae44d2e5fc8c708b6e66e

12 years agoRemove the simulator target from all makefiles. Bug: 5010576
Jeff Brown [Tue, 12 Jul 2011 05:12:16 +0000 (22:12 -0700)]
Remove the simulator target from all makefiles. Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8

12 years agoPermissionCache caches permission checks
Mathias Agopian [Mon, 27 Jun 2011 23:05:52 +0000 (16:05 -0700)]
PermissionCache caches permission checks

This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.

CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.

Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e

12 years agocleanup Kalman filter parameters, add/fix comments/units
Mathias Agopian [Mon, 13 Jun 2011 23:00:49 +0000 (16:00 -0700)]
cleanup Kalman filter parameters, add/fix comments/units

Change-Id: Iedcae7164af8f7ea0e048ea7c72d0f35d16d739f

12 years agoimprove orientation sensor with gyro data
Mathias Agopian [Thu, 9 Jun 2011 03:06:50 +0000 (20:06 -0700)]
improve orientation sensor with gyro data

when we do our own sensor fusion, we also export an
improved orientation sensor and hide the HAL sensor.
The fused orientation sensor is much more precise, fast
and smooth.

Change-Id: I0ea843b47ad9d12f6b22cce51f8629852d423126

12 years agouse quaternions instead of MRPs
Mathias Agopian [Sat, 28 May 2011 01:18:13 +0000 (18:18 -0700)]
use quaternions instead of MRPs

also use correct time propagation equation
disable the fused sensors when gyro is not present since
they were unusable in practice.

Change-Id: Iad797425784e67dc6c5690e97c71c583418cc5b5

12 years ago9-axis sensor fusion with Kalman filter
Mathias Agopian [Wed, 18 May 2011 05:54:42 +0000 (22:54 -0700)]
9-axis sensor fusion with Kalman filter

Add support for 9-axis gravity and linear-acceleration sensors
virtual orientation sensor using 9-axis fusion

Change-Id: I6717539373fce781c10e97b6fa59f68a831a592f

12 years agoFix a few issues with sensors reference-counting
Mathias Agopian [Fri, 27 May 2011 23:23:58 +0000 (16:23 -0700)]
Fix a few issues with sensors reference-counting

12 years agoFix a crasher in SensorService
Mathias Agopian [Thu, 19 May 2011 23:21:32 +0000 (16:21 -0700)]
Fix a crasher in SensorService

SensorService main thread wasn't java-enabled. however, in
some situations we end-up calling into the BatteryService from
that thread which causes a crash.

Change-Id: Iffba90e4c4b743dba84d62f1342001a9db31916d

12 years agoframeworks/base: remove LOCAL_PRELINK_MODULE
Iliyan Malchev [Mon, 14 Mar 2011 21:02:13 +0000 (14:02 -0700)]
frameworks/base: remove LOCAL_PRELINK_MODULE

Change-Id: I54dd62ebef47e7690afa5a858f3cad941b135481
Signed-off-by: Iliyan Malchev <malchev@google.com>
12 years agofix [4025681] continuous sensors should not try to send an event as soon as they...
Mathias Agopian [Thu, 10 Mar 2011 23:23:28 +0000 (15:23 -0800)]
fix [4025681] continuous sensors should not try to send an event as soon as they're activated

Make sure to send an event down only for sensors that report a value only on data
change. Other sensors, will naturally send an event when the next event is available.

Bug: 4025681
Change-Id: I6d444deda388b6bc9a33e3371e09d390f1566ec5

12 years agofix [3421350] Killing a game that uses the accelerometer renders the device unable...
Mathias Agopian [Thu, 3 Feb 2011 22:52:47 +0000 (14:52 -0800)]
fix [3421350] Killing a game that uses the accelerometer renders the device unable to sleep

when an app dies, make sure to disable all sensors that process
is connected to, regardless of wether this was the LAST connection
to this sensor.

Change-Id: I9c72b1792eee03815304674d5c2f25b5270e4748

12 years agofix [3369027] Sensor.TYPE_ROTATION_VECTOR is unstable and returns NaNs when running...
Mathias Agopian [Wed, 19 Jan 2011 22:26:25 +0000 (14:26 -0800)]
fix [3369027] Sensor.TYPE_ROTATION_VECTOR is unstable and returns NaNs when running slowly

The cut-off frequency of the lowpass filter was too high
for the sampling rate used by DELAY_NORMAL.

Now we use the same filters used for the gravity vector
(cascaded biquad at 1.5 Hz)

Change-Id: I319dc4f449a3abd553d61b196a9ddcf7782f912d

12 years agofix [3237242] sensormanager sensor active count gets out of sync
Mathias Agopian [Tue, 30 Nov 2010 01:26:51 +0000 (17:26 -0800)]
fix [3237242] sensormanager sensor active count gets out of sync

whether a physical sensor needed to be active or not was managed by
a simpe reference counter; unfortunatelly nothing prevented it to
get out of sync if a sensor was disabled more than once.

sensorservice already maintainted a list of all the "clients"
connected to a physical sensor; we now use that list to determine if
a sensor should be enabled. This can never be "out-of-sync" since
this is the only data structure linking a sensor to a user of that
sensor.

also removed the isEnabled() method, which was never used and
implemented wrongly (since it didn't take into account that a sensor
could be disabled for a client but not of another).

Change-Id: I789affb877728ca957e99f7ba749def37c4db1c7

12 years agoUses 4-th order low-pass for extracting gravity.
Mathias Agopian [Fri, 12 Nov 2010 01:58:51 +0000 (17:58 -0800)]
Uses 4-th order low-pass for extracting gravity.

Most accelerometers have 8-bits accuracy so we beed to
reject 48dB in thestop-band, which requires a 4-th order
filter at the cut-off frequency we're using.

Change-Id: Ic00421d38d751641f86b1f3ad7663e6b44a91198

12 years agoallow rotation-vector to have 4 components
Mathias Agopian [Mon, 22 Nov 2010 23:48:10 +0000 (15:48 -0800)]
allow rotation-vector to have 4 components

- upadte documentation for rotation vector
- update method dealing with rotation vector to deal with 4 components
- virtual rotation-vector sensor reports all four components
- improve SensorManager documentation layout

Whent he 4-th component of the rotation-vector is present, we can save
a square-root when computing the quaternion or rotation matrix from it.

Change-Id: Ia84d278dd5f0909fab1c5ba050f8df2679e2c7c8

12 years agodon't attempt to normalize the rotation vector
Mathias Agopian [Mon, 22 Nov 2010 09:04:09 +0000 (01:04 -0800)]
don't attempt to normalize the rotation vector

indeed, by construction of the rotation matrix, it is
guaranteed to have a length of 1.

moreover, the normalization code was missing a square-root,
fortunatelly, since the length is 1, this didn't cause any
damage (since sqrt(1) = 1).

Change-Id: I9facd668caaf5bb3bfccb139ab872f2bb2066365

12 years agoAdd support for virtual sensors.
Mathias Agopian [Fri, 12 Nov 2010 01:58:51 +0000 (17:58 -0800)]
Add support for virtual sensors.

Rework sensorservice to allow "virtual sensors", that is
sensors that report a synthetized value based on real sensors.

the main change to sensorservice is around managing which real
sensor need to be activated and which rate to use.

The logic for all this has been moved into SensorDevice, which
essentially wraps the sensor HAL but adds two features to it:
- it keeps track of which sensors need to be activated
- it keeps track of what rate needs to be used

For this purpose an "identity" is associated with each real sensor
activation, so we can track them.

On start-up we check for gravity, linear-acceleration and
rotation-vector sensors, if they're not present in the HAL, we
synthetize them in sensor-service.

Change-Id: I841db2c1b37ef127ed571efa21732ecc5adf1800

12 years agoFix a race condition in sensormanager
Mathias Agopian [Mon, 15 Nov 2010 04:55:25 +0000 (20:55 -0800)]
Fix a race condition in sensormanager

the per-connection state assumed the main sensorservice
lock was held during access. This is however not true while
pre-processing the events just before sending them to clients.
Therefore, there was a small window during which this state
could be modified while being used.

we now have an internal lock that protects this state.

Change-Id: I594680f20f09d6a4f1f38f093a1d3f650dcef1be

12 years agorecord the last event received regardless of having clients or not
Mathias Agopian [Thu, 11 Nov 2010 01:50:28 +0000 (17:50 -0800)]
record the last event received regardless of having clients or not

We only recorded the last received event (which is needed when a sensor
is activated on a connection) when there was some connection active.
This should fix an issue where sometimes the light sensor doesn't
return an event whent activated.

we also didn't need to hold the main lock while dispatching events
to clients.

Change-Id: I6c6386c040051ce205e3c0516c678e0603fa45e1

12 years agoimprove sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)
Mathias Agopian [Sat, 6 Nov 2010 02:12:58 +0000 (19:12 -0700)]
improve sensorservice dumpsys and increase the max sensor rate to 1 ms (1000Hz)

the increased maximum rate is needed for proper gyro integration, current gyro
parts can sample at up to 800Hz

Change-Id: Ide75f6d5bc7a0fdafeb2dafd72db39e7afb9e794

12 years agoReplace epoll() with poll() and rename PollLoop to Looper.
Jeff Brown [Tue, 14 Sep 2010 06:17:30 +0000 (23:17 -0700)]
Replace epoll() with poll() and rename PollLoop to Looper.

As part of this change, consolidated and cleaned up the Looper API so
that there are fewer distinctions between the NDK and non-NDK declarations
(no need for two callback types, etc.).

Removed the dependence on specific constants from sys/poll.h such as
POLLIN.  Instead looper.h defines events like LOOPER_EVENT_INPUT for
the events that it supports.  That should help make any future
under-the-hood implementation changes easier.

Fixed a couple of compiler warnings along the way.

Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae

12 years agoReport sensor events to BatteryStats service
Mathias Agopian [Fri, 23 Jul 2010 05:19:43 +0000 (22:19 -0700)]
Report sensor events to BatteryStats service

Change-Id: I9b83aa709887aa658bc474391573f2d45b6c4eb2

12 years agoSensorService handles last known state properly
Mathias Agopian [Fri, 23 Jul 2010 04:24:39 +0000 (21:24 -0700)]
SensorService handles last known state properly

SensorService now correctly sends the last known
state of a sensor as soon as a new connection is made.
This fixes the issue where, for instance, an application
could wait a long time before getting the light or proximity
sensor initial state.

Change-Id: Ic41392f3626e26c4f15746c7e17c7ecd44bbb10b

12 years agofilter sensor event by connection
Mathias Agopian [Thu, 22 Jul 2010 23:18:10 +0000 (16:18 -0700)]
filter sensor event by connection

we now don't send events down to a connection that has not
registered for this event.

Change-Id: I3fe507974d3e99293749bfec2ef871e8a0ee9600

12 years agopropagate sensor event rate properly to the sensor HAL
Mathias Agopian [Wed, 21 Jul 2010 22:59:50 +0000 (15:59 -0700)]
propagate sensor event rate properly to the sensor HAL

Change-Id: I1abe4c0fcce423caab79208353fded4d57398227

12 years agopropagate sensor event rate properly
Mathias Agopian [Wed, 21 Jul 2010 22:59:50 +0000 (15:59 -0700)]
propagate sensor event rate properly

Change-Id: I32e67d30e4295285a6827956cc8161b2025d70bc

12 years agoSensorService doesn't crash if correct HAL is not present
Mathias Agopian [Tue, 20 Jul 2010 02:09:10 +0000 (19:09 -0700)]
SensorService doesn't crash if correct HAL is not present

Change-Id: I83700b1a1b43390f5830e1056572bfb16e58e8e4

12 years agoBetter dumpsys logs
Mathias Agopian [Mon, 19 Jul 2010 22:20:39 +0000 (15:20 -0700)]
Better dumpsys logs

Change-Id: Iae65a8547ee5815cc4c3b74d2c9ef17bed7f565d

12 years agoAdded partial support for repporting sensor activity to IBatteryStats
Mathias Agopian [Mon, 19 Jul 2010 22:03:55 +0000 (15:03 -0700)]
Added partial support for repporting sensor activity to IBatteryStats

Change-Id: I2af319d89e49b0f2349ec9d8b0fccac80e9bc047

12 years agonew SensorService
Mathias Agopian [Thu, 15 Jul 2010 06:41:37 +0000 (23:41 -0700)]
new SensorService

remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.

Change-Id: Iddb77d498755da3e11646473a44d651f12f40281

12 years agoUtils: Fix a bug in the linear transformation code.
John Grossman [Wed, 27 Jun 2012 22:34:43 +0000 (15:34 -0700)]
Utils: Fix a bug in the linear transformation code.

Hand merge from ics-aah

> Utils: Fix a bug in the linear transformation code.
>
> Fix a bug where an incorrect result would be computed if you used the
> linear transformation code to do a reverse transformation (from B's
> domain into A's domain) when the scaler fraction was negative.
>
> Change-Id: I8e5f109314d235a177ab41f65d3c4cd08cff78be
> Signed-off-by: John Grossman <johngro@google.com>

Change-Id: Id90e18f685c61c1a89fd91c32adcf01363b3e8f3
Signed-off-by: John Grossman <johngro@google.com>
12 years agoam db1597a9: Fix shutdown sequence to avoid SIGSEGV when running am command
Johannes Carlsson [Mon, 25 Jun 2012 21:06:56 +0000 (14:06 -0700)]
am db1597a9: Fix shutdown sequence to avoid SIGSEGV when running am command

* commit 'db1597a98958b78dc0d8eced19ae1406382b70d6':
  Fix shutdown sequence to avoid SIGSEGV when running am command

12 years agoFix shutdown sequence to avoid SIGSEGV when running am command
Johannes Carlsson [Thu, 17 Feb 2011 13:06:53 +0000 (14:06 +0100)]
Fix shutdown sequence to avoid SIGSEGV when running am command

When the app_process is shutting down the main thread will close the
binder fd while pool threads are executing an ioctl (in
IPCThreadState::stopProcess called by AppRuntime::onStarted in
app_main.c).

The binder driver will then return all pending calls in ioctl
without any error and with a command. One of the threads gets a
BR_SPAWN_LOOPER which will create a new thread (the other thread
gets a BR_NOOP). This new thread then calls
vm->AttachCurrentThread. Usually this results in a log entry with
"AndroidRuntime: NOTE: attach of thread 'Binder Thread #3' failed",
but sometimes it also causes a SIGSEGV. This depends on the timing
between the new thread an the main thread that calls DestroyJavaVM
(in AndroidRuntime::start).

If IPCThreadState.cpp is compiled with "#define LOG_NDEBUG 0" the
pool thread will loop and hit the
ALOG_ASSERT(mProcess->mDriverFD >= 0) in
IPCThreadState::talkWithDriver.

Crashes like this has been seen when running the am command and
other commands that use the app_process.

This fix makes sure that any command that is received when the driver
fd is closed are ignored and IPCThreadState::talkWithDriver instead
returns an error which will cause the pool thread to exit and detach
itself from the vm. A check to avoid calling ioctl to a fd with -1
was also added in IPCThreadState::threadDestructor.

Another solution might be to change the binder driver so that it
returns an error when the fd is closed (or atleast not a
BR_SPAWN_LOOPER command). It might also be possible to call exit(0)
which is done when System.exit(0) is called from java.

Change-Id: I3d1f0ff64896c44be2a5994b3a90f7a06d27f429

12 years agoMerge "Pass fences from BufferQueue to SurfaceTextureClient"
Jesse Hall [Sat, 23 Jun 2012 02:58:47 +0000 (19:58 -0700)]
Merge "Pass fences from BufferQueue to SurfaceTextureClient"

12 years agoMerge "Transfer HWC release fences to BufferQueue"
Jesse Hall [Sat, 23 Jun 2012 02:45:10 +0000 (19:45 -0700)]
Merge "Transfer HWC release fences to BufferQueue"

12 years agoMerge "Move remaining bits of lockBuffer to dequeueBuffer"
Jesse Hall [Fri, 22 Jun 2012 17:15:00 +0000 (10:15 -0700)]
Merge "Move remaining bits of lockBuffer to dequeueBuffer"

12 years agoam 589cdbed: Reconcile with jb-release
The Android Open Source Project [Fri, 22 Jun 2012 15:20:21 +0000 (08:20 -0700)]
am 589cdbed: Reconcile with jb-release

* commit '589cdbed556fd38a95895ab684dbcded7f4851e9':

12 years agoReconcile with jb-release
The Android Open Source Project [Fri, 22 Jun 2012 15:17:16 +0000 (08:17 -0700)]
Reconcile with jb-release

Change-Id: Ic18750e72ccec1b5aad558da8959c9c4031b27f8

12 years agoPass fences from BufferQueue to SurfaceTextureClient
Jesse Hall [Thu, 14 Jun 2012 22:26:33 +0000 (15:26 -0700)]
Pass fences from BufferQueue to SurfaceTextureClient

ISurfaceTexture::dequeueBuffer now returns the buffer's fence for the
client to wait on. For BufferQueue, this means passing it through
Binder so it can be returned to the SurfaceTextureClient. Now
SurfaceTextureClient is responsible for waiting on the fence in
dequeueBuffer instead of BufferQueue: one step closer to the goal.

Change-Id: I677ae758bcd23acee2d784b8cec11b32cccc196d

12 years agoTransfer HWC release fences to BufferQueue
Jesse Hall [Thu, 14 Jun 2012 21:45:17 +0000 (14:45 -0700)]
Transfer HWC release fences to BufferQueue

After a HWC set, each SurfaceFlinger Layer retrieves the release fence
HWC returned and gives it to the layer's SurfaceTexture. The
SurfaceTexture accumulates the fences into a merged fence until the
next updateTexImage, then passes the merged fence to the BufferQueue
in releaseBuffer.

In a follow-on change, BufferQueue will return the fence along with
the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the
fence to signal before returning.

The releaseFence default value for BufferQueue::releaseBuffer() is
temporary to avoid transient build breaks with a multi-project
checkin. It'll disappear in the next change.

Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9

12 years agoMove remaining bits of lockBuffer to dequeueBuffer
Jesse Hall [Thu, 21 Jun 2012 18:35:23 +0000 (11:35 -0700)]
Move remaining bits of lockBuffer to dequeueBuffer

FramebufferNativeWindow::dequeueBuffer now waits for the next buffer
to be non-front in addition to being free.

Change-Id: I991f154958cc6b488b1241aba83d1f95a0513b3c

12 years agomerge in jb-release history after reset to jb-dev
The Android Automerger [Thu, 21 Jun 2012 14:02:53 +0000 (07:02 -0700)]
merge in jb-release history after reset to jb-dev

12 years agoUpdate ANativeWindow clients for sync
Jamie Gennis [Wed, 13 Jun 2012 23:32:25 +0000 (16:32 -0700)]
Update ANativeWindow clients for sync

This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.

Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6

12 years agolibui: add the Fence class
Jamie Gennis [Wed, 13 Jun 2012 23:31:43 +0000 (16:31 -0700)]
libui: add the Fence class

This change adds the Fence class to libui for to wrap the libsync
functionality.

Change-Id: I93a31baeee608b93c14da807a32013dabf783f84

12 years agoam 8aaf3e47: am a67e418e: Exit boot animation cleanly.
Mathias Agopian [Wed, 20 Jun 2012 20:39:58 +0000 (13:39 -0700)]
am 8aaf3e47: am a67e418e: Exit boot animation cleanly.

* commit '8aaf3e47a51aa0beebecc8c536504d310d07cda9':
  Exit boot animation cleanly.

12 years agoam a67e418e: Exit boot animation cleanly.
Mathias Agopian [Wed, 20 Jun 2012 20:37:09 +0000 (13:37 -0700)]
am a67e418e: Exit boot animation cleanly.

* commit 'a67e418e1fda219f6cc0a7e420bcf5cc4f9fe710':
  Exit boot animation cleanly.

12 years agoExit boot animation cleanly.
Mathias Agopian [Wed, 20 Jun 2012 00:26:12 +0000 (17:26 -0700)]
Exit boot animation cleanly.

The desc.txt file can now mark parts as 'must finish cleanly' by using
'c' as the part line prefix rather than 'p'.  If so indicated, if the
bootanimation is asked to quit it will do so only after waiting to
finish that part.

I considered either making init.c service killing smarter or promoting
bootanim to be a bindable service with a requestExit method.  However,
these changes are probably too big/risky given our ship date.  So
I used a property as a mailbox between SurfaceFlinger and bootanim.

Bug: 6679877
Change-Id: Id7dca22caa50b450fff25ca94f7242d971034f41

12 years agoMerge "Add support for HWC_DEVICE_API_VERSION_1_0"
Jesse Hall [Tue, 19 Jun 2012 15:55:12 +0000 (08:55 -0700)]
Merge "Add support for HWC_DEVICE_API_VERSION_1_0"

12 years agoam fb05c7c3: Reconcile with jb-release
The Android Open Source Project [Tue, 19 Jun 2012 13:16:15 +0000 (06:16 -0700)]
am fb05c7c3: Reconcile with jb-release

* commit 'fb05c7c34b45e468103b399ef60763e235dd6e06':
  SF could get stuck waiting for vsync when turning the screen off

12 years agoReconcile with jb-release
The Android Open Source Project [Tue, 19 Jun 2012 13:13:43 +0000 (06:13 -0700)]
Reconcile with jb-release

Change-Id: I6a74f5247794a5dddd6fbb75b2edbaba06674ab7

12 years agofix typo in makefile LOCAL_CFLAGS was spelled LOCAL_CLFAGS
Mathias Agopian [Tue, 19 Jun 2012 00:27:56 +0000 (17:27 -0700)]
fix typo in makefile LOCAL_CFLAGS was spelled LOCAL_CLFAGS

Change-Id: I58b96d28f608ce16fcad5ed0efb887e582779e03

12 years agosplit-up Client.h out of SurfaceFlinger.h
Mathias Agopian [Mon, 18 Jun 2012 23:47:56 +0000 (16:47 -0700)]
split-up Client.h out of SurfaceFlinger.h

Change-Id: I1993bf23e417163749d886283563a93d50b361b4

12 years agoam bbdad819: am 7c24b1d4: Merge "SF could get stuck waiting for vsync when turning...
Jeff Brown [Mon, 18 Jun 2012 17:52:34 +0000 (10:52 -0700)]
am bbdad819: am 7c24b1d4: Merge "SF could get stuck waiting for vsync when turning the screen off" into jb-dev

* commit 'bbdad8193ea3a16e9f65f32f4469959577b400e9':
  SF could get stuck waiting for vsync when turning the screen off

12 years agoam 7c24b1d4: Merge "SF could get stuck waiting for vsync when turning the screen...
Jeff Brown [Mon, 18 Jun 2012 17:32:32 +0000 (10:32 -0700)]
am 7c24b1d4: Merge "SF could get stuck waiting for vsync when turning the screen off" into jb-dev

* commit '7c24b1d4da5e13329d2105cb2f8285715d920787':
  SF could get stuck waiting for vsync when turning the screen off

12 years agomerge in jb-release history after reset to jb-dev
The Android Automerger [Sat, 16 Jun 2012 14:03:06 +0000 (07:03 -0700)]
merge in jb-release history after reset to jb-dev

12 years agoSF could get stuck waiting for vsync when turning the screen off
Mathias Agopian [Fri, 15 Jun 2012 06:39:35 +0000 (23:39 -0700)]
SF could get stuck waiting for vsync when turning the screen off

When turning the screen off we could have 2 waiters on the
vsync condition: The main vsync waiter as well as one in
onScreenReleased(). We were only signaling the condition though,
so it it would be possible to wake onScreenReleased() without waking
the main vsync thread which would then be stuck in .wait().

We fix this by just using broadcast() when receiving a vsync event.

We also add a broadcast() to signal when the state of
mUseSoftwareVSync changes.  This is important particularly for
the transition from hardware to software vsync because the main
vsync waiter might have observed mUseSoftwareVSync == false
and decided to block indefinitely pending a hardware vsync
signal that will never arrive.

Removed a potentially deadlocking wait for a signal in
onScreenReleased().  The function was trying to wait for the last
vsync event from the hardware to be delivered to clients but there
was no guarantee that another thread would signal it to wake up
again afterwards.  (As far as I can tell, the only other other
thread that might wake it up at this point would be a client
application issuing a vsync request.)  We don't really need to wait
here anyhow.  It's enough to set the mUseSoftwareVSync flag,
wake up the thread loop and go.  If there was a pending vsync
timestamp from the hardware, then the thread loop will grab
it and use it then start software vsync on the next iteration.

Bug: 6672102
Change-Id: I7c6abc23bb021d1dfc94f101bd3ce18e3a81a73e

12 years agoMerge "Implement SurfaceFlinger's ANW on top of BufferQueue"
Mathias Agopian [Fri, 15 Jun 2012 22:34:55 +0000 (15:34 -0700)]
Merge "Implement SurfaceFlinger's ANW on top of BufferQueue"

12 years agoMerge "SF could get stuck waiting for vsync when turning the screen off" into jb-dev
Jeff Brown [Fri, 15 Jun 2012 22:30:35 +0000 (15:30 -0700)]
Merge "SF could get stuck waiting for vsync when turning the screen off" into jb-dev

12 years agoSF could get stuck waiting for vsync when turning the screen off
Mathias Agopian [Fri, 15 Jun 2012 06:39:35 +0000 (23:39 -0700)]
SF could get stuck waiting for vsync when turning the screen off

When turning the screen off we could have 2 waiters on the
vsync condition: The main vsync waiter as well as one in
onScreenReleased(). We were only signaling the condition though,
so it it would be possible to wake onScreenReleased() without waking
the main vsync thread which would then be stuck in .wait().

We fix this by just using broadcast() when receiving a vsync event.

We also add a broadcast() to signal when the state of
mUseSoftwareVSync changes.  This is important particularly for
the transition from hardware to software vsync because the main
vsync waiter might have observed mUseSoftwareVSync == false
and decided to block indefinitely pending a hardware vsync
signal that will never arrive.

Removed a potentially deadlocking wait for a signal in
onScreenReleased().  The function was trying to wait for the last
vsync event from the hardware to be delivered to clients but there
was no guarantee that another thread would signal it to wake up
again afterwards.  (As far as I can tell, the only other other
thread that might wake it up at this point would be a client
application issuing a vsync request.)  We don't really need to wait
here anyhow.  It's enough to set the mUseSoftwareVSync flag,
wake up the thread loop and go.  If there was a pending vsync
timestamp from the hardware, then the thread loop will grab
it and use it then start software vsync on the next iteration.

Bug: 6672102
Change-Id: I7c6abc23bb021d1dfc94f101bd3ce18e3a81a73e

12 years agoam 0512af11: am 16272efb: Add ASSIST keycode.
Jeff Brown [Fri, 15 Jun 2012 19:00:28 +0000 (12:00 -0700)]
am 0512af11: am 16272efb: Add ASSIST keycode.

* commit '0512af11f4b790fb032dc7c344dcdac527faf8ad':
  Add ASSIST keycode.

12 years agoam 16272efb: Add ASSIST keycode.
Jeff Brown [Fri, 15 Jun 2012 18:57:37 +0000 (11:57 -0700)]
am 16272efb: Add ASSIST keycode.

* commit '16272efb7af0692266fecdc53b2c6d995bf397b7':
  Add ASSIST keycode.

12 years agoAdd ASSIST keycode.
Jeff Brown [Fri, 15 Jun 2012 18:46:11 +0000 (11:46 -0700)]
Add ASSIST keycode.

Bug: 6594275
Change-Id: I032b055207d16bfff93ee8a350c0dc52b9102926

12 years agoAdd support for HWC_DEVICE_API_VERSION_1_0
Jesse Hall [Wed, 6 Jun 2012 06:40:32 +0000 (23:40 -0700)]
Add support for HWC_DEVICE_API_VERSION_1_0

The acquire and release fences aren't yet used; this is just support
for the new version and temporary backwards compatibility for older
versions.

Change-Id: Ia5ccc05a97c86f649042b9a35e11042fa0187e84

12 years agorefactor HWComposer to break dependency with the HAL headers
Mathias Agopian [Mon, 14 May 2012 03:42:01 +0000 (20:42 -0700)]
refactor HWComposer to break dependency with the HAL headers

HWComposer must abstract the HWC HAL entirely, so that the
HAL can continue to evolve (and break binary compatibility)
without breaking SurfaceFlinger. The HWC data structure had
leaked outside of HWComposer, this is now fixed.

We now have an abstract interface that provide all the
needed functionality, HWCompose provides concrete
implementations of it based on the the HWC version.

Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb

12 years agoImplement SurfaceFlinger's ANW on top of BufferQueue
Mathias Agopian [Fri, 8 Jun 2012 00:52:54 +0000 (17:52 -0700)]
Implement SurfaceFlinger's ANW on top of BufferQueue

SF now has its own implementation of ANW for the
framebuffer and it uses BufferQueue. FramebufferNativeWindow
is now only used by stand-alone apps.

Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c

12 years agoMerge "don't error out when eglTerminate()ing an already terminated display"
Mathias Agopian [Wed, 13 Jun 2012 23:27:54 +0000 (16:27 -0700)]
Merge "don't error out when eglTerminate()ing an already terminated display"

12 years agodon't error out when eglTerminate()ing an already terminated display
Mathias Agopian [Wed, 13 Jun 2012 22:21:21 +0000 (15:21 -0700)]
don't error out when eglTerminate()ing an already terminated display

so says the EGL specification, section 3.2

Change-Id: Ice60530f8f6e47b4e14e06d2ab8eba799a7688a6

12 years agoam 1d2eb663: am 2d15fcab: Merge "reduce PB size from 2MB to 512KB" into jb-dev
Mathias Agopian [Tue, 12 Jun 2012 20:15:10 +0000 (13:15 -0700)]
am 1d2eb663: am 2d15fcab: Merge "reduce PB size from 2MB to 512KB" into jb-dev

* commit '1d2eb663ef5cf69aa852045c8a1c1807dfa7039e':
  reduce PB size from 2MB to 512KB

12 years agoam 2d15fcab: Merge "reduce PB size from 2MB to 512KB" into jb-dev
Mathias Agopian [Tue, 12 Jun 2012 19:42:38 +0000 (12:42 -0700)]
am 2d15fcab: Merge "reduce PB size from 2MB to 512KB" into jb-dev

* commit '2d15fcab3e3588cfddb6c7b180faecd3eccce2e5':
  reduce PB size from 2MB to 512KB

12 years agomerge in jb-release history after reset to jb-dev
The Android Automerger [Tue, 12 Jun 2012 18:23:05 +0000 (11:23 -0700)]
merge in jb-release history after reset to jb-dev

12 years agoMerge "reduce PB size from 2MB to 512KB" into jb-dev
Mathias Agopian [Mon, 11 Jun 2012 21:43:37 +0000 (14:43 -0700)]
Merge "reduce PB size from 2MB to 512KB" into jb-dev

12 years agoMerge "gltrace: Fixup vertex attrib pointers only for GLES2"
Siva Velusamy [Mon, 11 Jun 2012 19:26:03 +0000 (12:26 -0700)]
Merge "gltrace: Fixup vertex attrib pointers only for GLES2"

12 years agogltrace: Fixup vertex attrib pointers only for GLES2
Siva Velusamy [Mon, 11 Jun 2012 18:14:23 +0000 (11:14 -0700)]
gltrace: Fixup vertex attrib pointers only for GLES2

Change-Id: Ibf280c2a4372ce6e598e164eef0d72b7c0a6d1c2

12 years agoam 7c94f9d8: Reconcile with jb-release
The Android Open Source Project [Mon, 11 Jun 2012 16:25:48 +0000 (09:25 -0700)]
am 7c94f9d8: Reconcile with jb-release

* commit '7c94f9d8e07d17803c2b45ac6e115da3fe8827a4':

12 years agoReconcile with jb-release
The Android Open Source Project [Mon, 11 Jun 2012 16:22:35 +0000 (09:22 -0700)]
Reconcile with jb-release

Change-Id: Iac1c88f2833e67e52af2bc22a17fa93d30cb44cc