Commit Graph

15 Commits

Author SHA1 Message Date
Jesse Hall
56513f5ff4 Move emugl system code to development.git
Because of the way the SDK and Android system images are branched,
host code that goes into the SDK tools can't live in the same
repository as code that goes into the system image. This change keeps
the emugl host code in sdk.git/emulator/opengl while moving the emugl
system code to development.git/tools/emulator/opengl.

A few changes were made beyond simply cloning the directories:

(a) Makefiles were modified to only build the relevant components. Not
    doing so would break the build due to having multiple rule
    definitions.

(b) Protocol spec files were moved from the guest encoder directories
    to the host decoder directories. The decoder must support older
    versions of the protocol, but not newer versions, so it makes
    sense to keep the latest version of the protocol spec with the
    decoder.

(c) Along with that, the encoder is now built from checked in
    generated encoder source rather than directly from the protocol
    spec.  The generated code must be updated manually. This makes it
    possible to freeze the system encoder version without freezing the
    host decoder version, and also makes it very obvious when a
    protocol changes is happening that will require special
    backwards-compatibility support in the decoder/renderer.

(d) Host-only and system-only code were removed from the repository
    where they aren't used.

(e) README and DESIGN documents were updated to reflect this split.

No actual source code was changed due to the above.

Change-Id: I2c936101ea0405b372750d36ba0f01e84d719c43
2012-06-06 09:46:29 -07:00
Jesse Hall
80d4ba7716 Move emulator GLES from development.git to sdk.git
The emulator GLES support has two interfaces: a host shared library
interface used by QEMU, and a protocol between the platform and the
host. The host library interface is not versioned; QEMU and the GLES
renderer must match. The protocol on the other hand must be backwards
compatible: a new GLES renderer must support an older platform image.

Thus for branching purposes it makes more sense to put the GLES
renderer in sdk.git, which is branched along with qemu.git for SDK
releases. Platform images will be built against the protocol version
in the platform branch of sdk.git.

Change-Id: Ie73fce12815c9740e27d0f56caa53c6ceb3d30cc
2012-04-18 06:26:17 -07:00
Andrew Hsieh
9e3e95f65f am 76780669: Added rules to build 64-bit libraries for 64-bit emulator
* commit '76780669f9867587693563358ccdc903e9cdcbba':
  Added rules to build 64-bit libraries for 64-bit emulator
2012-03-22 13:27:43 -07:00
Jean-Baptiste Queru
40b67a0eb0 Merge 8aafafe4
Change-Id: I41f097b5b96c4d000b1748b9e0411497d323556a
2012-03-22 12:57:54 -07:00
Andrew Hsieh
76780669f9 Added rules to build 64-bit libraries for 64-bit emulator
All ten libraries can now be built in 64-bit named "lib64*" (*)
in addition to the original 32-bit form named "lib*".

Also, dlopen "lib64*so" in 64-bit.

(*) eg. In Ubuntu, all can be built with the following command:
  make out/host/linux-x86/lib/lib64OpenglRender.so \
       out/host/linux-x86/lib/lib64EGL_translator.so \
       out/host/linux-x86/lib/lib64GLES_CM_translator.so \
       out/host/linux-x86/lib/lib64GLES_V2_translator.so

Rules to build static libraries lib64log.a, lib64cutils.a and lib64utils.a
they depend were added in other CLs.

Change-Id: I3afb64de6dda1d55dbd1b4443d2dbc78a683b19f
2012-03-22 12:36:45 -07:00
Andrew Hsieh
8aafafe4bd Fixed crash and 64-bit porting issues
1. "emugen" generates four *dec.cpp files containing code like this
   to decode offset to pointer in stream

   tmp = *(T *)(ptr + 8 + 4 + 4 + 4 + *(size_t *)(ptr +8 + 4 + 4));

   If *dec.cpp are compiled in 64-bit, size_t is 8-byte and dereferencing of
   it is likley to get wild offset for dereferencing of *(T *) to crash the
   code.  Solution is to define tsize_t for "target size_t" instead
   of using host size_t.

2. Cast pointer to "uintptr_t" instead of "unsigned int" for 2nd param of
   ShareGroup::getGlobalName(NamedObjectType, ObjectLocalName/*64bit*/).
3. Instance of EGLSurface, EGLContext and EGLImageKHR are used as 32-bit
   key for std::map< unsigned int, * > SurfacesHndlMap, ContextsHndlMap,
   and ImagesHndlMap, respectively.  Cast pointer to uintptr_t and assert
   upper 32-bit is zero before passing to map::find().
4. Instance of GLeglImageOES is used to eglAttachEGLImage() which expect
   "unsigned int".  Cast it to uintptr_t and assert upper 32-bit is zero.
5. The 5th param to GLEScontext::setPointer is GLvoid* but contains 32-bit
   offset to vbo if bufferName exists.  Cast it to uintptr_t and assert
   upper 32-bit is zero.
6. Use %zu instead of %d to print size_t
7. Cast pointer to (uintptr_t) in many other places

Change-Id: Iba6e5bda08c43376db5b011e9d781481ee1f5a12
2012-03-22 11:10:31 -07:00
Jesse Hall
d6bd1843ce EmuGL: GLESv2 support for OES_EGL_image_external
Change-Id: I8911328d5dcccdf4731bd2d8fd953c12fdec5f1b
2012-02-22 15:03:30 -08:00
Jesse Hall
0e981c8304 EmuGL: Fix heap corruption
Off-by-two bug when removing textures from the tracking array could
overwrite malloc's mem chunk data structure, usually resulting in a
heap corruption abort on a later malloc/realloc/free.

Bug: 5951738
Change-Id: I11056bb62883373c2a3403f53899347ff8cdabf2
2012-02-03 22:54:24 -08:00
Jesse Hall
a592d9c043 EmuGL: misc small cleanups
* Disable verbose debug spam.
* Add missing GL enum to utility function. The default case was
  returning the correct size, so this doesn't fix any bugs, just
  removes some logcat spam.
* Comment and whitespace corrections.

Change-Id: I83fb8644331ae1072d6a8dae9c041da92073089f
2012-01-05 10:50:01 -08:00
Jesse Hall
3a655154d0 am af4f66be: EmuGL: implement OES_EGL_image_external for GLESv1
* commit 'af4f66be50b17c8b8fce1dda53389bb0a10968ba':
  EmuGL: implement OES_EGL_image_external for GLESv1
2011-11-22 15:43:26 -08:00
Jesse Hall
af4f66be50 EmuGL: implement OES_EGL_image_external for GLESv1
GLESv2 support will come in a followup change but will take advantage
of the GLClientState changes.

Change-Id: Ib6cbb4dafbd071e3b59b1e5d808b3e23656ada92
2011-11-21 13:47:49 -08:00
David 'Digit' Turner
0e205e6d6e emulator: opengl: minor fix and reformatting
This patches fixes a minor invalid usage of delete (instead of delete[])
and reformats the source code a little to make it more obvious.

Change-Id: If853d12e74549abcc6682430c837b0f14da81fdc
2011-10-19 17:54:20 +02:00
David 'Digit' Turner
894a63dd6e emulator: opengl: Add custom_write optimization to encoder.
This patch allows an auto-generated GLES encoder function to write
'isLarge' buffers with a custom writer, instead of calling stream->readFully()
directly.

This is intended to allow writing pixel or vertex data that is stored
with a specific stride.

Another patch will introduce the corresponding changes to the .attrib files

Change-Id: I6ca86b968cd3f4db91676bc485ee1e84419e50e0
2011-09-20 15:58:54 +02:00
David 'Digit' Turner
5d7f0875e9 emulator: opengl: 'large' buffer optimization
This patch modifies the guest encoding libraries to avoid
un-necessary copies when sending large buffers (e.g. pixels)
to the host. Instead, the data is sent directly through a
new IOStream method (writeFully()).

On my machine, this improves the NenaMark2 benchmark
(from 50.8 to 57.1 fps). More importantly, this speeds up
the display of non-GL surfaces too, which are sent through
the special rcUpdateColorBuffer() function in gralloc_goldfish.

This is noticeable in many parts of the UI (e.g. when scrolling
through lists).

To tag a given parameter, use the new 'isLarge' variable flag
in the protocol .attrib file.

Implemented for the following encoding functions:

  rcUpdateColorBuffer
  glTexSubImage2D
  glTexImage2Di
  glBufferData
  glBufferSubData
  glCompressedTexImage2D
  glCompressedTexSubImage2D
  glTexImage3DOES
  glTexSubImage3DOES
  glCompressedTexImage3DOES
  glCompressedTexSubImage3DOES

+ Optimize the auto-generated encoder functions to avoid
  repeated function calls (for size computations).

Change-Id: I13a02607b606c40cd05984cd2051b1f3424bc2d0
2011-09-20 15:58:54 +02:00
David 'Digit' Turner
4e6af749d5 emulator: opengl: Back-port GLES emulation from the master tree.
The modules here are only built when BUILD_EMULATOR_OPENGL is defined to true
in your environment or your BoardConfig.mk (see tools/emulator/opengl/Android.mk)

Change-Id: I5f32c35b4452fb5a7b4d5f9fc5870ec1da6032e6
2011-09-20 15:58:41 +02:00