Commit Graph

532 Commits

Author SHA1 Message Date
Marco Nelissen e12cfc23b2 am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
  Replace IInterface::asBinder() with a static
2014-11-17 18:52:56 +00:00
Marco Nelissen 097ca275f4 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 08:47:01 -08:00
Andreas Gampe 4037c458a7 resolved conflicts for merge of 07dffa18 to lmp-mr1-dev-plus-aosp
Change-Id: I42d8bc291f4f48f3098754b076889159c4b20e41
2014-11-13 15:16:53 -08:00
Andreas Gampe 89fd4f7fa6 Frameworks/native: Wall Werror in surfaceflinger
Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
2014-11-13 14:18:56 -08:00
Naseer Ahmed ff520bb938 am 7aa0c47e: sf: Add a NULL check in getDisplayConfigs
* commit '7aa0c47e4205c6fca136c38f272d911c25c8a8fa':
  sf: Add a NULL check in getDisplayConfigs
2014-11-03 22:31:50 +00:00
Naseer Ahmed 7aa0c47e42 sf: Add a NULL check in getDisplayConfigs
Validate the display binder by adding a NULL check in getDisplayConfigs.
This will prevent a false match if the caller queries the display
configs for an inactive display (whose binder is NULL by default).

Without this change we might end up attempting to index the display
config array, which is unpopulated for inactive displays, and this will
result in a crash. (See getDisplayInfo in SurfaceComposerClient.cpp for
an example of this scenario)

Change-Id: I1a12f43b7c375b9c01998dadd5b658275c733fb2
Acked-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2014-11-03 12:16:18 -08:00
Jesse Hall 18b846dda7 am c7636f60: Merge "surfaceflinger: fix -Wsign-compare warnings" into lmp-mr1-dev
* commit 'c7636f606270a4b79d745ec1acf049daedfa0e2f':
  surfaceflinger: fix -Wsign-compare warnings
2014-10-31 22:57:43 +00:00
Jesse Hall 7844211607 surfaceflinger: fix -Wsign-compare warnings
warning: comparison of integers of different signs: 'int' and 'size_t'
(aka 'unsigned int') [-Wsign-compare]

arning: comparison of integers of different signs: 'int32_t' (aka
'int') and 'const uint32_t' (aka 'const unsigned int')
[-Wsign-compare]

Change-Id: I823257aa7218c5fd492a3277853210db539bb2e2
(cherry picked from f9bfdc6c94)
2014-10-31 09:52:23 -07:00
Dan Stoza d77021637e am 1f3efb11: Don\'t run large virtual displays through HWC
* commit '1f3efb11ff8c884a254f4272f0d1ee0b77ceff2f':
  Don't run large virtual displays through HWC
2014-10-30 20:58:42 +00:00
Dan Stoza 1f3efb11ff Don't run large virtual displays through HWC
This change watches for a MAX_VIRTUAL_DISPLAY_DIMENSION value, which
will be set (if necessary) in BoardConfig.mk. If the value is set,
any virtual displays that have a width or a height greater than that
dimension will bypass the hardware composer HAL and be handled only
by SurfaceFlinger.

Bug: 17701816
Change-Id: Ia6ca44dfd6a7a9bc0f054493d3f13006bc32fa14
2014-10-28 16:01:47 -07:00
Riley Andrews 0b91d7e277 am 131866e1: Merge "Add glFlush in surfaceflinger screenshot code." into lmp-mr1-dev
* commit '131866e1a4cb3c592f923e95a8c1a66291e2057a':
  Add glFlush in surfaceflinger screenshot code.
2014-10-24 18:39:16 +00:00
Riley Andrews 9707f4df64 Add glFlush in surfaceflinger screenshot code.
After creating a syncKHR object with type EGL_SYNC_NATIVE_FENCE_ANDROID,
glFlush must be called before the EGL_SYNC_NATIVE_FENCE_FD_ANDROID attribute
is populated with a sync fd. We currently call eglDupNativeFenceFDANDROID
before issuing the flush.

Bug 18052459
Taken verbatim from matthew.k.gumbel@intel.com.

Change-Id: I3781d14f92862076e2bca7d27341a6dc6e7e3775
2014-10-23 16:25:17 -07:00
Jesse Hall 11f2e08a66 am 8ad8c0a7: am afe2b1fa: surfaceflinger: don\'t close fence fds after passing to queueBuffer
* commit '8ad8c0a775a1d4592479731973238b82480f76b2':
  surfaceflinger: don't close fence fds after passing to queueBuffer
2014-10-22 21:27:11 +00:00
Jesse Hall afe2b1fadd surfaceflinger: don't close fence fds after passing to queueBuffer
ANativeWindow::queueBuffer takes ownership of the fence fd passed to
it, and will close it before returning. SurfaceFlinger's screenshot
code was also closing the syncFd it passed to queueBuffer. Most of the
time this meant the second close() silently failed, but in a rare race
condition the file descriptor could be reused between the two
close()s.

Bug: 17946343
Change-Id: Ib74fcb1dce52cc21328059c99b7c4c76f41aa3a5
2014-10-21 11:11:53 -07:00
Dan Albert 27b780b517 am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:51 +00:00
Dan Albert 759115cd6d am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:43 +00:00
Dan Albert 9cc849500d Merge "Don't check if this == NULL." 2014-10-15 22:45:07 +00:00
Michael Lentine 3f121fc650 When eglMakeCurrent fails we need to fix the egl state.
Bug: 16676660

Change-Id: Ie7bee9c78378b9e9206060444319e6ee35e1ab74
2014-10-01 14:50:58 -07:00
Lajos Molnar 67d8bd66aa surfaceflinger: add getDisplayStats() method
This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
2014-09-18 17:03:20 -07:00
Dan Albert 1474f8864f Don't check if this == NULL.
Entering a method with this == NULL is undefined behavior. Clang whines
about this.

Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
2014-09-16 17:52:06 -07:00
Dan Albert 9e0e103b65 Silence warnings about unused parameters.
Change-Id: I503aafbdeaec3f53241872dc52af9f8b73a1416c
2014-09-09 16:53:59 -07:00
Riley Andrews c3ebe66b49 Add rotation to surfaceflingers screen cap.
+ This is needed so that activity manager does not
  have to do cpu side rotations when capturing recents
  thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
2014-09-09 03:51:16 +00:00
Jesse Hall d4548dd027 am 514e30a9: am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev
* commit '514e30a96cefad109509ce01622fa7f82f3f318c':
  surfaceflinger: skip composition for empty frames
2014-08-20 20:02:02 +00:00
Jesse Hall 514e30a96c am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev
* commit 'c3d1889e508038efe240ed1974ed377a2e12835c':
  surfaceflinger: skip composition for empty frames
2014-08-20 19:52:40 +00:00
Jesse Hall b7a0549c98 surfaceflinger: skip composition for empty frames
By not committing the results of composition for empty frames, we
avoid spitting out series of black frames for virtual displays that
don't have visible layers. We still draw one black frame when going
from having layers to not having any. In particular, this avoids
having a series of empty frames due to re-compositing the primary
display in the period between creating the virtual display and adding
layers to it.

Bug: 16786752
Change-Id: I7e9b2ed2e407d8d49c7af736b447d4c6181b0ad8
2014-08-19 22:15:43 -07:00
Riley Andrews 866399093f Take advantage of sync points during screen cap.
Do not wait for the screen capture to complete within surface flinger,
instead pass a sync point back with the captured gralloc buffer.

Change-Id: I7137c0e0fc710688d1d61f189159418fb27ea263
2014-08-19 19:27:14 +00:00
Eric Penner a02e9484be Merge "SurfaceFlinger: Prevent deadlock by updating an atomic layer set." into lmp-dev 2014-07-29 21:36:00 +00:00
Eric Penner 51c59cd1e7 SurfaceFlinger: Prevent deadlock by updating an atomic layer set.
Bug: 12934849

Change-Id: I9dede7316f1e967de4140bd731ac810115ea302f
2014-07-30 19:05:38 -07:00
Michael Lentine 9ae79d869a Build fix for size_t on 64bit.
Change-Id: Ic16895b30d78ba8a635b709adbae31a590501b20
2014-07-30 16:42:12 -07:00
Michael Lentine 7306c670eb Add error for format and make sure setActiveConfig fails with an invalid mode.
Change-Id: Iacdb5cbad125787f96c64c88d432fc541c4cad1a
2014-07-30 14:36:25 -07:00
Michael Lentine 47e45405d1 Allow for resizing of Virtual Displays.
Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.

Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
2014-07-30 14:36:25 -07:00
Michael Lentine 6c9e34a98a Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.
This can be used to change the current display mode of the device.

Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa9463)
2014-07-29 16:56:30 +00:00
Riley Andrews 03414a1cfe Turn on support for async cursor update in surfaceflinger.
If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.

Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
2014-07-28 22:07:41 +00:00
Jesse Hall b154c42c39 Improve memory coherence management in screenshot code [DO NOT MERGE]
The existing code worked in practice, but wasn't quite correct in
theory and relied on implementation details of other code. It's still
somewhat unusual and subtle, but now is correct-in-theory (I believe)
and a little better documented.

Bug: 16044767
Change-Id: I22b01d6640f0b7beca7cbfc74981795a3218b064
(cherry picked from commit c61576794e)
2014-07-14 19:29:09 +00:00
Jesse Hall 24cd98eef8 Compile libsurfaceflinger with Clang and -std=c++11 [DO NOT MERGE]
This is necessary to use C11/C++11 stdlib atomics, which the next
change will do. This change also fixes a couple bits of syntax that
both GCC and Clang refuse to compile in -std=c++11 mode.

Change-Id: Ia14d9d6b537a3bb106c23e19a277e48be180754c
2014-07-14 12:18:00 -07:00
Dan Stoza eac96b9bfd Merge "SurfaceFlinger: Fix rect out-of-bounds checks" 2014-06-17 21:43:29 +00:00
Andy McFadden 91b2ca8562 Add two new display info fields
This adds SurfaceFlinger's app VSYNC offset and buffer deadline
values to DisplayInfo.

Bug 14612039

Change-Id: Ie0ab21d388fe2764f2b6f71bd1cefa33dc861a73
2014-06-17 10:41:46 -07:00
Dan Stoza be31f44798 SurfaceFlinger: Fix rect out-of-bounds checks
Rects' right and bottom edges are treated as exclusive, so when
checking against maximum width and height, we should use > instead
of >=.

Change-Id: Ifcdf6813c13fcab1a55f16c21064e765e93d49f0
2014-06-11 11:20:54 -07:00
Wengang Wu 20071e5028 am e3d37a7b: Enable support RGBX_8888 for omap3
* commit 'e3d37a7b55f86f5d005dd67f828dcf51fe60c0f6':
  Enable support RGBX_8888 for omap3
2014-06-11 18:17:19 +00:00
Wengang Wu e3d37a7b55 Enable support RGBX_8888 for omap3
Bug: 14995811
Change-Id: Iaeb5a5ad0e3bcf215613f24f2570ae0d8267c016
2014-06-11 11:13:40 -07:00
Prashant Malani 7227b96a73 Merge "surfaceflinger: Replace blank/unblank with setPowerMode" 2014-06-12 03:30:50 +00:00
Wengang Wu 1210f2ab82 am 20071e50: am e3d37a7b: Enable support RGBX_8888 for omap3
* commit '20071e5028adb6d7ced81843d33e4d0baa0768ed':
  Enable support RGBX_8888 for omap3
2014-06-11 21:38:55 +00:00
Andy McFadden 645b1f7ffb Replace "lower power mode" experiment
This replaces the previous low-power mode experiment, which
discarded refresh events, with a new experiment that alters
the refresh period.

(see also I2849e5ea335c0d2509fea1c315392bce7f20451d )

The feature is enabled by specifying a nonzero value for the
"refresh skip count", which indicates the number of periods
to skip.  For example, the command:

  adb shell service call SurfaceFlinger 1016 i32 1

sets a skip count of '1', yielding a 30Hz refresh rate on a device
with a 60Hz display.  Changing the last value to '2' would set the
refresh to 20Hz.  '0' returns to the default behavior.

Bug 15523257

Change-Id: I00039c22a55750e74035644c63800e4bee1c774a
2014-06-11 10:19:08 -07:00
Andy McFadden 5167ec68fe Disable DispSync resync when not needed
If app and SF events aren't using phase offsets, we don't need
to maintain the DispSync model.  We just turn hardware VSYNC on
whenever something wants to draw.  This avoids some edge cases
where we were doing too much resync work.

Also, updated the systrace output.  The "VsyncOn" line was a
combination of SF and app event threads, and would occasionally
be very weird.  Removed VsyncOn, renamed VSYNC to VSYNC-app,
and added VSYNC-sf.

Also, added more details to the --dispsync dumpsys output.

Also, renamed global constants to not look like local variables.

Bug 15516453

Change-Id: I0da10b72f0d9a7b7eb5202d87cc18967f698adbd
2014-06-10 13:12:19 -07:00
Prashant Malani 2c9b11f029 surfaceflinger: Replace blank/unblank with setPowerMode
We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.

Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.

Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL

HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.

If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.

As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.

We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.

Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
2014-06-05 16:35:52 -07:00
Dan Stoza c18790018b SurfaceFlinger: Add sourceCrop to screenshot
Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.

Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
2014-05-23 09:19:03 -07:00
Andy McFadden 39cde06aee am b6601961: Merge "DO NOT MERGE Add "dumpsys SurfaceFlinger --dispsync"" into klp-modular-dev
* commit 'b66019615da8750588f1233a77b9c686b0a248c3':
  DO NOT MERGE Add "dumpsys SurfaceFlinger --dispsync"
2014-05-09 17:57:12 +00:00
Andy McFadden a7f75c0dfb Merge "Add "dumpsys SurfaceFlinger --dispsync"" 2014-05-09 17:49:33 +00:00
Andy McFadden 232f5bc675 DO NOT MERGE Add "dumpsys SurfaceFlinger --dispsync"
Dumps the current DispSync state.

Bug 14651879

(this is a near-cherrypick of Ide4e6dbd58b117bc1a6b97b57d10cd92ec86dc84)

Change-Id: I6e6c8452ede5c2d5098db1b884d28226e77d9a03
2014-05-09 10:49:11 -07:00
Andy McFadden c751e92c56 Add "dumpsys SurfaceFlinger --dispsync"
Dumps the current DispSync state.

Bug 14651879

Change-Id: Ide4e6dbd58b117bc1a6b97b57d10cd92ec86dc84
2014-05-08 16:14:41 -07:00
Dan Stoza dd02391756 Merge "Enable changing display configuration" 2014-05-06 21:08:16 +00:00
Dan Stoza 7f7da32569 Enable changing display configuration
This allows querying and switching display device configurations
through the ISurfaceComposer/SurfaceComposerClient interface.

Bug: 14320401
Change-Id: I8c22165698950e5da32204c1c4da92122f91a715
2014-05-05 16:45:26 -07:00
Andy McFadden 41d67d7ab4 Improve SurfaceFlinger PTS estimation
Get the next refresh time from DispSync instead of guessing based
on the current time.

Change-Id: I8dc72a3217bfd4e9b4c905034194d1a298cad69a
2014-05-02 10:56:54 -07:00
Ruchi Kandoi f52b3c88f1 SurfaceFlinger: Adds the functionality to reduce refresh rate to half of
the default.

Feature added for the low power mode.

Change-Id: I2849e5ea335c0d2509fea1c315392bce7f20451d
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-05-01 18:29:33 +00:00
Dan Stoza bba1385d1c am f3c07d4f: Fix virtual display nesting
* commit 'f3c07d4f70f33c2fe5b14ca8fbcdfa4133cc72c7':
  Fix virtual display nesting
2014-04-23 14:36:20 +00:00
Dan Stoza f3c07d4f70 Fix virtual display nesting
This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

(cherry-pick from master I600365c0fd5d3ad93e04295d26cf9de177ffc79b)

Bug: 12101046
Change-Id: I6182993d53537781aedb522f97a50f06eed8b80f
2014-04-22 16:19:02 -07:00
Svetoslav d85084b2b6 Adding render stats APIs to UiAutomation (framework native).
bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
2014-04-10 12:32:19 -07:00
Jesse Hall 8b834ffd9b am 1b751203: am 50ef8562: Merge "GraphicProducerWrapper may return false transact status"
* commit '1b7512036f3ea55cb1f62777ba6e56aad781f11c':
  GraphicProducerWrapper may return false transact status
2014-03-28 09:02:02 +00:00
Jesse Hall 1b7512036f am 50ef8562: Merge "GraphicProducerWrapper may return false transact status"
* commit '50ef8562fe7289495ad8592226f3c4d546119892':
  GraphicProducerWrapper may return false transact status
2014-03-28 08:50:09 +00:00
bdeng3X c2633ce19b GraphicProducerWrapper may return false transact status
GraphicProducerWrapper(GPW) changed how the methods of
BpGraphicBufferProducer(BpGBP) are executed.
First, "fake" BpGBP is created. Its remote is GPW. The GPW has
wrapped the real BpGBP.
All the method calls to the fake BpGPB will be intercepted by
the GPW inside it when the methods run into remote()->transact().
Then the GPW will invoke the transact() of the real BpGBP. And
Everything runs well except that the GPW forgets to store the
transact status and always return NO_ERROR to the fake BpGBP.

It would be disastrous if the binder call of the IGBP failed and
the out parameter "reply" of transact() was in unkown state.
E.g. the queueBuffer() in the fake BpGBP will try to operate on
the "reply". This will crash the SurfaceFlinger.

Change-Id: I01b31f64e1fc92804da3f16c1fb1420dcfb3b855
Signed-off-by: bdeng3X <bingx.deng@intel.com>
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
2014-03-27 09:09:19 +08:00
Dan Stoza b9b088375d Remove deprecated BufferQueue constructor
Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
2014-03-18 10:08:44 -07:00
Wonsik Kim 8bf3b1a496 Merge "Revert "Implement video plane layer"" 2014-03-18 01:00:44 +00:00
Wonsik Kim 29fa9590ad Revert "Implement video plane layer"
This reverts commit f837c93a1b.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
2014-03-17 11:17:28 +00:00
Greg Hackmann 55886cb128 am 7429e4f7: am 112aa42e: Merge "SurfaceFlinger: fix 64-bit format string warnings"
* commit '7429e4f7d43cd42563ce77a3a4a861a392bc750f':
  SurfaceFlinger: fix 64-bit format string warnings
2014-03-08 07:28:19 +00:00
Greg Hackmann 7429e4f7d4 am 112aa42e: Merge "SurfaceFlinger: fix 64-bit format string warnings"
* commit '112aa42e91b4bb0cde334753e2ad05e3f248b377':
  SurfaceFlinger: fix 64-bit format string warnings
2014-03-08 01:56:32 +00:00
Greg Hackmann 86efcc0cbc SurfaceFlinger: fix 64-bit format string warnings
Change-Id: Idacfbf0601743fba1c5de7632201a66a307a2710
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-07 12:45:13 -08:00
Wonsik Kim f837c93a1b Implement video plane layer
Binding with video source will follow.

Change-Id: Ic14e9757f5b61f4055cbeda47c1bafae0a621abb
2014-02-27 00:08:22 +00:00
Andy McFadden 44c35ec4a9 Allow "opaque" flag to be updated. DO NOT MERGE
Moves the "opaque layer" from Layer to Layer::State.  This allows
it to be updated as part of a transaction.

Bug 12387406

Change-Id: I0a114ce6adf77cd12fb08f96e0691b76c475768d
2014-02-18 15:55:42 -08:00
Dan Stoza c701401f8c Allow disabling layer rotation during screenshots
Add the ability to ignore layers' transformation matrices during
screenshot capture, which will allow the window manager to capture
unrotated images for recents during the device rotation animation.

Bug: 11805195
Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8
2014-02-14 23:10:42 +00:00
Dan Stoza 7143316af2 Fix virtual display nesting
This fixes the cycling rendering loop caused by nesting virtual
displays by preventing them from recomposing if their contents
haven't changed.

Bug: 12101046
Change-Id: I600365c0fd5d3ad93e04295d26cf9de177ffc79b
2014-02-04 16:46:54 -08:00
Andy McFadden 4125a4ffaf Allow "opaque" flag to be updated
Moves the "opaque layer" from Layer to Layer::State.  This allows
it to be updated as part of a transaction.

Bug 12387406

Change-Id: I0a114ce6adf77cd12fb08f96e0691b76c475768d
2014-01-29 17:36:49 -08:00
Jesse Hall 524672571f am 03691218: am e5f7bf74: am b6c21004: Merge "Implement per-display EGLConfig and configless EGLContext"
* commit '03691218ada2fb7e084ad4ae7ddd54f9b28d5611':
  Implement per-display EGLConfig and configless EGLContext
2014-01-03 18:36:29 +00:00
Jesse Hall 10ca42cbdc am 4c37d088: am 6c7dcfa9: am 662d3134: Merge "Move EGLConfig selection to RenderEngine"
* commit '4c37d0886ca06c290e205cad2798406361bbbf53':
  Move EGLConfig selection to RenderEngine
2014-01-03 18:36:28 +00:00
Jesse Hall 19e872912a Implement per-display EGLConfig and configless EGLContext
Bug: 12230666
Change-Id: Icca608b108cbdcab9cf01a9236d8cdbda000a836
Signed-off-by: Jesse Hall <jessehall@google.com>
2013-12-23 21:53:39 -08:00
Jesse Hall 05f8c703d4 Move EGLConfig selection to RenderEngine
Bug: 12230666
Change-Id: I8d1111a7e0fd9d9e2525e6a80da8ce46d7dd085d
Signed-off-by: Jesse Hall <jessehall@google.com>
2013-12-23 21:53:39 -08:00
Jamie Gennis cd65a2c51e am bbfbe93c: am 0a645cc5: SurfaceFlinger: give SF its own vsync phase
* commit 'bbfbe93c0d2d6c7818e23219d2925f02ddf5bd92':
  SurfaceFlinger: give SF its own vsync phase
2013-10-15 17:29:21 -07:00
Jamie Gennis 5727fc08ba am 47c772e8: am d1700756: SurfaceFlinger: Add EventControlThread
* commit '47c772e8ec28eb0a3df9c8edd252f292c7c8e152':
  SurfaceFlinger: Add EventControlThread
2013-10-15 17:29:21 -07:00
Jesse Hall c6694b4cb4 resolved conflicts for merge of e94d204a to master
Change-Id: Idb2030dbb25a2e4b972492587558b25a305e68bd
2013-10-15 17:22:33 -07:00
Jamie Gennis 0a645cc5a9 SurfaceFlinger: give SF its own vsync phase
This change allows SurfaceFlinger to run at a different vsync phase offset from
that used by external listeners.

Bug: 11175503
Change-Id: I561c53a5659fa6dc1e3e4ae30340f3c1a6adceb4
2013-10-15 14:31:41 -07:00
Jamie Gennis d1700756ec SurfaceFlinger: Add EventControlThread
This change adds a new thread for calling HWComposer's eventControl
asynchronously.  The DispSync-based vsync approach ends up enabling and
disabling HWComposer's vsync callbacks at arbitrary times, and some HWComposer
implementations do not have these calls optimized.

Bug: 11175503
Change-Id: I719be82bd200b391c61d40863b991c7b59acdfd6
2013-10-15 14:31:41 -07:00
Jesse Hall 948fe0ce74 Disable hardware vsync when blanking the screen
Bug: 11220224
Change-Id: I99d0a42e1a6bb0aaf89706f6d100e9ef2a5deaa4
2013-10-14 16:25:01 -07:00
Andy McFadden 95e4a7d9f3 am c00ab7b5: am 2d8d120d: Fix blank / partial screenshots
* commit 'c00ab7b5aafb7625ad7ebd2af107936df3efc98b':
  Fix blank / partial screenshots
2013-10-10 08:38:36 -07:00
Andy McFadden 2d8d120dc1 Fix blank / partial screenshots
The screen capture code wasn't waiting for the render to finish,
so sometimes you'd see an empty or partial image.

Bug 11131777

Change-Id: Ic64087322ce3bb15bb5f4fb1eb07579880fe6197
2013-10-09 16:38:02 -07:00
Jamie Gennis b85d2cf0a2 resolved conflicts for merge of 790b6d09 to master 2013-10-08 17:50:36 -07:00
Jamie Gennis faf77cce9d SurfaceFlinger: SW-based vsync events
This change adds the DispSync class, which models the hardware vsync event
times to allow vsync event callbacks to be done at an arbitrary phase offset
from the hardware vsync.  This can be used to reduce the minimum latency from
Choreographer wake-up to on-screen image presentation.

Bug: 10624956
Change-Id: I8c7a54ceacaa4d709726ed97b0dcae4093a7bdcf
2013-10-07 17:59:53 -07:00
Alan Viverette 794c5ba973 Simplify color adjustment using homogeneous coordinates
Change-Id: Ie31abacb134c29d82a6041fa7d521f68a1a273af
2013-10-03 16:40:52 -07:00
Dave Burke c5214289d6 am 9b4b1180: am 06993503: Merge "only clear FB when asked for the opaque layer" into klp-dev
* commit '9b4b1180941f4d2ef9d3e7bd26bc1855ff9fb141':
  only clear FB when asked for the opaque layer
2013-10-02 10:44:44 -07:00
Dave Burke 0699350336 Merge "only clear FB when asked for the opaque layer" into klp-dev 2013-10-02 17:36:40 +00:00
Jesse Hall fee52e20b9 am f3fa0712: am 93573e91: Merge "Treat composition frames with no layers as using GLES composition" into klp-dev
* commit 'f3fa0712282e760c316f44cba05f884f9399b98f':
  Treat composition frames with no layers as using GLES composition
2013-10-02 09:57:03 -07:00
Jesse Hall 93573e91c2 Merge "Treat composition frames with no layers as using GLES composition" into klp-dev 2013-10-02 14:54:03 +00:00
Jesse Hall 0c6fd94c13 am 92d7c3ee: am b65f32eb: Fix two EGLConfig selection bugs
* commit '92d7c3ee03109cf2d465a103b828b7d7d3ee9848':
  Fix two EGLConfig selection bugs
2013-10-01 20:58:49 -07:00
Mathias Agopian ac68302e1c only clear FB when asked for the opaque layer
a layer need to be considered NOT opaque if it has a
plane-alpha.

Bug: 10846930
Change-Id: Ibd8981b63ede4560c7096bacc4cff46a7eb2a8bb
2013-10-01 15:36:52 -07:00
Jesse Hall d05a17fbb3 Treat composition frames with no layers as using GLES composition
When there are no window layers for a display, SurfaceFlinger clears
the undefined region using GLES. Some of the places that check for
GLES composition weren't considering this special case, in particular:

- We were skipping the eglSwapBuffers() on these frames.
- We were putting VirtualDisplaySurface in HWC-only composition mode.

This change centralizes the logic for this special case.

Bug: 10957068
Change-Id: I2deaf2ed101e8ea76708862a6bb67751b6078794
2013-09-30 17:08:28 -07:00
Jesse Hall b65f32ebe2 Fix two EGLConfig selection bugs
This fixes two bugs introduced by
  Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d

(a) There is no invalid EGLConfig value, in particular zero is valid.
    Checking return values of eglGetConfigs and eglChooseConfig is the
    only way to determine success.
(b) The "simple" EGLConfig query used as the emulator fallback should
    not include EGL_RECORDABLE; the emulator doesn't have it.

Bug: 10935622
Change-Id: Ib798a24e7cf06a679811c46eaa45d39174a715ec
2013-09-30 10:49:16 -07:00
Mathias Agopian 2b3d0c4079 am 0ff4b283: am 6da15f46: fix crashers with wifi/virtual displays
* commit '0ff4b28396d77a0ed2f191836895a891108a8b5b':
  fix crashers with wifi/virtual displays
2013-09-26 12:47:35 -07:00
Mathias Agopian 6da15f46f5 fix crashers with wifi/virtual displays
Bug: 10647742
Change-Id: I4b8ed9da52ef95af3a3b3a04b98514a3776a674d
2013-09-25 20:40:07 -07:00
Mathias Agopian 1c479c56da am 754bad45: am d555684c: reinstate black-screenshot debugging code
* commit '754bad4534e9a2de8b4e3ecbe097993c71246f91':
  reinstate black-screenshot debugging code
2013-09-20 11:20:44 -07:00
Mathias Agopian 4d5755389d am f589dd29: am e2a3e872: Merge "Fix GLES context version selection" into klp-dev
* commit 'f589dd2915587994d3dd36eff2191962fe0b71c0':
  Fix GLES context version selection
2013-09-20 11:19:58 -07:00
Mathias Agopian d555684cb3 reinstate black-screenshot debugging code
turned off by default.

Bug: 10809349
Change-Id: I3e6b8c7860e6b0e122b8f07de4020967cd1f005c
2013-09-19 17:09:26 -07:00
Mathias Agopian 2185f8b420 Fix GLES context version selection
Explicitly selects an ES 2.0 config first, then an ES 1.x config,
before attempting the fallback path for the emulator.

Bug: 10820214
Change-Id: Ia8cc084c02a0e3de910def024da8a08d02bbd89d
2013-09-18 16:20:26 -07:00