Commit Graph

2596 Commits

Author SHA1 Message Date
Jesse Hall
735967c2e5 Merge "EmuGL: Deliver every frame to a callback" 2012-03-22 13:48:33 -07:00
Jesse Hall
08d643e5eb EmuGL: Deliver every frame to a callback
To enable multi-touch on a tethered device, allow a callback to be
registered with the OpenGL renderer. On every frame, the framebuffer
is read into system memory and provided to the callback, so it can be
mirrored to the device.

This change is co-dependent on Idae3b026d52ed8dd666cbcdc3f3af80175c90ad3
in external/qemu.

Change-Id: I03c49bc55ed9e66ffb59462333181f77e7e46035
2012-03-22 13:29:00 -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
Andrew Hsieh
206ea399b5 Refactor with ToTargetCompatibleHandle()
Refactor statements doing host-to-target handle conversion, eg.

   uintptr_t hndlptr = (uintptr_t)hostHandle;
   unsigned int hndl = (unsigned int)hndlptr;
   assert(sizeof(hndl) == sizeof(hndlptr) || hndl == hndlptr);

into a call to ToTargetCompatibleHandle()

Change-Id: I0bcfb37f1b50679d29e7f21fe230ad433fbbef7c
2012-03-22 01:27:44 +08:00
Vladimir Chtchetkine
c9d6edeea5 Change camera HAL to catch up with changes in emulator.
Emulator now allows fake camera to emulate both, back and front cameras at the same time.
Camera HAL is changed in this CL in order to support this.

Change-Id: I4dcf2d569bb0c6a3800b4a8da5edd4777b5a078a
2012-03-19 13:34:28 -07:00
Andrew Hsieh
129a0c2963 Merge "Added rules to build 64-bit libraries for 64-bit emulator" 2012-03-14 09:13:15 -07:00
Andrew Hsieh
a3f456f459 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-13 22:40:33 -07:00
James Dong
7803a1db5b Merge "Switched to use header files in /frameworks/native" 2012-03-13 12:44:43 -07:00
Andreas Huber
bd7ef3835c Merge "We're configuring media codecs dynamically now." 2012-03-13 09:01:32 -07:00
James Dong
27b71c7383 Switched to use header files in /frameworks/native
o related-to-bug: 6044887

Change-Id: Iea98db35e51aaf52063565818ecfea8a935693f3
2012-03-12 20:37:02 -07:00
Ed Heyl
35c941e726 Merge "Minor makefile tweak to compile with elfutils-0.138" 2012-03-09 09:48:10 -08:00
Mathias Agopian
cc3332aac7 remove dependency on apparently uneeded libs. might fix sdk build
Change-Id: I78cb49456ccf8bc6df3ebdd76ae63e0b0b6d7e4b
2012-03-08 21:02:36 -08:00
Ben Cheng
e35bfe51a1 Minor makefile tweak to compile with elfutils-0.138
Explicitly specify that this module is only built on linux-x86 and
darwin-x86

Change-Id: I2dba02b25c655af114417fc222a697e4d5294602
2012-03-08 16:14:35 -08:00
Derek Sollenberger
a96af3f6f8 am 3565ea1a: am 89e98da5: am a848b972: am 89b7a104: Merge "Add missing includes for threads.h"
* commit '3565ea1a6ecccc59839d883ee74fc4ba83f4ab02':
  Add missing includes for threads.h
2012-03-08 11:34:13 -08:00
Derek Sollenberger
89e98da5ac am a848b972: am 89b7a104: Merge "Add missing includes for threads.h"
* commit 'a848b97255a15d2ac75db1e367cc60ff46b77e20':
  Add missing includes for threads.h
2012-03-08 11:30:09 -08:00
Derek Sollenberger
a848b97255 am 89b7a104: Merge "Add missing includes for threads.h"
* commit '89b7a104d41c1ecbc1319a3d47199d40d56ebc96':
  Add missing includes for threads.h
2012-03-08 11:28:31 -08:00
Jesse Hall
cbd446a98a am 9322c5cb: Work around a y-invert bug on Macs w/ Intel GPU
* commit '9322c5cb2524c4f35408768ee3d1b8030f0360f9':
  Work around a y-invert bug on Macs w/ Intel GPU
2012-03-07 11:17:46 -08:00
Jesse Hall
1f4f50c7d2 am 767d0894: Delete dead code.
* commit '767d08948790527e9df951a752703938ff517d30':
  Delete dead code.
2012-03-07 11:17:45 -08:00
Jesse Hall
9322c5cb25 Work around a y-invert bug on Macs w/ Intel GPU
On Macs running OS X 10.6 and 10.7 with Intel HD Graphics 3000, some
screens or parts of the screen are displayed upside down. The exact
conditions/sequence that triggers this aren't known yet; I haven't
been able to reproduce it in a standalone test. This also means I
don't know whether it is a driver bug, or a bug in the OpenglRender or
Translator code that just happens to work elsewhere.

Thanks to zhiyuan.li@intel.com for a patch this change is based on.

Change-Id: I04823773818d3b587a6951be48e70b03804b33d0
2012-03-07 10:06:57 -08:00
Jesse Hall
767d089487 Delete dead code.
Change-Id: I5b87fac4e2140a903221a1f68b16fa6a96e5effc
2012-03-07 10:06:37 -08:00
Jesse Hall
a308d5ff8e Merge "Add/fix copyright notices" 2012-03-07 07:24:21 -08:00
Jesse Hall
f4a20e58aa Add/fix copyright notices
Several EmuGL files were missing copyright notices; added them. Others
had them but below other code, which makes checking for them more
difficult -- I moved these to the top of the file.

These files were all created by GraphTech as a work for hire for AOSP.

Change-Id: Iee67bcf1c9b54ad5aa8a9288ded0382a974c32cb
2012-03-06 16:13:03 -08:00
Jesse Hall
2478dfd351 Work around a y-invert bug on Macs w/ Intel GPU
On Macs running OS X 10.6 and 10.7 with Intel HD Graphics 3000, some
screens or parts of the screen are displayed upside down. The exact
conditions/sequence that triggers this aren't known yet; I haven't
been able to reproduce it in a standalone test. This also means I
don't know whether it is a driver bug, or a bug in the OpenglRender or
Translator code that just happens to work elsewhere.

Thanks to zhiyuan.li@intel.com for a patch this change is based on.

Change-Id: I04823773818d3b587a6951be48e70b03804b33d0
2012-03-06 16:09:06 -08:00
Jesse Hall
54934b06f1 Delete dead code.
Change-Id: I5b87fac4e2140a903221a1f68b16fa6a96e5effc
2012-03-06 16:09:06 -08:00
Derek Sollenberger
94548b6323 Add missing includes for threads.h
The missing headers were being transitively included through a
Skia header which is being removed.

Change-Id: I6a5b26c1f1bb3ed4c65e7e39fff3b927cb14eabf
2012-03-06 10:13:19 -05:00
Nick Kralevich
c7f0d89684 remove HAL_MODULE_INFO_SYM const
HAL_MODULE_INFO_SYM was declared as read-only, but
the struct is written to by libhardware.  This causes
a segfault when -Wl,-z,relro is enabled.

Fixed.

Change-Id: I3a3e8366bc2468aef75a3480edd0b3e8fcfeafa5
2012-03-01 17:06:37 -08:00
Andreas Huber
e01feb2d89 We're configuring media codecs dynamically now.
Change-Id: I55dcc3a9976f6db8f9fc10bf1b33068b1b26d339
2012-03-01 11:48:12 -08:00
Andrew Hsieh
bb6ee33b11 Merge "Fixed crash and 64-bit porting issues" 2012-02-29 16:29:01 -08:00
Andrew Hsieh
b100b6fd6a 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-02-29 15:54:06 -08:00
Jesse Hall
073e40031c resolved conflicts for merge of c765e79a to master
Change-Id: Id7018ac9f551ec8b224f030d8b04229ac2407a17
2012-02-27 14:12:32 -08:00
Jesse Hall
5333119e45 am a59610fa: am 9e016ede: am cbc7300c: EmuGL: enable SurfaceTexture async mode
* commit 'a59610fab6893530f15a9cfad8cdd97e4c5d578a':
  EmuGL: enable SurfaceTexture async mode
2012-02-27 14:00:23 -08:00
Jesse Hall
124d18041b am 7ef79e49: EmuGL: don\'t [de]queue buffers in eglMakeCurrent
* commit '7ef79e49c7e8f1ecf19a92114f41de39d102a3e8':
  EmuGL: don't [de]queue buffers in eglMakeCurrent
2012-02-27 13:55:39 -08:00
Jesse Hall
9e016ede09 am cbc7300c: EmuGL: enable SurfaceTexture async mode
* commit 'cbc7300cb209a4fd3b250546c72c35b7bb0aa8a1':
  EmuGL: enable SurfaceTexture async mode
2012-02-27 13:55:37 -08:00
Mathias Agopian
a3b1c78767 remove dependency on android_natives_priv.h
Change-Id: If06ea9aeb836d6ceb09745770956a25211f428d3
2012-02-24 18:04:51 -08:00
Jesse Hall
7ef79e49c7 EmuGL: don't [de]queue buffers in eglMakeCurrent
Whenever a surface was attached to a context, it was dequeing a new
buffer, and enqueing it when detached. This has the effect of doing a
SwapBuffers on detach/attach cycle, which is just wrong and
occasionally caused visible glitches (e.g. animations going backwards
for one frame). It also broke some SurfaceTexture tests which
(validly) depend on specific buffer production/consumption counts.

Change-Id: Ibd4761e8842871b79fd9edf52272900193cb672d
2012-02-24 15:54:59 -08:00
Jesse Hall
cbc7300cb2 EmuGL: enable SurfaceTexture async mode
Pass the swap interval from eglSwapInterval to the native window so it
can enable/disable SurfaceTexture's async mode. Fixes the deadlock in
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers.

Change-Id: I19bf69247341f5617223722df63d6c7f8cf389c6
2012-02-24 15:54:58 -08:00
Jesse Hall
f3c068c79a am bcd311ce: am 9cb15c9e: am 8bd39ae1: Merge "EmuGL: GLESv2 support for OES_EGL_image_external" into ics-mr1
* commit 'bcd311ce0b17d892f87d2e31741dc1873491d20f':
  EmuGL: GLESv2 support for OES_EGL_image_external
2012-02-24 12:11:52 -08:00
Jesse Hall
9cb15c9e81 am 8bd39ae1: Merge "EmuGL: GLESv2 support for OES_EGL_image_external" into ics-mr1
* commit '8bd39ae17caac6d275d785ce9420d7e643f15eb9':
  EmuGL: GLESv2 support for OES_EGL_image_external
2012-02-24 12:08:38 -08:00
Jesse Hall
72efa999d1 am ba8c8d15: am 66a386e3: am 00e61338: EmuGL: refinements to GLESv1 image_external
* commit 'ba8c8d1591a25b13047b24c10a1315ff178b2160':
  EmuGL: refinements to GLESv1 image_external
2012-02-23 12:25:49 -08:00
Jesse Hall
1d4fcce585 am 4660966b: am 144e1b59: am ac018fe3: EmuGL: refcount ColorBuffers on the host
* commit '4660966b791d8ea1be086a9ab0c58c672cca36ee':
  EmuGL: refcount ColorBuffers on the host
2012-02-23 12:25:47 -08:00
Jesse Hall
c2aa2cd77e am 2419e67b: am fc7a319e: am 91d4e8e1: GLESv2 translator: don\'t delete EGLImage textures
* commit '2419e67b07de7cdb7f502bb69634b23c147f899a':
  GLESv2 translator: don't delete EGLImage textures
2012-02-23 12:22:30 -08: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
66a386e33a am 00e61338: EmuGL: refinements to GLESv1 image_external
* commit '00e61338b8374de090e81537047846ca06f88280':
  EmuGL: refinements to GLESv1 image_external
2012-02-22 13:47:27 -08:00
Jesse Hall
144e1b5998 am ac018fe3: EmuGL: refcount ColorBuffers on the host
* commit 'ac018fe3f65e18083a2dd317f73e4139bfa5fee6':
  EmuGL: refcount ColorBuffers on the host
2012-02-22 13:45:42 -08:00
Jesse Hall
fc7a319e5c am 91d4e8e1: GLESv2 translator: don\'t delete EGLImage textures
* commit '91d4e8e195592dbc812441597118452f887ea07d':
  GLESv2 translator: don't delete EGLImage textures
2012-02-22 10:11:31 -08:00
Siva Velusamy
e7cb1c37e8 Merge "glesv2debugger: Remove obsolete files." 2012-02-22 10:10:11 -08:00
Jesse Hall
00e61338b8 EmuGL: refinements to GLESv1 image_external
* EGLImageTargetRenderbufferStorageOES was incorrectly accepting
  TEXTURE_EXTERNAL_OES as a target. Revert that; the host GL will
  correctly reject it with INVALID_ENUM.

* Handle the REQUIRED_TEXTURE_IMAGE_UNITS_OES texparameter query.

* Validate texture parameters set on TEXTURE_EXTERNAL textures;
  otherwise invalid parameters would work on the emulator but not on a
  real device.

Change-Id: I49a088608d58a9822f33e5916bd354eee3709127
2012-02-21 11:13:20 -08:00