Commit Graph

718 Commits

Author SHA1 Message Date
Mathias Agopian
d75f84d641 reduce PB size from 2MB to 512KB
this allows us to enable h/w acceleration on low-end
devices while keeping memory usage down.

Bug: 6557760
Change-Id: I8af2de3038dc2579360b8b73aa452cb7a0e506a9
2012-06-05 21:44:43 -07:00
Jamie Gennis
1401ad526c Add the EGL_ANDROID_fence_sync spec.
Change-Id: I8c26e5caaf8d89a60a09a5308d55e336537b916e
2012-05-30 16:34:32 -07:00
Jesse Hall
83e7c8c431 Implement the EGL_KHR_fence_sync in libagl
Implementing this in libagl allows us to start using it for
SurfaceTexture in emulator builds, which is necessary to avoid
corruption in the Browser when using the host-accelerated GL path.

Bug: 6515813
Change-Id: Icafba8687cb5d010d8d42b3866b298d2be984fc9
2012-05-22 12:11:41 -07:00
Mathias Agopian
cc2b1560e8 fix EGL_CLIENT_STRING
it should read OpenGL_ES (with an underscore)

Bug: 6529643

Change-Id: I7caf07793bffe5a8dcceaff496a222077486fc87
2012-05-21 14:02:53 -07:00
Siva Velusamy
2fdcc81ddf gltrace: Allow receiving commands of length > 4
Currently, gltrace offers very few trace collection options. As a
result, these options are encoded in a single integer. The trace
control task simply receives integers and interprets them as
commands.

This patch changes the control protocol to first receive the
command length followed by the actual command itself. This allows
for future flexibility to provide enable other commands.

Change-Id: Id5f56c80a025bbbe7613ab4457e092732e7d9dc9
2012-05-16 12:00:24 -07:00
Jesse Hall
201f3b2da5 Disable EGL hibernation due to jank
Hibernating EGL takes a long time (>100 ms) and blocks all other
rendering. During window animations, the outgoing activity begins
hibernation before the animation stops, causing visible stutter.
Hibernation is still available by setting 'BOARD_ALLOW_EGL_HIBERNATION
:= true' in the devices BoardConfig.mk

Change-Id: Iab4e00723a1adcd97481e81b2efdc821b3e9712f
2012-05-04 15:21:35 -07:00
Siva Velusamy
c7d767ad57 gldebugger: Allow connections from root user
Change-Id: I26ce670ae93c43bd36843576e824a9d7acea644d
2012-04-26 09:07:41 -07:00
Mathias Agopian
4a8111bc8c Merge "Added an EGLTest for eglTerminate" 2012-04-19 17:22:48 -07:00
Jesse Hall
a0fef1c8bb Fix deadlock when cleaning objects in eglTerminate
When eglTerminate() is called with a window surface still exists, a
deadlock would occur since egl_display_t::terminate() holds a lock
while destroying the window surface, which calls
onWindowSurfaceDestroyed() which attempts to take the same lock.

This change refactors the hibernation code and data into a separate
object with its own lock, separate from the egl_display_t lock. This
avoids the deadlock and better encapsulates the hibernation logic.

The change also fixes a bug discovered incidentally while debugging:
hibernating after calling eglTerminate() succeeds, but will cause
awakens from subsequent eglInitialize() to fail. We will no longer
hibernate a terminated display.

Change-Id: If55e5bb603d4f8953babc439ffc8d8a60af103d9
2012-04-17 14:52:13 -07:00
Daniel Lam
1cbcb98a25 Added an EGLTest for eglTerminate
This tests if eglTerminate can succeed while objects
are leaked.  Currently the test fails because of a deadlock.

Change-Id: Ibe26edfda28691284d0674e803e8d3114f3ce4c6
2012-04-16 22:25:13 -07:00
Jesse Hall
258385978c Hibernate the EGL implementation when idle
If the EGL implementation supports the EGL_IMG_hibernate_process
extension, use it to hibernate (and hopefully release memory or other
resources) when the process isn't actively using EGL or OpenGL ES. The
idleness heuristic used in this change is:

(a) Wake up when entering any EGL API call, and remain awake for the
    duration of the call.
(b) Do not hibernate when any window surface exists; this means the
    application is very likely in the foreground.
(c) Do not hibernate while any context is made current to a thread.
    The app may be using a client API without the EGL layer knowing,
    so it is not safe to hibernate.
(d) Only check these conditions and attempt to hibernate after a
    window surface is destroyed or a thread's context is detached. By
    not attempting to hibernate at the end of every EGL call, we avoid
    some transient wakeups/hibernate cycles when the app is mostly idle,
    or is starting to become active but hasn't created its window
    surface yet.

On a Galaxy Nexus, hibernating frees 1567 VM pages from the process.
Both hibernating and waking can take anywhere from 30ms to over 100ms
-- measurements have been very inconsistent.

Change-Id: Ib555f5d9d069aefccca06e8173a89625b5f32d7e
2012-04-09 21:36:17 -07:00
Jesse Hall
b29e5e8c26 Increment/decrement a counter around EGL calls
This is in preparation for a change that will hibernate the underlying
EGL when idle. Instead of a bare egl_display_t*, get_display() now
returns a egl_display_ptr, which acts like a smart pointer. The
"wakecount" counter managed by the smart pointer isn't used for
anything in this change. It will be used to make sure we don't
hibernate when any thread is in an EGL call, without having to hold a
mutex for the duration of the call.

Change-Id: Iee52f3549a51162efc3800e1195d3f76bba2f2ce
2012-04-09 21:35:17 -07:00
Jamie Gennis
28ef8d7911 EGL: add GPU frame completion tracing
This change adds a debug option to EGL to use an EGLSyncKHR each frame to
determine when the GPU finishes rendering the frame.

Change-Id: I09ce071db904b44f07ca814c586c291c8b59385a
2012-04-06 09:23:13 -07:00
Colin Cross
bb67556871 Merge "frameworks/native: prevent some opengl tests from building in pdk" 2012-03-27 10:28:58 -07:00
Colin Cross
9f64c2a9e4 frameworks/native: prevent some opengl tests from building in pdk
Some of the tests in frameworks/native/opengl/tests depend on java
or jni, and shouldn't be in frameworks/native.  Prevent them from
building in pdk builds for now.

Change-Id: Ie7a012513dd03992ac1f093bd245aeca826c9cb9
2012-03-26 16:01:43 -07:00
Mathias Agopian
7db993a98b debug.egl.finish can be used to force a glFinish() when eglSwapBuffers() is called
this debug property is evaludated at eglInitialize() time.

Change-Id: Ie439e4aac87f7fdc6ab2add86183d6d042f3ee8b
2012-03-25 00:49:46 -07:00
Mathias Agopian
b0e76f456a remove dependency of EGL on ndk header
Change-Id: Ia6e489b5b4f028864bdf54923e81f604710dd8ad
2012-03-23 14:15:44 -07:00
Siva Velusamy
8e2f3858d5 gltrace: Only accept connections from the shell.
Only accept incoming connections from the shell user.

Change-Id: Ibef1a796d794d45f73db59949b39cb1ce68542b4
2012-03-15 16:41:35 -07:00
Siva Velusamy
b13c78f852 gltrace: Expose a function to set OpenGL trace level.
This patch adds a function setGlDebugLevel() to libEGL to enable
GL tracing. This will be used by the Java layer to add an option
to "am start" that can enable tracing for a particular application.

Change-Id: Ie1dbdd550f502df8633553595cb33ee9d9ae44e1
2012-03-09 16:43:48 -08:00
Mathias Agopian
373c2b2869 fix include path
Change-Id: I84adf53594cd4083a4a8ab475f175abb7414cda5
2012-03-07 19:46:57 -08:00
Siva Velusamy
2178dcf149 Merge "gltrace: Send vertex attribute data after glDraw() call." 2012-03-06 08:59:32 -08:00
Mathias Agopian
622cfadc8f fixup include paths
- remove unneeded include deps
- remove some hardcoded include paths

Change-Id: Ifae0e2b2d738e0f94f8525c45be78f4227ce1673
2012-03-05 15:59:38 -08:00
Siva Velusamy
50129e4ae2 gltrace: Send vertex attribute data after glDraw() call.
This patch enables tracing of vertex attribute data that
is specified using glVertexAttribPointer().

At the time the glVertexAttribPointer() call is made, we
only receive a pointer in client space, without any indication
of the size (# of attributes). This size is known only at
the time of the glDraw() call.

This patch generates a new message glVertexAttribPointerData()
when a draw call is issued that contains the vertex attribute
data.

A glDrawArrays() call directly gives the size of data to copy.
A glDrawElements() call gives the indices to copy. In such a
case, all data between the min & max indices drawn are copied
and sent to the host. To support glDrawElements() with an
element array buffer, this patch also adds state that maintains
a copy of all element array buffers.

Change-Id: I434da794a0aa9ada8e7474e219ffb1d79b183ecf
2012-03-01 17:41:53 -08:00
Jamie Gennis
1c8e95cf86 Add tracing to various graphics components.
This change adds ATRACE call tracing to BufferQueue,
SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL.

Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
2012-02-27 17:50:35 -08:00
Mathias Agopian
864d2afbb3 libagl shouldn't export anything
Change-Id: Ia823dbc56aab2a0b8a6063df4348fe6baac124c6
2012-02-27 13:03:04 -08:00
Siva Velusamy
640579b736 Merge "gltrace: Make code 64-bit safe." 2012-02-27 12:31:01 -08:00
Siva Velusamy
9801142afb gltrace: Make code 64-bit safe.
Currently, the trace API passes the pointers that need to be
patched up via 32 bit integers. Such code will not be 64 bit safe.
This patch sends all pointers in a separate array of pointers
for the fixup calls to read from.

Change-Id: If975333f11a6f6f9a74fba57de328affaed452a5
2012-02-27 12:08:47 -08:00
Siva Velusamy
0128a6b819 Merge "gltrace: attach buffer data sent with glBufferData" 2012-02-27 07:41:38 -08:00
Mathias Agopian
5f2165f945 remove dependency on android_native{s_priv|buffer}.h
Change-Id: Ie4b95f7061c240f37c504414259f92d72c4ffc89
2012-02-24 18:26:01 -08:00
Mathias Agopian
870b8aa15c remove libui dependency on libEGL
Change-Id: I1194f04085637d5c384e134967249430cc43b6ee
2012-02-24 16:42:46 -08:00
Siva Velusamy
9291da97cb gltrace: attach buffer data sent with glBufferData
Attach the buffer that is passed with glBufferData
and glBufferSubData to the proto buf.

Change-Id: I1b4c1172d405736b06cb0a356a6e241e1d60c4d5
2012-02-24 11:32:00 -08:00
Siva Velusamy
05df4504e5 gltrace: Trace thread time and wall clock time.
For each gl function, trace both the thread and wall clock
times.

Change-Id: I32b6caa67fa50bf915dab89b3c5021ee82e28d55
2012-02-17 11:09:47 -08:00
Mathias Agopian
3ac9473cb9 Merge "Don't wrap EGLImageKHR and EGLSyncKHR anymore" 2012-02-14 18:59:47 -08:00
Mathias Agopian
7c0441ac27 Don't wrap EGLImageKHR and EGLSyncKHR anymore
this simplify our EGL wrapper implementation a lot.
This wrapping is no longer needed now that we can only
support a single underlaying EGL implementation.

Change-Id: I8213df7ac69daac447f1fe6e37044b78aac4e9a9
2012-02-14 17:14:36 -08:00
Siva Velusamy
fefddbc181 Merge "gltrace: Patch up all glUniform*() calls." 2012-02-14 16:36:44 -08:00
Siva Velusamy
88e8e5a3f1 gltrace: Patch up all glUniform*() calls.
This patch updates the trace information for all glUniform*() calls
to have the right data (the actual uniforms that are passed).

In addition, as soon as a program is linked, information regarding
all the active attributes and uniforms is passed on to the debugger.

Change-Id: Icfbc6722789b42c413a845cf546577fa6de7da2b
2012-02-14 15:08:20 -08:00
Mathias Agopian
7773c435bc EGLConfig is now not remaped to an internal EGLConfig
this is possible now that we support only a single
EGL implementation. this allows a large code simplification.

Change-Id: I7a6b9db4c5d60f4407c6061e7a68729af63d5242
2012-02-13 20:23:15 -08:00
Mathias Agopian
ada798b7ca remove multiplexing of multiple EGL implementation
from now on, the system can only have one EGL
implementation. this means the software and h/w renderer
cannot be used at the same time on a device. Of course, the
h/w renderer is always prefered; in its absence we
default to the software renderer.

Change-Id: Ib579f58055dd0ce4c4a99144131efa11c16ca3d3
2012-02-13 18:11:42 -08:00
Mathias Agopian
a4b2c04182 fix a dead-lock in eglMakeCurrent
this was introduced in a recent change. eglMakeCurrent can
end up calling eglDestroyImageKHR via ANativewWindow::disconnect
when the consumer is in the same process.

we make sure we don't hold the lock while this is happening.

Change-Id: Id17fe4fd76eecf5f962cefb9aa32be41fc1b042d
2012-02-03 15:24:51 -08:00
Siva Velusamy
a7167f3647 gltrace: fixup Push & Insert Marker calls
Change-Id: I58ced7225fac79ec636a65da4883614a5dce6dff
2012-02-01 12:16:40 -08:00
Mathias Agopian
fb87e54a9a fix a race condition in eglMakeCurrent()
it would happen when a context was made non-current, in this
case we would call the implementation's eglMakeCurrent() which
would succeed, if we're rescheduled at that point, another
eglMakeCurrent() could make that context current to another thread,
however, when we came back to the original call we would
overwrite egl_context_t internal state.

this is fixed by moving the critical section under
egl_display_t's lock.

Change-Id: I743c85696e13263d3a9570824940263df0caacdc
2012-01-30 18:20:52 -08:00
Mathias Agopian
0d6aa287d1 Merge "add all needed GL extension wrappers" 2012-01-30 17:44:09 -08:00
Mathias Agopian
a6d86e5ea7 add all needed GL extension wrappers
when increasing MAX_NUMBER_OF_GL_EXTENSIONS to 256
we also needed to create all the corresponding wrappers.

Change-Id: I90edaaf0885ccdfab48e7a1396bcf88e039cfb25
2012-01-30 17:40:29 -08:00
Mathias Agopian
9e2464c4b9 Merge "add support for GL_EXT_debug_marker" 2012-01-30 15:23:47 -08:00
Siva Velusamy
b8c3914547 Merge "gltrace: Use Unix Domain Socket rather than INET Socket" 2012-01-30 09:08:27 -08:00
Mathias Agopian
48d438d05f add support for GL_EXT_debug_marker
This extension is always added to the GL_EXTENSIONS
extension string for the current GL context, regardless
of if it's supported by the h/w driver.

The extension itself will be handled by GLES_trace (eventually),
when GLES_trace is not enabled, it'll result to a no-op.

If the h/w implementation has this extension, we'll call that version
instead of our dummy version.

Change-Id: Ie5dd3387c4d45cd5ed5f03b73bda6045620a96bc
2012-01-29 22:22:09 -08:00
Mathias Agopian
453851f3a0 Merge "update GLES headers and add support for corresponding new extensions." 2012-01-29 22:03:19 -08:00
Mathias Agopian
3127260614 update GLES headers and add support for corresponding new extensions.
Change-Id: I554d9659113b4721b748ee5c1a3b1ca82b11d75e
2012-01-28 20:41:35 -08:00
Mathias Agopian
cf701aa9fe remove unused code
Change-Id: If900fcc50f9ffc424e270cb6063b16a2d7bc04d3
2012-01-28 18:47:13 -08:00
Siva Velusamy
0832fb6407 gltrace: Use Unix Domain Socket rather than INET Socket
Export trace information via abstract Unix Domain Socket (UDS).
This allows tracing of applications without INTERNET permission,
and should be faster as well.

Change-Id: Iabb67fcc2bc2484afd8128af07dca723b81c52c6
2012-01-27 17:24:18 -08:00
Jamie Gennis
e8696a40e0 hack up frame latency measurement
Change-Id: I6d9a466a23285304f0e229a5649815636ab5d6af
2012-01-24 15:41:50 -08:00
Siva Velusamy
34c726efb5 gltrace: fixup data for glTexSubImage2D & glDeleteBuffers
Change-Id: I1c1deb8c6026ecf1fa0ed5287ccf601416eba6dc
2012-01-17 12:28:11 -08:00
Steve Block
e6f43ddce7 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
2012-01-08 13:19:13 +00:00
Steve Block
32397c1cd3 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
2012-01-06 10:07:54 +00:00
Steve Block
c267bab3d1 Merge "Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE" 2012-01-05 14:07:02 -08:00
Siva Velusamy
3f194e6e3a gltrace: add user settings to control data captured.
Currently users do not have control over the amount of data
captured during tracing. This patch adds 3 settings that users
can enable/disable at runtime:
  - capture framebuffer on eglSwap() calls
  - capture framebuffer on glDraw*() calls
  - capture texture data passed to glTexImage*() calls
Disabling these options when not needed signficantly decreases
the size of the trace file, and reduces performance overhead for
the running application.

These settings are stored in the per process GLTraceState.
A separate thread listens for commands from the host, and updates
the state based on the user commands.

Change-Id: Ic4518b94e8bcbc5330ac7138153721caa98b365d
2012-01-04 12:50:13 -08:00
Steve Block
a19954ab37 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
2012-01-04 20:05:49 +00:00
Siva Velusamy
56ac6ff9bd gltrace: add start time & duration to each traced call.
Change-Id: Idfec8f715f6000594b6381cbfdee9fdf6d89f484
2012-01-04 11:38:37 -08:00
Siva Velusamy
93a826f78f gltrace: transport buffering and context management
This patch adds two improvements:
1. Protobuf messages are buffered and sent in chunks.
2. Multiple EGL contexts are handled properly: Corresponding
to each EGLContext, a GLTraceContext with a unique ID is created.
On eglMakeCurrent, the appropriate GLTraceContext is set and is
used while tracing subsequent GL Calls in that thread.

Change-Id: I34076376d3e5af205c87c7396ea47659844abd6e
2012-01-04 11:38:37 -08:00
Siva Velusamy
59511ad1cb Merge "gltrace: attach contents of the appropriate framebuffer" 2012-01-04 11:18:29 -08:00
Steve Block
9d45368352 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
2012-01-03 22:38:27 +00:00
Jack Palevich
2b93f0bf44 Fix convert8To4, convert8To5
See b/5680952 "Compilation warnings in etc1.cpp" for discussion.

Fixes b/5680952

Change-Id: I0af6ba5ed5e60f3ed7a6a28eba3b09504fee1a3f
2011-12-09 14:06:07 -08:00
Siva Velusamy
f132ac35d8 gltrace: attach contents of the appropriate framebuffer
Currently, gltrace always attaches the contents of the currently
bound framebuffer. This patch changes it to attach the contents
of FB0 on eglSwap, and the currently bound framebuffer for the
glDraw* calls.

Change-Id: Ice0520d45d75638fe61cd91149df773074216510
2011-12-07 16:00:58 -08:00
Siva Velusamy
a8cfde8897 gltrace: Make framebuffer contents an optional message.
Currently, the contents of the FrameBuffer are sent by encoding
them as the last argument to the function call. As a result, it is
not possible to know if a message has the framebuffer encoded in it
without looking at the function type.

This patch modifies the protobuf definition to include a separate
optional framebuffer message.

Change-Id: Ief3a6950052d927ca0743e729457435b48c25a92
2011-12-05 14:13:16 -08:00
Siva Velusamy
73d2b3c7e5 Merge "glestrace: Framework for GLES tracing library" 2011-12-02 15:49:01 -08:00
Siva Velusamy
0469dd6d55 glestrace: Framework for GLES tracing library
This patch provides a framework for tracing GLES 1.0 and 2.0
functions. It is missing a lot of features, but here are the
things it accomplishes:

- Stop building the glesv2dbg library, and build the
    glestrace library instead.
- Replace the hooks for glesv2dbg with the ones for glestrace.
- Add the basics for the trace library. Currently, this
    traces all GL functions, but not all required data is
    sent for all the functions.  As a result, it will not
    be possible to reconstruct the entire GL state on the
    host side.

The files gltrace.pb.* and gltrace_api.* are both generated
using the tools/genapi.py script.

Change-Id: Id60a468f7278657f008bc6ea1df01f9bdfecfdd3
2011-12-02 15:30:17 -08:00
Mathias Agopian
bc2d79ed7a add a way to access the version string of the h/w implementation of EGL
we use a hidden egl extension. the version string is printed
in SF's dumpsys log.

Change-Id: I123eb4bde6de462bb2404c67b74d6d6219a48d6a
2011-11-29 18:00:35 -08:00
Jamie Gennis
e011aa2b0f Merge "EGL: Use cache sizes defined in the BoardConfig" into ics-mr1 2011-11-21 15:54:54 -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
89c1d61c16 EGL: Use cache sizes defined in the BoardConfig
This change introduces two new BoardConfig variables to control the size
limits of the EGL blob cache.  MAX_EGL_CACHE_ENTRY_SIZE is the size
limit for values inserted into the cache, and MAX_EGL_CACHE_SIZE is the
size limit for all entries in the entire cache (including both keys and
values).  If either of these BoardConfig variables are not defined then
a default size limit is used instead.

Change-Id: I6703d93f966b6389c6499f23d841e42339f9c9d7
2011-11-21 11:48:17 -08:00
Jamie Gennis
0f83b2f976 Merge "EGL: fix blob cache extension detection" into ics-mr1 2011-11-17 17:10:32 -08:00
Jamie Gennis
11f8fde84d Merge "GLES: add image external enums" into ics-mr1 2011-11-17 15:47:28 -08:00
Jamie Gennis
9f43009177 EGL: fix blob cache extension detection
Bug: 5474671
Change-Id: I6359063ccf23f076fc84c80b8a2f6731a65eef18
2011-11-17 14:06:46 -08:00
Mathias Agopian
f3ae82d813 be a bit more defensive when parsing extension strings
hopefully this will fix a crash in the emulator.

Bug: 5624674
Change-Id: I96586e29ea20efd73c4ad50870df5b7368bf3c3b
2011-11-16 16:49:25 -08:00
Jamie Gennis
9c6c6992e0 GLES: add image external enums
This change adds Java definitions for the enums of the
GL_OES_EGL_image_external OpenGL ES extension.

Bug: 3482193
Change-Id: Ib50326f8be9b9cc9021753855c3846ddcdc5eaa2
2011-11-15 11:35:46 -08:00
Mathias Agopian
4b9511c161 rework a bit how we manage EGL extensions
- don't advertise extensions that are not supported
  by any implementation

- remove EGL_ANDROID_swap_rectangle which is not
  implemented by anybody and confuses people

- add some comments about mandatory extensions

Bug: 5428001
Change-Id: Id8dc48116ac1d1eb79ec9ef55d03e29d4257c1f3
2011-11-14 19:05:45 -08:00
Mathias Agopian
f0480de374 fix crash when validating an invalid EGL objects
the code that validated EGL objects dereferenced the object
to access its EGLDisplay -- needed for validation (!).
This was wrong for two reasons, first we dereferenced the object
before validating it (potentially leading to a crash), secondly
we didn't validate that the object existed in the right EGLDisplay.

We now use the EGLDisplay passed by the user API.

Change-Id: I66f9e851d4f8507892a6b1fee3065f124c4e7138
2011-11-14 17:40:21 -08:00
Jamie Gennis
7cd230c508 Merge "EGL: add the ANDROID suffix to the blob cache ext" into ics-mr1 2011-11-14 17:36:46 -08:00
Jamie Gennis
c42fcf05ce EGL: add the ANDROID suffix to the blob cache ext
This change adds the ANDROID suffix to the all the types and functions
defined by the EGL_ANDROID_blob_cache extension.

Change-Id: I087875b96d9a7053efb9c8d5614f9f765eed799d
2011-11-11 13:17:03 -08:00
Romain Guy
c58b9999e1 Merge "Terminate EGL when an app goes in the background" into ics-mr1 2011-11-10 17:10:41 -08:00
Romain Guy
4725e2ca80 Terminate EGL when an app goes in the background
This does not happen on high end gfx devices. This happens
only if only one EGL context is initialized in the current
process.

Change-Id: Ibd1737efdf84eef8a84108b05795440d1ae9964e
2011-11-10 16:44:49 -08:00
Jamie Gennis
99c3d700d2 EGL: add deferred saving of the cache
This change causes any insertions into the EGL cache to trigger an
attempt to save the cache contents to disk.  The save operation is
deferred to allow multiple cache insertions to be batched up.

Change-Id: I6cfec9c0dbbef94d3f8880860e2a365dccc296c7
2011-11-08 17:59:36 -08:00
Jamie Gennis
98c6383580 EGL: implement loading and saving the cache
This change adds support for saving and loading the contents of the EGL
cache.  It also adds some simple tests for the EGL cache.

Change-Id: I18e5e789e0897a0783d29d1c1e64d26de2dd44c4
2011-11-08 15:54:36 -08:00
Jamie Gennis
766010858e EGL: use an in-memory the blob cache
This change makes the makes the stub EGL_ANDROID_blob_cache callbacks
actually use a BlobCache object.

Bug: 5474671
Change-Id: I5cbaae2dea3aad2fe306c9f57029c3f215a0863a
2011-11-07 10:48:42 -08:00
Jamie Gennis
aca51c06f3 EGL: Add stubs for EGL_ANDROID_blob_cache
This change adds a stub cache implementation that gets passed to the
underlying EGL implementation at initialization time.

Change-Id: I14437c5b6f91b7a34a19bb02ad802e6e54f88d2a
2011-11-04 15:01:51 -07:00
Mathias Agopian
0e8bbee577 don't log EGL errors due to unimplemented proprietary extensions
Change-Id: Icfc33d4f55d1e7fb49390ce0921ba37a438c9fc2
2011-10-05 19:15:32 -07:00
Mathias Agopian
1ac8b72f4f fix EGL debugger
always use GL_RGBA, GL_UNSIGNED_BYTE for screen capture
and make sure to handle GL_BGRA_EXT used on some gpu.

Change-Id: If9c973677fec8a5c4e72be22e7ef7d4bf5f008f4
2011-09-19 14:44:37 -07:00
Mathias Agopian
06649fece4 cleanup: fix typos in logs
Change-Id: Ib5744564a873ea2b84100174673dc4d3ae109fcf
2011-09-16 11:56:40 -07:00
Jonas Yang
1c3d72a229 Add (support for) EGL_NV_system_time extension.
Change-Id: I62bf0fcb5ccdc77c042b425a42054fb3122575b6
Signed-off-by: Mathias Agopian <mathias@google.com>
2011-09-13 16:44:22 -07:00
Mathias Agopian
ecfe091af3 add an option to EGL to dump stack traces on errors
enable by setting debug.egl.callstack to 1

Change-Id: I7fad9ce71b4c4c5ece97d4f9d139348eab742a3c
2011-09-06 18:06:04 -07:00
David 'Digit' Turner
80b30c24ff opengl: EGL: special case for GLES emulation
This patch modifies the library loaded in libEGL.so to
handle the case of GLES emulation as follows:

- if we detect that we run inside the emulator, check the
  GPU emulation status through ro.kernel.qemu.gles, which
  will be set to 1 if supported, or 0 otherwise.

  When trying to run on an older version of the emulator,
  the kernel parameter will not be defined at all.

- if GPU emulation is supported, use egl.cfg as usual.
  It will contain a line like "0 0 emulation" that will
  load libEGL_android.so appropriately.

- nothing is changed if we don't run inside the emulator.

NOTE: Ideally, we would modify libEGL_emulation.so to
      redirect all calls to libEGL_android.so in this case.

      However, this turns out to be extremely tedious to implement
      (too many functions with different signatures).

      As such,  it is much simpler to make the check before
      loading the library.

Change-Id: I9930bc168d9013cc8700feedc57b979384467c37
2011-09-02 15:41:13 +02:00
Mathias Agopian
a45c547910 fix another bug that prevented the gl debugger to work
we didn't set the debug tls properly

Change-Id: Iad9cc5b5d230a8eb7f680c4b70925c5e43e73051
2011-09-01 17:50:52 -07:00
Mathias Agopian
ccfa5c3364 this should fix the GL debugger
we were checking against to the wrong variable

Change-Id: Iff3f5ab2d6ba5ac0d3d8161011b38e673ee7e67b
2011-09-01 14:55:00 -07:00
Mathias Agopian
5fecea776a fix logging of eglMakeCurrent() errors
Change-Id: Ie22cabff822a8fb3186f082491234b9503b431c3
2011-08-25 18:38:24 -07:00
Jamie Gennis
9f24fd020e EGL: move disconnect to surface dtor
This change moves the call to native_window_api_disconnect from
eglDestroySurface to the egl_surface_t destructor.  The egl_surface_t
can outlive the external EGLSurface if eglDestroySurface is called while
the surface is made current on a thread.

Change-Id: I0df6117a5633c2a19935fe356579abdd76fc471f
2011-08-24 15:00:23 -07:00
Mathias Agopian
3a0cae8e5f implement EGL_TEXTURE_EXTERNAL_OES in libagl
this allows the emulator to display some graphics

Change-Id: Ib4671ad70b8df598d02307f2b9c5b843421cea25
2011-08-18 16:26:21 -07:00
Mathias Agopian
7dddeac971 fix test-opengl-swapinterval
EGLConfig selection should now work on any device

Change-Id: I4d4580e891d1faf817fa853838406fb49d12e50a
2011-08-15 15:25:40 -07:00
Mathias Agopian
81a6335052 connect/disconnect is now called from our EGL wrapper
the original connect/disconnect hooks are deprecated
and replace by api_connect/api_disconnect. the original
hooks are no no-ops.
api_connect/api_disconnect is now only called from the
android framework.

Bug: 5057915
Change-Id: I8ca64cd1acd6cabf915bf54689ec2e5f6dfa495a
2011-08-01 14:06:20 -07:00
Romain Guy
868a0aff31 Add new OpenGL test
Change-Id: Icab48d71945bf94dd53f58b728a951d46380d945
2011-07-19 17:20:35 -07:00
Jamie Gennis
dc159f92fa EGL: update EGL_ANDROID_recordable extension.
This change adds an enum value and a description of the expected
implementations to the EGL_ANDROID_recordable extension specification.
It also adds the new enum value to the 'eglext.h' header.

Change-Id: Ia0de2d5613708445ff83b85a7e550f9417531ee4
2011-07-17 18:42:09 -07:00
Jeff Brown
7175398247 Merge "Remove the simulator target from all makefiles. Bug: 5010576" 2011-07-12 12:15:07 -07:00
Jeff Brown
baa44b89ec Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I04d722f258951a3078fe07899f5bbe8aac02a8e8
2011-07-11 22:12:16 -07:00
Jamie Gennis
1a14b442e0 Merge changes I002177a6,Ibaff52fe
* changes:
  Add the EGL_ANDROID_recordable spec.
  Add the spec for EGL_ANDROID_blob_cache.
2011-07-11 17:14:33 -07:00
Jamie Gennis
bd3b6ef117 Add the EGL_ANDROID_recordable spec.
Change-Id: I002177a68fafd6bb941aa64445c85fd5ff56223a
2011-07-11 17:13:02 -07:00
Jamie Gennis
0d0c5a6d6b Merge "EGL: fix the ANativeWindow size/fmt override" 2011-07-11 15:47:20 -07:00
Romain Guy
e03de93794 Always make GL calls with a valid EGL context.
Bug #5010760

Change-Id: If7500ef69683948e727df1406f458f18b11259d1
2011-07-11 15:33:51 -07:00
Jamie Gennis
bee205fd58 EGL: fix the ANativeWindow size/fmt override
This change fixes how the Android EGL layer overrides the size and
format of an ANativeWindow in eglCreateWindowSurface.  The new behavior
is to leave the size untouched when overriding the format.  The previous
behavior was to reset the ANativeWindow to use the default size set by
the ANativeWindow implementation.

It also adds two new 'perform' methods to the ANativeWindow interface:
set_buffers_dimensions and set_buffers_format, and redefines the
behavior of set_buffers_geometry to be the combination of these two new
methods.

Additionally, this change adds an error check for the return value of
the new native_window_set_buffers_format call, which required adding a
(stub) handler for to FramebufferNativeWindow.

Change-Id: I805c7ccd8d4730dfb132d10d8bc3fb058a0b9df1
2011-07-11 12:31:45 -07:00
Jamie Gennis
34d3f3810d Add the spec for EGL_ANDROID_blob_cache.
Change-Id: Ibaff52fee5c856283536ad37251cc80a9f3f938b
2011-07-11 12:06:54 -07:00
Mathias Agopian
2f739f8f04 Add a simple EGL test
currently it just tests EGLConfig selection

Change-Id: Id9d9971012d733147dd7dc02fa2054307960235e
2011-07-08 14:40:39 -07:00
Mathias Agopian
1cadb25da1 fix x86 build
Change-Id: I03cfbfeaeb8b13842248856b14b4a23711036e10
2011-05-23 17:48:36 -07:00
Mathias Agopian
5b287a6ea8 eglTerminate() now actually frees up all active egl objects
as specified by the EGL specification, terminated objects's
handles become invalid, the objects themselves are destroyed
when they're not current to some thread.

Change-Id: Id3a4a5736a5bbc3926a9ae8385d43772edb88eeb
2011-05-16 19:03:33 -07:00
Mathias Agopian
518ec112f4 refactor EGL source code
no changes is functionality. split various objects into their own files.
make egl_display objec's lock internal.
2011-05-16 19:02:45 -07:00
Mathias Agopian
0ad71a97c6 fix (Again) adding OES postfix when looking for gl functions
Change-Id: Ib14723ed5355fdc423226ec20a32e26fe7dd68fe
2011-05-11 20:37:47 -07:00
Jeff Boody
e647f3c76c add OES postfix without truncating function
Change-Id: Id47304cf38914190cec58d703801f456ab916f63
2011-05-11 18:05:49 -07:00
Mathias Agopian
69e43b71af fix libagl surface initialization
this broke recently when removing copybit support.

Change-Id: I5cc7ff7f49268411c6c2cfb2d97590d52b13dbd5
2011-05-11 13:41:09 -07:00
Iliyan Malchev
697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -07:00
Mathias Agopian
75c1535eb3 remove last traces of copybit
Change-Id: Ia0f13a0ee6f702256482b5eb29d7fa2aa840bfc7
2011-05-02 16:27:21 -07:00
Mathias Agopian
9cdb01da71 get rid of dependency on copybit HAL module
Change-Id: Ia608099a2426c11a91d33063ba53c93e1eccb428
2011-04-28 19:50:21 -07:00
Jamie Gennis
1b528fb9d8 EGL: Allow creating a SurfaceTexture EGLSurface.
This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.

Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
2011-04-25 16:41:11 -07:00
David Li
133cf52ac9 GLES2Dbg: noop - format & comment
Change-Id: Ibb36508181d4322e236b6595b28d253f282c36d7
Signed-off-by: David Li <davidxli@google.com>
2011-04-21 14:15:10 -07:00
David Li
620676eec7 GLES2Dbg: send some GL implementation constants to client
Change-Id: Ic6c51c09b1c3d2e1e1a28c6ed552714c3243827c
Signed-off-by: David Li <davidxli@google.com>
2011-04-19 14:44:51 -07:00
David Li
7b271eba88 GLES2Dbg: initial tests
Change-Id: Ibf07eff68d39267fd5c9bec2870f59a5ae2f51e3
2011-04-19 14:42:14 -07:00
David Li
c2ca836b17 GLES2Dbg: added CaptureDraw and CaptureSwap options
CaptureDraw specifies how many glDrawArrays/Elements to glReadPixel
CaptureSwap similarly applies to eglSwapBuffers

Change-Id: Ie7a7e3392b4ecdc0659dcee04f4bab97c35267dc
Signed-off-by: David Li <davidxli@google.com>
2011-04-12 15:56:10 -07:00
David Li
499c6f02e6 GLES2Dbg: use dump.gles2dbg file when fails to create socket
setprop debug.egl.debug_forceUseFile 1: always use file
setprop debug.egl.debug_maxFileSize <int MB>: exit when reached
setprop debug.egl.debug_filePath <path>: may need to make the file
 writable first.
setprop debug.egl.debug_port <unsigned short>
setprop debug.egl.debug_proc <proc cmdline>: to match debuggee process

Change-Id: I34ca1f3092f3abf17e2ded9d1689d0cdef6e07e8
Signed-off-by: David Li <davidxli@google.com>
2011-04-12 15:56:10 -07:00
David Li
904f18f792 GLES2Dbg: add EXTEND_AFTER_CALL_Debug_* macro and improve protocol
To allow auto generate of Debug_glReadPixels function.
Also added AfterGeneratedCall messag type, and client override
 of expectResponse for improving protocol.
Also implemented callers for client to get shader/program iv & infolog

Change-Id: I8426de0be4b7ffcb8b2b4f063ad85d19a9d2d72e
Signed-off-by: David Li <davidxli@google.com>
2011-04-12 15:56:10 -07:00
David Li
864f839e96 GLES2Dbg: change GLES2_dbg to shared library
Change-Id: I493e9bff431bd939f4e80e1e9c614dd557307fa2
Signed-off-by: David Li <davidxli@google.com>
2011-04-12 15:56:10 -07:00
Elliott Hughes
9875750593 Kill the global references in the OpenGL wrappers.
Just use jniThrowException instead. Note that it would be trivial to throw
seemingly more appropriate exceptions (NullPointerException and
OutOfMemoryException in particular), but I'm only attempting to preserve
existing behavior here.

I also found shadowing bugs in some of the special-case functions, which
would previously always have leaked memory.

This also moves an accidental change to a generated file (ActivityThread ->
AppGlobals) into the generator, so it won't be overwritten in future.

Change-Id: Iab570310b568cb406c60dd0e2b8211f8a36ae590
2011-04-11 15:31:20 -07:00
Eric Hassold
7fecf8c1ff Initialize reference counter for egl_display_t
Add missing member initialization for reference counter, used to determine
if a context is ready.

Change-Id: I45f81177ac2851129681f827afe015b60b3cd73c
2011-03-31 16:52:02 -07:00
Eino-Ville Talvala
2e2132d773 Merge "Add a simple OpenGL ES 2.0 test program that displays a camera preview stream." 2011-03-29 13:34:03 -07:00
David Li
214c31dbe5 Merge "GLES2Dbg: use 256KB chunks for lzf compression" 2011-03-29 12:00:07 -07:00
Eino-Ville Talvala
55c617aa2d Add a simple OpenGL ES 2.0 test program that displays a camera preview stream.
Uses a SurfaceTexture feeding into a OpenGL ES2 GLSurfaceView. Also
uses accelerometer data and SurfaceTexture-provided timestamps for a
simple physics simulation which moves the camera preview oval in
response to device movement.

Change-Id: I275a0c6a4e25829d617e635b25e70e2a9c8455cb
2011-03-28 15:27:19 -07:00
Jack Palevich
62d08f5bc3 Add Java support for a few accidentally omitted OpenGL ES APIs.
Fixes 3491494 Support OpenGL APIs: glBlendEquationSeparate and friends

Change-Id: I8fdc94b6ea14e9a7e3d402a965d500790a3d8f77
2011-03-28 14:49:12 -07:00
David Li
7a52015696 GLES2Dbg: use 256KB chunks for lzf compression
Data format is uint32_t totalDecompressedSize, then repeat:
uint32_t chunkDecompressedSize, chunkCompressedSize, chunk data.
If chunkCompressedSize == 0, then chunk is not compressed.

Also start fixing integer sizes on server.
On client, set endianness to match server.

Change-Id: I0d5afa16976ea6019b91c4e21d284605da7e135e
Signed-off-by: David Li <davidxli@google.com>
2011-03-28 10:32:37 -07:00
Eric Hassold
11c01568c3 Make objects collection a member of egl_display object
Move EGL objects (contexts, surfaces, ...) collection from global
static into EGL display object. Since EGL implementation currently
supports only one display, this doesn't change current logic. This
aims at preparing for next coming changes in eglTerminate() to
support per-display cleanup.

Bug: 4152714
Change-Id: I5e424781b89c3c275f9922f943463d5f6b1f6bc6
2011-03-25 14:37:19 -07:00
David Li
922ddd6dad Merge "GLESv2Dbg: ability to create GL calls from client" 2011-03-24 16:43:02 -07:00
David Li
fef0451f7f Merge "GLES2Dbg: added SETPROP expectResponse" 2011-03-24 16:42:58 -07:00
David Li
3f9c90c1ec Merge "GLES2Dbg: added reference frame for glReadPixels" 2011-03-24 16:42:53 -07:00
David Li
e315b16e8f Merge "GLES2Dbg: use libLZF for compressing images" 2011-03-24 16:42:44 -07:00
Eric Hassold
3ede7c133a Check for initialized EGLDisplay when required by specification
Check for initialized display, and set EGL error to EGL_NOT_INITIALIZED
whenever it isn't, for all EGL functions taking an EGLDisplay as argument
and requiring it to have been initialized.

Bug: 3366011
Change-Id: Ib1d8a3a207257995518f4430fe97f8c406c7fc13
2011-03-23 15:59:00 -07:00
David Li
49633ca2ed GLESv2Dbg: ability to create GL calls from client
caller.cpp Is generated by generate_caller_cpp.py
Hand written functions are in caller.h

Change-Id: I27ed9792df52569159a2d1b8a78207c7a7518537
Signed-off-by: David Li <davidxli@google.com>
2011-03-22 18:42:22 -07:00
David Li
ebcfe2d632 GLES2Dbg: added SETPROP expectResponse
to allow "stepping" in functions.
Also fix bug in reference frame.

Change-Id: Ia33620eaf2c5f4e615f7aad2df277b6afc617060
Signed-off-by: David Li <davidxli@google.com>
2011-03-22 18:42:22 -07:00
David Li
8b27d3592d GLES2Dbg: added reference frame for glReadPixels
Change-Id: I37398d8d835e54a1764dfabd617fdc2c640864c2
2011-03-22 18:42:03 -07:00
David Li
c615816679 GLES2Dbg: use libLZF for compressing images
liblzf is in external/liblzf, it's BSD-type licence (optionally GPL2)

Change-Id: Idc7883fe2155f366cda384e64796a1493335ae4f
Signed-off-by: David Li <davidxli@google.com>
2011-03-21 18:23:28 -07:00
David Li
5a0d29009c Merge "GLES2Debugger: Make command exchange async to improve performance." 2011-03-17 14:38:37 -07:00
Mathias Agopian
7d7723d330 am 9405d987: am a05a8ac5: am af831a7b: Merge "fix [4107131] nvidia driver call takes a very long time" into honeycomb-mr1
* commit '9405d98705db1c8102b77ef960f344ac416d165c':
  fix [4107131] nvidia driver call takes a very long time
2011-03-16 16:03:24 -07:00
Mathias Agopian
36bdf14a75 fix [4107131] nvidia driver call takes a very long time
We were leaking all EGLSyncKHR objects, over time the list
would grow and become very slow to operate on.

Bug: 4107131
Change-Id: I6c82daf49fe3189d04550781d64d57c30c95f552
2011-03-16 14:19:03 -07:00
Jamie Gennis
9db01a7c1c am 0ea44ac0: am 00f47af8: Merge "SurfaceTexture: disallow unsupported uses." into honeycomb-mr1
* commit '0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1':
  SurfaceTexture: disallow unsupported uses.
2011-03-15 13:01:27 -07:00
Jamie Gennis
5c0c93a8c4 SurfaceTexture: disallow unsupported uses.
This change makes the ANativeWindow_lock NDK function error out if it is
passed an ANativeWindow with a concrete type that is not Surface.  It
also makes eglCreateWindowSurface fail if it is passed a
SurfaceTextureClient as its 'window' argument.

Bug: 4087277
Change-Id: Ie68c50c52d88f72d8a387f6c094908044c83a88c
2011-03-15 10:37:37 -07:00
Iliyan Malchev
3875d79ef6 Merge "frameworks/base: remove LOCAL_PRELINK_MODULE" 2011-03-14 16:58:05 -07:00
Jamie Gennis
5b92e39c14 am dcbc2557: am c313b59b: am 071929b2: Merge "gl2_yuvtex: use the gralloc-provided stride." into honeycomb-mr1
* commit 'dcbc255734e506bacd36d8d9483b7f3d6d96d10b':
  gl2_yuvtex: use the gralloc-provided stride.
2011-03-14 15:25:14 -07:00