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>
Don't allocate primary framebuffer from carveout.
Allocate them from IOMMU heap just like the external framebuffer.
Bug: 7626586
Change-Id: I52a8db1a34d19856302b38d2c30c1290d1f2f060
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
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>
Can be set for debugging, valgrind, board bringup etc.
Also - we fail reading the sysfs vsync, we fall back and fake it.
Bug: 7301591
Change-Id: I9509fd7aa8862d5af7d521e29fe32bef9654168c
Signed-off-by: Iliyan Malchev <malchev@google.com>
Conflicts:
libhwcomposer/hwc_vsync.cpp
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>
This change adds support for flip operation during MDP composition. This
enables frames to get MDP composited during 270 degree orientation too (with
pre rotation doing 90 degree rotation) or even with layers with just h flip or
v flip.
Bug: 7435860
Change-Id: I7fd18226d8337b2cd9341d709c2bd030eff881f7
Signed-off-by: Iliyan Malchev <malchev@google.com>
Read can return fail when the panel is off.
When read fails do not exit from the vsync thread,
continue with the vsync signal, as later there will
be correct vsync event from the driver
Change-Id: I0f145b93fe5d365eafb6b9e7661160f00f84db40
Acked-by: Arun Kumar K.R<akumarkr@codeaurora.org>
(cherry picked from commit ef93ede83eba15252a5e902981c491bf8ed228cc)
* remotes/quic/partner-android/jb-mr1-dev: (27 commits)
hwc: Open sysfs node when thread is initialized.
hwc: Return failure code if hwc_set fails to draw
hwc: Create releaseFd even if no HWC layers
hwc: clean up overlay for external from the draw thread only
HWC: Protect hwc_set from async events
hwc: external: Add screen-fitting to external panel.
hwc: add some logging
hwc: utils: Include orientation while screen-fitting.
overlay: mdprot: Call rotator start only on config change.
hwc: fix for not ignoring framebuffer
hwc: don't open sysfs on every iteration
hwc/overlay: Add premultiplied alpha support.
hwc: external: Cleanup overlay objects on external disconnect.
display/libhwcomposer: fix potential memory leak
hwc: more error checks
hwc: Remove call to glFinish
hwc: Skip secure buffers in non secure mode
hwc: move enable disable ioctls to vsync thread
hwc: fix some race conditions
don't call vsync-ctrl ioctl for same enable value
...
Earlier, the sysfs node was created in the driver for the
first time in dsi_video_on. This has now been moved to probe
so this node can be opened to the start of the thread.
Bug: 7305728
Change-Id: I01230e4fdc2bddd160ce0d84e153f1f8c179b8df
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>
Screen fitting for out-of-bounds videos (with overlays) exists for primary
panel. Add this same support for external panels, so that GPU won't be needed
in panning use-cases.
Bug: 7313955
Change-Id: I274a821264d87098227b144752f4d0b89d342cd9
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>
MDP doesn't like out-of-screen-bounds parameters. So based on the position of
the layer, we adjust the portion of layer the MDP should pick.
However, this did not factor in orientation, so far. This patch does that and
allows panning to work in other orientations, without having to use GPU.
Bug: 7313955
Change-Id: Ice17ad144abcd60279c2ef9ad87fc617a1bd3621
Signed-off-by: Iliyan Malchev <malchev@google.com>
Call ROTATOR_START ioctl only if the rotator config changes.
Save the last good config when the start succeeds.
Make getSessId()'s return type uint32_t from int to match the member's.
This was causing all methods to think the rotator session id is a negative
invalid number. This ensures ROTATOR_FINISH is called.
Bug: 7320914
Change-Id: I5ca048ea866316f18d8df14dc08218fca2c82bdf
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>
Add premultiplied alpha belnding support while using MDP for composition.
Layers could have PMA blending which was missing from hwc1.1
This change just handles the PMA case.
Bug: 7301436
Change-Id: I7d83169831b40943b2b595723fefc3a95a177137
Signed-off-by: Iliyan Malchev <malchev@google.com>
Cleanup overlay objects and close fds when external is disconnected. Without
this, the external does not come on when cable connected-disconnected multiple
times when device is in suspended state.
Bug: 7150885 (part of the fix)
Bug: 7295979
Bug: 7150885 (partial)
Change-Id: I1ae2ce7220b9928dde332ce3644dbe671d25c7e6
Signed-off-by: Iliyan Malchev <malchev@google.com>
This changes fixes a memory leak, by freeing up the pipe alloc structure
everytime before parsing the current frame.
related-to-bug: 7301196
Change-Id: I23edefca71ec0209291be24ee9d629b4a80f0a25
Acked-by: Jeykumar Sankaran<jsanka@codeaurora.org>
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>
Gralloc uses the GRALLOC_USAGE_HW_FB flag to allocate memory from carveout.
This is fine for primary framebuffer, but for external framebuffer we need IOMMU
heap buffers, since the ioctls for external work with those.
Ideally, the primary buffers also need to come from IOMMU heap, which is ongoing
work. This patch allocates the first 2 FB buffer requests (assuming they are for
primary) from carveout and allocates all subsequent buffers from IOMMU heap.
Bug: 7124159
Change-Id: Ie53b2e1e7fcac136acd2d251f39cefe367fc7125
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>
When secure mode is on, skip overlay composition for
non secure buffers.
Bug: 7216266
Change-Id: I5fb1f3a26505bb69305e7d359bdb3a020baf193f
Acked-by: Amara Venkata Mastan Manoj Kumar<manojavm@codeaurora.org>
From post() for external call the new ioctl MSMFB_OVERLAY_COMMIT
to update the external display.
The new IOCTL is faster than the default PAN and waits for DMAE to finish before
returning. This fixes tearing.
Bug: 7249589
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
Change-Id: Ic755e634d5f141a567c7d93f39c74bb087cd7044
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>
Pass through binder calls for non qservice calls.
Change-Id: I9cae0d40b8377bda9627fbc3e6f90d5aed1f1e0f
Signed-off-by: Iliyan Malchev <malchev@google.com>