OSDN Git Service
Lingfeng Yang [Fri, 24 Jun 2016 02:06:28 +0000 (19:06 -0700)]
Fix 3Dmark crash - preserve more host connections
The CL
https://googleplex-android-review.git.corp.google.com/#/c/
1131769/
for killing host connections was too aggressive.
It incorrectly assumed that if eglInitialize was not called in the
current thread, it'd be treated as a gralloc-only connection.
It's perfectly possible to create a new thread,
not call eglInitialize, and call eglCreateContext instead,
which is within proper usage since after there is supposed
to be only one display per process.
This situation resulted in 3DMark crashing, because once the
connection is killed on a thread that is not actually gralloc-only,
all the state goes away and segfault is just a matter of time.
This CL makes it so that eglCreateContext / eglMakeCurrent
mark the connection as not gralloc only, preventing the
connection from being erroneously killed.
The behavior where no extra render threads are created
when opening recents is still preserved.
(Cherry-pick from
ebff5363850076de2623b6f6a0ff035ea3e823d5)
Change-Id: I20a204aefca91e5ac8f6b097d9fcd799f6b02583
Surendra Vispute [Fri, 24 Jun 2016 00:24:14 +0000 (17:24 -0700)]
Merge opengl/ from device/generic/goldfish to /
Yahan Zhou [Wed, 22 Jun 2016 23:13:17 +0000 (23:13 +0000)]
Merge "Fix glTexSubImage2D" into mnc-emu-dev
Yahan Zhou [Wed, 22 Jun 2016 22:36:04 +0000 (15:36 -0700)]
Fix glTexSubImage2D
This is to port
https://googleplex-android-review.git.corp.google.com/#/c/
1145109
into mnc
Change-Id: Ic53c1181ab1c69fb33c5758034c0c4ec131b010e
Yahan Zhou [Wed, 22 Jun 2016 22:26:08 +0000 (15:26 -0700)]
Fix build scripts for klp
The previous build script makes klp fail to boot. This patch fixes it.
Change-Id: I091fdd29ef3f37d10d5f56c81e9ba17618214ebf
Yahan Zhou [Sat, 18 Jun 2016 00:40:14 +0000 (17:40 -0700)]
Make build script compatible with klp and up
It gets rid of c++11 and makes build script compatible with klp and up.
It also includes GL headers here, because headers in framework/native
might be different across API levels.
Change-Id: Ida425416a392cef878256965d69b54afe42b7263
Bill Rassieur [Mon, 20 Jun 2016 22:30:41 +0000 (15:30 -0700)]
Initial empty repository
Yahan Zhou [Mon, 20 Jun 2016 19:58:05 +0000 (19:58 +0000)]
Merge "Fix EGL cleanup code for CTS android.nativeopengl" into mnc-emu-dev
Yahan Zhou [Fri, 10 Jun 2016 00:54:34 +0000 (17:54 -0700)]
Fix EGL cleanup code for CTS android.nativeopengl
In CTS, android.nativeopengl.EGLCleanupTest tries to repeatatively
create and destroy egl context for 1000 times to check for memory leaks.
This patch releases resources when destroying contexts.
It turns android.nativeopengl.EGLCleanupTest from failure to flaky,
because of two other issue:
(1) There is a 1 min timeout in the test:
cts/tools/tradefed-host/src/com/android/cts/tradefed/testtype/
WrappedGTest.java
Our emulator can barely finish it within 1 min.
(2) There is another bug that may trigger UI rendering events after the
test begun, which crashes randomly because this test releases rendering
resources. It needs to be fixed in another patch.
Change-Id: Id285f526149638c63eb78c167c7d2daef7bd2412
Yahan Zhou [Mon, 20 Jun 2016 16:58:21 +0000 (16:58 +0000)]
Merge "Regenerate gl encoder from qemu" into mnc-emu-dev
Yahan Zhou [Fri, 17 Jun 2016 22:06:37 +0000 (15:06 -0700)]
Regenerate gl encoder from qemu
Regenerated from:
https://android-review.googlesource.com/#/c/237292/
Change-Id: I7972c4fddfb9765af39856ccd8aa29ac67558301
Lingfeng Yang [Mon, 13 Jun 2016 15:39:28 +0000 (08:39 -0700)]
Don't leave gralloc-only host connections hanging.
bug:
29318455
Memory leaks are becoming more of a problem, especially
with host machines that don't have much RAM and when
we use the emulator for long periods of time.
This CL fixes the problem detailed in the bug link,
which is that the number of render threads
(and thus thread-specific storage) skyrockets when
repeatedly pressing the Recents button while an app is active.
The thing is that there are lots of threads
that never use the EGL display, just gralloc, in order
to do gralloc things like update the screenshot display
of apps in recents.
These threads are not cleaned up because a thread pool
is often used to manage these sorts of tasks.
If a new or different thread suddenly wants to update
the recents screenshots through gralloc, a new connection
will be established.
This CL uses gralloc_unregister_buffer as a signal
for when a thread might be done with gralloc in general,
exiting the host connection immediately.
Of course, there may be other things that the thread wants
to do, but then it can just go ahead and create a new connection.
We also use the heuristic that we do not exit on gralloc_unregister_buffer
when the thread seems to be a bona fide rendering thread
(eglInitialize has been called).
There are still more leaks going on, this fixes just
one source of them.
After this CL, the render thread count should be held constant
when repeatedly starting apps and going to recents.
Change-Id: I5f57539429f149e3a938467e3b82fa911ab118c3
Bjoern Johansson [Mon, 13 Jun 2016 23:09:20 +0000 (16:09 -0700)]
Use correct format when reading color buffers
When reading back data from color buffers on the host make sure gralloc
uses the correct format and type parameters. Previously it was hardcoded
based on RGBA at 8 bits per component which would cause incorrect reads
for other pixel formats. This could cause QEMU pipe reads to call abort
because the reads went past a page boundary if the calculated size
exceeded the actual buffer size.
Change-Id: Ifa61f0a97d79577744b899b1bbb4120a0b9170eb
Yahan Zhou [Mon, 6 Jun 2016 19:42:17 +0000 (19:42 +0000)]
Merge "Move stream->flush to non-generated code" into mnc-emu-dev
Yahan Zhou [Mon, 6 Jun 2016 19:30:39 +0000 (12:30 -0700)]
Move stream->flush to non-generated code
Move flush command out of auto-generated code.
Change-Id: I3f3c8ca49344ea4c5357d7d6953364ce1015ea99
Yahan Zhou [Mon, 6 Jun 2016 17:51:45 +0000 (17:51 +0000)]
Merge "[cherry-pick] Lose HAVE_ANDROID_OS in goldfish." into mnc-emu-dev
Yahan Zhou [Thu, 2 Jun 2016 00:24:28 +0000 (17:24 -0700)]
Check vertex buffer size before glDraw*
This patch verifies if a vertex buffer is big enough before calling
glDraw*. It fixes crashes when trying to index outside of vertex buffer.
It should make it less crashy in glDrawElements and glDrawArrays:
https://code.google.com/p/android/issues/detail?id=207284
Change-Id: I36f0f568d96b576f0e0975435d2d7fd41cd9e732
Elliott Hughes [Wed, 12 Aug 2015 21:30:38 +0000 (14:30 -0700)]
[cherry-pick] Lose HAVE_ANDROID_OS in goldfish.
cherry pick from:
https://android-review.googlesource.com/#/c/166427
Change-Id: Id626aee8d65e0ded543ac12416c37f938d196676
Yahan Zhou [Wed, 1 Jun 2016 19:49:39 +0000 (12:49 -0700)]
Fix mnc build
Missing a bracket when cherry-pick.
Change-Id: I5202bf4dc5c64cb4663fdcadcbf6704272708b42
Lizhe Liu [Wed, 27 May 2015 03:13:23 +0000 (11:13 +0800)]
[cherry-pick] Optimize glGetIntegerv to reduce the cost of translating
Hardware GLES emulation in the Android platform is implemented
with a mix of components. Translator module is one of the most
important components in emulator. It translate the function
calls into calls to the appropriate desktop APIs and cost lots
of reference to complete it. So optimization must be beneficial
to us. GL_MAX_CUBE_MAP_TEXTURE_SIZE, GL_MAX_RENDERBUFFER_SIZE
and GL_MAX_TEXTURE_SIZE are the rough estimate value of the
largest texture which the OPENGL can handle. All of them are
constant value. So there is no need for us to translate them
from guest os to host os every time. We can cache the value
after first time and reuse it next time.
Cherry-pick from:
https://android-review.googlesource.com/#/c/151899
Change-Id: I1a0352c40b667bafd6ec1fb66a8060d7fe4a415d
Signed-off-by: Lizhe Liu <lizhe.liu@intel.com>
Yahan Zhou [Wed, 1 Jun 2016 17:38:02 +0000 (17:38 +0000)]
Merge "[cherry-pick] opengl: GLEncoder: Fix potential array buffer misbinding" into mnc-emu-dev
Yu Ning [Wed, 19 Aug 2015 07:22:13 +0000 (15:22 +0800)]
[cherry-pick] opengl: GLEncoder: Fix potential array buffer misbinding
When encoding a glDrawElements() or glDrawArrays() call, the encoder
needs to figure out whether each array (e.g. vertex, color, etc.) uses
a bound buffer or not. It is possible that some arrays use bound buffers
while others immediate buffers. In this case, there is a chance that the
encoder fails to preserve the semantics of the input GLES calls,
resulting in misinterpretation by the translator that all arrays use
bound buffers.
Fix this by encoding an unbind operation before any glXXXPointer() call
that does not mean to use a bound buffer. For GLESv2, that is already
done:
40a674e Fix emulator crashes on glDrawElements command
This CL does the same for GLESv1.
Cherry-pick from:
https://android-review.googlesource.com/#/c/167443/
Change-Id: Ifd17321b124a4f4b1037a43d5a54094541d367f1
Signed-off-by: Yu Ning <yu.ning@intel.com>
Lingfeng Yang [Wed, 25 May 2016 15:31:06 +0000 (08:31 -0700)]
Don't optimize out rcUpdateColorBuffer
bug:
28406160
If we want to use rcUpdateColorBuffer to
synchronize on the host in order to remove
out of order webcam frames, we need to call it
if (cb->hostHandle), not just when
the width and height are nonzero.
Otherwise, we get deadlocks.
Change-Id: Ib98774b935e8786e307dd38711a0f2f9ffea440e
Lingfeng Yang [Fri, 27 May 2016 00:32:31 +0000 (00:32 +0000)]
Merge "Save a few glBindBuffer calls" into mnc-emu-dev
Lingfeng Yang [Thu, 26 May 2016 21:18:33 +0000 (14:18 -0700)]
Save a few glBindBuffer calls
When sending vertex attributes, we only need to
bind the context-wide GLClientState's VBO
if a particular vertex attrib state is enabled.
This CL makes it so we call glBindBuffer only if
the currently bound vbo changes, in many cases
completely eliminating extra glBindBuffer calls
in sendVertexAttributes. Each extra glBindBuffer
call takes a few microseconds.
Change-Id: I04de3be0114ec6df10e67bc801b6d089bf5096db
Lingfeng Yang [Mon, 23 May 2016 19:16:04 +0000 (12:16 -0700)]
Refactor GL extension getting part in checksum setup.
Change-Id: Ieb26ce5682a87821935a5b639e5242942d13ac21
Adam Buchbinder [Fri, 20 May 2016 22:25:59 +0000 (15:25 -0700)]
Fix memory-handling issues in the OpenGL code.
This fixes the folloiwng cppcheck reports:
[device/generic/goldfish/opengl/system/GLESv2_enc/GL2Encoder.cpp:789]:
(error) Mismatching allocation and deallocation: str
[device/generic/goldfish/opengl/system/GLESv2_enc/GL2Encoder.cpp:795]:
(error) Mismatching allocation and deallocation: str
[device/generic/goldfish/opengl/tests/gles_android_wrapper/egl.cpp:492]:
(error) Mismatching allocation and deallocation: attrib
Change-Id: Iaf494eca1b927b2fa4b91f01ba340746b9da9bd3
(cherry picked from commit
3375e5e21450b78daf109225707d574976b7ec1c)
Yahan Zhou [Tue, 17 May 2016 16:56:04 +0000 (16:56 +0000)]
Merge "Sends tex coord only when the texture is enabled in gles1" into mnc-emu-dev
Yahan Zhou [Mon, 16 May 2016 23:23:22 +0000 (16:23 -0700)]
Sends tex coord only when the texture is enabled in gles1
Only send tex coord if the corresponding texture unit is enabled.
This is to prevent a crash in An3DBench:
https://b.corp.google.com/issues/
9631994
Change-Id: I23ae030adba3a3fa05e00f63c96040b439b86baf
Bjoern Johansson [Thu, 12 May 2016 17:38:27 +0000 (10:38 -0700)]
Create and read color buffer when expecting reads
Make sure color buffers are created when gralloc is allocating buffers
that indicate that software reads are going to happen. In this case
software will require the rendered data to be available from the host at
a later point and that means that rendering has to be stored in a color
buffer. Also make sure that when gralloc locks a buffer for reading it
will actually read the data from the host if the buffer is marked for
reading.
Change-Id: Ief4b7fe34401727cabec9fdd5c2b9812a6c49612
Yahan Zhou [Wed, 11 May 2016 23:04:02 +0000 (23:04 +0000)]
Merge "Cleanup debugging code in a previous CL" into mnc-emu-dev
Yahan Zhou [Wed, 11 May 2016 22:54:56 +0000 (15:54 -0700)]
Cleanup debugging code in a previous CL
Clean up my logs.
Change-Id: Ia447994af03358964bb39330824e8da8eeebf08b
Yahan Zhou [Wed, 11 May 2016 22:34:26 +0000 (22:34 +0000)]
Merge "Add framebuffer checks to pass dEQP" into mnc-emu-dev
Yahan Zhou [Wed, 11 May 2016 22:06:34 +0000 (15:06 -0700)]
Add framebuffer checks to pass dEQP
They are defined in GLES3 compatible context, but used in dEQP-GLES2
tests. So we need to enable them.
Should be used with this CL in the host:
https://android-review.googlesource.com/#/c/229251
dEQP-GLES2.functional.fbo.completeness.renderable failures 21->0
Change-Id: Ieacbbcc4afa688711c4d090971036505a74cc1ab
Yahan Zhou [Wed, 11 May 2016 17:54:59 +0000 (17:54 +0000)]
Merge "Allow rgb10_a2 internal format in renderbuffer" into mnc-emu-dev
Yahan Zhou [Wed, 11 May 2016 17:45:31 +0000 (10:45 -0700)]
Allow rgb10_a2 internal format in renderbuffer
dEQP-GLES2.functional.fbo.completeness.renderable.renderbuffer failures
3->0.
Change-Id: If5b94f5b1edc182ec5ccf2bd3321306a826e757e
Yahan Zhou [Mon, 9 May 2016 16:48:23 +0000 (16:48 +0000)]
Merge "eglCreateContext returns error code when taking wrong attributes" into mnc-emu-dev
Yahan Zhou [Thu, 5 May 2016 01:10:46 +0000 (18:10 -0700)]
eglCreateContext returns error code when taking wrong attributes
CTS.android.nativeopengl.EGLCreateContextTest fail -> pass
Change-Id: Iec95f568b65cd60cd78cc5eb80ce3ff0d1ae1731
Lingfeng Yang [Wed, 4 May 2016 16:12:53 +0000 (16:12 +0000)]
Merge "Flush draw calls" into mnc-emu-dev
Lingfeng Yang [Mon, 2 May 2016 17:47:00 +0000 (10:47 -0700)]
Flush draw calls
Increases Antutu Garden performance by 2-4 FPS,
depending on if host renderthread uses lock
(faster if no lock)
The idea is that if the draw calls are not flushed,
they may be called too late on the host,
resulting in lower performance:
the GPU is just sitting idly between pipe flushes
for more instructions.
Change-Id: I78e278fc9b30b4a135b48f56d912b6aba8aadea7
Evan Birenbaum [Thu, 28 Apr 2016 21:07:02 +0000 (21:07 +0000)]
Merge "FBO completeness check in glDrawElements." into mnc-emu-dev
Evan Birenbaum [Thu, 28 Apr 2016 19:47:57 +0000 (12:47 -0700)]
FBO completeness check in glDrawElements.
dEQP-GLES2.functional.negative_api.vertex_array.*:
3 Fail -> 0 Fail
The host framebuffer (not the guest state) is not complete in these
tests, so a call to the host glCheckFramebufferStatus is needed to
confirm that. The cached state is unreliable, since things may have
changed since the last guest call to glCheckFramebufferStatus.
Change-Id: I2cf026129c871df68b328949e9c79b3f5df590eb
Yahan Zhou [Thu, 28 Apr 2016 18:19:12 +0000 (18:19 +0000)]
Merge "glActiveTexture should set GL_INVALID_ENUM when taking wrong input" into mnc-emu-dev
Lingfeng Yang [Mon, 25 Apr 2016 16:39:43 +0000 (16:39 +0000)]
Merge "Stricter FBO completeness checks" into mnc-emu-dev
Lingfeng Yang [Mon, 25 Apr 2016 16:39:36 +0000 (16:39 +0000)]
Merge "Validate presence of framebuffer attachment's object" into mnc-emu-dev
Yahan Zhou [Wed, 20 Apr 2016 23:02:10 +0000 (16:02 -0700)]
Support glDrawElements with GL_UNSIGNED_INT again
This is defined in GLES2 extension.
Change-Id: Id6ac22bb207a88ebb13282c443c0bc990f25cdf3
Yahan Zhou [Tue, 12 Apr 2016 17:02:38 +0000 (10:02 -0700)]
Workaround: disable checksum for a problem in glTexSubImage2D
This is a temporary workaround for a problem in glTexSubImage2D. It
disables the GL checksum to avoid crashes. Please revert this CL when
the root cause is solved.
Change-Id: I8401449e42da87f580f119982a1bcb1b6b9a4c8b
(cherry picked from commit
c1a6ab7b5ce1e23cf65a8e936860bcea879b6eef)
Lingfeng Yang [Tue, 12 Apr 2016 16:29:11 +0000 (09:29 -0700)]
Stricter FBO completeness checks
dEQP-GLES2.functional.fbo.completeness.*:
39 Fail -> 0 Fail
Based on similar logic in Swiftshader's libGLESv2/libGLESv2.cpp
Also cache the result of glCheckFramebufferStatus,
if already called from somewhere else.
Change-Id: I3fb42dd6902cfce4043d08fd459a7069ef491f7e
Lingfeng Yang [Fri, 8 Apr 2016 21:42:34 +0000 (14:42 -0700)]
Validate presence of framebuffer attachment's object
dEQP-GLES2.functional.negative_api.state.get_framebuffer_attachment_parameteriv
Fail -> Pass
dEQP-GLES2.functional.fbo.api.attachment_query_empty_fbo
Fail -> Pass
Track texture and renderbuffer object associations to
framebuffer attachment points.
Change-Id: Iff646bc57ef0202105768123cfa99384f37b01a3
Evan Birenbaum [Fri, 15 Apr 2016 22:03:51 +0000 (22:03 +0000)]
Merge "Sanity checks in vertex array functions." into mnc-emu-dev
Evan Birenbaum [Wed, 13 Apr 2016 19:53:09 +0000 (12:53 -0700)]
Sanity checks in vertex array functions.
dEQP-GLES2.functional.negative_api.vertex_array.*:
6 Fail -> 3 Fail.
dEQP-GLES2.functional.rasterization.*:
1 Fail -> 0 Fail.
The remaining vertex array failures will be fixed using some of
Frank's framebuffer status code.
Change-Id: Id8623029180beb6e792a3250763f08c4a03c7499
Lingfeng Yang [Fri, 15 Apr 2016 19:23:55 +0000 (12:23 -0700)]
Send glDrawArrays even if there is no vertex array
The spec says that if there are no arrays,
vertex attributes are to be used next.
dEQP-GLES2.functional.draw.random.50
Fail -> Pass
Change-Id: I81ab0bcac1c483436f8930212159a5079fe7b725
Lingfeng Yang [Fri, 8 Apr 2016 19:46:42 +0000 (12:46 -0700)]
Validation for glGetVertexAttribPointerv
dEQP-GLES2.functional.negative_api.state.get_vertex_attrib_pointerv
Fail -> Pass
Based on Intel's OpenGL validation for goldfish opengl,
introduced in nyc-dev
Change-Id: If67192368935f21de20c0f531036db027b867b37
Lingfeng Yang [Fri, 8 Apr 2016 19:38:35 +0000 (12:38 -0700)]
Validation for glGetVertexAttrib i/f v
dEQP-GLES2.functional.negative_api.state.get_vertex_attrib i/f v:
Fail -> Pass
Based on Intel's OpenGL validation for goldfish opengl,
introduced in nyc-dev
Change-Id: I9b539024e88a5afb7c78f8543e7c9ffff4f837e0
Lingfeng Yang [Fri, 8 Apr 2016 19:21:13 +0000 (12:21 -0700)]
Validation for glGetUniform i/f v
dEQP-GLES2.functional.negative_api.state.get_string:
Fail -> Pass
Based on Intel's OpenGL validation for goldfish opengl,
introduced in nyc-dev
Change-Id: I9c3b820a5fa6b3b3e4b5e8590cca590cf9ef86d2
Lingfeng Yang [Fri, 8 Apr 2016 19:13:45 +0000 (12:13 -0700)]
Validation for glGetString
dEQP-GLES2.functional.negative_api.state.get_string:
Fail -> Pass
Based on Intel's OpenGL validation for goldfish opengl,
introduced in nyc-dev
Change-Id: I74c480cf38a01e9c13f35ee3f58168415f7b6ab3
Lingfeng Yang [Mon, 4 Apr 2016 16:26:19 +0000 (09:26 -0700)]
More gracefulness on dequeueBuffer_* fail on flip
BUG: https://code.google.com/p/android/issues/detail?id=204176
Features like Instant Run will do things like abandon
the current set of buffers SurfaceFlinger gave to the UI,
which makes functions like eglSwapBuffers fail,
since they are dequeueing a buffer that is considered 'invalid'
(as it is before the instant run).
If we set the EGL error to EGL_BAD_ALLOC, this interacts badly
with libs/hwui/renderthread/EGLManager.cpp, causing
a LOG_ALWAYS_FATAL(...) to be called, which aborts the current process.
This CL sets the EGL error to EGL_BAD_SURFACE instead,
which allows hwui to recover.
Change-Id: I7cb5bf3b3834b3696981746f2319804c1adf6a25
Yahan Zhou [Mon, 21 Mar 2016 23:17:53 +0000 (23:17 +0000)]
Merge "Fix a typo in GLES encoder headers" into mnc-emu-dev
Yahan Zhou [Mon, 21 Mar 2016 23:11:38 +0000 (16:11 -0700)]
Fix a typo in GLES encoder headers
Unimportant but let's fix it.
Change-Id: I360ba0dc0b676238adaeb5d4360c10a9ec8c2371
Yahan Zhou [Fri, 18 Mar 2016 21:25:44 +0000 (21:25 +0000)]
Merge "Exit when QemuPipe is corrupted by GL" into mnc-emu-dev
Yahan Zhou [Wed, 16 Mar 2016 19:41:08 +0000 (12:41 -0700)]
Checksum for GLES messages from host to guest
Add checksum for GLES messages from host to guest. This patch contains
generated code (gl_enc.cpp, gl2_enc.cpp, renderControl_enc.cpp) and
shared code with the host (ChecksumCalculator.cpp,
ChecksumCalculator.h).
Change-Id: I577a34cae5208d3f11a165f861a69fa0971cf864
Yahan Zhou [Thu, 10 Mar 2016 19:45:02 +0000 (11:45 -0800)]
Checksum for GL pipe communication
This is the guest side implementation for cl go/oag/c/207292.
It initializes checksum whenever a renderControl is created. Each
HostConnection owns a checksum structure.
The list contains mostly auto-generated code by emugen.
Change-Id: I5f7bb9ec8a0cea82f3687f8a15839081651fd841
Yahan Zhou [Tue, 8 Mar 2016 22:02:22 +0000 (14:02 -0800)]
Exit when QemuPipe is corrupted by GL
Previously when QemuPipe is corrupted, it prints an error message, and
the application will continue to use it, which leads to random behaviour
in GL on the host.
This patch crashes the APP and pops up the crash dialog when the pipe is
(going to be) corrupted. It would happen if the user asks GL to write /
read a NULL pointer (i.e. passing NULL to glGenBuffers). It might also
happen for other unknown reasons.
Change-Id: I303772029bb72a845fa0d4c79b0d38dba1fca2c7
Lingfeng Yang [Wed, 2 Mar 2016 05:27:49 +0000 (21:27 -0800)]
Cache glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, int*).
BUG: https://buganizer.corp.google.com/issues/
27418143
If we don't, the chatter over the pipe will
kill framerate.
I believe this is OK for the emulator,
as the parameter is dependent on only the
GPU hardware.
Change-Id: I9bd74de6317316902bddf54b915ef509625cee52
Yahan Zhou [Tue, 1 Mar 2016 20:03:48 +0000 (12:03 -0800)]
glActiveTexture should set GL_INVALID_ENUM when taking wrong input
The GL spec says it generates GL_INVALID_ENUM if taking a wrong input.
Currently it generates GL_INVALID_OPERATION which is not the expected
error code.
Change-Id: I3313ad49130651d0358dbd3bdeb67b7e2d4fd5d9
Yahan Zhou [Fri, 19 Feb 2016 21:59:34 +0000 (13:59 -0800)]
GL encoder null pointer check before write
Previously when encoding some functions, if the user gives us a null
pointer, the encoder will write a header with some data length while not
actually writing any data. This patch fix it by writing 0 into the data
length field for all those functions.
The changed functions include:
glBufferSubData
glCompressedSubTexImage2D
glTexSubImage3DOES
glCompressedTexImage3DOES
glCompressedTexSubImage3DOES
Other functions do not directly write user's pointer, so they don't need
to be updated.
Since this is auto-generated code, there would be another patch in
emu-master-dev to update the code generator.
Change-Id: I05fca078dfcf01e20fa757f1050820b21ca080b7
Yahan Zhou [Thu, 11 Feb 2016 00:10:46 +0000 (16:10 -0800)]
Fix crash when forgot to call glVertexAttribPointer
Calling glDraw* will crash the emulatorif one forgot to call
glVertexAttribPointer first. This patch fixes it.
There are two situations: (1) user forgot to enable any vertex
attribute arrays, or (2) user enabled a vertex attribute array but
forgot to bind any data to it. This patch fix both situations. After the
patch, in (1) user will get an error message, in (2) user will get an
error message as well as GL error code GL_INVALID_OPERATION. These are
similar behaviors as running it in swift shader or on a real device.
(Running it on a real device with (1) will give nothing and with (2)
will crash the app.)
Change-Id: Id045c0c81a489a7c6ee4b6efc91f5ab148432f35
Yahan Zhou [Wed, 10 Feb 2016 01:42:33 +0000 (17:42 -0800)]
Support glDrawElements with GL_UNSIGNED_INT in the encoder
Currently glDrawElements with type GL_UNSIGNED_INT is not supported by
our encoder and decoder. The emulator will crash if someone uses it.
This patch add the support in the encoder side.
The related issue is here: b.android.com/200338
The patch on the decoder:
https://android-review.googlesource.com/#/c/202101
Change-Id: I9a6cde9983d34f39cfcc8c66a7ccf021dd5963eb
Yahan Zhou [Wed, 3 Feb 2016 22:03:43 +0000 (22:03 +0000)]
Merge "Fix the GLES version number in the emulator encoder" into mnc-emu-dev
Yahan Zhou [Fri, 29 Jan 2016 20:12:57 +0000 (12:12 -0800)]
Fix the GLES version number in the emulator encoder
The native code, emulator encoder and emulator decoder each keeps its
own GLES version number. Previously they are inconsistent when
EGL_CONTEXT_CLIENT_VERSION=3. In this patch, because our emulator
currently doesn't support GLES3, we return EGL_NO_CONTEXT with an
error code EGL_BAD_CONFIG when the user tries to use GLES 3.
In future when we impelment GLES3, please remmeber to change the
version number here, as well as those in native code and the emulator
decoder.
Release Note:
Report error code when setting up GLES3
Change-Id: I1d1083310d28bb57f42625daaed710711495a3ed
Lingfeng Yang [Sat, 30 Jan 2016 00:02:25 +0000 (16:02 -0800)]
Clean up minor opengl errors/warnings.
There are always disconcerting messages printed to logcat
whenever developing apps on the emulator.
glUtilsParamSize and other functions
often fail with "unknow param 0x00..."
These are missing GLenums and types that for
some reason are not in glUtils.cpp
in OpenglCodecCommon.
There also has been a long-standing warning
that eglSurfaceAttrib is not implemented.
It seems we don't need to implement that to get things done,
so we will give a no-op implementation that suppresses
the warning.
Change-Id: I1b672cedf1672fc09cfe6a832f908e1496cc7a46
Nicolas Capens [Thu, 10 Dec 2015 22:45:35 +0000 (17:45 -0500)]
Fix pedantic cast error (EGL).
Change-Id: I6afa419f6e2519c3293452f273a0cebac4c00b6f
Nicolas Capens [Thu, 10 Dec 2015 20:10:25 +0000 (15:10 -0500)]
Fix pedantic cast error (GLES1).
Change-Id: I74c2756cbf9190a1e2b9c30546bf60233e4ed543
Nicolas Capens [Thu, 10 Dec 2015 18:47:02 +0000 (13:47 -0500)]
Fix pedantic cast error.
Change-Id: I1d5bfbc17f4ed36774b8713af14d1c7a7177d3e5
Nicolas Capens [Fri, 20 Nov 2015 20:10:09 +0000 (15:10 -0500)]
Advertise EGL_KHR_gl_texture_2d_image
EGL_KHR_gl_texture_2d_image must be supported unconditionally.
Bug
24517776
Change-Id: Ib1e4fc549ceee2291b2313dc46ae7c9c1159e4c9
Nicolas Capens [Mon, 23 Nov 2015 22:13:00 +0000 (17:13 -0500)]
Create EGL image targets from client objects.
Bug
24517776
Change-Id: I90c724e8c882c8686391d5cfb7a6e1977edbaf21
Nicolas Capens [Mon, 23 Nov 2015 22:03:18 +0000 (17:03 -0500)]
Create client object EGL images.
Call the host-side eglCreateImageKHR() implementation to create EGL
images from client objects (e.g. textures).
Bug
24517776
Change-Id: I9bea7cfad700d601d3b747576f903ece7789e7d9
Nicolas Capens [Fri, 20 Nov 2015 16:16:34 +0000 (11:16 -0500)]
Discern between EGL image types.
EGL images can be created from an Android native buffer or a GL client
texture.
Bug
24517776
Change-Id: I3b77ec44ae9e630d7bb4aec87e2ec3957a2f3ab2
Nicolas Capens [Tue, 3 Nov 2015 17:24:12 +0000 (12:24 -0500)]
Use the encoding gralloc only when qemu.gles == 1
Bug
25443830
Change-Id: I2ccd60b4752e436117d65a2a3c7400c35bfaa3df
(cherry picked from commit
ea2243eda287d9ecd582e8c293c8abc2c06d3004)
Pascal Muetschard [Mon, 17 Aug 2015 20:09:57 +0000 (13:09 -0700)]
Implement a couple more surface attributes in eglQuerySurface.
Bug:
23036813
(cherry picked from commit
7c1d90fdcda89c2db9ae0b9af833c7d4e9eeab9c)
Change-Id: Idacdb8c3d63b7d7a2824e954c7455750008b2e9d
Pascal Muetschard [Mon, 17 Aug 2015 23:16:09 +0000 (16:16 -0700)]
Read the size of a window surface from the native buffer.
Currently the size of a window surface is incorrectly read from the native
window rather than the buffer associated with the created surface. With this
change, the surface size is initialized from the buffer and updated whenever
the buffer is swapped.
Bug:
23036813
(cherry picked from commit
3ef98877c4e06835a20e7050d03fa71e1a2d1ddb)
Change-Id: Ifdcdf7f84f74caab799ae3d1ef389eae7168ed21
Pascal Muetschard [Mon, 17 Aug 2015 19:22:07 +0000 (12:22 -0700)]
Handle pixel formats with 16bit and 32bit color channels.
When computing the OpenGL pixel format constant of an EGL surface,
return GL_RGB or GL_RGBA for EGL surfaces that have 16 or 32 bits
per color channel in addition to 8 bits.
Bug:
23036813
(cherry picked from commit
6e696c3bddbcd23dafb5fe6ba394afc4809ff049)
Change-Id: Ib560a8169e4e0c24e59d23f68137eba9926cfdb1
Pascal Muetschard [Mon, 17 Aug 2015 21:07:22 +0000 (14:07 -0700)]
Correctly set the surface type upon creation.
Fix the window and pbuffer surface creation to set the correct type
based on which function was called. Currently the type was
incorrectly set to the bitmask of all surface types supported by the
chosen config.
Bug:
23036813
(cherry picked from commit
21eaf2b62ac4daa5ba1a3b7c6fefe006b6631e41)
Change-Id: I7beaaa8cd55f44f5dc5f6e5d110132d810c06dc9
Pascal Muetschard [Fri, 14 Aug 2015 22:15:05 +0000 (15:15 -0700)]
Fixes interpretation of attribute lists in the EGL emulation library.
In a few places, EGL_NONE was incorrectly assumed to be 0. EGL_NONE is
used to indicate the end of the list. By assuming EGL_NONE is 0, the
code would fail to detect the end of the list appropriately.
Bug:
23036813
(cherry picked from commit
6801005a9e9e5741cbc73a98d7282485767d7e96)
Change-Id: I909d48a15a2cebfda93fb165e55821d7b694fa4b
Miroslav Tisma [Wed, 23 Sep 2015 10:54:56 +0000 (12:54 +0200)]
GPU: Build gralloc.ranchu.so
(cherry picked from commit
84a59f965e69afd90199668b2ba60431e7be3728)
Change-Id: Id0ee8a78830fdaa788c103d506510ba3d4ea36c2
Eino-Ville Talvala [Wed, 5 Aug 2015 22:43:30 +0000 (15:43 -0700)]
Camera/gralloc: Add basic capability handling, support DEPTH
Also fix bug with AE not correctly overriding sensor values
when ON but still INACTIVE.
- Add Y16 support to gralloc (treat exactly as RAW16)
- Add Y16 output support to camera
- Adds depth static and dynamic fields to camera:
- poseRotation
- poseTranslation
- intrinsicCalibration
- radialDistortion
- availableDepthStreamConfigurations
- availableDepthMinFrameDurations
- availableDepthStallDurations
- depthIsExclusive
Bug:
20537722
Change-Id: If64bb2a698a8a49777f848cfc6401d8fba299541
Yu Ning [Fri, 7 Aug 2015 21:30:07 +0000 (21:30 +0000)]
am
7edd1a22: (-s ours) am
4b7ce097: am
9fe34eba: am
34689229: (-s ours) am
02ef81b4: am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
7edd1a22bf31f23793b7f02e0ced9e7b7b748ed1':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:30:07 +0000 (21:30 +0000)]
am
e3d2c781: (-s ours) am
b3f8cad0: am
280ec983: am
b871b1a0: (-s ours) am
3f83b3fd: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
e3d2c781cc392b117fac57b77509dca893926f6e':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:30:07 +0000 (21:30 +0000)]
am
d2ddfd29: (-s ours) am
d88b2e76: am
ad5614a1: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
d2ddfd29876e1e58256204d72c9091558d2daaea':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:20:39 +0000 (21:20 +0000)]
am
4b7ce097: am
9fe34eba: am
34689229: (-s ours) am
02ef81b4: am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
4b7ce09787da9d0fe83886a9d108b5cf040f2244':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:20:38 +0000 (21:20 +0000)]
am
b3f8cad0: am
280ec983: am
b871b1a0: (-s ours) am
3f83b3fd: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
b3f8cad0747087e269bfe9fa9bf644a578d46f13':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:20:37 +0000 (21:20 +0000)]
am
d88b2e76: am
ad5614a1: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
d88b2e76f3c19a80477a7c2554760d20e8359fea':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:05:00 +0000 (21:05 +0000)]
am
9fe34eba: am
34689229: (-s ours) am
02ef81b4: am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
9fe34eba10fee82060545fdcbae94bbe75fcbb7d':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:05:00 +0000 (21:05 +0000)]
am
280ec983: am
b871b1a0: (-s ours) am
3f83b3fd: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
280ec983bf8036c82d02582e588faf92b4fbfa6a':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 21:04:59 +0000 (21:04 +0000)]
am
ad5614a1: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
ad5614a19c1307fd8e2d01c525990af47e648de5':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 19:06:37 +0000 (19:06 +0000)]
am
34689229: (-s ours) am
02ef81b4: am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
34689229db2be359644bc2c9e7246a47d5982bac':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 18:59:20 +0000 (18:59 +0000)]
am
02ef81b4: am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
02ef81b4c9e9e8db4bc4e797f879aab666fca9e6':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 18:55:01 +0000 (18:55 +0000)]
am
b871b1a0: (-s ours) am
3f83b3fd: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
b871b1a06e24cc8ce863a2ab5a8fb4a4dcc85e1d':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 18:47:49 +0000 (18:47 +0000)]
am
3f83b3fd: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
3f83b3fdc3c3b0926e4d2f56788a9becdb92200b':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
Yu Ning [Fri, 7 Aug 2015 18:46:47 +0000 (18:46 +0000)]
am
51af59bd: (-s ours) am
3840dbf5: DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
* commit '
51af59bd9c6f3d52ab48cc9099b99f071bbda5eb':
DO NOT MERGE opengl: Fix QemuPipeStream::readFully reading beyond end of buffer