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
1. Since SF doesnt invoke blank for virtual display,
handle pipe clean up as part of Primary display
blank.
2. Support virtual display to query display attributes.
This refactor is done to address Framework reboot issue.
Change-Id: I266a87228193fd85252a22242b66dd4af5f3033f
Implement sync for rotator.
If a buffer is rotated, it can be used by producer soon after
rotation (and it wont have to wait until vsync).
Mdp waits for the rotator buffer's release fence to signal
to start display.
Hwc waits for previous access to rotator buffer by MDP to finish
before using it
Change-Id: I5664806a17c44d58af62a2825ce454089fcd31cf
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
- 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
Add a BWC policy manager that decides if BWC needs to be disabled on
certain conditions.
These conditions are statically determined. BWC might get used and
still fail (or cause failure of subsequent pipe requests) if SMP
blocks are not sufficient.
Change-Id: I805738911a8da7dfc6232c133c74ef844c3af5b1
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
Remove default arguments from setMDPflags function to get rid of
issues hidden from the developer.
Change-Id: Ic78645675b0aaab284fe2d0de8fffb4b26beabc7
- 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
- The required orientation on External can be set using the
properyt sys.ext_orientation.
- Values can be HAL_TRANSFORM_ROT_90, HAL_TRANSFORM_ROT_270
- According to the value set, the FB_TARGET for External will
be rotated and positioned as per aspect ratio on Ext
- For YUV(video layer) it just calculates the position, as the
rotation should be the source orientation
- This feature is supported only for low resolution panel.
Change-Id: I3d532ee0cb8dca3c37869537b55cd8044fd9047e
If there are any EXTERNAL_ONLY layers present in the list, mark
them as HWC_OVERLAY such that SF does not compose and in hwc_set
post that layer to Ext display, ignore other layers
Change-Id: Ic5db3bfa88295167d23d1fb2be7640c9fc772054
Acquire mExtLock before proceeding further in
hwc_prepare_external to prevent crashes arising out
of updating ctx variables from two different
threads(composition and uevent threads)
Change-Id: I0f18c41b117f18aeb25572b53ef6eba3638bb826
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
Log a frame-by-frame succession of HWComposer layers' data and write
their buffers, if any, into raw or png files based on system property
values.
Change-Id: Icceccf5fff5ab4d78dbc6c28c11210b8837ddfd9
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
Set z-order of video layer to 0 and framebuffer to 1 in case
of video overlay composition so that the blending takes effect.
Also set is_fg OFF for framebuffer.
Change-Id: I05f930074d265d690f29a1003b7c28077df89bbf
CRs-fixed: 458180
Even if we exceed max supported layers, configure pipe for FB
Because FB contents are always displayed using hwc
Also some minor code fixes
Change-Id: I740ab7e908c916373b1d87facd831e09098ce753
Do not allow mdp composition when any layer format has alpha channel
and needs scaling as the VG pipes are not supporting alpha downscaling.
In few scenarios, at the beginning/ending of animations Surface Flinger
passes few frames with flag HWC_BLENDING_NONE though it has Alpha.
When such layer passed to VG piple and if needs scaling , it results in
flicker. Hence, just checking for HWC_BLENDING_NONE is not enough.
Change-Id: I70fdfe4547df6fe7b2771ed8042f43aa4e07a71d
CRs-fixed: 462508
This change adds support to MDP composition to use DMA pipes when
layer scaling is not needed. Also makes sure not to invoke
MDP rotator when DMA pipes are configured since MDP rotator will
expect both the DMA pipes to available for performing rotation.
In such cases, we let the first frame of rotated video frame to
fall back to FB.
Change-Id: I3c3697dd2713ce9b86ba1e23192ec5841abd25ec
Slightly different version went on jb_2.5 which caused a
mismatch. Escaped testing because FB HAL is not used.
Change-Id: Ia7ee2fb80bf937499d372383641f71530dc1feca
This patch removes the usage of the framebuffer HAL which is
deprecated in JB MR1 onwards. The code is left for compatibility
such as conformance tests but it is unused for normal display
usage.
Change-Id: If98133bdaa759cdc41d4503ff695b225ee43cb6f
Conflicts:
libhwcomposer/hwc_utils.cpp
-Add support for Video via overlay on 4k2k external panel.
-Add support for rotating videos on 4k2k panels. We use
pre-rotation in hwc to rotate a video into a single buffer,
irrespective of panel size. Then this buffer is fed to MDP.
Rotator objects are managed by the new RotMgr.
-Cleaup mdpcomp and overlay.
Change-Id: Ifb08534747e8e18b6c58dd8a3e1a9947409100f1
Sometimes vsync would not be disabled before the display is
blanked.
This was due to the vsync disable ioctl being kicked off in a
thread different from the event control which surfaceflinger
called. So, while the calls from surfaceflinger are in order, the
order of execution wasn't always the same. Hence, making sure
ioctls are called in the same context to ensure order.
Also
- Make blanking/unblanking logs show the operation as a string.
- Add a debug property to dump vsync timestamps (needs framework
reboot)
- Remove a log which showed delay in reading vsync. This log was
unreliable when vsync is disabled and we're still reading from
the sysfs node.
Change-Id: Ibec04e9ffebd0ac6e1d32b7031e3668abd9390ff
CRs-fixed: 443113
The earlier copybit solution involved blitting directly into
the SurfaceFlinger's framebuffer target. That solution involved
unnecessary framework changes and caused issues when the
framebuffer was being written to both by GL and copybit.
Update hwc_copybit to use our own buffers for this purpose.
We also make sure we display only the region we're interested in
so that unnecessary artifacts from previous blits do not show up
on the display. This way, we can avoid clearing the intermediate
buffers every frame.
Change-Id: I713b3fc606e0768444c621af76853ece41964da1
This patch:
-Implements MDP composition for higher resolution
panels of width more than 2k.
-Adds DMA pipe support for high res. MDP composition
Change-Id: Ib7b1f822e3600eca81521294fedfe05e948b65c3
Close acquireFenceFds always even in case of failures if a layer is either
OVERLAY or FRAMEBUFFER_TARGET to prevent leaks in case of failures.
The framework is *not* responsible for closing acquire fds, for layers
marked as above two.
Change-Id: Ia6c751d3ec25f196f5503120894fc6cc692b9d25
This change allows virtual display to be composed
by HWC for supporting Google WFD App + QCOM WFD stack.
Change-Id: If8892230256e72fa34e3fb5ae715c3ad8cbd5b64
Add a client interface which interfaces with hwc.
qservice upon receiving IPC, provides a callback notification to the qclient
which does appropriate stuff in hwc.
In future, qservice can safely be even made a separate process with no changes
to exisiting code. This was not true earlier owing to the hwc pointer held by
qservice forcing it to be in the same process that hwc is in.
CRs-fixed: 452977
Change-Id: I05838c213f5d4606a6573693de1bacbc5876107e
- Read scan_info sys file node to check if TV underscans
- Apply action safe parameters to avoid overscan on ext display
- Store action safe width and height ratio using system property
- Use these to calculate the destination position on the ext display
- Remove unsed ActionSafe Class
Change-Id: Id27e6fa20966fb13fc16aa7e237cacce8caeb642
CRs-fixed: 447367
This change introduces the following changes:
- Frames having 2 yuv layer can be bypassed
- if not handled by MDP comp, video path will not
handle any such frames and will be FB rendered
Change-Id: Id211dbc185608c482badbca00a2708fa6138a8e5
In Mdss, mSecureMode is never set, instead the secure content flag
has been set/unset on each layer buffer.
Change-Id: I3283533c11206e189ce70dbc84776b2cff3a909d
- Add CopybitEngine to hwc_context
- draw the layer on the HWC_FRAMEBUFFER_TARGET using
copybit(c2d) if it qualifies for C2D composition.
- use fence returned from the copybit during c2d
composition
Change-Id: I052da015cd031f7abd6411d83d7944c335caeff7
This change introduces hdmi pending state, where we allow
frames to fall back to FB, closing all MDP pipes.
Pipes could be used by primary (mixer 0) in which case moving
them to external (mixer 1) involves unsetting them and setting
them in the same round which is not recommended by the driver.
It will fall back to GPU till HDMI is configured on a connect
event.
CRs-Fixed: 430057
Change-Id: I4b6677883c499f6d15656c3578190be1115ee6b4
Restructure MDPComp class for 4kx2k displays.
Cleanup MDPComp class to remove unused stuff and formatting.
Add a MDPCompLowRes class for current functionality.
Add a hollow MDPCompHighRes class for future.
Change-Id: I343540e712d31ca907257a73b49567578f49d5f7
Add support for 4kx2k FB for primary and external panels.
Change class design to create appropriate version of FBUpdate on boot up based
on the panel resolution.
Change-Id: I216d815d9b81c610aa39e351f7b55736dfa48b43
Does a basic implementation of the dump function
called by SurfaceFlinger in dumpsys.
Further logs in different areas can be added later on
using the dumpsys_log utility.
Change-Id: I2194b4ed7f10947272b7b824ef802ce2ee3c8a48