Commit Graph

38 Commits

Author SHA1 Message Date
Guy Zadikario
0536060b40 emulator opengl: guest/host rendering syncronization.
Added a return value for rcFlushWindowColorBuffer and
rcUpdateColorBuffer in order to make those calls to block
with a round-trip to the host. This is to make sure that
the color buffer is up-to-date before the flinger use it
for rendering.
Also added a call to the native windows's lock function after
EGL is attached and bound to render on the window. This call
was missed before.

This syncronization can be optimized by removing the round-trip
and insert sync primitive to the stream at every draw command that
reads from a color buffer to make the sync happen on the host
before rendering the color buffer and remove the need for the
guest to wait for that update.

Change-Id: I1c2d8bc407b69663e992a68d5aa755f19bbe0ec3
2011-06-25 16:56:08 +03:00
Stas Gurtovoy
88ad268dd9 emulator opengles: Fixed bug in gralloc unregister_buffer
Reset the ashmemBase & mappedPid on unregister_buffer

Change-Id: Ia209f88a15eb51edb39b1a799500d835b944bc87
2011-06-25 16:30:30 +03:00
Stas Gurtovoy
128f401e4f emulator opengles: Fixed a bug in eglChooseConfig implementation.
The config_size argument in rcChooseConfig should match the number
of requested configs and not the size in bytes to store it.
Moved the configs array size computation into rendeerControl.attrib.

Change-Id: I9e797024522965a656764c20252b25ff5ae657f5
2011-06-25 16:30:30 +03:00
David 'Digit' Turner
8422a11a21 emulator: opengl: Update/simplify build scripts
This patch is a major rework of the build opengl-emulation
build scripts. See README for details.

In a nutshell, this introduces various functions that considerably
simplify the declaration of the 26+ modules in this implementation,
by handling auto-generation of sources and module imports/exports.

Change-Id: I827522d783c7b6cf5eafd37204a1025c235458cd
2011-06-23 00:35:54 +02:00
Guy Zadikario
22a288abf8 emulator gralloc: removed compilation warnings.
just removes anoying compliation warnings in the HMI
initialization.

Change-Id: I23377a7cae774cf436f89e25edb78c10ff5b5c78
2011-06-21 20:47:43 +02:00
Guy Zadikario
7d39ef3772 emulator opengl: Fix gralloc color buffer uploads
Use the correct OpenGL pixel type enum when uploading
color buffer content to host.

Change-Id: Idc859306c0398850505f0f348796bc4f12b63b6a
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
ca629bd28e emulator opengl: fix crash in gralloc_free
Fixed bug in list implementation in gralloc_free which caused a crash,
also removed some log prints.

Change-Id: Ie932c838086c99567643868682419ceb122cf787
2011-06-21 20:47:43 +02:00
Guy Zadikario
1ef706f96f emulator opengl: implement glGetString
Added rcGetGLString token to renderControl to query
a GL string constant from the current context from the host.
Implement glGetString functinality in EGL so that the string
value can be cached in the context structure and also
implementation can be shared between GLESv1 and GLESv2.

Also, fixed clientAPI context initialization check in
eglMakeCurrent. The check was for the previously bounded
context instead for the newly bounded context.

Change-Id: I41c0b4ad462c9ad5bd5c66719b41509bb1b7a947
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
6a79e88f01 emulator opengl: pool of fixups to the system components.
Those fixes make the system load without failure.
Also the flinger and bootanimation are running.

Change-Id: Ieb7039e76c444df778a421a07bccc48514199245
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
2220d27302 emulator opengl: added Bind texture to EGLImage/surface
added functionality to bind an EGLImage to a texture both
in the system and host sides.

Change-Id: I2dc26090b45da080ac4d0e8f5799c95f7cc54634
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
a26f6f221b emulator opengl: Added glFinishRoundTrip to GLESv2
Change-Id: Ia1c6cb7e75a1769040d13e81d0da7db5f5c28435
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
de40cd3cc8 emulator opengl: Small change to support more surface attributes
Change-Id: I14d630d50c8505dabcd065e6187bd6d6509c312b
2011-06-17 17:27:19 +03:00
Stas Gurtovoy
a6882bf79d emulator opengl: Added glFinishRoundTrip implementation.
This is to allow glFinish to wait for the host render to finish.

Change-Id: I43e23aee19700b79bc70c89e791df180c6c1fb91
2011-06-17 17:27:19 +03:00
Stas Gurtovoy
903945c963 emulator opengl: implemented getProcAddress in GLESv1.
Also changed emugen to generates gl_ftable.h needed for
getProcAddress implementation.
Added not_api attrib to emugen's gl.attrib to exclude from the
generated ftable.

Change-Id: I03786ea5d5a640bbcf5efccadca5bf2ec3e09fca
2011-06-17 17:27:15 +03:00
Stas Gurtovoy
d32c2d9633 emulator opengl: system GLESv1 first commit.
This is the first commit for the GLESv1 implementation.
It also includes needed fixes in emugen to support const types.
Also, changed glFinish definition in gl.in to match the
definition as in gl.h.

Change-Id: I90262a1db6035a90af8db17984acecef6499847a
2011-06-17 17:18:45 +03:00
Stas Gurtovoy
a7b7e95b03 emulator opengl: implement eglChooseConfig functionality.
Added new RenderControl command to request the host to execute
the ChooseConfig functionality.

Change-Id: Ib92be313a6df740de69d671c6994ec6cae17ea13
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
33dc9add2a emulator opengl: some system egl fixes after a review.
Change-Id: I4a0c72319e8c69fba8ac00ed7bfff7667ae07269
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
c36ac6ed2f emulator opengl: moved gralloc buffer handle struct to be shared.
We need to share the cb_hande_t between gralloc/EGL/GLES, moved it
into the opengl system common lib.
Also added eglSwapBuffers implementation.

Change-Id: Ia461a48c273af42293aafcf084e457adf03cbed3
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
dd0a3777bc Handle egl context
Added EGLContext functionality to emulator's accelerated EGL implementation.

Change-Id: Idde7d701808839f8d89c6c081a9f3216bdea7a52
2011-06-11 00:16:20 +03:00
Stas Gurtovoy
8a8c601c4f emulator opengl: Create and destroy Surfaces
Also fixed link failure.

Change-Id: I4cbe28b2d51a5d4e48c4cba72df64f9df0898da5
2011-06-11 00:15:19 +03:00
Stas Gurtovoy
37db3deb7b First commit of the system egl implementation.
At this point system/egl should build without errors

Change-Id: Ieabae930fc20a8df4f3d68f179d685401e946e74
2011-06-09 21:24:26 +03:00
David 'Digit' Turner
892a6306e7 emulator: opengl: Use QEMU pipe.
This patch modifies the guest libraries to use the new
fast qemu "opengles" pipe to communicate with the host
renderer process.

Note that the renderer is still listening on a TCP socket
on port 22468.

Change-Id: I6ab84f972a8024e1fdababa4615d0650c8d461bf

Conflicts:

	tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
	tools/emulator/opengl/tests/gles_android_wrapper/ServerConnection.h
2011-05-03 16:21:12 +02:00
Jacky Romano
59ad4dfd2b emulator opengl: handle NULL pointers
glTexImage[2,3]D and glBufferData properly handle NULL pointer
parameter

Change-Id: If799d41966b700b8fae3e7a68cac5b3a488b0146
2011-05-03 16:04:34 +02:00
Jacky Romano
0c814b227c emulator opengl - encode glShaderSource
glShaderSource strings are concatenated into a single string
before sent over the wire protocol. The wire protocol transfer is
done using a special api call 'glShaderString'

Change-Id: I90c157df66fe82fee17c460a1e7852d370c77088
2011-05-03 15:25:25 +02:00
Jacky Romano
68e7ee63f5 opengl emulator - handle shader string decoding
Shader strings are sent over the wire protocal as one concatenated
string. a special api call - glShaderString is used to handle the
encoding and decoding of this string.

Change-Id: Id682763f35e9fcc6215559931db2112a4fa981a9
2011-05-03 15:15:25 +02:00
Jacky Romano
318ffd3798 Emulator Opengl - adding preliminary version of GLESv2 encoder
This preliminary version includes the API definition, and the
GL2Encoder implementation class

Change-Id: I7ef9cfeb98c1e85097287ab26733825087368ee0
2011-05-03 14:54:03 +02:00
Jacky Romano
254492ffd6 Add GLESv2 functionality to GLESv1/GLESv2 shared code
Extends GLClientState to support additional state data
that is required by GLESv2. this includes:
* normalized flag in vertex attribute arrays
* getter for vertex attribute arrays state
* glParamSize now knows about the result size of GL2 parameters
* utility functions required for a GLESv2 encoder

Change-Id: I7e57d978bed5b8b929b918aee66c7f71dc5df3b1
2011-05-02 18:23:13 +03:00
Jacky Romano
3c2aa9b931 Move utility functions into glUtils
Move utility functions into glUtils so they can be shared
between GLESv1 and GLESv2 codecs.

Change-Id: I673b316395604e4288412e7ace328076812d4cc1
2011-05-02 18:23:13 +03:00
Liran
fb06a28c30 GLESv1 extensions
This fix adds support for OpenGLES 1.1 extensions in the codec
layer. This fix also includes bug fixes in GLEncoder (client-state)
and gles android wrapper modules.

Change-Id: I512649724d43e4af9d3ce5d49ae66d9f4da0b823
2011-04-28 09:24:46 +03:00
Guy Zadikario
f7cd7ec421 emulator opengl: first commit of gralloc implementation.
This is the emulator opengl implementation of gralloc.

NOTE that it is currently build only if BUILD_EMULATOR_OPENGL_DRIVER
is defined, This is because the other driver peices (EGL/GLES) are
still missing.

Change-Id: If48f5ed619df6efb00cb4e590d99ce49d87875f6
2011-04-16 10:42:34 +03:00
Guy Zadikario
64db3f9a02 emulator opengl: OpenglSystemCommon library shared between gralloc/EGL/GLES.
This is a static library of utilities shared between the emulator opengl
system components, gralloc, EGL, GLES. In includes host connection functionality
and access to OpenGL TLS info.

Change-Id: Ic63a6f7384a2035308ca6d316c747f0e6c6f2ef3
2011-04-16 10:32:39 +03:00
Guy Zadikario
32fc922316 emulator opengl: renderControl API encoder/decoder
That adds the renderControl API encoder/decoder which is used for
guest to host control commands. See system/renderControl_enc/README
for more info about the API itself.

Change-Id: I2c72803137889d646fbb3d2a56ecdcf94b088f40
2011-04-13 13:33:26 +03:00
Guy Zadikario
caafd4df2e Moved IOStream.h to be used in external API for libOpenGLRender.
This change includes four changes:
1) moved IOStream.h into host/include/libOpenGLRender, this directory
   will include the api interface into the libOpenGLRender which will be
   used later by the emulator and we need this interface to use IOStream.h
2) Updated Andorid.mk files to include the new directory location of IOStream.h
   in the LOCAL_C_INCLUDE.
3) Added new function "read" to IOStream which reads a message without a givven
   size.
4) Updated TcpStream to use "cutils/sockets.h" instead of using directly the socket api for portability reasons. (It now compiles on windows as well).

Change-Id: I30eb40c8dcd5aacf0d993aff9cdb90b283b12dde
2011-04-13 13:33:05 +03:00
David Turner
e8c05eb11a Merge "fix handling pointers in emugen." 2011-04-05 05:59:55 -07:00
Liran
03c86416d5 fix handling pointers in emugen.
Moved 'isPointer' attribute from variable to type field.
The .types input file now includes new column specifying if a type is a pointer or not
previously emugen declared as pointer only types which included '*' character but did not
process well the case of 'char **' (pointer to pointer).

Fixed the gl.types and ut_rendercontrol.types accordingly.
Few other fixes to gl.attrib and gl.in.

Change-Id: Ifd3591119dfa504703c68556802a40e38fe4940e
2011-04-04 16:05:18 +03:00
Jacky Romano
81c015740c emulator opengl - directory rearrangment
Move system/OpenglCodecCommon into shared/OpenglCodecCommon so it's code
can be shared among more components of the project.

Move tests/ut_renderer/TimeUtils.* into a the common area

Annotate ErrLog.h and GLDecoderContextData.h with the project license statement

Change-Id: Ieea42e95edd5ad89fda4cfa40356a012304ee976
2011-04-04 12:20:49 +03:00
Jacky Romano
6a04b8afc5 Emulator opengl - Opengl ES 1.1 encoder
This change the opengl target side encoder library (libGLESv1_enc)
The library includes api definition files for 'emugen' code generation
tool and a serrounding code to handle opengl specific sematics (such as client state)
tracking

Change-Id: I8708b945c8c9c7fbe06147b703bdee27a576c7a0
2011-03-28 19:06:03 +02:00
Jacky Romano
c27986a3c2 Opengl implementation - codec common code
This change adds the libOpenglCodecCommon, which holds
shared code between the encoder and the decoder parts of the opengl
codec. The library is built as static with both a target version and
a host version.

Change-Id: I163eea8fdb635620e6cde9d1d75c3e7369953213
2011-03-28 19:01:49 +02:00