Commit Graph

206 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
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
Steve Kondik 3141dc73b6 surfaceflinger: Clean up use of QC extended API
Change-Id: I1256605e63e90f3baaa213453246fb0e44e0c770
2015-10-12 23:36:09 -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
Dileep Marchya 24e0fdd93b SurfaceFlinger: Add dim layer information into HWC layer.
- Set dim layer flag = 0x80000000 to send dim layer hint to HWC.
- Clear HWC_SKIP_LAYER flag when dim layer flag is set.

Change-Id: I56904c65fb487e6e89d4c057015443730d727299
2015-10-06 03:22:28 -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
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 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 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 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
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 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
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
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
Michael Wright 1f6078aef7 Have VirtualDisplays send SF resize messages when resizing
Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
2014-07-30 11:23:44 -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
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
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
Svetoslav d85084b2b6 Adding render stats APIs to UiAutomation (framework native).
bug:12927198

Change-Id: Ibb1c07f7d89e11281e5c1f27f412a29ac6f9c4ab
2014-04-10 12:32:19 -07:00
Dan Stoza b9b088375d Remove deprecated BufferQueue constructor
Bug: 13415624
Change-Id: I9fe15e45daa7351f1db34ee75bfee6f19cb347d3
2014-03-18 10:08:44 -07:00
Wonsik Kim 29fa9590ad Revert "Implement video plane layer"
This reverts commit f837c93a1b.

Change-Id: I6a1aa9ad0aca023267dc53d19c950b1535123ca7
2014-03-17 11:17:28 +00: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
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
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 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
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
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
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 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
Alan Viverette 9c5a333511 Add API for pushing color transforms to SurfaceFlinger
BUG: 9057596
Change-Id: Iea0953366eac875b7968897a75472c25a137edb5
2013-09-12 20:04:35 -07:00
Mathias Agopian ff2ed70fa3 color blindness enhancement
This is an attempt at improving the experience of
users with color vision impairement.

At this time this feature can only be enabled for
debugging:

  adb shell service call SurfaceFlinger 1014 i32 PARAM

  with PARAM:
   0 : disabled
   1 : protanomaly/protanopia simulation
   2 : deuteranomaly/deuteranopia simulation
   3 : tritanopia/tritanomaly simulation
  11, 12, 13: same as above w/ attempted correction/enhancement

The enhancement algorithm tries to spread the "error"
such that tones that would otherwise appear similar can be
distinguished.

Bug: 9465644

Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
2013-09-04 22:11:15 -07:00
Mathias Agopian 4f4f094348 SurfaceFlinger now runs in the process's main thread
it used to spawn its own thread and return the main thread
to the binder thread pool -- this was confusing the naming
of things in the kernel.

Bug: 10331839

Change-Id: I2d13a6d73409a38109300fcbe6a04b4c41cb5d00
2013-08-20 11:16:45 -07:00
Jesse Hall 9e663de4fe Use new HWC display type/count constants.
Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
2013-08-16 14:28:37 -07:00
Mathias Agopian 3f84483382 SurfaceFlinger now uses GLES 2.x when available
Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
2013-08-13 16:07:45 -07:00
Jesse Hall 6c913be9ca Add ISurfaceComposer::destroyDisplay
Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
2013-08-08 13:12:29 -07:00