Remove the unnecessary blank lock, mdp comp lock, secure lock.
Rename the ext lock to a more appropriate draw lock.
The mdp comp lock is at an incorrect place and causes unwanted
objects to show up in dumpsys, since configDone hasnt cleaned
them up yet.
dump(), blank(), draw() should all acquire a common lock.
draw() includes prepare() and set().
Change-Id: I595547dd5a393a8af6cd8c9297d50793b715e658
An earlier patch disabled plane alpha completely for video.
Instead, do this only when we are in video only mode.
Change-Id: I2edc8c5ff5c90ec205b63175e5f3a4e6ff7eae69
Command mode panels have an internal framebuffer with which they
refresh, hence the idle invalidator isn't needed for them.
Change-Id: I6acf0cc1f8c520cbcf706f109a42e47304c534d3
- cleans up external library
- add separate library for virtual display
- process virtual updates in its separate path
in hwc.
- Acquire blank mutex lock for one complete drawing
cycle
Change-Id: Ib984c578464a131ecdb27ee48960f58d68b7a5a7
Add assertive display support to hwc. This feature takes effect when
node /sys/class/graphics/fb*/ad is present. This signifies that that LM0
is being used with fb* for writeback.
When a video playback begins we write "1" to this node to indicate to
post processing that a writeback will happen. Likewise a "0" is written
to this node when playback stops.
The original contents are worked upon and the modified output is fed
via writeback to either rotator or mdp as appropriate.
The feature doesnt trigger when either:
1) Buffer size exceeds 2048
2) External display is connected
3) Multiple yuv streams are present
When this mode is active, MDP comp is applied only to yuv layer.
Change-Id: If5520f9dc849de3189c9f9ed4e9072c8f8f760e1
If the left split is not published by the driver then the default should
be even split. This was missing from the configuration in utils. This is
already taken care of in framebuffer configuration and mdp composition.
Change-Id: I3db44481fd791809146752ddff56420dcbe89fb4
For split displays, earlier we allowed pipes to switch mixers in
subsequent rounds. This change prevents that and makes sure there
is one composition round where a pipe being transferred to another
mixer of the same display is UNSET
Change-Id: I3c679cc4256363eeb70c5cf8bcaf5047b8a064c2
If framebuffer needs to be configured, configure it before all the
other layers in mdp composition. This helps in cases where we are
out of SMPs and framebuffer configuration fails owing to that.
Framebuffer being the fallback path, should always get highest
priority when reserving SMP blocks
Change-Id: Ie7a6903d1b9fb98b308689c81522571449bf2e8e
Added the ability to disable idleInvalidator when the
debug.mdpcomp.idletime property is set to "-1". The hwc test app
displays image on the screen with surface flinger turned off.
This causes timeout, so this change is to allow the testapp to
disable the timeout functionality by setting property.
Change-Id: I1adf28eea33ea73f3695644bec95056d16bd85f8
If debug property for MDP composition is enabled,
we call dump function from composition thread.
Make sure we are not holding the MDP composition
lock before calling dump function as this also tries
to acquire the same lock and causes a dead lock.
Change-Id: I05e5fd58be096f1ab683d796cc1beb4972c2168f
Reset the current frame data before returning from MDP
composition prepare to avoid accessing previous frame data
in MDP composition draw phase. Avoid the number of app layers
going beyond the layer count limit in MDP composition.
Change-Id: I2a3035ad5cb1731060b9359ccdbe9fe0c07e843c
CRs-fixed: 510683
Dumpsys runs in different thread not in composition thread.
Accessing mdp composition frame info in dumpsys with out
synchronizing could cause crash since frame info can get reset
in composition thread.
CRs-fixed: 503268
Change-Id: If3f7d8cc9fce8b14622e666fa52583ff0cfdedd2
Add support for unevenly split primary displays.
The driver provides info about the split via msm_fb_split sysfs node
For external we assume even split. If driver doesn't specify any split
for primary, we default to even split.
Change-Id: I4d541f41de2d7a5d2b62653fa33cab079a6d5d30
If an incoming layer has HFLIP tranform it needs two lines of
SMP buffer(or latency buffer). For panels with width greater than
1k this is costly. Fallback to GPU if RGB layer transform has HFLIP.
Change-Id: I9de63bf088d6afa0924ece7ac75e68f0bab7a6b5
When WFD is connected to 8x26
1) On Video transition, have 1 padding round if external connected.
Required to shift pipes across mixers.
2) Request DMA pipe always for FB on WFD.
Necessary for rotation + writeback
3) Disable non-worm-hole calcs on external (because of 2)
4) Disable action-safe calcs on external (because of 2)
Change-Id: I63b50b2477db443f9ea1d3fa610b59295c9359b7
In video-only cases, don't use yuv count for fb Z order, instead use
the mdp count which indicates how many video layers are actually
being sent to overlays.
Change-Id: I53ab4316fbb17f5d054066ef2dd85d89183d6a8c
This change adds adb property support to disable mixed mode in
MDP Comp. Will be helpful in debugging issues to narrow down the
root cause.
Change-Id: I49b737bb8755dc3a35db2e1ea8ccb2043135d2b0
Move the condition for checking maximum number of app layers
ourside the isFrameDoable function to avoid heap corruption while
updating hnd array in cacheAll function.
Change-Id: Id4458fcadc7775a2d78b1849de6782857c6ac17f
Fix MDP comp array index access in case of High Res pipe allocation.
This is already correct in case of Low Res allocation routine.
Change-Id: I7eaa0711ef8998ea03edba18b74db80459daf4c7
- Check for MAX_NUM_APP_LAYERS before updating yuv indices array.
- Fall back to GPU composition when number of app layers exceeds
MAX_NUM_APP_LAYERS to avoid heap corruption.
Change-Id: Ieb91b705a0a5f50ce2f8829d1f1ee048d44b7d2e
In scaling check, consider out of bounds layers, apply trim
and then decide if scaling is necessary or not.
Change-Id: Iad7f662f42096b3f7a4a1c4cfe71048d275f4b5f
These include constrained targets, with external connected which could
lead to a scarcity of pipes. Furthermore owing to a scarcity of writeback
interfaces, even if pipes are available, we may not be able to still
use rotator.
Change-Id: Ie2fb4c1726f32addcace89c268a126abe0cddbe0
In case of videos, do a fallback using 2 pipes per mixer at most.
This redraw will happen only once to reduce pipes from at most 4
to at most 2 and never draw again until there is an update.
Change-Id: I78c0dc2af4e3bd7e9128994e507e777187b4e247
- When primary is animating, the animation should not be
shown on the external display.
- Mark all app layers as HWC_OVERLAY on external during
animation so that SF wont compose it on FB.
Change-Id: Ic557cabfd9f2518614777c0e993541e36e090850
In High res case, there was no check for whether a layer is marked for mdp
leading to unnecessary pipes reserved for rgb layers on external.
Remove z order setting in allocLayerPipes, its too early, incorrect and
will be over-written anyway.
Remove the separate pipe allocation block for YUV. It is redundant and
unnecessary.
Change-Id: Ie90b4202a27ca4f52874514e3fa2b136ae5717f5
Reset idle fall back at the end of prepare, so that irrespective of
whether primary or external is configured first, both will fall back.
Change-Id: I6206f7cf0cccf71d1b33153044546515029f4e08
Alpha downscaling check should be applied to the full and partial
mdp comp checks rather than as a hard-feature check.
This means we could still have a video going through MDP comp and
the volume bar (lets say) failing the Alpha downscale check.
Change-Id: I6a47057e826668f7f19e20b6d0a548fffa349de2
By default make use of redrawing. It will be toggled only when caching
decides there shouldn't be any. Per our priority ordering:
1) Full MDP - redraw irrelevant
2) Partial/Cached MDP - decide on redraw
3) Only Video - 1 & 2, which include video, are not possible. Redraw.
4) Fallback - Redraw.
Change-Id: I6b74a5edcf79488ede2ea9480721731f371af9c8
Check for MDP's max downscale limit before using MDP for composition.
MDP 4 can downscale in each direction upto a factor of 8.
Bug: 8744080
Change-Id: Ib9f640a6b1db3ba6244eb665a060f624425b4841
There is h/w limitation when MDP_OP_SCALE_RGB_ENHANCED bit and
MDP4_OP_SCALEX_EN or MDP_OP_SCALEY_EN bit is set.
The minimum block size is 2x2. MDP will hang if the source RGB image
height or width is equal to 1. Hence fallback to GPU in such cases.
Change-Id: I7333b097fd26bfb888865de9c39d1664bc87acca
Fix reseting on handles, they never were in most cases,
owing to wrong size.
Fix redrawing, which needs to be done also when the fb's zorder changes.
Fix mdpcount update which should happen before we assess the pipes
available versus the pipes needed.
Handle video only cases, where other UI layers could be present, but we
cannot use MDP comp for them.
Restructure MDP comp decision model and some redesign.
Change-Id: I86a2efb77edccbbb9e9d7701d06c5b2578a9d2aa
Introduce a padding round between the DMA line and block modes.
Do this based on whether DMA is actually being used, when block mode
is first requested.
This relieves the driver of doing an UNSET ahead of vsync which could
cause blinks in all such transition scenarios.
This approach should lead to smooth transitions for multiple targets
with the exception of secure videos, where there could be a blink in
any of the different approaches we use.
Change-Id: Ibc0b8d284b5c6ed9291a7cfa7e7f221300a921e2
Add support for decimation on top of what MDP can downscale,
because decimation can have quality issues.
B-family MDP downscale of 1/4, plus decimation of 1/16 can let
us have a total downscale of 1/64.
Also decimate by 2 (min) if width is greater than what layer mixer
supports and is not handled by the client.
Change-Id: I3b7c4bf321c7561bd98206ad118f4ac1ee2879ae
Add support for tracking the mode in which DMA is being used in overlay.
Remove unnecessary tracking variables, and their set,reset inconsistency.
With such varibles in hwc, it still leads to overlay giving out DMA pipes.
Make overlay as the single tracking place.
Change-Id: Ib949f3d0ef5918ef323c81cb1768b68a68c83da4
Layer transform should be considered while performing
downscale limitation check. Failing which videos will
fall back to GPU.
CRs-fixed: 474244
Change-Id: I04e005afa77a209d5de58446d4c6f15842d9a43b
With this change we are moving MDP composition from all-or-nothing
implementation to mixed mode implementation where layers can
partially be composited through MDP and while rest of the layers are
composed / cached in framebuffer.
- Mixed mode design is based on layer caching
- Mixed mode path is configured only when non-bypassing
layers are cached.
- Never allow mixed mode when FB needs to be udpated.
- If we cannot bypass all MDP comp marked layers, bail
out completely.
Change-Id: Ie08f39db07e032b537f042d0d2bfe772ebfed049
In case of High resolution MDP comp, initialize rot field to NULL,
which was missing.
This is already done in the Low resolution case.
Change-Id: I5a9be8393cceff58f0ba3b6d85a887949f25af62