Fix locking on wfd pause, resume events. Some variables are updated
without proper locks being held.
Fix external related lock in hwc to include complete prepare and draw
Mdp comp for primary, otherwise, ends up reading some flags without
locks.
Change-Id: I0f2f0953a7ab322128d044ca3458e359da4e575e
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
We need to call commit on wfd even if in paused state so that pipes
which are unset are actually unstaged from driver
Change-Id: Id71de8b80c44a632989de154a2387380d8fa66f0
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 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
Remove return statement from display commit failure and assign
the return value as -1 to avoid memory leak during error scenario.
Change-Id: I87dd73e997e016f89944bb1603b517847bbc555c
- 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
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
This change is the hwc and copybit changes need to enable
composition to go through mdp on msm8610.
Change-Id: If0df3a247c5f4f4310966d14fe8fd839bf84b9d5
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
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
- Dump more info for BUFFER_SYNC ioctl failure case.
- Enable debug logs for blank/unblank display.
Change-Id: I289ed8ad39a0181ff4a404644b90cb02a8144b9a
In extreme cases, when all pipes are used, the buffer is insufficient.
Reduce logging by striping off unnecessary bytes.
Change-Id: I5a6ffb9ff288e389eea4e9ca4ac850ed59d539ff
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
This is logged in the kernel and if there are excessive delays,
logged in the PowerManager.
Bug:8485194
Change-Id: Ia83b186ccae1fb6de59f200faf28346f84d832b6
- On suspend, SurfaceFlinger calls hwc_blank on primary and
external separately, inbetween these calls there might be a
update, which leads to acquiring overlay pipes for external
which will not be cleared and results in showing up stale
frame on external display
- This change clears all the overlay pipes used on every blank
Change-Id: I44d62b7d0fcd992cf8a26bb0c21df77952bc1381
CRs-fixed: 464070
This is indicative of how many frames are posted to the display
by SurfaceFlinger. Set debug.gr.calcfps to 1 and restart the
framework to enable.
Change-Id: Ic503c14380fd7d8a5b062aa5da0d61bfc3991cb2
CRs-Fixed: 462010
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
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
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
If the incoming layer count exceeds MAX_NUM_LAYERS,
let surfaceflinger handle the list.
CRs-fixed: 456906
Change-Id: I53159104e5e714ba313d0196ca959f55c82e18ae
Surfaceflinger does not send Blank/unblank event to hwc for virtual
display, handle it explicitly when blank for primary is invoked, so
that any pipes unset gets committed.
Change-Id: Iec7a1611a8963408f65c8a73a1c15e47cd7faab6
CRs-Fixed: 456810
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
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
Call MSMFB_DISPLAY_COMMIT for primary FB even if FB handle is null.
This is already done for external FB.
Change-Id: I5c405f933ce0fd99df6813acea45169802c54226
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
Android has scenarios where it calls HWC::prepare and HWC::set
without any application layers. In such cases, for power
optimization, user space avoids calling PLAY
(on FB - since there is no new content drawn) and COMMIT ioctls.
But we might have called UNSET on mdp pipes used for the previous
frame. As per the current MDP design, these freed pipes will not
be unstaged unless atleast a COMMIT ioctl is called on that mixer.
Change-Id: I7f7574b2e589e80c4926533066e35784bb29b4a5
CRs-Fixed: 437736
- 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
- When the device is suspended, the overlay pipes will be unset,
but they wont be unstaged as there is no DISPLAY_COMMIT ioctl
called for ext display, as a result the fence wont be signalled
by the MDP.
- This is needed as we dont turn off the External display(HDMI)
Change-Id: I9794ad2ae7c9d7b4ce3f9787f50ea9da87966e41
CRs-fixed: 425483
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