Commit Graph

52489 Commits

Author SHA1 Message Date
Alistair Strachan 89301eaf21 Fix EGL shim extension injection for GL ES 3 drivers.
The Android EGL shim injects GL_EXT_debug_marker into the ES driver
EXTENSIONS string for the OpenGL ES 1.x and 2.0/3.0/3.1 drivers if
the extension is not already provided. This feature is used by
GLES_trace.

In Open GL ES 3.0 it became possible to query an indexed version of
the EXTENSIONS string via GetStringi(). NUM_EXTENSIONS Gets were
also added to the specification (taken from Open GL).

If the shim does not have to inject the extension, then there is no
problem, as glGetString() and glGetStringi() / NUM_EXTENSIONS will
be consistent. However, if the Android EGL shim injects the
extension, NUM_EXTENSIONS and GetStringi() will report one less
extension than is really available.

Consistency between these methods is tested by the dEQP framework
with the dEQP-GLES3.functional.state_query.string.extensions test.
If the driver does not provide GL_EXT_debug_marker, this test
fails.

This change wraps all of the affected entry points so that the
wrapped driver extensions are never visible directly to dEQP,
eliminating the inconsistency.
2015-05-28 15:34:31 -07:00
Dan Stoza f008799d37 SF: Skip render-to-texture for color transforms
In cases where SurfaceFlinger is applying a color matrix (usually for
accessibility features), we previously would perform a render-to-
texture for the initial composition, and then apply the matrix during
a copy to the framebuffer. This changes that behavior to just apply the
matrix during composition without a render-to-texture pass.

This may result in a perceived change of the image in cases with alpha
blending, since the blending is performed at a different stage of the
pipeline and the system effectively performs non-linear blends.
However, neither this nor the prior render-to-texture pass is strictly
correct in that regard, and this approach is less error-prone and
likely faster.

Change-Id: I2110ff0374f61d76df7b087dde8a1ed98990440c
2015-05-27 13:32:51 -07:00
Michael Lentine 7fc3ef0eb0 Merge "Add hotplug support for primary display." into mnc-dev 2015-05-27 17:39:59 +00:00
Dan Stoza 0e65e6c283 libgui: Fix surface damage on rotated buffers
Flips the width and height when the buffer comes in with a 90 degree
rotation so that performing the Y-flip from GL works correctly.

Bug: 20761426
Change-Id: I41c9edc8549c6cbdb534277b996ff20c59034582
2015-05-26 13:22:27 -07:00
Michael Lentine 20828e633d Merge "Fix surfaceflinger tests." into mnc-dev 2015-05-22 20:16:10 +00:00
Michael Lentine 01f9e920b0 Merge "Fix libgui tests." into mnc-dev 2015-05-22 20:16:01 +00:00
Michael Lentine 10613dc3b5 Add hotplug support for primary display.
When the primary is connected/disconnected on tv devices HWComposer updates
it's display parameters but doesn't destroy or recreate the display.

Bug: 18698244

Change-Id: I759c8f75d3e3a7462b85eb51973fb5072b71a702
2015-05-22 13:14:57 -07:00
Michael Lentine 5a16a62950 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
2015-05-22 13:14:57 -07:00
Michael Lentine d8ead0ccd4 Fix libgui tests.
Update IGraphicsBufferProducerTest to the new maximum enum value which is now
NATIVE_WINDOW_BUFFER_AGE. Update SurfaceTextureGLToGL_test to use the correct
counts for GraphicsBuffer refs.

Buf: 18138368

Change-Id: Ie2f7e00b414d63100b16944e3ab36b1ffceecd57
2015-05-22 13:14:57 -07:00
Chong Zhang 041b945e07 Merge "fix BufferItem flatten/unflatten alignment" into mnc-dev 2015-05-22 19:04:05 +00:00
Chong Zhang 47f674dfec fix BufferItem flatten/unflatten alignment
bug: 21370100
Change-Id: Ia3991dc591c176bdbd1d78d1804aa22777525b62
2015-05-22 10:54:25 -07:00
Adam Powell 217a04bab4 Merge "Adding round qualifier constant to native API." into mnc-dev 2015-05-18 21:30:27 +00:00
Michael Lentine 699a32bcdf Merge "Refactor ConsumerBase and it's derived classes." into mnc-dev 2015-05-18 21:29:39 +00:00
Michael Lentine 847f11e215 Refactor ConsumerBase and it's derived classes.
Move setDefaultBufferSize, setDefaultBufferFormat, and
setDefaultBufferDataSpace into ConsumerBase and remove them from
CpuConsumer and BufferItemConsumer.

Bug: 19977701

Change-Id: Ic68992464c5da6da7a41c4063a53029a69efcd1b
2015-05-18 14:29:18 -07:00
Elliott Hughes bfb1f1cc83 Don't use TEMP_FAILURE_RETRY on close in frameworks/native.
Bug: http://b/20501816
Change-Id: Id13a62f02243c6c4831e2f47944dc34fa822f5b6
(cherry picked from commit 997abb668b)
2015-05-15 17:26:44 -07:00
Adam Lesinski 7eb1459416 Adding round qualifier constant to native API.
Change-Id: I43e6c029412d0ed1d345c16fdce90e2879c52a8e
2015-05-15 14:58:28 -07:00
John Reck 2c237ee1d5 Fix async_stop
Change-Id: I68a258cf71cfcd999bbd568ab3c96255c11bec41
2015-05-15 10:00:34 -07:00
John Reck 3db36803b2 Merge "Add ConsumerBase::isAbandoned" into mnc-dev 2015-05-14 23:27:46 +00:00
John Reck e478305181 Add ConsumerBase::isAbandoned
Bug: 20105644
Change-Id: I21526b5397ea51a15500c44a99daa9d75fc4ea67
2015-05-14 15:55:11 -07:00
Dan Stoza 4794879186 Merge "SurfaceFlinger: Handle EGL errors more cleanly" into mnc-dev 2015-05-14 17:42:21 +00:00
Dan Stoza 65476f3332 SurfaceFlinger: Handle EGL errors more cleanly
Adds some more safety checking for cases where we get an error while
trying to create the EGLImage. The checking puts the Layer into a
failed state after detecting an error, since the shadow queue may no
longer be synchronized.

Bug: 20957332
Change-Id: I68b4c40eab3e58731b875ed5752f2c7d17f14bcb
2015-05-14 09:48:19 -07:00
Michael Lentine 51c8c502f6 Merge "Modify EGL to disconnect the window when the surface gets destroyed." into mnc-dev 2015-05-14 16:39:28 +00:00
Michael Wright 7c000280a5 Merge changes from topic 'button_actions' into mnc-dev
* changes:
  Fix input tests to work with new MotionEvent member
  Revert "Revert "Add new MotionEvent actions for button press and release.""
2015-05-14 15:31:21 +00:00
Michael Wright b03f103fd4 Fix input tests to work with new MotionEvent member
Change-Id: I0dde0f91f693903f26edc116b5dbcbf33bac2b93
2015-05-14 16:29:13 +01:00
Michael Wright 7b159c9a4f Revert "Revert "Add new MotionEvent actions for button press and release.""
This reverts commit 70b41ef580.
2015-05-14 14:48:03 +01:00
Michael Wright c921ce2681 Merge "Revert "Add new MotionEvent actions for button press and release."" into mnc-dev 2015-05-14 13:47:13 +00:00
Michael Wright 70b41ef580 Revert "Add new MotionEvent actions for button press and release."
This reverts commit 48a8a0e432.
2015-05-14 14:46:17 +01:00
Michael Wright f27e668104 Merge "Add new MotionEvent actions for button press and release." into mnc-dev 2015-05-14 13:31:25 +00:00
Michael Wright 48a8a0e432 Add new MotionEvent actions for button press and release.
Introduce ACTION_BUTTON_PRESS and ACTION_BUTTON_RELEASE as actions to
signal a button press or release. If these actions happen
simulanteously with a DOWN or UP event then they're explicitly
ordered to happen after the DOWN or preceding the UP in order to send
them to the most recently targeted view.

Also, introduce new stylus button constants that differ from the
constants we use for mouse buttons.

Bug: 20704355
Change-Id: Ib960a5004db5429ad2fc8db020704773e2978327
2015-05-14 13:25:41 +01:00
Michael Lentine 00699fa641 Modify EGL to disconnect the window when the surface gets destroyed.
Bug: 14445579

Change-Id: I1d263ff6cffcb6e448761fca7ca4b06466ad65aa
2015-05-13 15:41:41 -07:00
Dmitriy Ivanov af3a3778c2 Merge "Switch libGLESv1_CM/libGLESv2 to hash-style=both" into mnc-dev 2015-05-13 22:11:19 +00:00
Dmitriy Ivanov ae62e0573a Switch libGLESv1_CM/libGLESv2 to hash-style=both
Old version of unity uses custom linker to link
  itself and libmono. The custom linker does not
  support lookups with gnu-hash style. Switching
  libraries needed by libunity.so to --hash-style=both
  fixes this problem.

Bug: http://b/20093774
Change-Id: I2a4887cf7a5ee80a8976ecaad54b52dc62518e55
2015-05-13 15:05:07 -07:00
Hiroshi Yamauchi 6f48c7f3dc Merge "Replace JNI primitive array critical calls with non-critical ones." into mnc-dev 2015-05-13 18:37:57 +00:00
Michael Wright 4866f08718 Merge "Use previous pressure value if the current fusion data is zero." into mnc-dev 2015-05-13 16:56:07 +00:00
Michael Wright 4eed0f8f8d Merge "Synthesize events for pressure and button changes." into mnc-dev 2015-05-13 16:55:48 +00:00
Dan Stoza 09d561dbee Merge "Fix PTS handling for buffer replacement" into mnc-dev 2015-05-13 16:34:07 +00:00
Adam Lesinski 4b4820db4b Merge "Verify that the native handle was created" into mnc-dev 2015-05-13 03:38:36 +00:00
Adam Lesinski eaac99a717 Verify that the native handle was created
The inputs to native_handle_create can cause an overflowed allocation,
so check the return value of native_handle_create before accessing
the memory it returns.

Bug:19334482
Change-Id: I1f489382776c2a1390793a79dc27ea17baa9b2a2
2015-05-12 17:35:48 -07:00
Dan Stoza 48cb8310e2 Merge "libgui: Always allow allocation on connect" into mnc-dev 2015-05-12 21:57:28 +00:00
Dan Stoza 2b83cc920a libgui: Always allow allocation on connect
This change places BufferQueue into a predictable state where
allocation is allowed whenever a producer connects. This allows clients
to disconnect and reconnect without having to worry about being locked
out of allocation.

Bug: 20554276
Change-Id: Ic0f920a3d4204f2cafdfa69e46f3bb4204571d7e
2015-05-12 14:55:15 -07:00
Hiroshi Yamauchi 4e7de461c1 Replace JNI primitive array critical calls with non-critical ones.
The glgen part.

Bug: 19235243
Change-Id: I69dfa84f15366808b964517c1ba270ddeb3c5940
2015-05-12 14:24:23 -07:00
Dan Stoza a4650a50a0 Fix PTS handling for buffer replacement
This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
2015-05-12 13:10:17 -07:00
Aravind Akella af8ed3f06c Merge "Improve logging in SensorService dump output." into mnc-dev 2015-05-12 19:12:43 +00:00
Aravind Akella 444f267572 Improve logging in SensorService dump output.
Maintain a per sensor circular buffer of last 10 sensor_events and the wall clock time
at which each event is received.

Change-Id: Ia50c825ab5a7aaf0932ce7dce7ac8b9be7071e77
2015-05-12 11:44:01 -07:00
Jesse Hall 2a7dde5803 Merge "libEGL: whitelist the EGL_KHR_create_context_no_error extension" into mnc-dev 2015-05-12 17:31:25 +00:00
Jesse Hall 408e59f63a libEGL: whitelist the EGL_KHR_create_context_no_error extension
Allow EGL implementations to expose the
EGL_KHR_create_context_no_error extension if they wish.

https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_create_context_no_error.txt

Change-Id: I3290ccc2a69a1fa0b00ec3f1aa4f876906c64bfb
2015-05-12 08:42:05 -07:00
Michael Wright 53dca3aadd Use previous pressure value if the current fusion data is zero.
Occasionally we'll receive the stylus up signal (pressure = 0) before
we receive the touch screen up signal. Rather than giving pointer a
pressure value of 0 (which is one of the signals of hovering) or
falling back to the touchscreen pressure values (which would make for
an inconsistent stream), use the previous pressure value which should
always be non-zero for a stream of fused data.

Bug: 20449776
Change-Id: I71eb97e7c4ea53e42b0eb54fc1f8ae7f89aad9d1
2015-05-12 14:17:42 +01:00
Michael Wright 43fd19fd1a Synthesize events for pressure and button changes.
Even when there isn't movement on the touchscreen we should produce
events for pressure and button state changes generated by external
stylii.

Change-Id: I9fd7ba85902d5d6bfb28d5e5ff5d8f340a94c2bf
2015-05-12 14:08:47 +01:00
Dan Stoza dc13c5b85b libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
2015-05-11 15:33:01 -07:00
Aravind Akella be451b57b9 Merge "Fix the arguments to memcpy." into mnc-dev 2015-05-09 00:17:40 +00:00