323 Commits

Author SHA1 Message Date
Mathias Agopian
7671c088cd am 77f17095: am 533a2803: Merge change I18ffb549 into eclair
Merge commit '77f17095ed17a6ccc7fc1f1b3ddb31c63bbf66a2' into eclair-mr2-plus-aosp

* commit '77f17095ed17a6ccc7fc1f1b3ddb31c63bbf66a2':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-12-01 18:41:42 -08:00
Mathias Agopian
77f17095ed am 533a2803: Merge change I18ffb549 into eclair
Merge commit '533a2803506cc4f196403fdfafd948bd4f8e60d9' into eclair-mr2

* commit '533a2803506cc4f196403fdfafd948bd4f8e60d9':
  fix [2069023] STOPSHIP: disable DEBUG_COPYBIT
2009-12-01 17:13:50 -08:00
Mathias Agopian
18ffb5493b fix [2069023] STOPSHIP: disable DEBUG_COPYBIT 2009-11-30 12:10:53 -08:00
Jack Palevich
85a9498a2f am 9c0b39c4: am ca00dee2: Merge change I5aa3adcf into eclair
Merge commit '9c0b39c47efade5ee2303a8f8ffbd9cf87c2c841' into eclair-mr2-plus-aosp

* commit '9c0b39c47efade5ee2303a8f8ffbd9cf87c2c841':
  Improve the exception message text by including eglGetError().
2009-11-25 14:04:14 -08:00
Jack Palevich
9c0b39c47e am ca00dee2: Merge change I5aa3adcf into eclair
Merge commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5' into eclair-mr2

* commit 'ca00dee21425882619aef4ecbe3e0d08de0544e5':
  Improve the exception message text by including eglGetError().
2009-11-25 13:48:54 -08:00
Jack Palevich
5aa3adcf30 Improve the exception message text by including eglGetError().
Should help us track down the cause of bug 2285187
2009-11-25 13:56:21 +08:00
Mathias Agopian
8e9af2bd1d am b439f561: am 13feccf5: Merge change I39f0003e into eclair
Merge commit 'b439f561a6aa3900f1850e71a4aa60618af13f90' into eclair-mr2-plus-aosp

* commit 'b439f561a6aa3900f1850e71a4aa60618af13f90':
  fix [2235414] libagl glDeleteBuffers() crashes
2009-11-19 19:12:01 -08:00
Mathias Agopian
b439f561a6 am 13feccf5: Merge change I39f0003e into eclair
Merge commit '13feccf592d6870b41b3b8a0a31d2abefad0d7ae' into eclair-mr2

* commit '13feccf592d6870b41b3b8a0a31d2abefad0d7ae':
  fix [2235414] libagl glDeleteBuffers() crashes
2009-11-19 19:07:36 -08:00
Mathias Agopian
39f0003e3a fix [2235414] libagl glDeleteBuffers() crashes
don't dereference null pointers, would happen if one of the array wasn't bound.
2009-11-19 17:32:05 -08:00
Jack Palevich
8d0e147233 am a822f02b: resolved conflicts for merge of dc49acb0 to eclair-mr2
Merge commit 'a822f02bb9c7f5bf2e3fa3cb63effc391be158c5' into eclair-mr2-plus-aosp

* commit 'a822f02bb9c7f5bf2e3fa3cb63effc391be158c5':
  More GLSurfaceView cleanup.
2009-11-16 19:52:12 -08:00
Jack Palevich
a822f02bb9 resolved conflicts for merge of dc49acb0 to eclair-mr2 2009-11-17 11:39:54 +08:00
Jack Palevich
a08d46d8aa More GLSurfaceView cleanup.
+ The mDone flag is now a pair of flags: mShouldExit and mExited. The
problem with mDone was that it meant "had been asked to exit", but was
being used by some observers as "had exited". Using two variables means
that observers can observe either "had been asked to exit" or "had exited",
as they prefer.

+ Simplyify where we check for mShouldExit. We now check for it at the
  top of our innermost guardedRun while loop.

+ requestExitAndWait now waits for mExited to be set to true to know
that a thread has exited, rather than using join(). This means we can use
wait() for the check, which releases the sGLThreadManager
monitor, avoiding a potential deadlock.

+ move the event queue into the sGLThreadManager monitor. This avoids
having to acquire two locks in order to enque/deque events, which also
avoids the potential for lock ordering deadlocks.

+ Simplify the event dequeueing code. We now deque one event each time
through the main GLSurfaceView loop. Events still have priority over
rendering, so there isn't any semantic change, it just cleans up the code.

+ Avoid trying to acquire an egl Surface if we're paused.

+ To simplify reasoning about the code, call sGLThreadManager.notifyAll()
in every case where we modify one of the variables that's protected by
the sGLThreadManager monitor. It would be slightly more efficient to only
notify when we change variables that could cause a thread to wait(), but
then we would have to redo our analysis every time we change any code.

+ Clean up the logic for creating the EGL surface and then calling the
renderer's onSurfaceCreated / onSurfaceChanged methods.

+ Implement work-around for bug 2263168	"Need to draw twice after
  screen rotation..."
2009-11-16 18:48:26 +08:00
Mathias Agopian
da5e90bee4 am 66b5d902: am 27407208: Merge change Icf335098 into eclair
Merge commit '66b5d902a29e08237f16be53a84f9c2472df8493' into eclair-mr2-plus-aosp

* commit '66b5d902a29e08237f16be53a84f9c2472df8493':
  fix [2236865] STOPSHIP: bump soft gl and egl minor version number
2009-11-13 09:26:24 -08:00
Mathias Agopian
66b5d902a2 am 27407208: Merge change Icf335098 into eclair
Merge commit '274072089ceff6eacb9ccfb59290a18f43739c87' into eclair-mr2

* commit '274072089ceff6eacb9ccfb59290a18f43739c87':
  fix [2236865] STOPSHIP: bump soft gl and egl minor version number
2009-11-12 23:06:15 -08:00
Mathias Agopian
cf3350982f fix [2236865] STOPSHIP: bump soft gl and egl minor version number 2009-11-12 15:19:42 -08:00
Jack Palevich
99cf71b085 am 83536cee: Merge change I1179efbb into eclair-mr2
Merge commit '83536cee2b2b5445c5ba0b22531c23890b82da41' into eclair-mr2-plus-aosp

* commit '83536cee2b2b5445c5ba0b22531c23890b82da41':
  Fix multi-lock ordering issues in GLSurfaceView
2009-11-10 18:06:05 -08:00
Jack Palevich
1179efbb3b resolved conflicts for merge of ba56915a to eclair-mr2 2009-11-11 10:01:46 +08:00
Android (Google) Code Review
ba56915a71 Merge change Ie806ae6f into eclair
* changes:
  Fix multi-lock ordering issues in GLSurfaceView
2009-11-10 15:21:28 -08:00
Jack Palevich
67dcd6c239 Fix multi-lock ordering issues in GLSurfaceView
There were potential deadlocks between the per-GLThread monitors and the
GLThreadManager monitor.

To avoid these deadlocks we now use a single monitor for
both the GLThreadManager state and the per-GLThread state.

Converted GLThreadManager's semaphore into the equivalent
synchronized-wait-notifyAll code. This enables us to wait for
either mDone, or user events, or the EGL surface with a single "wait()".

Simplified the logic used to acquire and release the EGL surface. The
EGL surface is now only requested while the surfaceFlinger surface
is acquired.

Removed the "egl surface stealing" policy we had recently inserted.
It's not needed now that we reliably quit when requested.

Pulled user event processing outside of the  GLThreadManager monitor
so that we don't call any potentially-long-running code while
inside the monitor.

This should help with bug 2228262.
2009-11-10 18:26:42 +08:00
Mathias Agopian
c6ed8100c2 am 0b9d3ba2: am c421fc2a: Merge change Id09376d1 into eclair
Merge commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13' into eclair-mr2-plus-aosp

* commit '0b9d3ba2feab494e7bbd180b51a4311864d08e13':
  fix [2071412] work around mdp 32-bits fade limitation
2009-11-09 19:38:43 -08:00
Mathias Agopian
0b9d3ba2fe am c421fc2a: Merge change Id09376d1 into eclair
Merge commit 'c421fc2ada7c1bff104733b840bd640151bebbbb' into eclair-mr2

* commit 'c421fc2ada7c1bff104733b840bd640151bebbbb':
  fix [2071412] work around mdp 32-bits fade limitation
2009-11-09 19:34:59 -08:00
Mathias Agopian
d09376d1e2 fix [2071412] work around mdp 32-bits fade limitation
make sure to always specify blits *inside* the source bitmap.
2009-11-09 17:55:59 -08:00
Jack Palevich
73ae27f0c5 am 8da3ac92: resolved conflicts for merge of 3f857b78 to eclair-mr2
Merge commit '8da3ac92a6a6247ef06de4d4b684f8635d8fc003' into eclair-mr2-plus-aosp

* commit '8da3ac92a6a6247ef06de4d4b684f8635d8fc003':
  Allow a GLThread to release and reacquire the EGL Surface as needed.
2009-11-09 16:11:11 -08:00
Jack Palevich
8da3ac92a6 resolved conflicts for merge of 3f857b78 to eclair-mr2 2009-11-10 08:04:53 +08:00
Jean-Baptiste Queru
ac94fbd081 merge from open-source master 2009-11-09 11:00:18 -08:00
Jack Palevich
32d4165184 Allow a GLThread to release and reacquire the EGL Surface as needed.
We currently only allow one GLThread to have an active EGL Surface at a
time.(This may be lifted in the future, when EGL and GL are reentrant.)

Prior to this change we would enforce this rule by having older GLThreads
quit when a new GLThread started. That had the drawback of leaving the
older GLSurfaceViews in a zombie state -- their GLThreads would be
gone.

We now enforce this rule by just releasing and reacquiring the EGL surface
context as needed.

Specific changes to the code:

created private helper methods - startEgl and stopEgl to help manage
starting and stopping EGL.

Move the calls to sGLThreadManager start and end from the outermost run
method into the startEgl / stopEgl methods.

Reworked the wait loop to handle starting and stopping EGL as needed.

needToWait() gets simpler -- just looks at current status.

sGLThreadManager.shouldQuit was replaced by shouldHaveEgl.


This is another step in fixing bug 2228262.
2009-11-08 10:55:56 +08:00
Jack Palevich
e54f267f06 am a3a351e5: resolved conflicts for merge of 4e3fadd0 to eclair-mr2
Merge commit 'a3a351e5d164d0c8b461ae7af86edc0227654a76' into eclair-mr2-plus-aosp

* commit 'a3a351e5d164d0c8b461ae7af86edc0227654a76':
  Fix stupid bug in GLThreadManager implementation.
2009-11-06 16:45:58 -08:00
Jack Palevich
a3a351e5d1 resolved conflicts for merge of 4e3fadd0 to eclair-mr2 2009-11-06 16:35:19 -08:00
Jack Palevich
a44249500f Fix stupid bug in GLThreadManager implementation.
The code intended to copy the old value of a field, before the
field was updated. However, what the code was actually doing was
copying the new value of the field, after the field was updated.

The fix was to move the copy to before the update.

This is work towards fixing bug 2228262
2009-11-07 07:49:15 +08:00
Jack Palevich
a9e47546a5 am 79447b20: resolved conflicts for merge of 84872738 to eclair-mr2
Merge commit '79447b2087c8c820d742185dda7305101f9656f0' into eclair-mr2-plus-aosp

* commit '79447b2087c8c820d742185dda7305101f9656f0':
  Improve GLSurfaceView to avoid deadlocks and race conditions.
2009-11-06 00:25:44 -08:00
Jack Palevich
79447b2087 resolved conflicts for merge of 84872738 to eclair-mr2 2009-11-06 00:13:38 -08:00
Jack Palevich
8b2c9c9ecb Improve GLSurfaceView to avoid deadlocks and race conditions.
This is work towards fixing bug 2228262

Specific issues fixed by this change:

+ GLThread names now include the thread id, making it easier to tell one
GLThread from another.

+ A private final static boolean LOG_THREADS can be set to true at compile
time to print out thread-related trace information, helpful for debugging
GLSurfaceView behavior. This static defaults to "false".

+ Changed calls to "notify" to "notifyAll" to make the code more
robust in case more than two threads are blocked on the same monitor.

+ Add a GLThreadManager to help manage the transition to
a new GLThread. Currently only one GLThread can be active in an address
space. When the second thread starts up, the GLThreadManager helps the old
GLThread to shut down,

+ Make sure we stop waiting for dead GLThreads. This is done by adding
checks for a variable mDone being true to our monitor wait loops. And
we use a "finally" clause at the end of GLThread.run() method to set mDone
and notifyAll any wait loops.
2009-11-06 10:21:46 +08:00
Mathias Agopian
ba37ea550d am 6d9e0c7a: am 36fe3eea: part of fix [2186418] switch passion to 24-bits framebuffer
Merge commit '6d9e0c7aa797f4dae5f529560e9e7c31336624e3' into eclair-mr2-plus-aosp

* commit '6d9e0c7aa797f4dae5f529560e9e7c31336624e3':
  part of fix [2186418] switch passion to 24-bits framebuffer
2009-11-04 15:10:13 -08:00
Mathias Agopian
6d9e0c7aa7 am 36fe3eea: part of fix [2186418] switch passion to 24-bits framebuffer
Merge commit '36fe3eeaa056ff13455c0df73b495b2bae8c1469' into eclair-mr2

* commit '36fe3eeaa056ff13455c0df73b495b2bae8c1469':
  part of fix [2186418] switch passion to 24-bits framebuffer
2009-11-04 14:59:44 -08:00
Mathias Agopian
36fe3eeaa0 part of fix [2186418] switch passion to 24-bits framebuffer
add support for RGBX_8888 EGLConfigs in the software renderer
(since that's what we're using in the MDP case)
2009-11-04 14:51:18 -08:00
Mathias Agopian
4360624241 am 8e5e44e9: am 9a54d7dd: Merge change Ibbf945f3 into eclair
Merge commit '8e5e44e9538fc327800414926651d46967ccc725' into eclair-mr2-plus-aosp

* commit '8e5e44e9538fc327800414926651d46967ccc725':
  fix [2236832] software OpenGL ES driver doesn't work on sholes
2009-11-04 13:23:36 -08:00
Mathias Agopian
8e5e44e953 am 9a54d7dd: Merge change Ibbf945f3 into eclair
Merge commit '9a54d7dddcbc982d644c627693dc39fb2cb5c0fb' into eclair-mr2

* commit '9a54d7dddcbc982d644c627693dc39fb2cb5c0fb':
  fix [2236832] software OpenGL ES driver doesn't work on sholes
2009-11-04 13:14:59 -08:00
Mathias Agopian
bbf945f3c0 fix [2236832] software OpenGL ES driver doesn't work on sholes
make sure to not pass our fake handles to the real gralloc
2009-11-03 21:08:06 -08:00
Mathias Agopian
4e90c907f4 am 65ab88c7: am 21977eb0: Merge change I56981989 into eclair
Merge commit '65ab88c78916d7e3a182125878b17c8f40d7cac5' into eclair-mr2-plus-aosp

* commit '65ab88c78916d7e3a182125878b17c8f40d7cac5':
  fix [2231527] Compatibility with SpaceJunk game (OpenGL)
2009-11-03 15:21:00 -08:00
Mathias Agopian
65ab88c789 am 21977eb0: Merge change I56981989 into eclair
Merge commit '21977eb0f1d22497d0beed0492e579f953a56552' into eclair-mr2

* commit '21977eb0f1d22497d0beed0492e579f953a56552':
  fix [2231527] Compatibility with SpaceJunk game (OpenGL)
2009-11-03 15:11:11 -08:00
Android (Google) Code Review
21977eb0f1 Merge change I56981989 into eclair
* changes:
  fix [2231527] Compatibility with SpaceJunk game (OpenGL)
2009-11-03 18:04:49 -05:00
Mathias Agopian
d1d744cdf4 am 07d38c66: am 8637759a: Merge change I36d0184e into eclair
Merge commit '07d38c66692b7d87415667010c0658202b5a7f39' into eclair-mr2-plus-aosp

* commit '07d38c66692b7d87415667010c0658202b5a7f39':
  fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
2009-11-03 09:47:31 -08:00
Mathias Agopian
07d38c6669 am 8637759a: Merge change I36d0184e into eclair
Merge commit '8637759a1d34a4adda292579d5f8790587659235' into eclair-mr2

* commit '8637759a1d34a4adda292579d5f8790587659235':
  fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
2009-11-03 09:34:40 -08:00
Mathias Agopian
5698198967 fix [2231527] Compatibility with SpaceJunk game (OpenGL)
we treated all lights as local lights when transforming their
position back to object space.
2009-11-02 18:33:08 -08:00
Mathias Agopian
36d0184e08 fix[2228133] pixelflinger ignores the "vertical stride" leading to artifacts when playing back video
we lost the concept of vertical stride when moving video playback to EGLImage.
Here we bring it back in a somewhat hacky-way that will work only for the
softgl/mdp backend.
2009-11-02 17:48:33 -08:00
Iliyan Malchev
cb80b4f18e am 8385baea: am 05cb5610: Merge change I8c0eb9a6 into eclair
Merge commit '8385baea4742734dd23843b6dcf89fd2e0490dd6' into eclair-mr2-plus-aosp

* commit '8385baea4742734dd23843b6dcf89fd2e0490dd6':
  libagl: silence a LOGD
2009-10-30 18:41:22 -07:00
Mathias Agopian
78383abf76 am cbf583d7: am 77bd91f8: Merge change Ie3e80456 into eclair
Merge commit 'cbf583d7229aaff65734b4234e81db8ead864761' into eclair-mr2-plus-aosp

* commit 'cbf583d7229aaff65734b4234e81db8ead864761':
  Turns out the SGX driver is correct and the bug was in this test.
2009-10-30 18:41:00 -07:00
Iliyan Malchev
8385baea47 am 05cb5610: Merge change I8c0eb9a6 into eclair
Merge commit '05cb5610fdfb7b69cf90a9230853e59b4ae5e219' into eclair-mr2

* commit '05cb5610fdfb7b69cf90a9230853e59b4ae5e219':
  libagl: silence a LOGD
2009-10-30 18:35:51 -07:00
Iliyan Malchev
8c0eb9a6eb libagl: silence a LOGD
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-10-30 18:29:08 -07:00
Mathias Agopian
cbf583d722 am 77bd91f8: Merge change Ie3e80456 into eclair
Merge commit '77bd91f8af44867935ea2df22f69fb244b009b94' into eclair-mr2

* commit '77bd91f8af44867935ea2df22f69fb244b009b94':
  Turns out the SGX driver is correct and the bug was in this test.
2009-10-30 17:07:49 -07:00