Commit Graph

723 Commits

Author SHA1 Message Date
Mathias Agopian ba0b9cca69 am ef36f2a8: am d17e3b5f: prevent a client from crashing surfaceflinger
* commit 'ef36f2a84cb8478b0baa299d980922ce7824c0b3':
  prevent a client from crashing surfaceflinger
2012-10-22 15:38:00 -07:00
Mathias Agopian d17e3b5f6c prevent a client from crashing surfaceflinger
a misbehaving or malicious client could cause SF to crash
by providing a "fake" IInterface. we now check the
IInterface we get is our own and local.

Bug: 7278879
Change-Id: Ia19d05902d4b2385c5a16416148378d4998833fd
2012-10-22 14:54:23 -07:00
Jamie Gennis 7ee4aba226 am 3b6055a7: am ba7dc2db: Merge "SurfaceFlinger: add support for secure displays" into jb-mr1-dev
* commit '3b6055a7184a2da7bbdd94118a8c6af875bb28b1':
  SurfaceFlinger: add support for secure displays
2012-10-22 13:57:51 -07:00
Jamie Gennis ba7dc2db6e Merge "SurfaceFlinger: add support for secure displays" into jb-mr1-dev 2012-10-22 13:50:19 -07:00
Jamie Gennis dd3cb84cfb SurfaceFlinger: add support for secure displays
This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set.  All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
2012-10-22 13:41:21 -07:00
Andy McFadden 42371e5e63 am 44c985ef: am 620685c2: Fix emulator vsync
* commit '44c985ef7d0b6d94fa9df3fd5ea718eca0ecdbd1':
  Fix emulator vsync
2012-10-19 16:17:41 -07:00
Andy McFadden 620685c2e6 Fix emulator vsync
The code that reserves display IDs was only run when a hardware
composer was present.  The eventControl() function, which handles
enabling of vsync, was ignoring the request because the primary
display didn't appear in its set of allocated IDs.  This moves
reservation of IDs for built-in displays outside the HWC-only block.

Also, added a couple of warnings in eventControl().

Bug 7376568

Change-Id: I185ccdf817a25499b5c2668f8f6d594afb8c1568
2012-10-19 12:53:46 -07:00
Jamie Gennis 5937c9d581 am caadbc53: am 7c41bf70: SurfaceFlinger: change the animation timeout
* commit 'caadbc5324cd4503450ac6bd9bb09c3c5fcb7430':
  SurfaceFlinger: change the animation timeout
2012-10-17 16:58:54 -07:00
Jamie Gennis 7c41bf7092 SurfaceFlinger: change the animation timeout
This change changes the animation transaction timeout from 500us to 5s.

Bug: 7362633
Change-Id: I9bed8e74f726dae2daa398afc29babcea00d5b04
2012-10-17 09:40:07 -07:00
Mathias Agopian e7f167bffa am 179c4db2: am db9b41fd: fix a corruption in blank/unblank
* commit '179c4db2c3f26e6586b0b0fe2c576fc9ae349580':
  fix a corruption in blank/unblank
2012-10-15 20:39:30 -07:00
Mathias Agopian db9b41fd15 fix a corruption in blank/unblank
we were holding a reference (ie: pointer) to a sp<DisplayDevice>
while processing the message. Meanwhile the object itself could
go away and we would end up accessing a dead object.

the root cause of the problem is that we are accessing mDisplays[]
in a few places outside of the main thread.

Bug: 7352770
Change-Id: I89e35dd85fb30e9a6383eca9a0bbc7028363876c
2012-10-15 20:31:12 -07:00
Jamie Gennis 5bc5f22d37 am 5c51f0fb: am 3365c567: Merge "SurfaceFlinger: add animation transactions" into jb-mr1-dev
* commit '5c51f0fb38bd0cd80031da3eee6f335d5d28c3fc':
  SurfaceFlinger: add animation transactions
2012-10-15 20:26:15 -07:00
Jamie Gennis 3365c56716 Merge "SurfaceFlinger: add animation transactions" into jb-mr1-dev 2012-10-15 19:36:12 -07:00
Jamie Gennis 2d5e230292 SurfaceFlinger: add animation transactions
This change adds a transaction flag for WindowManager to indicate that a
transaction is being used to animate windows around the screen.  SurfaceFlinger
will not allow more than one of these transactions to be outstanding at a time
to prevent the animation "frames" from being dropped.

Bug: 7353840
Change-Id: I6488a6e0e1ed13d27356d2203c9dc766dc6b1759
2012-10-15 19:09:04 -07:00
Jesse Hall ce27f53de7 am c558269b: am 837d2f9e: Always set vertex alpha when drawing screenshot layers
* commit 'c558269b1ab8c4985b86a0f39338d42f162693f2':
  Always set vertex alpha when drawing screenshot layers
2012-10-15 15:01:47 -07:00
Jesse Hall 837d2f9e83 Always set vertex alpha when drawing screenshot layers
The screenshot is a GL_RGB texture, and the GL_REPLACE texture env
mode uses vertex alpha for GL_RGB textures instead of alpha=1.0.

Bug: 7340077
Change-Id: I6fbb907023e48f9c422b15a33da79757d6726840
2012-10-15 12:38:33 -07:00
Jamie Gennis ea5ef70398 am ec93e762: am dd57d551: Merge "SurfaceFlinger: make the num FBs a board config" into jb-mr1-dev
* commit 'ec93e762afc46534aadb3f583dbf87e38e85bfe9':
  SurfaceFlinger: make the num FBs a board config
2012-10-12 14:39:54 -07:00
Jamie Gennis dd57d55194 Merge "SurfaceFlinger: make the num FBs a board config" into jb-mr1-dev 2012-10-12 14:33:52 -07:00
Jamie Gennis cdbaecb541 SurfaceFlinger: make the num FBs a board config
Bug: 7283132
Change-Id: I38116f39fc18212f2daab94bbfc3daaf89439fc4
2012-10-12 14:29:12 -07:00
Jesse Hall 570967f6a8 am f5b27f71: am b763d5ff: Assume LayerScreenshot has pre-multiplied alpha
* commit 'f5b27f714063361d07a7ca6f107bba3e13b75d38':
  Assume LayerScreenshot has pre-multiplied alpha
2012-10-11 17:54:35 -07:00
Jesse Hall b763d5fffa Assume LayerScreenshot has pre-multiplied alpha
Bug: 7300129
Change-Id: Ie9114adc4b5c9a8cc3c65bfe6d9478b2cba4e0d8
2012-10-10 21:40:26 -07:00
Andy McFadden 9f997217cf am 9349b510: am f0c89b28: Merge "Fix HDMI unblank behavior" into jb-mr1-dev
* commit '9349b5108c3763337868ffc5de51330c00d6db04':
  Fix HDMI unblank behavior
2012-10-10 19:39:21 -07:00
Andy McFadden 9e9689c111 Fix HDMI unblank behavior
Two issues:

(1) We were announcing the hotplug event before we were ready to
handle blank/unblank events, so we were losing the initial unblank
that power manager sends us when HDMI is first plugged in.  This
left the display blank until you toggled the device power off/on.

(2) We were retaining fbTargetHandle for HDMI after the display was
disconnected.  The value didn't get updated when HDMI was reconnected
because the display was blank, so we didn't go through that code
path.  So, when HDMI was re-connected, we passed stale data into
the HWC.

Bug 7323938

Change-Id: I2335d24fd7b0f00bb23fc63aa7bcf44cb8857c73
2012-10-10 18:17:51 -07:00
Mathias Agopian 58deaa8b29 am 43bd832d: am 0acb00c2: Merge "fix typo that prevented proper loging of EGL error code" into jb-mr1-dev
* commit '43bd832d128726334de622d67aaac09051c07941':
  fix typo that prevented proper loging of EGL error code
2012-10-09 16:59:54 -07:00
Jeff Brown e8fae277fa am 70f07572: am c5b58166: Merge "don\'t automatically unblank external displays" into jb-mr1-dev
* commit '70f07572f8ce6b83b167170eea9d500e51549395':
  don't automatically unblank external displays
2012-10-09 16:58:27 -07:00
Mathias Agopian 0acb00c2d7 Merge "fix typo that prevented proper loging of EGL error code" into jb-mr1-dev 2012-10-09 16:52:37 -07:00
Mathias Agopian b8fc00bfb4 fix typo that prevented proper loging of EGL error code
needed for investigating 7309949

Bug: 7309949
Change-Id: If29a5c08d0e87f46b44ba2e1030be61cb4d1403b
2012-10-09 16:44:48 -07:00
Mathias Agopian 3292cae8c3 don't automatically unblank external displays
this should be handled by the display-manager. we were doing
that in SF because until recently we didn't have enough support
in the HAL. however, this is now causing other problems when
plugging hdmi while the screen is off for instance.

Bug: 7150885
Change-Id: I739b209056a765d38d05295cf202f67ee0f506ae
2012-10-09 14:49:01 -07:00
Mathias Agopian 8a34643a33 am 1a003e4a: am cb55857b: fix dumpsys Layer name when using multiple displays
* commit '1a003e4aec1c4ffc2b11c8b9f05f69db6280987c':
  fix dumpsys Layer name when using multiple displays
2012-10-08 16:23:08 -07:00
Mathias Agopian cb55857bbd fix dumpsys Layer name when using multiple displays
Bug: 7288401
Change-Id: I14beeef58fac5270cef3b611e18c163060efe6c3
2012-10-08 15:57:17 -07:00
Mathias Agopian 4dae9ebd80 am eb38d852: am 1b3aeb48: fix SurfaceFlinger DDMS debugging
* commit 'eb38d85260073470e5a27af820fe6cd9f2bc35ae':
  fix SurfaceFlinger DDMS debugging
2012-10-07 23:41:57 -07:00
Mathias Agopian 1b3aeb4844 fix SurfaceFlinger DDMS debugging
DdmHandleAppName.setAppName() signature changed which broke
this debugging feature.

Needed for debugging b\7267680

Change-Id: I4482bf5a441e91bef89d1ddea9a4152333be7f88
2012-10-07 16:41:12 -07:00
Mathias Agopian 8b2a88bad1 am 95b9a0b6: am e835976d: Merge "Tone down a fatal assert" into jb-mr1-dev
* commit '95b9a0b688eab5a3c0c1fadb71e258e93e4c344c':
  Tone down a fatal assert
2012-10-04 20:34:46 -07:00
Andy McFadden 5a8f9012ee Tone down a fatal assert
The new disconnectDisplay function doesn't handle virtual displays,
but it may be called for them.  Return without doing anything.

Bug 7281786

Change-Id: I62607f2ae6073fa66b393f55932604aeb8e03566
2012-10-04 19:09:45 -07:00
Jesse Hall 178652a5d7 am 3b4e55c0: am 9a143922: Ignore display state changes for disconnected displays
* commit '3b4e55c0442322823898dd838cb50fe589e1e9d7':
  Ignore display state changes for disconnected displays
2012-10-04 18:01:50 -07:00
Jesse Hall 9a14392256 Ignore display state changes for disconnected displays
When a display is disconnected, removing it from SurfaceFlinger's
display list is non-atomic with removing it from the Display Manager
and any in-flight transactions. So SurfaceFlinger might get a display
state change transaction for a display it has already forgotten about.
Just ignore these.

Bug: 7288082
Change-Id: Ic27e55377f3db40fb34e3b1cd67e43297df117a2
2012-10-04 16:40:35 -07:00
Mathias Agopian 1c19de6c28 am 64a22423: am 81cd5d3b: make sure we don\'t call into the HWC HAL when not needed
* commit '64a224236d930921581de52eb87ef1ab7fab3780':
  make sure we don't call into the HWC HAL when not needed
2012-10-04 15:31:51 -07:00
Mathias Agopian 81cd5d3b94 make sure we don't call into the HWC HAL when not needed
when enabling/disabling vsync we now make sure to
not call into the HAL if the state wouldn't change.

Bug: 7274951

Change-Id: Ie24a6d68888a51b577acf9c2a973d85437cbacaf
2012-10-04 15:25:32 -07:00
Andy McFadden 42d7dfccee am 61f142a2: am 27ec5739: Fix crashes after HDMI disconnect
* commit '61f142a25c14c8e24f8040098b4c223f0d725cb2':
  Fix crashes after HDMI disconnect
2012-10-04 12:29:00 -07:00
Andy McFadden 27ec5739bc Fix crashes after HDMI disconnect
The display was being removed from SurfaceFlinger's list before we
had a chance to reset HWComposer's layer list, so we were passing
stale data into the hardware composer (which has its own per-display
data).  This resulted in "invalid gralloc handle" complaints.
We now clear the layer list immediately after removing the display.

The display was being removed while its EGLSurface was still
"current", resulting in "cancelBuffer: BufferQueue has been
abandoned" complaints.  We now call makeCurrent on the primary
display before removing the external display.

Bug 7274254

Change-Id: Ia59e3a61d7ec46488b96bf93ec5e4ed3488b70e4
2012-10-04 02:02:23 -07:00
Jesse Hall c2e3e07549 am ee5fb929: am ba607d53: Add Fence::waitForever which logs a warning timeout, and use it
* commit 'ee5fb9299b6a7d81af6c2c1e598c4e9fd71a8ba9':
  Add Fence::waitForever which logs a warning timeout, and use it
2012-10-02 16:36:16 -07:00
Jesse Hall ba607d53c6 Add Fence::waitForever which logs a warning timeout, and use it
Bug: 7217641
Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
2012-10-02 16:29:46 -07:00
Mathias Agopian 2ae7bec770 Revert "improve sensor fusion" -- DO NOT MERGE
This reverts commit bdf277355d.
This reverts commit dc5b63e40e.

it might be responsible for a regression that makes the
rotation vector spin.

Bug: 7267330
Change-Id: Ifb10e933537e70c1d85a7ba73a7e3ae59002fe62
2012-10-01 20:31:05 -07:00
Jamie Gennis d30b36d1fd SurfaceFlinger: reset the FB_TGT acquire fence
This change makes SurfaceFlinger reset the acquire fence fd to -1 after each
call to HWComposer::commit.  The HWComposer implementation is resonsible for
closing the fd, so SurfaceFlinger should make sure not to pass it to HWC
multiple times.

Change-Id: I79554d9f6d6ef2b77d632d40251516c1f5b16ddb
Bug: 7258954
2012-10-01 12:24:59 -07:00
Mathias Agopian 135e5899f7 save/restore viewport properly when taking screenshot
Bug: 7241739
Change-Id: Iba8b9ffc75ab47fbc56169e65da26d96850a9297
2012-09-30 16:43:20 -07:00
Mathias Agopian bae92d0d60 reset GL viewport and project when caputring the screen
Bug: 7241739
Change-Id: I3bb5214b070384de9be2026647865c6c236a4331
2012-09-28 13:34:26 -07:00
Andy McFadden c01a79d77b Pass display arg to blank/unblank
This allows us to blank and unblank displays other than the built-in
display (e.g. HDMI).

Bug: 7240511
Change-Id: I89ea13f9e497be74c3e1231d0c62fb558e93e0f8
2012-09-28 13:04:16 -07:00
Jamie Gennis a4310c8be2 SurfaceFlinger: don't always set HWC_GEOM_CHGD
This change fixes a bug in SurfaceFlinger that caused the HWC_GEOMETRY_CHANGED
flag to be set every flip.

Change-Id: I4f395a2883bcbb53b23b3d14941aff108739c9f0
Bug: 7234237
2012-09-27 17:27:20 -07:00
Andy McFadden e206549ccf Merge "Recompute visible regions more vigorously" into jb-mr1-dev 2012-09-26 17:27:43 -07:00
Andy McFadden ab10c5804c Recompute visible regions more vigorously
Some of the code in latchBuffer was calling invalidateHwcGeometry,
but that didn't cause the SurfaceFlinger visible region code to
re-evaluate the layer's visibility.  Set the recomputeVisibleRegions
"out" parameter instead.

Bug 7235797

Change-Id: If6ba33fbd1a594cd64cc5253aebf752d6ceda1c9
2012-09-26 16:19:12 -07:00