Commit Graph

532 Commits

Author SHA1 Message Date
Byunghun Jeon 987034b563 SurfaceFlinger: Native changes to add blur effect
Native changes to add blur-behind and blur mask effect

Change-Id: I54faf82d750e8299de6d261f6a893ab26d08df84

SurfaceFlinger: Adding template for LayerBlur files

Change-Id: I444009113b7bdd6c5284863fd1f56358e67d9fe6

SurfaceFlinger: Featurize libuiblur module for OSS build

Change-Id: Ifdc176e699434125d17b111c044b8ba954cf717c
2015-11-08 01:07:13 -08:00
Ricardo Cerqueira 1cdd1b5ad2 Android 6.0.0 release 26
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iEYEABECAAYFAlYxAgIACgkQ6K0/gZqxDnjCqACfbBT6VOiUFQvRn7w1SAa+4rjF
 1IwAn2rBUqWo0dOKVwF1DDfFmGZXc8SB
 =1BqV
 -----END PGP SIGNATURE-----

Merge tag 'android-6.0.0_r26' into HEAD

Android 6.0.0 release 26

Conflicts:
	include/android/input.h

Change-Id: Ifa374c6d3055be3b8a5d60967f8b4c0043da739b
2015-11-05 01:41:42 +00:00
Steve Kondik 8f0e75211f Merge branch 'm' of git://codeaurora.org/platform/frameworks/native into cm-13.0
Change-Id: I7830f596b2e7da809a759491d8115ff158c43734
2015-10-21 16:56:23 -07:00
Ricardo Cerqueira b87c456431 surfaceflinger: Track the last surfaceview frame for latency dumps
When measuring GL latency with dumpsys, it's possible to hit a
race condition if the hardware is fast enough to complete rendering
the test cycle before the latency dump is requested, since it only
matches the latency for live layers (unless it's an animation. See
change I8bded1ea08a4cddefef0aa955401052bb9107c90)

So always save a reference to the last rendered SurfaceView frame,
and dump its values if there isn't an active one.

Change-Id: I740e9830161396ea955b5a53322bd8576b5136bc
2015-10-17 13:58:36 -07:00
Steve Kondik ccf7c200ce input: Adjust priority
* Bring into the desired group to get the best result.

Change-Id: I3bd031074cd7006994736b4c22d0294b6012f662
2015-10-17 13:51:11 -07:00
Pawit Pornkitprasan fd1fb639a1 Bring back support for glReadPixels screenshot path
Squashed commit of the following:

commit 012d3fe41d1d6cd38a0858b59145e9a4447641fa
Author: Hashcode <hashcode0f@gmail.com>
Date:   Sun Dec 8 19:36:50 2013 +0000

    sf: Always use opengles for screen capture

    Go back to the usage of GRALLOC_USAGE_HW_TEXTURE and GRALLOC_USAGE_HW_RENDERER
    in captureScreenImplLocked regardless of useReadPixels value

    This fixes the EGL_NO_IMAGE_KHR error returned from
    eglCreateImageKHR (blank images returned from screenshot path)

    Change-Id: I62fe90a081607b9e89c67f3dcfd34c84efc89d35

commit 4866ddf98ac98d8e22a1cd6a21894bb17f274588
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Thu Oct 31 03:53:39 2013 +0000

    Revert "remove support for glReadPixels screenshot path"

    This reverts commit 3ca76f416b.

    Conflicts:
    	include/gui/ISurfaceComposer.h
    	libs/gui/ISurfaceComposer.cpp
    	libs/gui/SurfaceComposerClient.cpp
    	services/surfaceflinger/SurfaceFlinger.cpp
    	services/surfaceflinger/SurfaceFlinger.h

    Change-Id: I8c239e533757af770e418dbb198f5a86c736961f

Change-Id: I8c239e533757af770e418dbb198f5a86c736961f
2015-10-16 14:45:10 -07:00
Baldev Sahu dfab0ee254 SurfaceFlinger: Add support for MDP3
This change is porting of following commits related to MDP3

1) SurfaceFlinger: Change to support framebuffer flip for 2D blitters
- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

  "Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c"

2) SF: Avoid wormhole clear for BLIT calls
- Do not call GPU clear from SF when composition
  type is BLIT as it'll be taken care in HAL.

  "Change-Id: Ia613eb9b824c6484ecc8c8fa4ee883545d8541b8"

3) surfaceflinger: Allow gpu to render widevine level3
- Allow gpu to render widevine level3 but keep
  blocking screen shots.

  "Change-Id: I914232a062acbb7b17901dbf2b414973230e59d9"

Change-Id: I35eef9eb1597af21c195e07d5fe4c0c73ab3a269
2015-10-07 02:52:17 -07:00
Ramkumar Radhakrishnan cfd539bf4a sf: This is a combination of following changes.
Author: Prabhanjan Kandula<pkandula@codeaurora.org>
SF: Add support for inverse mounted panels.

Add 180 rotation in SF to account for inverse mounted panels.
The framework will be unaffected and use policies for a 0 mounted
panel. SF changes the global transform and silently induces the H,V
flips. Similar flips are added to screenshots as well.

CRs-Fixed: 894147

Change-Id: I6e9576ee734ee85097491eaa1e8e94cfb3731e0f

Author: Ramkumar Radhakrishnan<ramkumar@codeaurora.org>
SF: Clear visible region of layer appropriately.

Clear visible region of layer having layer stack id different than
the display layer stack id to ensure that the layer won't be present
on the wrong display layer list.

Change-Id: I59289fea63ec7a2451d4715cfe7926ba34fdb8e3

Change-Id: I5ad08a6013aa173d621ee80c766a6e19e1086a35
2015-10-06 03:22:26 -06:00
Baldev Sahu 3652b23865 SurfaceFlinger: Add support for V4L2 based wfd solution.
This change add support for V4L2 based Wi-Fi display.

Change-Id: Ib3f3868eb0b7fa2bf7e58246fb2c5cd0ddceb7e1
2015-10-06 03:22:26 -06:00
Raj Kamal 20f9ced881 SurfaceFlinger: Add support for DisplayUtils
Add DisplayUtils class which uses the custom implementations
of ExLayer, ExSurfaceFlinger, ExHWComposer,
and ExVirtualDisplaySurface classes if needed

Change-Id: Ibdd8da5d3d0d602f42b76a15d0994c6aa98bee3f
2015-10-06 03:22:25 -06:00
Tatenda Chipeperekwa 8eaa19460d SurfaceFlinger: Support get/set ActiveConfigs
This includes the following two changes squashed into one and
retaining the change I182f41edbaf9226fc62d6d17ee964998cd9f21f7

sf: Fixes for resolution change in SurfaceFlinger

1. Use active config from HWC when querying display attributes

   When we query the display attributes we should use the active
   config as reported by HWC in cases where HWC version is 1.4.
   In all other cases we should revert to the default config,
   config 0, as the active config.

2. Set/update the display config if HWC config change was successful

   The new config should only be applied if HWC succeeded in changing
   the active config. This would otherwise cause failure or undefined
   behavior if the client sets an invalid/unsupported display config.

3. Set the active config at display creation time

   When a new display device is added update the active config by
   querying HWC.

   Change-Id: I182f41edbaf9226fc62d6d17ee964998cd9f21f7

sf: Initialize active config for non-virtual displays at boot time

When a non-virtual display device is added at boot time, update the
active config by querying HWC otherwise the default config (config 0)
will be used.

    Change-Id: I90f42fa1d20ed6176c4be464a10ae69a2f6a6d55

Change-Id: I182f41edbaf9226fc62d6d17ee964998cd9f21f7
2015-10-06 03:22:24 -06:00
Dan Stoza f2699fc3a8 SF: Add colorTransform to DisplayInfo
Adds the colorTransform field, which defines a vendor-specific color
transform (e.g., wide gamut, sRGB, etc.) to the DisplayInfo class, and
populates it from the HWC interface.

Bug: 20853317
Change-Id: I153edc36a361407656f3eb5082b96c2da2ecbec7
2015-08-31 13:41:24 -07:00
Dan Stoza 14cd37cf3d SF: Track missed frames and optionally drop them
Adds code to track whether SurfaceFlinger has sent two frames to HWC in
the same vsync window. This can occur if one frame is delayed so far
it slips into the next window or just if one frame takes an abnormal
amount of time. If this occurs, it shows up as FrameMissed in systrace.

Also adds a property debug.sf.drop_missed_frames which, if set, tells
SurfaceFlinger to skip sending a frame to HWC (i.e., calling
prepare/set) when we detect this condition, which can help prevent
backpressure from the HWC implementation.

Bug: 22513558
Change-Id: I2df0d44cec5fd6edba419388d8c90b5710d1a5b6
2015-07-23 11:15:32 -07:00
Dan Stoza 6a25a28728 am 806334aa: am 1998615f: Merge "sf: Initialize EventThread before creating HWC"
* commit '806334aacd089d1c419ed77021a2b1bb4f7644ef':
  sf: Initialize EventThread before creating HWC
2015-06-30 17:38:41 +00:00
Dan Stoza 2311608667 libgui/SF: Propagate SECURE Layer flag changes
This allows changes to the SECURE flag to propagate down to
Layers in SurfaceFlinger so that WindowManager can change it on the fly
in response to device policy updates.

Bug: 20934462
Change-Id: I558f6d22c6273be373f1f480365e42536af18a33
2015-06-18 15:11:20 -07:00
Saurabh Shah f948105810 sf: Initialize EventThread before creating HWC
Once HWC is created, it could use any of the provided hooks, which
could lead to a crash if the EventThread (handler) isn't initialized
prior to creating HWC.

Change-Id: I5ea35fe9bcb150fb74aae1295b798bd787ad6cee
2015-06-17 11:08:29 -07:00
Tatenda Chipeperekwa 40da48bfdf 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: Ib32a7dc8378d3438df0dba1ecd608bbcfc837717
2015-06-11 12:28:41 -07:00
Tatenda Chipeperekwa 23e16bb5da 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
(cherry picked from commit ac71c26e9180d9d181be5ec9e45da72d39144a8b)
2015-06-11 10:40:21 -07:00
Dan Stoza 65dc7eeff0 SF: Swap w/h when capturing rotated screenshots
Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.

Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
(cherry picked from commit 3502416204)
2015-06-10 10:33:21 -07:00
Dan Stoza 3502416204 SF: Swap w/h when capturing rotated screenshots
Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.

Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
2015-06-09 16:46:20 -07:00
Jeff Brown 8b04725f14 Bypass surface flinger permission check for calls from system.
Early during the boot, before activity manager is ready to handle
permission checks, the system needs to be able to change the display
state.  Added a hardcoded exemption for AID_SYSTEM (which already
has permission to talk to surface flinger anyhow).

Bug: 19029490
Change-Id: I6222edcab8e394e5fb6adf7a982be446e4505a1e
(cherry picked from commit 3bfe51d790)
2015-05-28 14:19:22 -07:00
Dan Stoza 8e8eba5091 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
(cherry picked from commit f008799d37)
2015-05-28 13:35:39 -07:00
Michael Lentine b64d875152 Fix surfaceflinger tests.
Update the screenshot code and add correct return values to surface flinger's
capturescreenshot function.

Buf: 18138368

Change-Id: Ieb42d289088589f941502fbd69da7aa939265e07
(cherry picked from commit 5a16a62950)
2015-05-28 13:33:25 -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 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
Dan Stoza 7d89d06a6f SurfaceFlinger: Limit to 4k Layers
Sets a limit of 4k Layers which SurfaceFlinger will allow to be in
existence at any given time. An attempt to create Layers in excess of
this limit will fail with NO_MEMORY.

Bug: 20674586
Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972
(cherry picked from commit e7f8dde3f3)
2015-04-30 15:10:00 -07:00
Dan Stoza e7f8dde3f3 SurfaceFlinger: Limit to 4k Layers
Sets a limit of 4k Layers which SurfaceFlinger will allow to be in
existence at any given time. An attempt to create Layers in excess of
this limit will fail with NO_MEMORY.

Bug: 20674586
Change-Id: I2dfaf59643d826f982b2fa44e8a9ed643176d972
2015-04-30 14:29:30 -07:00
Dan Stoza d5296b342e am 66dc4ee3: am b47584f4: am 2e398e64: Merge "SF: Permit changing DispSync offsets at runtime"
* commit '66dc4ee3729c4e6fea624805a1e58843ce920477':
  SF: Permit changing DispSync offsets at runtime
2015-04-15 22:16:03 +00:00
Dan Stoza 91dea34652 am 19f06de0: am 40b2a8b4: am e7d20eb0: Merge "SurfaceFlinger: Pass surface damage to HWC"
* commit '19f06de0930e0f741ed113c37faf306fceee39bd':
  SurfaceFlinger: Pass surface damage to HWC
2015-04-15 21:42:44 +00:00
Dan Stoza db4ac3ce63 SF: Permit changing DispSync offsets at runtime
This modifies EventThread such that its phase offsets for both
Choreographer and SurfaceFlinger may be modified at runtime. It also
plumbs this functionality up to the SurfaceFlinger debug interface so
that it is possible to rapidly test different offsets without
restarting the framework.

Change-Id: I426873f8553f931250dfebc9a8a4a78e9f1f4309
2015-04-15 13:56:28 -07:00
Dan Stoza ee44edd0ac SurfaceFlinger: Pass surface damage to HWC
Passes the surface damage from the incoming SurfaceFlingerConsumer
BufferQueue down to the hardware composer HAL interface, if the
HWC version number is 1.5 or greater.

Bug: 11239309
Change-Id: Ic4305210593874a8d6deba3319055b2b8c57e926
2015-04-15 13:20:01 -07:00
Jeff Brown 3bfe51d790 Bypass surface flinger permission check for calls from system.
Early during the boot, before activity manager is ready to handle
permission checks, the system needs to be able to change the display
state.  Added a hardcoded exemption for AID_SYSTEM (which already
has permission to talk to surface flinger anyhow).

Bug: 19029490
Change-Id: I6222edcab8e394e5fb6adf7a982be446e4505a1e
2015-04-10 20:26:51 -07:00
Jesse Hall 5b20fd0882 am 28c03cca: am c2a5b469: am a527c07b: Merge "Fix mistake using width instead of height."
* commit '28c03cca9835957f6e304b18358243b184fa46f8':
  Fix mistake using width instead of height.
2015-03-24 21:20:24 +00:00
Christopher Ferris 0e7497957a Fix mistake using width instead of height.
Found by rodrigo.chiossi@intel.com.

Change-Id: I49d590ed39f6b47ba58a77a75d66b2964ea1cb1d
2015-03-23 14:37:26 -07:00
Dan Stoza 35283ef01b am 105aa28e: am b275b4dc: am 3949f664: Merge "SurfaceFlinger: Fix null pointer exception"
* commit '105aa28eeff9d31eebc7645aecb7630918a09b2a':
  SurfaceFlinger: Fix null pointer exception
2015-03-10 15:48:55 +00:00
Dan Stoza b275b4dc3e am 3949f664: Merge "SurfaceFlinger: Fix null pointer exception"
* commit '3949f664c71ad1269ee0c921d176e3b4484015cc':
  SurfaceFlinger: Fix null pointer exception
2015-03-09 18:05:26 +00:00
Dan Stoza 24a42e9f54 SurfaceFlinger: Fix null pointer exception
Fixes a null pointer exception in getActiveConfig

Bug: 19416124
Change-Id: I45a01f67affb63a348866ce42a6013c5eb71fe8f
2015-03-09 10:04:11 -07:00
Dan Stoza b90cf07f8b SurfaceFlinger: Add --static-screen stats
Adds a --static-screen option to dumpsys SurfaceFlinger, which
displays screen-on time broken down by the time between the prior
frame and the current frame. An example dump looks like this:

$ adb shell dumpsys SurfaceFlinger --static-screen
Static screen stats:
  < 1 frames: 12.235 s (3.5%)
  < 2 frames: 29.898 s (8.7%)
  < 3 frames: 15.370 s (4.4%)
  < 4 frames: 13.103 s (3.8%)
  < 5 frames: 15.780 s (4.6%)
  < 6 frames: 2.022 s (0.6%)
  < 7 frames: 0.201 s (0.1%)
  7+ frames: 256.887 s (74.4%)

The buckets are exclusive, so '< 3 frames' covers the interval
[2, 3) frames

Bug: 19543586
Change-Id: I3253a54c23995d25e96016997acedd0775956b60
2015-03-05 14:43:08 -08:00
Dan Stoza 22d0bdf326 resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp
Change-Id: I0be2ecb8085f2cd9560138460bcc27d71c011608
2015-01-27 11:49:26 -08:00
Dan Stoza 1665c8e101 Revert "SurfaceFlinger: Attempt to attribute fds to layers"
This reverts commit 03eccb6616.

Change-Id: I4f0da7bb62bf77bb3d399aee601beae5e03928fe
2015-01-27 11:03:50 -08:00
Dan Stoza a5cbb1f18b am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible
* commit 'ef1c17ae9417abc1e21e49dbc629e448efc947dc':
  SurfaceFlinger: Make log message 64-bit compatible
2015-01-17 00:50:53 +00:00
Dan Stoza 3372cc25df resolved conflicts for merge of 03eccb66 to lmp-mr1-dev-plus-aosp
Change-Id: I1f38cbe7019b2b48b1094dee154ad97c23fd22c2
2015-01-16 16:18:51 -08:00
Dan Stoza ef1c17ae94 SurfaceFlinger: Make log message 64-bit compatible
Fixes the build on 64-bit targets that complain about using a size_t
with a %d in a format string

Change-Id: I7dfcd3a49eb0dbc5dffeb82bb7208de7f7925f08
2015-01-16 15:58:13 -08:00
Dan Stoza 03eccb6616 SurfaceFlinger: Attempt to attribute fds to layers
This tracks fds when layers are created and destroyed in an effort to
determine which specific app (if any) is active when fds are leaked

Bug: 19017008
Change-Id: I1f1d5a9cbc1399e3df3a2d350324f80b3a4e3477
2015-01-16 15:02:22 -08:00
Jesse Hall 9c22ac77e4 am 5b730570: Merge "surfaceflinger: use Mutex timedLock instead of tryLock loop"
* commit '5b730570be2bd1f90346a5921d0b70dc11351396':
  surfaceflinger: use Mutex timedLock instead of tryLock loop
2015-01-12 23:41:46 +00:00
Jesse Hall fcd15b478c surfaceflinger: use Mutex timedLock instead of tryLock loop
Rather than trying to acquire the state lock without waiting three
times at 1 second intervals in SurfaceFlinger::dump(), just try to
acquire the lock once with a 1 second timeout. Avoids spurious mutex
acquire failures that lead to flaky
com.android.cts.jank.opengl.CtsHostJankOpenGl results.

Bug: 18842510
Change-Id: I00ce6109647de2aef8831dd2f8fa98652ba7f4e0
2015-01-10 15:41:01 -08:00
Dan Stoza db5827d314 am 5878444f: SurfaceFlinger: Listen to HWC invalidate
* commit '5878444fb8da043021f30d3de739531f15390df5':
  SurfaceFlinger: Listen to HWC invalidate
2014-12-03 20:43:29 +00:00
Dan Stoza 5878444fb8 SurfaceFlinger: Listen to HWC invalidate
"Do less work when using PTS" broke the invalidate path up from HWC
to SurfaceFlinger. When HWC would signal an invalidate, SurfaceFinger
would wake up, see no new buffers, and go back to sleep. This is fine,
except when the invalidate is a result of an HDMI hotplug, in which
case the screen remains blank. This change makes that functionality
work again.

Bug: 18564815
Bug: 18558468
Change-Id: I2e2171d86839945f4e4e6555d66f7e2895bd096a
2014-12-02 16:58:17 -08:00
Dan Stoza 686c5be472 am 6b9454d1: SurfaceFlinger: Do less work when using PTS
* commit '6b9454d1fee0347711af1746642aa7820b1ea04d':
  SurfaceFlinger: Do less work when using PTS
2014-11-18 02:07:36 +00:00
Dan Stoza 6b9454d1fe SurfaceFlinger: Do less work when using PTS
Currently, SurfaceFlinger is very dumb about how it handles buffer
updates at less than 60fps. If there is a new frame pending, but its
timestamp says not to present it until later SurfaceFlinger will wake
up every vsync until it is time to present it. Even worse, if
SurfaceFlinger has woken up but nothing has changed, it still goes
through the entire composition process.

This change (mostly) fixes that inefficiency. SurfaceFlinger will
still wake up every refresh period while there is a new frame
pending, but if there is no work to do, it will almost immediately go
back to sleep.

Bug: 18111837
Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
2014-11-17 21:32:13 +00:00