SurfaceFlinger uses two event-threads to support phase-offsets
for application and SurfaceFlinger itself. Extra thread may
cause scheduling issues and wake-up latency for either
SurfaceFlinger or Application, depending on scheduling, even
when running at higher priority as these threads have low-load
and qualify for task-packing.
Use single event-thread when phase offsets are same.
Debug runtime service call behavior change when same phase-offset:
1018 (set phase offset for Application): will change both
Application and SurfaceFlinger phase offsets.
1019 (set phase offset for SurfaceFlinger): Will be a no-op.
Change-Id: I2514b4ff6249e9bce3eb19f60b1dfe0de12b86d9
* QC media encoder appears to be incapable of switching between RGBA8888
buffers and NV12_ENCODEABLE dynamically. This requires that we switch
the entire stack to use the QC opaque format, or RGBA8888.
REF: CRACKLING-938
Change-Id: Ibd6a8faf8d268d3bfb4d61e4118a778ed82f1ab5
Move the ExSurfaceFlinger, ExLayer, etc., classes to this
repository, to avoid dependency accross projects with static
linking
The following commits are included in this:
commit 04f501b31f627e47ae540b5160b2f86b7adbd921
Author: Baldev Sahu <bsahu@codeaurora.org>
Date: Wed Nov 25 18:05:51 2015 +0530
display-fw: Properly initialise mIsGPUAllowedForProtected flag
- This flag need to be initialize to false when layer is
created.
Change-Id: Ie3df40ffc4240c33883f19ecbef6428f7c539b07
CRs-fixed: 942102
commit 09032188751356db295bc5467133ec484dc536cd
Author: Arun Kumar K.R <akumarkr@codeaurora.org>
Date: Tue Oct 20 10:22:51 2015 -0700
display-fw: Enable checking for INTERNAL_ONLY private flag
Check for INTERNAL_ONLY private flag and return correct values
from the function isIntOnly
Change-Id: I61b44f636412e0ad93e1b3ff18e4accdf90eeafe
CRs-fixed: 927880
commit f687ac25b3482b92da3c252d29b65e850cca3ce1
Author: Arun Kumar K.R <akumarkr@codeaurora.org>
Date: Thu Oct 15 16:37:11 2015 -0700
display-frameworks: Include libqdutils
only for target builds
Featurize including libqdutils for targets which uses QCOM_BSP,
helps in resolving compilation for emulator builds
Change-Id: I39639c3100eb20dd24d2a875bb0e9bc82d2b2d1f
commit 4ec765e01be506a8083980fc746a1737bbac4bf2
Author: Arun Kumar K.R <akumarkr@codeaurora.org>
Date: Wed Oct 7 18:33:34 2015 -0700
display-fw: Disable rotation animation on secondary displays
- Set the animating flag on layer during animation which is used
as hint to disable rotation animation on secondary displays.
- Set sys.disable_ext_animation to enable the feature
- Remove unused definitions in the extended hwc header
Change-Id: I7b72c7b605930ea189e047fec17ed18b17d46fdf
CRs-fixed: 922304
commit 6998bbdfd7af3126b64897b16b6961e84952601b
Author: Baldev Sahu <bsahu@codeaurora.org>
Date: Thu Jul 30 16:01:15 2015 +0530
display-frameworks: Extend support for MDP3
- Add support for HWC_BLIT
- Allow GPU to compose widevine level 3
Change-Id:I11e03ccd0842d019e85d0c29bc5b7be559fccbaa
commit 2fa7aa1684c0162b8226c4327c86c6eaf6b76101
Author: Manoj Kumar <manoj@codeaurora.org>
Date: Thu Aug 20 13:52:15 2015 -0700
display-frameworks: Override mOutputUsage with sink Usage flags
mOutputUsage flags contain default usage flags and doesnt reflect
sink usage flags. Override mOutputUsage with sink usage flags.
This change is needed to support WFD Secure usecase.
Change-Id: I14d8812049f635a8ebe6a944783e0ec7f8f80b1f
commit 09da768794c8c6acd786d73239ed5a739695b8cb
Author: Raj Kamal <rkamal@codeaurora.org>
Date: Mon Jul 20 10:46:27 2015 +0530
display-frameworks: Extend the classes defined in SF
Add support for custom classes ExSurfaceFlinger,
ExLayer, ExHWComposer and ExVirtualDisplaySurface
Change-Id: Iab8c4835faaad9b436bbd34d38702741eb0cf12d
Change-Id: Ie400c94ccc77fc379ffa256af03a9e42ba5decaa
This error can be seen for the following use case
1. Connect HDMI display
2. Dump the SurfaceFlinger state
The problem here is that HWComposer would have processed the display
connection event via the hotplug mechanism and considers that the
external display is connected. However, SurfaceFlinger has not
updated its internal state (mDisplays) since it will be waiting for
the mStateLock to be release by the dump function. As a result, when
the dump function invokes the getLayerSortedByZForHwcDisplay for the
external display, we will end up seeing the error log message because
SurfaceFlingers internal state has not yet been updated.
We can move this to ALOGW since it is a non-fatal/recoverable state.
CRs-Fixed: 914173
Change-Id: Ib0ba359ecd894dd463417ba57ba1f72c07b5833e
Reduce transparent region from a layer only if the transparent
region has valid intersection with the layer. Otherwise, reducing
a transparent region lying completely outside of the layer leads to
invalid sourcecrop values for the layer.
Change-Id: Iee9ba53a8072c21c9ba8a6d58cb14ca30f8600ba
CRs-Fixed: 620973
Compute crop and display frame for GPU composition also
in the same way it's done for HWC and compute vertices
and texture coordinates for GPU composition. This avoids
pixel shifts in output of GPU composition & overlays.
Change-Id: I0d31b1e4a81049fff72109d1a210e7cbd945cfe9
[root cause ] framebuffer surface is in the same process of surface flinger
[changes ] call IGraphicBufferProducer::allocateBuffers on producer inside the DisplayDevice constructor to force-allocate all three buffers.
[side effects] none
[self test ]<tshark, enter and exit mainmenu>: ok
[reviewers ] zhongjun.chen
[change_type ] AOB --> google_original
[tag_product ] common
Change-Id: Ideb75d3aa1ed23b2fa4d263a120ea3ca39d01361
This change is porting of below commits related to MDP3
In MDP3 we are using the widevine level3 for secure content
display. And this should applicable only for primary display
not for screen shot or screen recording
- CRs-Fixed: 595469
- Change-Id: I99be2d81287ab746d5c4a2375c3106c59e61a8fc
Change-Id: Ie7ac95e1c03eb7ad6f71098ecf09a1e25e69760f
Blur layer need to capture screen shot to create to blur
effect. Hence need to take care any user defined orientation
as well.
Change-Id: I1c0478810d12661edf2586293bbed342a5b4dc7e
Dedupe rotation calculation code and make rotation a statically
available property in the DisplayDevice
Change-Id: Ic517ab0d2c05026cd6fa46d664aab7926be17b62
This patch works in addition to the following commit
re-implementing ro.sf.hwrotation:
7d283431ef
When using values of 90 and 270 for ro.sf.hwrotation the
LCD width and height also need to be swapped to display properly.
Change-Id: I2874fdb8f8d8b855df6d62d338c9a22360491973
NOTE: This patch does not fix the initial startup of bootanimation
* Previously HAL orientation sensor would always be replaced if the HAL
did not provide a rotation vector sensor as well. Practically no HAL
does, so the virtual sensor would always replace it.
* Add the virtual sensor only if the HAL does not provide it.
Change-Id: I50ad2cd6c60b53eddc4c6854997ec2e3dbff0d1a
* In KitKat and on most Samsung devices, the orientation sensor is
not getting registered, and makes the compass non-working in a lot
of apps. This patch enables the sensor for such devices.
Change-Id: I0ebba72ec4aa2cfa02c21a6daff0c356c6793fd0
(cherry picked from commit 98fa6f1152da759ef3eaf36cb16e0aaf2013376a)
The sensors API introduced a new flush() method that older binaries
won't have. For those, replace the firstFlush invocation with a
setDelay call since a lot of implementations interpreted that as
the initialization step.
We also don't want any kind of call to flush() to happen when it
isn't there, since it'll either hit a random OEM extension or
a memory address we really don't want to execute.
Change-Id: I26ce923fe385751fed7d1c483a53c074249f0620
sensorservice: Set the rate for pre-1.1 HALs _after_ activation
We want to be sure these are applied in the same sequence they
used to be...
Change-Id: Ied2ba08ed3c4bed3a80bac6ab5471fcea9ba2c09
If triple framebuffers are enabled, the number of acquired
buffers isn't increased by default. Set the count to one less
than the max buffers to make sure all three buffers come into
play.
Change-Id: I8fae1b5564fbea598e415a86b0a21c3449c92d87
Reserve HWC for VDS for WFD use case. During WFD usecase, sink usage
will contain GRALLOC_USAGE_PRIVATE_WFD flag.
When HWC is avoided, all virtual displays are composed using GLES.
This means that GLES composes directly into the sink buffer and
signals the consumer. Furthermore, it is expected that any color
conversion will be handled on the consumer side.
CRs-Fixed: 908380
Change-Id: I93ff54c79ece788b6caf3f4172835d8ac1362f62
Initial sensor flush at subscription is a mechanism to avoid sensors
to get stale samples before subscription happens. However, there is a
slight chance that a most recent sample will be lost during the flush
process. This is OK for continuous sensors but problematic in
on-change sensor as on-change event does not come continuously and
a lost event can cause inconsistent state in client. Flush at
subscription of on-change sensor is disabled in this CL to avoid new
important on-change event to be discarded during the initial flush
process.
Bugs: b/24647069
b/25241873
b/24804819
Change-Id: Ibda099c6b9f5fb6e200f13cf13a850b0026e9e7c
- Add support to set animating layer for HWCLayers
- After hwc_prepare, dont override the compType of a layer to
HWC_FRAMEBUFFER if its for non-primary displays
Change-Id: Iac462778ce5fb9016290846146e62f80dcfafd5c
CRs-fixed: 922304
* The visible pointer icon when hovering or drawing with the stylus is
quite annoying when trying to actually draw with it. Turn it off by
default and add an option to turn it on.
Forward Port from CM-11.0
Change-Id: Ie4e9e6bcc48803b195d1615d83d6e36d663cc33a
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
Android 5.0 cannot form multitouch events from multiple input
devices. So it is not possible to report one touchpoint from the
stylus position and, at the same time, another touchpoint from a
finger touch. Instead, when a new input device starts up the currently
active input is cancelled. This is highly undesirable while writing
with the pen.
The easiest solution is to ignore non-stylus touch events while the
stylus is within range (hovering) of the touchscreen. For example,
N-trig digitizers implement this in hardware. But wacom digitizers do
report pen data simultaneously with touch data. This patch disables
(non-stylus) touch input within 50ms of stylus data. On my Galaxy
Note this is necessary to make stylus input usable.
Original commit by vbraun:
b9cb296130
Change-Id: I97f26369826e96c97461c8ae188f1c64dec1b4d3
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
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
Avoid disabling DispSync resync if app and SF events aren't
using phase offsets. This prevents hardware VSYNC from turning
on always whenever something needs to be drawn, thereby
bringing down the power numbers.
Change-Id: I83c8f79eb46b9fdaa730ec32767ebed3286347b8
- 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
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
Add DisplayUtils class which uses the custom implementations
of ExLayer, ExSurfaceFlinger, ExHWComposer,
and ExVirtualDisplaySurface classes if needed
Change-Id: Ibdd8da5d3d0d602f42b76a15d0994c6aa98bee3f
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
Add handling of "replacement" key events in InputReader and EventHub by
consulting device's character key map (if exists) for presence of
replacement key code for given get code and meta state combination,
before passing it to InputDispatcher.
This enables defining special keys, such as ESC, on keyboards lacking
enough physical keys, via combination of normal keys and modifiers, for
example AltR + 1 => ESC.
Bug: 24504154
Change-Id: I7e36104808bedcf724436c1fbb63d37c35cca8af
This reverts commit 9b70ab7a3cb260205e81e40ba181a86710d2eb95, reversing
changes made to 153008efb5a00ed3c18d588ce15f90d2442a9786.
Bug: 24302031
Change-Id: Ia746381b30be3b54cb646ed412b7271962c4b02a