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
Unlock previously locked overlay buffers in N+1th draw round, rather than N+2th.
This is now possible because of wait for PAN.
Provides an opportunity to improve genlock behavior.
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Change-Id: I13d9c39e276918c3d3d27b2f07ed486b27b58441
Draw sequence in hwc_set
--eglSwapBuffers
--wait for fb_post. Its ok to draw to External only at this point.
--draw to external | Parallel with PAN
--commit to external | Parallel with PAN
--wait for pan (happening in fb_post) to finish.
Call MSMFB_OVERLAY_SET ioctl only when params change.
These thing together ensure a correct sequence and should fix tearing and
stuttering, the latter assuming there are no other display pipeline delays.
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
Change-Id: Ibb0ad8485fa6b30dc6ac07ae8b25a760941c08ce
Also store the hwc_procs_t* into a dedicated field instead of one of
the hwc_composer_device_1_t::reserved_procs slots, which are supposed
to be NULL so the structure can be extended without breaking backwards
binary compatibility.
Change-Id: I11e6bc713958d854aba418242caa749cbcb21f1d
The blank ioctls were never called, we were relying on
the driver to implicitly do this on suspend/resume.
Fix this by calling blank with the right parameters.
Change-Id: Ib969c4e55d9f460255750f07aecefb04a310bd7a
Add support for different types of external-only layers
EXTERNAL_ONLY: General purpose
EXTERNAL_BLOCK: Blocks the display of other ext-only layers
EXTERNAL_CC: Used for closed captions with videos.
Change-Id: I9cc7b9a1dbf1085194725474d6a4d1094e27a0c8
Acked-by: Saurabh Shah <saurshah@codeaurora.org>