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
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
When MDP comp is done the layer cache
is not reset. Calling the layer cache updated
after MDP comp is configured ensures that the
cache is reset correctly.
Change-Id: I9fc3ddd713ceac4be708e33782c3661e758dfcb9
This commit has the following changes:
1. Use hdmi switch node for hdmi hotplug
- uses /devices/virtual/switch/hdmi switch_state to determine
the hdmi connect/disconnect
- this switch will be set to 1 on connect and 0 on disconnect
- on connect, open framebuffer device, will trigger the hdcp
authentication.
- the driver will set the hdmi_audio switch to indicate that
the HDMI sink supports audio
2. Enable HDP on unblank
- this will resolve the device freeze during the bootup with hdmi
connected
Change-Id: Id7a656d548a31178e31dcb9aea8acf38a56c9e0c
(cherry picked from commit 953b04b3cbba2f91d25795e5b0560c13d47844b0)
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
Also make sure layer cache is used correctly when
we're not using MDP composition
Bug: 7643563
Change-Id: I4dcd70c2da128b2dcbe0b72dc14031983649719d
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This change extends MDP composition to support
upto 4 layers by making border fill as base pipe and
using all MDP h/w pipes in overlay mode.
Conflicts:
libhwcomposer/hwc.cpp
libhwcomposer/hwc_utils.cpp
libhwcomposer/hwc_utils.h
Bug: 7626586
Change-Id: I01a0e53ddfbcf3ed46734f6f3bb0ef7d912ceac6
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Remove state based pipe handling and make pipes tracked dynamically.
Add the configStart, configDone, nextPipe availablePipes APIs.
Remove setState API.
-configStart marks all pipes available.
-configDone garbage-collects unused pipe objects.
-nextPipe returns the index of next available pipe and create a corresponding
pipe object if not present
-availablePipes returns total of "unallocated" pipes. (Pipes could be allocated
but unused)
Changes in hwc adapt to the new overlay APIs.
Compile out MDP comp.
Remove unused files in overlay and hwc.
Update licenses.
Conflicts:
libhwcomposer/hwc.cpp
libhwcomposer/hwc_utils.cpp
Bug: 7626586
Change-Id: Id8e56901d34e5dc0fd088260d05e3e46f68ff090
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
In the cases where all the layers that are marked as HWC_FRAMEBUFFER did not
change, we can mark them as HWC_OVERLAY since their contents are already on the
framebuffer and do not need any additional processing.
This optimization shows power improvement for video playback.
Bug: 7623741
Change-Id: Ia178a926e6f56a3ec9291250a22a66f212c30b14
Signed-off-by: Iliyan Malchev <malchev@google.com>
Check for errors while drawing the layers in hwc_set.
Return -1 in the error case so that framework doesn't wait on fences.
Bug: 7284105
Change-Id: I024f9ca07faf64d6b90d4f483164dc15c0d7992c
Signed-off-by: Iliyan Malchev <malchev@google.com>
Cleanup overlay for external from the draw thread. If done from the uevent
thread, its possible that the object being used by draw thread is deleted by
uevent thread.
This also removes unnecessary side-effects where libexternal sets states in
hwc, whereas, it could be set from hwc itself. There should be no need for
libexternal to modify states in hwc.
Bug: 7335863 (partial fix)
Change-Id: If07483e640abae2ced2418e0d5c8f278f8c6ec33
Signed-off-by: Iliyan Malchev <malchev@google.com>
Wait for hwc_set completion if already in progress before processing
the async events.
Bug: 7288769
Change-Id: Ibdd0ee82f079df566b899c94df19f6bb1031d686
Signed-off-by: Iliyan Malchev <malchev@google.com>
We are seeing errors where a device's hwcVsyncThread is not present for some
reason. The surface flinger has not crashed, so either the thread never got
created, or it exited withouth throwing an error. This patch adds some more
verbose on-error logging to the HWC as an attempt to verify the theory that the
thread does not get created, or fails in pthread_create. While we're at it, we
add the same logging at pthread_create() for hwcUeventThread, as well.
Also, replace the lseek()+read() with a pread() combo in the vsync thread.
Change-Id: I555d786a7d66ff4ef1dbfd95947a7d9341e56f11
related-to-bug: 7305728
Signed-off-by: Iliyan Malchev <malchev@google.com>
If the FB is not used, because all the app layers are overlays, then set the
flag to have the driver not fetch from the FB pipe.
Bug: 7183992
Change-Id: I96ecc1610ac052e8512158d189b0614ecf82d139
Signed-off-by: Iliyan Malchev <malchev@google.com>
-- numHwLayers==1 means that there is only the FB_TARGET which HWC shouldn't
draw. Also check for blank in set. Checking for this in prepare prevents us
from acquiring pipes.
-- add null check for private handle
-- print out vsync timestamp data on error
bug: 7274417
related-to-bug: 7288769
Change-Id: I8dae0d0748c5226fdc33ed8f5cc5259835dec2de
Signed-off-by: Iliyan Malchev <malchev@google.com>
It had a glFinish which is not needed anymore on HWC 1.1
Bug: 7274951
Change-Id: I1389802a0ed3f0199d7d7ba0110a343b2f571106
Acked-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Fix some race conditions between hwc_eventControl and the hwcVsyncThread.
Bug: 7274951
Change-Id: Ic71d65918303b4cef6a379ff5397702b2b578373
Signed-off-by: Iliyan Malchev <malchev@google.com>
* Read sysfs entries to get vsync timestamp from kernel.
* External display continues to use uevents for hotplug events
* A new thread, vsyncThread is created to read and send vsync
timestamps to HAL.
* Disable H/W VSYNC for MDP 5.x targets until kernel changes are
complete.
* Synchronization is needed to make sure read() is not called
by hwcVsyncThread when VSYNC is disabled.
Change-Id: Iab0a94a3cfce9142b8867859f2a7d9bcaecb0996
Acked-by: Neti Ravi Kumar <ravineti@codeaurora.org>
If the pipes are closed after PAN a blank screen is
seen when when we transition from MDP composition
to GLES composition.
We close the unused pipes at the beginning of the set
since the decision has already been made in prepare.
Bug: 7188473
Change-Id: I6f946fa3d02f1c84fb2bb8d3b8e5c823c1151fd5
Signed-off-by: Iliyan Malchev <malchev@google.com>
Call sync before draw since draw could use rotator which reads out of the
buffer. For that to happen cleanly, the buffer should not be in use. Calling
sync before draw makes sure, the buffer is free to be used.
[TEMP]
Enable rotator for external video, since sync-pt is not used for external yet.
Bug: 7227220
Change-Id: I25fec8ecc158e28801f238d2829af4d635f3e2c9
Signed-off-by: Iliyan Malchev <malchev@google.com>
When rotator is rotating GPU writes into it causing tearing. With hwc1.1,
framework doesnt use fbDev, which had a call to glFinish(). Consequently, this
was missed out. Adding this missing code to hwc1.1
Related-to-Bug: 7227220
Change-Id: I7287d3d73b839fef818e31c1c8a783f1fb96d9f1
Signed-off-by: Iliyan Malchev <malchev@google.com>
Need to check if this is valid before doing anything
Extra NULL checks all around to prevent any invalid
lists from SurfaceFlinger
Change-Id: I57ca97167e469910bcaaa68672ae70b41a061ded
Related to bug: 7124159
UI Mirror works with tearing because sync operates at primary vsync. Need
kernel patch to wait on external post.
Change-Id: I77116ef40ae25a2207feb5ca3cd9065ef0da6e4a
Signed-off-by: Iliyan Malchev <malchev@google.com>
Bug: 7124159
--External disabled
--MDP comp coded but disabled.
--Videos via overlay, so that secure videos can work.
Change-Id: Ie48b264143d5e4237ab9724e28930e3f68ba49ee
Signed-off-by: Iliyan Malchev <malchev@google.com>
Add QService binder interface to enable communication
to display by the mediaserver for Securing/Unsecuring start and end
notifications.
Create separate lib for external.
Clear reserved field before applying format.
Change-Id: I463c9c6deac7587bd0c4e0b84513b5d0b5dd7e98
Add check for presence of non-zero number of layers.
Move the "composition after powerdown" log under that check.
Move the caching of dpy under list non-null check.
Change-Id: I99b9293e671a15ba1fb31692e30413d2bbd97867