OSDN Git Service
Kalyan Kondapally [Sat, 22 Jul 2017 08:15:44 +0000 (04:15 -0400)]
Android: Add HWC 1.5 support.
We want to enable Android M support but M only supports
version <2.0 HWC. Let's enable support for HWC 1.5.
Support is enabled only if BOARD_USES_HWC1 is set to
true in BoardConfig.
Jira: None.
Test: System boots up to Home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Munish Bhardwaj [Fri, 21 Jul 2017 06:52:04 +0000 (12:22 +0530)]
Initial patch to enable HWC Validation code
This will use HWCService eventually to run the tests.
Jira: IAHWC-78.
Test: Build passes.
Signed-off-by: Munish Bhardwaj <munishx.bhardwaj@intel.com>
Fan, Yugang [Wed, 19 Jul 2017 08:36:26 +0000 (16:36 +0800)]
Update the HWC ebuild file to support .so and binary installation.
Latest HWC will install shared lib .so files and testlayers binary
will be generated after the "make install", to align with latest
HWC source, this commit will support .so files and testlayers
installation(not install test json example files).
Jira: None
Tests: Build HWC in Chrome OS SDK with this ebuild file without
error, and deploy the HWC package to Chrome OS device
without error, the testlayers can be executed normally
with the shared the libhwcomposer.so.* installed.
Signed-off-by: Yugang Fan <yugang.fan@intel.com>
Poornima [Tue, 18 Jul 2017 05:41:31 +0000 (11:11 +0530)]
Added Support to test displayModes related APIs using HWC service
Usage:
/system/bin/hwcmode [displayId <print/get/set <displayconfigindex>>]
Jira: IAHWC-78.
Test: Able to test all the display mode related APIs.
Signed-off-by: poornima.y.n@intel.com
Harish Krupo [Tue, 18 Jul 2017 07:33:26 +0000 (03:33 -0400)]
Fix tearing issue in multi display mode
Jira: IAHWC-80
Tests: No tearing is observed on all the displays
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kalyan Kondapally [Tue, 18 Jul 2017 07:26:00 +0000 (03:26 -0400)]
REVERTME: Android: Don't register more than one display for hot plug event.
For some reason this is causing tearing during scrolling.
Jira: IAHWC-80
Test: No tearing seen during scrolling.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 18 Jul 2017 01:21:06 +0000 (21:21 -0400)]
Add Basic DisplayManagement for Android.
This tracks down for displays in extended mode and ensuring we
fall back to cloned mode as needed.
Jira: IAHWC-80
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Harish Krupo [Mon, 17 Jul 2017 16:29:11 +0000 (21:59 +0530)]
Remove unneeded break if encoder is found
When an encoder is found for the first connector, the
variable found_encoder is set to true which then causes
the loop to terminate unnecessarily. This causes only one
connector to be detected at boot time.
Jira: IAHWC-80
Tests: On boot, more than one connected displays are identified.
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kalyan Kondapally [Mon, 17 Jul 2017 01:09:03 +0000 (21:09 -0400)]
Android: Enable support for Extended mode.
There seems to be no definitive way to track extended and cloned
mode here. What we do is if we get a ValidateDisplay request
for a display in cloned mode, we assume we will have a separate
update request for this display and disable the cloned mode.
Jira: IAHWC-80
Test: Extended mode works as expected on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 17 Jul 2017 01:01:51 +0000 (21:01 -0400)]
Disable Idle frame tracking for displays in cloned mode.
This should be coming from display owning the presentation
of these cloned displays.
Jira: IAHWC-80.
Test: Multiple displays work fine on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 16 Jul 2017 22:57:32 +0000 (18:57 -0400)]
Add support for clone Mode.
Not sure how to determine if we want to be in extended
or cloned mode in multi montior case. For now we default
to Cloned mode and this will need finetuning when we
have a better understanding of extended mode on Android.
There is a known issue that if external display is not
connected during boot up of Android, than it is never
recognized after that for some reason.
Jira: IAHWC-80
Test: Linux test apps and Android switches to clone mode
automatically when multiple display are connected.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 16 Jul 2017 18:15:30 +0000 (14:15 -0400)]
Add support for scaling layers.
External display might have a difference resolution compared to
primary and when in clone mode we would need to scale layers to
match the resolution. For now this results in gpu composition of
all layers but in future we could use pipe scalar to scale the
layers.
Jira: IAHWC-80
Test: Linux test apps scale layers automatically when external
display and primary display resolutions don't match.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 15 Jul 2017 07:43:16 +0000 (03:43 -0400)]
Fix Linux builds.
Jira: None.
Test: Build passes on Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 09:58:24 +0000 (05:58 -0400)]
Initial plumbing to enable multi display support.
Android relies on HotPlug event call back to determine if certain
display is connected or disconnected. Hook this up to notify
Android as and when Display connection status change.
Jira: IAHWC-80
Test: Linux tests work fine in multi monitor case
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 15 Jul 2017 03:39:59 +0000 (23:39 -0400)]
Add missing license.
Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 08:13:46 +0000 (04:13 -0400)]
Rename drmhwctwo to iahwc2.
Jira: None.
Test: Build compiles on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 08:20:24 +0000 (04:20 -0400)]
Revert "Rename drmhwctwo to iahwc2."
This reverts commit
7315927a01fc6619bd03e25562b3dbe26ddf8e4e.
Kalyan Kondapally [Thu, 13 Jul 2017 23:41:50 +0000 (19:41 -0400)]
Use flags instead of bool to track state in DisplayQueue.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 13 Jul 2017 22:46:05 +0000 (18:46 -0400)]
Add support for other apps to control display during startup.
On certain platforms, there is a need to give applications
control of display during boot up and ignore updates in hwc
Jira: None.
Test: Boot to home screen with and without hwc.lock present.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 22:19:28 +0000 (18:19 -0400)]
Rename drmhwctwo to iahwc2.
Jira: None.
Test: Build compiles on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 08:13:20 +0000 (04:13 -0400)]
Remove redundant z_order variable in drmhwctwo.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 07:59:42 +0000 (03:59 -0400)]
Remove redundant code.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 11 Jul 2017 06:54:03 +0000 (02:54 -0400)]
Resize viewport when display rect has changed.
We assumed that display rect of a given surface would never
change. However, this is not true with caching since, we re-use
the same surface and in case of 3D Composition we need to ensure
the viewport is updated to be same as Display frame rect.
Jira: IAHWC-79
Test: When resized to full screen, we don't see any intermediate
frames with old size.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Jeevaka Prabu Badrappan [Fri, 7 Jul 2017 09:21:55 +0000 (14:51 +0530)]
Replace Mutex with SpinLock
Jira: IAHWC-78
Test: Build compiles.
Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan@intel.com>
Kalyan Kondapally [Mon, 10 Jul 2017 05:57:47 +0000 (01:57 -0400)]
Reset continuous frames to 0 when we have idle frame.
When system is idle, we may still have update coming in every time
system time changes etc. Re-validating layers in this case is
redundant operation, instead let's reset continuous frame counter
to "0" in case we have a idle frame. This will ensure we dont
un-necessarily re-validate layers.
Jira: None.
Test: Check that we dont re-validate layers after going to idle mode
unless really needed.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 9 Jul 2017 22:09:58 +0000 (18:09 -0400)]
Release GPU Resources after rendering layers.
Instead of releasing GPU resources in DisplayQueue, handle it
in Compositor itself.
Jira: None.
Test: SHmem doesn't grow when u launch and close applications.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 9 Jul 2017 21:37:16 +0000 (17:37 -0400)]
Close Buffer handle when we are done using it.
Jira: None.
Test: Gralloc handle is closed when NativeBufferHandler is closed.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 22:43:00 +0000 (18:43 -0400)]
Set correct state to layer when we fall back to GPU Composition.
We didn't set the correct state for overlay layer in case primary
layer had to go through GPU composition before being shown on
display. This patch fixes this.
Jira: None.
Test: Check that we dont re-validate layers during start up.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 08:45:45 +0000 (04:45 -0400)]
Reset surface damage when ever layer dimension changes.
Instead of complicating surface damage logic, if any layer position
changes let's reset the surface damage and clear the whole surface.
Jira: None.
Test: Check that bluetooth icon don't flicker during update.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 05:34:00 +0000 (01:34 -0400)]
VirtualDisplay: Render layers only if content has changed.
Currently, we composite layers even though nothing might have
changed, instead lets continue to show previous composition
results in case nothing has changed.
Jira: None.
Test: No rendering artifacts with secondary display enabled
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 21:14:02 +0000 (17:14 -0400)]
Ignore idle refresh when power mode is set to off.
Surfaceflinger doesn't expect any updates to happen when system
goes to idle mode as it has already cleared buffer queue in this
case. We might end up calling idle refresh as we detect no
activity for last few frames, to avoid competing with Surface
flinger lets avoid requesting display refresh in case system is
in the process of being powered off.
Jira: None.
Test: From developer options enable secondary display and let system
go to idle mode. Ensure that system doesnt reboot but we can
bring it back to active state by moving cursor.
Kalyan Kondapally [Thu, 6 Jul 2017 19:42:05 +0000 (15:42 -0400)]
Explicitly delete GPU Resources with offscreen rendering.
We could fail offscreen rendering for various reasons, let's make
sure we are doing proper cleanup of GPU resources in this case.
Jira: None.
Test: System doesnt restart itself within 1-5 mins when simulating
secondary display.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 10:37:16 +0000 (06:37 -0400)]
Dont update VirtualDisplay when powermode state is not kon.
We can be doze mode or off mode. In these cases we should ignore
any update requests in virtual display.
Jira: None.
Test: When going to idle mode, we dont see any EGLContext related
errors in logcat eventually leading to system reboot.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 08:46:55 +0000 (04:46 -0400)]
Clear surface when display/src rect has changed.
We track width/height changes as part of surface damage but dont
accurately track position changes causing rendering issues with
cursor. Let's ignore surface damage when position has changed till
we are able to accurately track this.
Jira: None.
Test: Cursor renders fine when GPU composited.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 5 Jul 2017 00:20:47 +0000 (20:20 -0400)]
Align Surfacedamage semantics with Android.
From Android hwc2 documentation:
"Once set through this function, the damage region remains
the same until a subsequent call to this function."
Let's align to this expectation and lot easier as there
should be no need to update Surfacedamage if it hasn't
changed over frames.
Jira: None.
Test: This is more for API alignment.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 16:37:25 +0000 (12:37 -0400)]
Dont re-validate layes if display/src rects/content attributes have changed.
We might be rendering layers using 3D or Display composition. In
case of 3D we don't have to worry re-validating the layers as we
blit them to an offscreen surface before scanning out.
Jira: None.
Test: No graphics regression on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 13:53:50 +0000 (09:53 -0400)]
Release GPU resources agressively.
We now track all fb, texture resources and explicitly delete them
when surface is being deleted instead of how we do it today which
is after couple of frames.
Jira: None.
Test: Check that shmem doesn't increase dramatically when moving
between applications.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 12:49:06 +0000 (08:49 -0400)]
Release unused memory when commit is ignored.
Let's release any free surfaces when we ignore commits, so we
dont hold on to unnecessary memory.
Jira: None.
Test: Memory doesn't increase when commits are ignored.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 11:08:45 +0000 (07:08 -0400)]
Take into consideration previous layer damage.
Jira: None.
Test: When cursor is gpu rendered, one should not see the image
still in old position when it's being moved around.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 10:50:22 +0000 (06:50 -0400)]
Copy hwc_buffer state when copying buffer.
This information is needed to decided if the buffer is to be
released by HWC or not.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 09:27:46 +0000 (05:27 -0400)]
Track DisplayFrame changes separately.
This is useful in case of cursor layer and can avoid re-validating
layers when cursor is moved. This can be extended to other
GL composited layers in future.
Jira: None.
Test: Memory doesnt increase when cursor changes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kishore Kadiyala [Tue, 4 Jul 2017 04:59:05 +0000 (10:29 +0530)]
REVERT [PARTIAL] : Disable invoking of hwc.info service
In User debug builds, while Joule board boots via ColdBoot or ALT+CTRL+DEL,
it loops in for a while between Android TEXT and Android Animation before
reaching the home screen.
This patch disables invoking of hwc.info service which fixes the issue.
Jira: IAHWC-76
Test: Boot the Joule Board with Power ON/OFF or ALT+CTRL+DEL with
USERDEBUG build
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 02:08:28 +0000 (22:08 -0400)]
Fix crash when we connect external monitor after bootup.
DisplayQueue may not be initialized in SetPowerMode if display
is not connected. We delay setting power mode until Display
is actually connected.
Jira: None.
Test: Connect external monitor after edp is up and running. Ensure
system does not crash.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 00:46:29 +0000 (20:46 -0400)]
Tests: Clip display frame, source rect to resolution.
Jira: None.
Test: Linux tests run on resolutions lesser than what is specified
in test config files.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 3 Jul 2017 23:56:48 +0000 (19:56 -0400)]
Handle HDMI-change notification also.
Jira: None.
Test: Hot plug event notifications are still handled correctly.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 3 Jul 2017 20:55:21 +0000 (16:55 -0400)]
Be more aggressive in releasing used memory.
We try to re-cycle surfaces whenever possible and hold on to
surfaces till not needed. This caused ANR on low memory
platforms. We now release memory as soon as it's
free and not needed by any planes being currently used.
Jira: None.
Test: Check memory usage doesnt continue to increase by closing
and launching application.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 3 Jul 2017 03:56:33 +0000 (23:56 -0400)]
Remove surface damage related things from displayplanestate.
Each native surface maintains it's own surface damage state.
We can remove this from DisplayPlaneState as no body uses this
information.
Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 3 Jul 2017 04:02:30 +0000 (00:02 -0400)]
Re-render layers which are part of Viewport only.
We accurately maintain viewport to encapsulate all regions
which have actually changed. When surfaces are not cleared,
can can ignore layers which are outside the viewport.
Jira: None.
Test: Check that when time/battery is updated only top layer
is updated on Android and nothing else.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 3 Jul 2017 00:02:58 +0000 (20:02 -0400)]
Populate display frame rects only when rendering.
Most of the time we get away with composition play back, we use
display frame rects only when we need to re-render any thing.
Let's populate display frame rects only in this case.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 2 Jul 2017 20:14:03 +0000 (16:14 -0400)]
Track if plane surface needs to be cleared via displayplanestate.
Displayplaestate tracks the offscreen targets being used to show
on screen. Let's also track if the offscreen surface needs to be
cleared, so we can avoid unnecessary clear operations.
Jira: None.
Test: No graphics artifacts seen on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 2 Jul 2017 19:46:35 +0000 (15:46 -0400)]
Remove kLayerPositionChanged usage.
This is already covered by content change tracking.
Jira: None.
Test: Popups are still rendered correctly.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 1 Jul 2017 06:15:23 +0000 (02:15 -0400)]
Revert "Remove width_ and height_ from displayplanemanager."
This reverts commit
7e6ae2837645ca07a37f66667ef315cb69c42f41.
Kalyan Kondapally [Sat, 1 Jul 2017 06:15:00 +0000 (02:15 -0400)]
Revert "Allocate buffers of size we need."
Broke Video when played in fullscreen.
This reverts commit
7ae89ef1018718a24e5d6d9daac11b40c1c41183.
Kalyan Kondapally [Sat, 1 Jul 2017 02:48:38 +0000 (22:48 -0400)]
Ignore commits in case nothing has changed.
Jira: None.
Test: No graphics regressions on Linux and Android.
Kalyan Kondapally [Fri, 30 Jun 2017 22:36:18 +0000 (18:36 -0400)]
Cleanup hwcservice API naming.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Poornima [Tue, 27 Jun 2017 09:15:23 +0000 (14:45 +0530)]
Added libhwcservice - getHwcVersion().
Basic implementation to check hwc.info service working
Currently added implemenation to get HWC version
Usage:In the device shell, use below command
service call hwc.info 1
Jira: None.
Test: Build passes on Android and able to get HWC info
Kalyan Kondapally [Fri, 30 Jun 2017 19:48:02 +0000 (15:48 -0400)]
Ensure all layers have a release fence.
It is expected that hwc waits on acquire fence and buffer queue
would wait on release fence of each layer. In case we are just
recycling the buffer, let's reset acquire fence of the layer as
it's release fence.
Jira: None.
Test: No regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 30 Jun 2017 19:50:30 +0000 (15:50 -0400)]
Revert "Use kms fence as release fence."
We are working around a problem in BufferQueue.
This reverts commit
993387aa93f0eeb717a094ad0afea79595ceb958.
Kalyan Kondapally [Fri, 30 Jun 2017 08:45:10 +0000 (04:45 -0400)]
Use kms fence as release fence.
Jira: None.
Test: No regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 30 Jun 2017 01:25:04 +0000 (21:25 -0400)]
Clear surface only as needed.
In GLRenderer we always clear the surface, instead we should ask
the surface if this operation is needed.
Jira: None.
Test: No regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 23:53:45 +0000 (19:53 -0400)]
Mark backbuffers to be re-used when revalidating cache.
This should avoid the situation where we allocate more memory
when backbuffers are available for re-use.
Jira: None.
Test: Check that we dont allocate buffers when things are available
for re-use.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 23:39:26 +0000 (19:39 -0400)]
Remove width_ and height_ from displayplanemanager.
These are no longer needed.
Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 23:35:02 +0000 (19:35 -0400)]
Allocate buffers of size we need.
Currently, we always allocate buffer equal to the resolution of
screen when ever we create an offscreen surface(Native Surface).
Instead, lets allocate buffer of size we really need to show.
Jira: None.
Test: No graphics regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 21:59:57 +0000 (17:59 -0400)]
Split z_order and index of layer.
Each overlaylayer represents an hwclayer. We may ignore some
hwclayers depending on visible area and other filters in future.
Hence, Let's store the z_order of overlaylayer and index of hwclayer
it represents separately.
Jira: None.
Test: No regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 17:18:28 +0000 (13:18 -0400)]
Revert "Remove position change tracking."
This reverts commit
ef1f65fe0e05e77dd6825f0182178f1864d36d74.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 29 Jun 2017 08:52:47 +0000 (04:52 -0400)]
Initial plumbing needed to update areas which have only changed.
We get surface damage for each layer every frame, we can use this
to track which layer regions need to be updated instead of
updating everything every time. This patch adds the needed initial
plumbing but doesnt enable the support itself.
Jira: None.
Test: No graphics regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 26 Jun 2017 23:11:49 +0000 (19:11 -0400)]
Define Rotation property fields.
We may be on platforms which dont have support for these
fields in libdrm. Define them in HWC if they are not
already defined.
Jira: None.
Test: Build passes on Linux with latest libdrm.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 25 Jun 2017 01:10:46 +0000 (18:10 -0700)]
Refactor: Make it easy for adding different backends.
This patch refactors code to make it easy to add new backends
in future. No functional change.
Jira: None.
Test: No regressions on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 24 Jun 2017 01:06:50 +0000 (18:06 -0700)]
Split Framebuffer format and texture format.
We sometimes ignore alpha value for primary when hardware doesnt
support RGBA. However, when sampling from the texture we need to
ensure we are not ignoring alpha. This patch splits framebuffer format
and texture format.
Jira: None.
Test: No rendering regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Pallavi G [Fri, 23 Jun 2017 08:50:29 +0000 (14:20 +0530)]
Segmentation fault fix with only one cursor layer
In case where we have total no of layers as 1 and ie cursor,
we end up with segmentation fault and the surfaceflinger crashes.
Fixed that one cursor layer handling in the presentdisplay.
Jira: IAHWC-75
Test: Tested on Android no crash is observed when we move from full screen to
normal screen during youtube video playback in the chrome browser
Signed-off-by: Pallavi G <pallavi.g@intel.com>
Pallavi G [Thu, 22 Jun 2017 10:21:28 +0000 (15:51 +0530)]
Fix the cursor assignment with the layer size of 2
when the total no of input layers is 2 we end up assigning the cursor
to the overlay plane and fixed that corner case also to assign the
cursor layer to the cursor plane
Jira: IAHWC-74
Test: Tested on Android now no blank image behind the cursor in the fullscreen Video or Image
Signed-off-by: Pallavi G <pallavi.g@intel.com>
Kalyan Kondapally [Wed, 21 Jun 2017 15:32:00 +0000 (08:32 -0700)]
Ensure we release fences always.
GetReleaseFences was not always getting called for some reason,
to be safe lets reset the release fence in SetReleaseFence call.
Jira: None.
Test: No crashes as a result of running out of fds.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 20 Jun 2017 20:27:09 +0000 (13:27 -0700)]
Add initial plumbing to handle cursor gpu composition separately.
This doesnot change any behaviour but does the necessary plumbing
needed to handle gpu rendering of cursor separately in case we
need it.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 20 Jun 2017 10:25:40 +0000 (03:25 -0700)]
Ensure we always have a offscreen target during validation.
When falling back to GPU we need to ensure we always have offscreen
buffer set for the plane, otherwise all subsequent validations will
also fail.
Jira: None.
Test: When using NV12 buffer we still have Video in a separate plane.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Pallavi G [Tue, 20 Jun 2017 09:25:03 +0000 (14:55 +0530)]
Fix for cursor source crop position
Sometimes the Android framework sets the source crop
position coordinates x and y to some non zero value.
Due to that the drm kernel plane check is failing and
the cursor is falling back to the gpu path.
Irrespective of the x and y value make it to zero,
anyway we allocate the cursor buffer size bigger then
the required size.
Jira : IAHWC-73
Test : Tested on Android, no cursor layer falling back to gpu
Change-Id: I953e5f1e39e9474e6920fd625346e2f7d47671f5
Signed-off-by: Pallavi G <pallavi.g@intel.com>
Kalyan Kondapally [Tue, 20 Jun 2017 09:46:13 +0000 (02:46 -0700)]
Remove position change tracking.
This should be already covered by surface damage and visible
region tracking and is unnecessary to be tracked separately.
Jira: None.
Test: No rendering artifacts on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Mingwei Wang [Mon, 19 Jun 2017 10:08:36 +0000 (18:08 +0800)]
Update display with known configs.
This change was missing in the path where we try to find
encoder for the connector.
Jira: None.
Test: Comes up to UI on APL platform.
Signed-off-by: Xu, Randy <randy.xu@intel.com>
Signed-off-by: Mingwei Wang <mingwei.wang@intel.com>
Kalyan Kondapally [Mon, 19 Jun 2017 02:52:12 +0000 (19:52 -0700)]
Remove previous_layers_ in DisplayQueue.
DisplayQueue in Android can discard old buffers any time, we where
seeing lot of errors while closing handles in our side in this case.
Let's only hold on to the current buffers on screen and the new
ones being scanned out.
Jira: None.
Test: Errors related to "Failed to close gem handle -1" are minimised.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 19 Jun 2017 01:59:01 +0000 (18:59 -0700)]
Remove OverlayBufferManager.
OverlayBuffer lifetime is owned by OverlayLayer. Overlaylayer
now manager the lifetime of buffer and releases it.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 18 Jun 2017 10:34:54 +0000 (03:34 -0700)]
Release surfaces when not in use.
We held onto surface with an assumption that they might be re-used
in subsequent frames. However, with composition caching we might
never never need them for a while until screen composition has
really changed. Let's release the surfaces which are not in use.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 18 Jun 2017 08:42:35 +0000 (01:42 -0700)]
Add initial support to query if a separate plane is needed for a layer.
In future we would need to force layers on to separate layers,
depending on how frequrently they are updated, if its Media related
etc. This patch adds minimum needed support for now with Video
case.
Jira: None.
Test: Check that Media related layers get a separate plane.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 18 Jun 2017 07:34:06 +0000 (00:34 -0700)]
Remove redundant code related to idle mode.
Jira: No.
Test: Build passes on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 18 Jun 2017 07:11:24 +0000 (00:11 -0700)]
Add support to fall back to single plane in idle mode.
We now register Refresh call back from Surface Flinger to
force a refresh when detect we are not doing any updates
but using more than one plane. We currently have a
threshold of 100 vblank callbacks before doing this. This
no can be made configurable in future. Also, once in
idle mode we wait for 10 continues frame updates before
trying to use planes unless layer validation is triggered
by change in layer compositions of a given frame. This no
can also be made configurable in future.
Jira: None.
Test: Check that we use single plane when we dont have continuous
updates and when playing Video for example automatically
switch to multi plane scenario.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 18 Jun 2017 07:10:29 +0000 (00:10 -0700)]
Dont use ScopedSpinLock if not needed.
Jira: None.
Test: No regressions on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 17 Jun 2017 11:35:08 +0000 (04:35 -0700)]
Remove waits on Acquire Fences.
Kernel does implicit synchronization for us, we can rely on
that rather than waiting on fences in HWC.
Jira: None.
Test: No rendering artifacts on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 14 Jun 2017 20:04:03 +0000 (13:04 -0700)]
Track when cursor is GPU Rendered.
If cursor is GPU Rendered, than we need to ensure any change
is alpha is taken into account in subsequent frames.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 14 Jun 2017 19:21:24 +0000 (12:21 -0700)]
Ensure Media gets a separate plane.
This will ensure we dont render Media related content due
to any changes to 3D.
Jira: None.
Test: No Graphics regression on Android. Check that Video buffers
get a separate plane in both full and non full screen cases.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 16 Jun 2017 19:27:39 +0000 (12:27 -0700)]
Add VirtualDisplay support.
Enable Virtual display support using HWC. We no longer depend
on Client composition to handle this.
Jira: None.
Test: Enable Secondary display and see right content in the
simulated secondary display.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 16 Jun 2017 19:23:17 +0000 (12:23 -0700)]
Make it bit more verbose to check FramebufferStatus errors.
I was finding it bit hard to track down why Makecurrent was
failing when virtual display support was enabled. This helped
to have bit more information and track down what is happening.
Jira: None.
Test: Get appropriate error messages when bindframebuffer calls
failed in logcat.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 15 Jun 2017 02:48:27 +0000 (19:48 -0700)]
Linux: Fix Multiple layers test.
We didnt set the surface damage appropriately, causing the demo
to not update the content after first frame.
Jira: None.
Test: Run multiplelayer tests and check that frames are updated
correctly.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Yugang [Tue, 13 Jun 2017 18:42:09 +0000 (02:42 +0800)]
Change definition place to fix assignment issue
Move layer_parameter definition to outside of for to avoid the
assignment issue which will cause the render init failure.
Jira: None.
Test: Test app works normally without render init issue.
Signed-off-by: Fan Yugang <yugang.fan@intel.com>
Poornima [Tue, 13 Jun 2017 08:01:37 +0000 (13:31 +0530)]
Added Test case for MultiMode Display support Usage cmd: ./tests/testlayers --displaymode <print/forcemode displayconfigindex>
To get supported display modes
cmd:./tests/testlayers --displaymode print
To test particular display mode (forcemode)
For ex. To test 9th display config, command would be,
./tests/testlayers --displaymode forcemode 9
Jira:IAHWC-34
Tests: Able to set displaymode as per user choice
Signed-off-by: N, Poornima Y <poornima.y.n@intel.com>
Poornima [Tue, 13 Jun 2017 07:59:59 +0000 (13:29 +0530)]
Implementation of getActiveConfig(),returns the active display mode index.
Jira:IAHWC-34
Tests: No regression on Android and linux
Signed-off-by: N, Poornima Y <poornima.y.n@intel.com>
Poornima [Tue, 13 Jun 2017 07:57:08 +0000 (13:27 +0530)]
Support to set the display Mode Implementation of SetActiveConfig()
Jira:IAHWC-34
Tests: Android boot up as expected with preferred mode
Signed-off-by: N, Poornima Y <poornima.y.n@intel.com>
Signed-off-by: G, Pallavi <pallavi.g@intel.com>
Poornima [Mon, 12 Jun 2017 13:05:02 +0000 (18:35 +0530)]
Get All Supported Display Modes
Implementation of GetDisplayConfig() and support to get all the
display modes supported.
Jira:IAHWC-34
Tests: No regression on Android and linux
Signed-off-by: N, Poornima Y <poornima.y.n@intel.com>
Kalyan Kondapally [Tue, 13 Jun 2017 07:22:29 +0000 (00:22 -0700)]
Convert right format when importing buffer.
In Overlay Layer we check if format of buffer has changed to
check with Kernel if the format can be supported by hardware.
We where going back to kernel everytime in case of
Video since at this point we didnt handle the format conversion
(we did this when we created egl image for first time). Now, we do
the format conversion and store it while importing the buffer.
Jira: None.
Test: Check that when playing video we dont trigger a full validation
on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 13 Jun 2017 02:20:04 +0000 (19:20 -0700)]
Add libhwcservice.
This is imported from VPG HWC code base.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 12 Jun 2017 18:29:43 +0000 (11:29 -0700)]
Ensure we close all the gem handles.
We create gem handles in our side which need to be closed
when releasing buffer. This was not an issue on Linux as
minigbm takes care of it.
Jira: None.
Test: shmem doesn't grow when switching between apps on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Tapani Pälli [Mon, 12 Jun 2017 11:40:54 +0000 (14:40 +0300)]
fix compilation error when BOARD_USES_GRALLOC1 is set
Jira: None.
Test: Code compiles without errors on Android when
BOARD_USES_GRALLOC1 is set
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Poornima [Fri, 9 Jun 2017 10:35:39 +0000 (16:05 +0530)]
Android: Fix the cursor reorder issue
Sometimes cursor layer comes as the lowest zorder and we end up
assigning to the primary plane.
Made a change in PresentDisplay to handle the condition.
Jira: https://jira01.devtools.intel.com/browse/OAM-46186
Tests: Android boots up and issue is not see
Signed-off-by: N, Poornima Y <poornima.y.n@intel.com>