OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
6 years agoGive out error message when meet errors
Lin Johnson [Fri, 23 Mar 2018 03:30:26 +0000 (11:30 +0800)]
Give out error message when meet errors

It will help for debug HWC.
Aslo fix android build warning cutils/log.h is deprecated

Jira:None
Tests:Build pass on Android
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoEnsure we re-map layer+plane in case layers are removed.
Kalyan Kondapally [Wed, 28 Mar 2018 07:53:52 +0000 (00:53 -0700)]
Ensure we re-map layer+plane in case layers are removed.

Currently, we did this when all layers associated with a
plane where removed. Instead we now check if we have free
planes to accomadate remaining layers when a layer is
removed or added and do incremental validation of
layers and planes.

Jira: None.
Test: Layers are scanned out directly when panning home screen
      after going to a idle state.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix warnings generated in common core hwc
Richard Avelar [Fri, 23 Mar 2018 21:42:08 +0000 (14:42 -0700)]
Fix warnings generated in common core hwc

Adjust casting for coversion warnings and adjust ifdef gaurd which
causes a param unused warning for source_layers.

Jira: None.
Test: Build passes without warnings
Signed-off-by: Richard Avelar richard.avelar@intel.com
6 years agoChange meta-data process to algin with SOS & fix Nestedisplay hotplug miss
xue.yifei [Wed, 21 Mar 2018 08:27:01 +0000 (16:27 +0800)]
Change meta-data process to algin with SOS & fix Nestedisplay hotplug miss

Change-Id: I2a329ba493d8666214483872e820fcbb5d4248f3
Jira: None
Test: Tested on android
Signed-off-by: xue.yifei <yifei.xue@intel.com>
6 years agoRefine VA module.
Wang,Fei [Tue, 27 Mar 2018 08:07:10 +0000 (16:07 +0800)]
Refine VA module.

1. Ensure HSBC/Sharp/Deinterlace/Scaling mode can be set to libva
correctly.
2. Integrate Hue/Satation/Brightness/Contrast into one filter.
3. Do memset before quary from libva.
4. Set default csc scaling mode as High Quality mode.

Jira: None.
Test: Set/Restore color works as expected.

Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoUse global cache for KMS resources
Lin Johnson [Tue, 27 Mar 2018 02:35:57 +0000 (19:35 -0700)]
Use global cache for KMS resources

KMS resources include framebuffers and gem handles
should be process widely shared. Do not close gem handle
when other drmbuffer are still refernce it

Jira: None
Tests: Extend mode, video playback
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoFix Damage rect regression
Lin Johnson [Tue, 27 Mar 2018 02:40:16 +0000 (10:40 +0800)]
Fix Damage rect regression

The regression introduced in fb2fdd91d3cb99adcb1737131b3f55b69a0bf6ca.
Some buttons are not getting rendered correctly.

Jira: None
Tests: Buttons correctly rendered
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoFixed one display hang when plug 3 displays in clone mode.
Wan Shuang [Fri, 23 Mar 2018 02:23:02 +0000 (10:23 +0800)]
Fixed one display hang when plug 3 displays in clone mode.

JIRA: #1242
Test: Boot into Android home screen.

6 years agoBe more aggresive with plane allocation when layers are removed.
Kalyan Kondapally [Mon, 26 Mar 2018 06:38:41 +0000 (23:38 -0700)]
Be more aggresive with plane allocation when layers are removed.

In case additional layers are removed, we still continue to use
the old plane+layer combination even if no new layers are
added. Let's check if layers can be scanned out in this case
and try to avoid offscreen composition.

Jira: None.
Test: We see overlays all layers scanned out with gfx benchmark.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevert "videoeffect: Query vpp caps before use it"
Kalyan Kondapally [Sat, 24 Mar 2018 11:29:55 +0000 (04:29 -0700)]
Revert "videoeffect: Query vpp caps before use it"

H264 Benchmarks miss 60 fps.

This reverts commit 89909d407c1efd4fec07156719739e9e83f3fba4.

6 years agoOptimize Cursor rendering using GPU.
Kalyan Kondapally [Mon, 26 Mar 2018 04:21:19 +0000 (21:21 -0700)]
Optimize Cursor rendering using GPU.

When layers are moving, we need to clear old and new damage rect
of that layer to ensure we don't show any old content. Now, we
detect this situation in NativeSurface and take cummulative
surface damage into account.

Jira: None.
Test: No garbage rendered when CURSOR_WA is enabled, display is rotated
      90 and cursor is moved around.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoHandle Surface Damage correctly in case of Transforms.
Kalyan Kondapally [Sun, 25 Mar 2018 06:49:21 +0000 (23:49 -0700)]
Handle Surface Damage correctly in case of Transforms.

We didn't flip the SurfaceDamage co-ordinates in this case
like RenderState does with Display Frame and Source Rects.
Let's handle 90 and 270 case for SurfaceDamage.

Jira: #278.
Test: Rendering works fine when displays are rotated 90/270.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRe-work Clone mode.
Kalyan Kondapally [Sat, 24 Mar 2018 10:46:57 +0000 (03:46 -0700)]
Re-work Clone mode.

We reset all fences after source display is handled. When
handling Clone display we cannot rely on original layer
fences for any synchronization. Instead of using original
layers, let's use the composition results of Source display.

Jira: #295.
Test: Clone display still works without any regressions.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd Cursor plane checks.
Kalyan Kondapally [Fri, 23 Mar 2018 03:21:26 +0000 (20:21 -0700)]
Add Cursor plane checks.

We might be having only one plane allocated to us and this
might not be a universal plane. Ensure cursor plane is valid
before trying to use it.

Jira: None.
Test: No crash seen with single plane per pipe usage.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix conversion warning when building hwc
Richard Avelar [Wed, 21 Mar 2018 20:58:11 +0000 (13:58 -0700)]
Fix conversion warning when building hwc

Adjust casting to remove warning that occurs when building make
androidia with hwc.

Jira: None.
Test: Build passes without the warning.
Signed-off-by: Richard Avelar richard.avelar@intel.com
6 years agoConfigure custom resolution
Gowtham Hosamane [Mon, 5 Mar 2018 03:55:03 +0000 (19:55 -0800)]
Configure custom resolution

By default HWC sets the display hardware config mode as the resolution.
The additional mechanism of setting resolution via config file.
This resolution could be smaller from display resolution.

Jira: #275
Test: When float mode is set, config changes to set custom resolution
for the required pipe to be working as desired. If not enabled, it
should continue to work as before.

6 years agoFix Rendering issues when playing Video with Mosaic display.
Kalyan Kondapally [Wed, 21 Mar 2018 13:56:25 +0000 (06:56 -0700)]
Fix Rendering issues when playing Video with Mosaic display.

We didn't translate the surface damage to be within the bounds
of the display frame. This meant we would discard the whole
surface damage as outside display frame in certain cases ending
up not rendering the content at all.

Jira: None.
Test: Video plays fine with Mosaic support set to true.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix Crashes when running on Virtual environments.
Kalyan Kondapally [Wed, 21 Mar 2018 11:16:21 +0000 (04:16 -0700)]
Fix Crashes when running on Virtual environments.

We might be just have a single plane or no plane
given to us in this case. Let's have appropriate checks
taking this into account and not assume to have atleast
1 plane.

Jira: None.
Test: Boots to Android Home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset Cache in case composition failed.
Kalyan Kondapally [Wed, 21 Mar 2018 03:20:00 +0000 (20:20 -0700)]
Reset Cache in case composition failed.

We are not sure about our state in this case. Let's
start over.

Jira: #286
Test: No crash happens when Media composition fails.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoHandle Buffer format changes in case of using Media backend.
Kalyan Kondapally [Wed, 21 Mar 2018 02:18:21 +0000 (19:18 -0700)]
Handle Buffer format changes in case of using Media backend.

In some cases last video frame might have xr24 format. In this
case we should choose 3D Compositor and not really the Media
backend to handle offscreen composition. Now we do these checks
and ensure we choose the right backend.

Jira: fixes #269
Test: Video playback doesn't fail when at the very end of the stream.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix (kTransform90 | kReflectX) and (kTransform90 | kRefectY) transforms
Kevin Strasser [Tue, 20 Mar 2018 22:51:04 +0000 (15:51 -0700)]
Fix (kTransform90 | kReflectX) and (kTransform90 | kRefectY) transforms

This code has never been reachable since its introduction in the initial
code import. Break (kTransform90 | kReflectX) and (kTransform90 | kRefectY)
cases out so the switch statement works as intended.

Jira: None
Test: ./testlayers --frames 1 -j jsonconfigs/kmscube1layer_rot90.json
      Cube should be rotated, with light blue/blue edge on top and black
      corner to the right
Test: ./testlayers --frames 1 -j jsonconfigs/kmscube1layer_rot90flipx.json
      Cube should be rotated, with yellow/red corners on top and black
      corner to the right
Test: ./testlayers --frames 1 -j jsonconfigs/kmscube1layer_rot90flipy.json
      Cube should be rotated, with blue/light blue edge on top and black
      corner to the left

Fixes-coverity-id: 1465620
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoAdd tests to cover rotate90 and flip transforms
Kevin Strasser [Tue, 20 Mar 2018 23:11:45 +0000 (16:11 -0700)]
Add tests to cover rotate90 and flip transforms

These test cases are designed to exercise some paths that were found to be
dead in a recent coverity pass.

Jira: None
Test: ./testlayers -j jsonconfigs/kmscube1layer_rot90.json
Test: ./testlayers -j jsonconfigs/kmscube1layer_rot90flipx.json
Test: ./testlayers -j jsonconfigs/kmscube1layer_rot90flipy.json

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agokRrefreshRate should return refresh period in nanoseconds
Lin Johnson [Tue, 20 Mar 2018 03:27:11 +0000 (11:27 +0800)]
kRrefreshRate should return refresh period in nanoseconds

Jira:OAM-53716
Tests:None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoFix warnings when building hwc
Richard A [Mon, 19 Mar 2018 22:33:19 +0000 (15:33 -0700)]
Fix warnings when building hwc

Adjust casting and include gaurds to silence redefined and narrow conversion
warnings.

Jira: None.
Test: Build passes without warnings
Signed-off-by: Richard Avelar richard.avelar@intel.com
6 years agoRemove opengl, vulkan, va use for dummy compositor
Richard A [Mon, 19 Mar 2018 22:16:17 +0000 (15:16 -0700)]
Remove opengl, vulkan, va use for dummy compositor

Adjust makefiles in order to build without certain functionality that
we won't need enabled in the splash screen with dummy compositor flag set.

Jira: None.
Test: Build passes when using dummy compositor flag
Signed-off-by: Richard Avelar richard.avelar@intel.com
6 years agoForce Partial clear in case layers use blending.
Kalyan Kondapally [Tue, 20 Mar 2018 06:14:00 +0000 (23:14 -0700)]
Force Partial clear in case layers use blending.

In case only surface damage changes, we ended up not clearing
the buffer. This resulted in showing in previous blended contents.
We now, force partial clear for all layers ahving blending
and a valid surface damage.

Jira: #278
Test: Rotate all supported modes and see no rendering issues.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoInitial Coverity fixes.
Kalyan Kondapally [Mon, 19 Mar 2018 09:24:46 +0000 (02:24 -0700)]
Initial Coverity fixes.

Jira: None.
Test: Minimizes complaints seen with Coverity builds.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agovideoeffect: Query vpp caps before use it
XuGuangxin [Mon, 19 Mar 2018 09:00:43 +0000 (02:00 -0700)]
videoeffect: Query vpp caps before use it

two things fixed here:
1. We query caps on UpdateCaps, but we use the caps in SetVAProcFilterDeinterlaceMode.
But SetVAProcFilterDeinterlaceMode call before UpdateCaps, this makes
SetVAProcFilterDeinterlaceMode use a invalid value.
2. when we changed the video effect, we mmeset the param_, it will make
the param_.surface_region and param_.output_region useless

Jira: None.
Test: 1. Video playback works fine.
2. adb shell hwcservice_test -b 100, you see the video turn bright on screen

6 years agoEnsure we swap Media surface as needed.
Kalyan Kondapally [Mon, 19 Mar 2018 07:20:08 +0000 (00:20 -0700)]
Ensure we swap Media surface as needed.

Jira: None.
Test: Video playback works fine.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevert "REVERTME: Disable usage of Media pipeline."
Kalyan Kondapally [Mon, 19 Mar 2018 03:29:39 +0000 (20:29 -0700)]
Revert "REVERTME: Disable usage of Media pipeline."

This reverts commit 95047742df2d368ae601bdff4ce9d4026d685ee4.

6 years agoAdd support for multi plane import.
Kalyan Kondapally [Sun, 18 Mar 2018 07:43:48 +0000 (00:43 -0700)]
Add support for multi plane import.

In this case we might have multiple prime fds, take this into
account while importing the buffer.

Jira: None.
Test: Video plays fine on Android IA.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse buffer handle to identify buffer.
Lin Johnson [Sun, 18 Mar 2018 07:38:39 +0000 (00:38 -0700)]
Use buffer handle to identify buffer.

This should be unique to each buffer. Let's use this instead
of prime handle. Reenable cache again.

Jira:None
Tests: No UI flicker on OneA, and video is good
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoAdd API to enable/disable HDCP support from HWCService API.
Kalyan Kondapally [Mon, 12 Mar 2018 02:25:05 +0000 (19:25 -0700)]
Add API to enable/disable HDCP support from HWCService API.

Jira: None.
Test: We are able to toggle HDCP state via the API tested by
      hwcservice_test.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we release buffer only when it's not used by plane.
Kalyan Kondapally [Thu, 15 Mar 2018 01:59:41 +0000 (18:59 -0700)]
Ensure we release buffer only when it's not used by plane.

We need to ensure we hold on to the buffer in case it's still
being used for scanout.

Jira: fixes #266 #235.
Test: No commit failures seen during clone mode.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoREVERTME: Disable usage of Media pipeline.
Kalyan Kondapally [Tue, 13 Mar 2018 09:33:33 +0000 (02:33 -0700)]
REVERTME: Disable usage of Media pipeline.

This is causing flicker when playing Videos.

Jira: None.
Test: No flicker seen when playing Video on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevert "Use Display Frame Rect as viewport."
Kalyan Kondapally [Mon, 12 Mar 2018 06:40:59 +0000 (23:40 -0700)]
Revert "Use Display Frame Rect as viewport."

Sometimes status bar is not rendered.

This reverts commit 7121ef5d1b754fc712fd862872756dab100c46b3.

6 years agoCall HandleCommitFailure everytime commit fails.
Kalyan Kondapally [Mon, 12 Mar 2018 04:19:58 +0000 (21:19 -0700)]
Call HandleCommitFailure everytime commit fails.

We where calling this only in case ValidateLayers was true.

Jira: None.
Test: No new regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoREVERTME: Disable buffer cache for now.
Kalyan Kondapally [Sun, 11 Mar 2018 23:34:01 +0000 (16:34 -0700)]
REVERTME: Disable buffer cache for now.

For some reason we are retrieving wrong buffers on Android.

Jira: None.
Test: Correct content is always shown when using app switcher.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse Display Frame Rect as viewport.
Kalyan Kondapally [Sun, 11 Mar 2018 21:59:55 +0000 (14:59 -0700)]
Use Display Frame Rect as viewport.

We shouldn't be rendering anything outside this rect.

Jira: None.
Test: No new rendering issues on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAlso check if surface is onscreen before releasing it.
Kalyan Kondapally [Sun, 11 Mar 2018 23:51:31 +0000 (16:51 -0700)]
Also check if surface is onscreen before releasing it.

Surface can have a buffer age of 0 but not in the queue to
be shown on screen. Let's check for this and release buffers
in case they are not queued to be shown on screen.

Jira: None.
Test: No new crashes seen on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoHandle layer transform in VARenderer
Xiaosong Wei [Thu, 8 Mar 2018 08:36:17 +0000 (14:06 +0530)]
Handle layer transform in VARenderer

VA only support 90/180/270 rotation so we only handle these transforms
in VARenderer.

Jira: None.
Test: Video rotation should work
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agotravis-ci: install meson 0.43.0
Harish Krupo [Fri, 9 Mar 2018 04:04:19 +0000 (09:34 +0530)]
travis-ci: install meson 0.43.0

Jira: None
Test: Travis ci should build successfully

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix build with ENABLE_DISPLAY_DUMP.
Kalyan Kondapally [Fri, 9 Mar 2018 01:44:35 +0000 (17:44 -0800)]
Fix build with ENABLE_DISPLAY_DUMP.

Jira: None.
Test: Build passes with ENABLE_DISPLAY_DUMP option.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we don't release inflight surfaces.
Kalyan Kondapally [Fri, 9 Mar 2018 01:39:34 +0000 (17:39 -0800)]
Ensure we don't release inflight surfaces.

private_data_ is shared object. We where resetting surfaces
of this object in case commit failed. We shouldn't do
that, instead just mark any new offscreen surfaces to be freed.

Jira: None.
Test: Get's to home screen without any crashes.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRelease un-used surface for every frame.
Kalyan Kondapally [Thu, 8 Mar 2018 10:00:08 +0000 (02:00 -0800)]
Release un-used surface for every frame.

Instead of tracking this in multiple places, use tracker.

Jira: None.
Test: No crashes while booting up to home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont add recycled surface to dedicated layers.
Kalyan Kondapally [Wed, 7 Mar 2018 08:09:53 +0000 (00:09 -0800)]
Dont add recycled surface to dedicated layers.

We ignore all dedicated layers when calculating regions to
be rendered. We shouldn't add source layers of a recycled
surface to this list.

Jira: None.
Test: No new flicker issues seen on Android with APL.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCheck if a layer is better off on a separate plane.
Kalyan Kondapally [Wed, 7 Mar 2018 07:12:05 +0000 (23:12 -0800)]
Check if a layer is better off on a separate plane.

Jira: None.
Test: No new flickers seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure top plane always cover the area of it's display frame.
Kalyan Kondapally [Wed, 7 Mar 2018 06:46:31 +0000 (22:46 -0800)]
Ensure top plane always cover the area of it's display frame.

We made sure of this for n and n-1 plane. However, we should
check for all the previous scanout planes and make sure the
current offscreen rendered plane covers the complete region.
Else we will be rendering invalid content.

Jira: None.
Test: No flickers seen when moving between icons on home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPass layer to SetBuffer in Overlay.
Kalyan Kondapally [Wed, 7 Mar 2018 06:10:30 +0000 (22:10 -0800)]
Pass layer to SetBuffer in Overlay.

We query from the layer if it's type is cursor and use that
information to do some additional booking in case of
raw pixel data.

Jira: None.
Test: Cursor shows up with Weston.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoIgnore height while checking if downscaling is needed.
Kalyan Kondapally [Sat, 3 Mar 2018 19:28:34 +0000 (11:28 -0800)]
Ignore height while checking if downscaling is needed.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSquash planes if it doesn't full cover the underlying plane.
Kalyan Kondapally [Fri, 2 Mar 2018 05:45:11 +0000 (21:45 -0800)]
Squash planes if it doesn't full cover the underlying plane.

Jira: None.
Test: Reduced flicker when navigating between views.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable IMG Context Priority support on APL.
Harish Krupo [Thu, 1 Mar 2018 17:11:17 +0000 (09:11 -0800)]
Enable IMG Context Priority support on APL.

Jira: None.
Test: Boots up fine on Android.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoAdded Support for 32bit RGBA format
pyn1 [Wed, 28 Feb 2018 09:16:40 +0000 (14:46 +0530)]
Added Support for 32bit RGBA format

One of the CTS test cases expects the support
to create Buffer of type HAL_PIXEL_FORMAT_RGBA_1010102

Jira:  None
Tests: Buffer Created successfully for the intended format
       CTS command: run cts -m CtsHardwareTestCases

Signed-off-by: Poornima <poornima.y.n@intel.com>
6 years agoSquash planes as needed.
Kalyan Kondapally [Thu, 1 Mar 2018 04:10:53 +0000 (20:10 -0800)]
Squash planes as needed.

Earlier commit only checked if we need to squash planes in case
of rendering the layers if we where mapping it to overlay. However,
we can have cases where we are mapping the layers to last plane.
This patch handles that case too.

Jira: None.
Test: Flickers reduced when scrolling settings view.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset cache in case layer z-order has changed.
Kalyan Kondapally [Mon, 26 Feb 2018 00:37:07 +0000 (16:37 -0800)]
Reset cache in case layer z-order has changed.

Jira: None.
Test: Reduced grabage rendering when using task switcher.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMerge pull request #248 from harishkrupo/master
kalyan kondapally [Thu, 22 Feb 2018 10:10:22 +0000 (02:10 -0800)]
Merge pull request #248 from harishkrupo/master

Fix corrupted patch

6 years agoFix corrupted patch
Harish Krupo [Wed, 21 Feb 2018 04:47:04 +0000 (10:17 +0530)]
Fix corrupted patch

Jira: None
Test: Build should pass with travis-ci

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix hwc compilation error due to libva2.0 master upgrade
biskhand [Thu, 15 Feb 2018 00:16:41 +0000 (08:16 +0800)]
Fix hwc compilation error due to libva2.0 master upgrade

Jira: None.
Test: Build passes on Android.
Signed-off-by: badiuzzaman.azzarfan.bin.iskhandar@intel.com
6 years agoRemove unneeded travis resources
Harish Krupo [Tue, 20 Feb 2018 04:17:06 +0000 (09:47 +0530)]
Remove unneeded travis resources

Strip down hwc-install.tar.bz2 to include only those files
which are required.

Jira: None
Test: Should build properly in travis-ci.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix linux build
Harish Krupo [Tue, 20 Feb 2018 03:49:13 +0000 (09:19 +0530)]
Fix linux build

Remove utils_android.h from nesteddisplay.cpp

Jira: None
Test: Should build properly with travis-ci

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoAdd readme for build_script
Harish Krupo [Tue, 20 Feb 2018 01:33:51 +0000 (07:03 +0530)]
Add readme for build_script

Jira: None.
Test" None.
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoHyper dmabuf sharing
xue.yifei [Sun, 11 Feb 2018 09:54:45 +0000 (01:54 -0800)]
Hyper dmabuf sharing

Add hyper dmabuf sharing feature in NestedDisplay.

Jira: None
Test: Tested on android
Signed-off-by: xue.yifei <yifei.xue@intel.com>
6 years agotravis-ci: Enable building linux frontend
Harish Krupo [Mon, 19 Feb 2018 01:26:17 +0000 (06:56 +0530)]
travis-ci: Enable building linux frontend

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix damage rects when layers are removed or added.
Kalyan Kondapally [Mon, 19 Feb 2018 04:41:28 +0000 (20:41 -0800)]
Fix damage rects when layers are removed or added.

Jira: None.
Test: No new regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix travis builds
Harish Krupo [Mon, 19 Feb 2018 01:26:17 +0000 (06:56 +0530)]
Fix travis builds

- Install python3-pip as pip3 is required to install meson.
- Install udev, mtdev dependency

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix commit failures.
Kalyan Kondapally [Sun, 18 Feb 2018 22:00:10 +0000 (14:00 -0800)]
Fix commit failures.

Eventhogh we where able to scanout the layer, we still
created an offscreen target for it. As Test commit used original
layer it passed but actual commit failed as it was using offscreen
surface. From Dmesg:
"[   70.371775] [drm:drm_atomic_check_only] Invalid source coordinates 1920.000000x1080.000000+0.000000+0.000000
[   70.371777] [drm:drm_atomic_check_only] FB: 1920+56
[   70.371779] [drm:drm_atomic_check_only] src_w > fb_width: 0
[   70.371781] [drm:drm_atomic_check_only] src_x > fb_width - src_w: 0
[   70.371783] [drm:drm_atomic_check_only] src_h > fb_height: 1
[   70.371785] [drm:drm_atomic_check_only] src_y > fb_height - src_h: 0"

This is also highlights generic problem as we always assume offscreen
surface to be same as resolution size. This limitation should be
addressed in followup patches.

Jira: None.
Test: No commit failures seen during boot up.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix travis builds.
Kalyan Kondapally [Sun, 18 Feb 2018 19:12:49 +0000 (11:12 -0800)]
Fix travis builds.

Jira: None.
Test: Builds pass.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoBuild linux frontend using travis-ci
Harish Krupo [Sun, 18 Feb 2018 04:39:02 +0000 (10:09 +0530)]
Build linux frontend using travis-ci

Add required scripts to build linux frontend as a part of travis.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
6 years agoAdd iahwc backend inside Hwcomposer.
Harish Krupo [Tue, 13 Feb 2018 05:43:09 +0000 (11:13 +0530)]
Add iahwc backend inside Hwcomposer.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoEnsure we mark surfaces for recycling when planes are disabled.
Kalyan Kondapally [Sun, 18 Feb 2018 02:09:25 +0000 (18:09 -0800)]
Ensure we mark surfaces for recycling when planes are disabled.

This can happen in case layers of a plane are removed and we
disable it in GetCachedLayers.

Jira: None.
Test: No memory increase seen as layers are removed and added.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCheck if plane type is cursor before applying Cursor W/A.
Kalyan Kondapally [Sun, 18 Feb 2018 02:07:44 +0000 (18:07 -0800)]
Check if plane type is cursor before applying Cursor W/A.

Jira: None.
Test: Cursor plane shows up during bootup.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant variables/functions in DisplayQueue.
Kalyan Kondapally [Sat, 17 Feb 2018 23:43:19 +0000 (15:43 -0800)]
Remove redundant variables/functions in DisplayQueue.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd log to trace wrongly disabled planes.
Kalyan Kondapally [Sat, 17 Feb 2018 23:18:15 +0000 (15:18 -0800)]
Add log to trace wrongly disabled planes.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix garbage when minimizing windows.
Kalyan Kondapally [Sat, 17 Feb 2018 22:02:46 +0000 (14:02 -0800)]
Fix garbage when minimizing windows.

Sometimes wrong rect was being rendered when minimizing windows.
This happened when layers where removed, which moved them from
one plane to another. Let's force reseting rect and plane validation
in this case.

Jira: None.
Test: We don't see flickers/grabage when windows are minimized.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTry scanout only if you have one layer.
Kalyan Kondapally [Sat, 17 Feb 2018 11:37:45 +0000 (03:37 -0800)]
Try scanout only if you have one layer.

Jira: None.
Test: Bottom tool bad doesn't disappear when navigating between views.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix flicker with task switcher.
Kalyan Kondapally [Thu, 15 Feb 2018 10:41:29 +0000 (02:41 -0800)]
Fix flicker with task switcher.

In some cases we didn't refresh the surfaces correctly as we
mixed this state with validation. Let's separate them and track
them separately.

Jira: None.
Test: No flicker seen when using app switcher on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoIgnore planes which have layers above threshold value.
Kalyan Kondapally [Thu, 15 Feb 2018 09:13:43 +0000 (01:13 -0800)]
Ignore planes which have layers above threshold value.

When layers are removed, we can safely ignore the planes
which have these layers.

Jira: None.
Test: Linux tests pass.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we render layers when squashing planes.
Kalyan Kondapally [Thu, 15 Feb 2018 08:40:28 +0000 (00:40 -0800)]
Ensure we render layers when squashing planes.

Jira: None.
Test: Build passes on Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRelease any free surfaces even if we are ignoring the commit.
Kalyan Kondapally [Thu, 15 Feb 2018 08:30:45 +0000 (00:30 -0800)]
Release any free surfaces even if we are ignoring the commit.

We ignore commit if no content has changed. Even in this case
let's free any unused surfaces.

Jira: None.
Test: No new regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRefresh planestate tracking when layer rect has changed.
Kalyan Kondapally [Thu, 15 Feb 2018 07:35:17 +0000 (23:35 -0800)]
Refresh planestate tracking when layer rect has changed.

Instead of taking max of current and previous region, let's
re-calculate the whole rect again. This avoids possible cases
of newer rects being smaller than newer ones.

Jira: None.
Target. No new regressions with Linux apps.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse displayframe as scissor rect for full clear.
Kalyan Kondapally [Thu, 15 Feb 2018 06:44:23 +0000 (22:44 -0800)]
Use displayframe as scissor rect for full clear.

Jira: None.
Test: Android launches to home screen.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we release surfaces in case commit has failed.
Kalyan Kondapally [Thu, 15 Feb 2018 05:29:05 +0000 (21:29 -0800)]
Ensure we release surfaces in case commit has failed.

In case we are doing full validation, we will allocate new
surfaces, let's make sure we delete them in case commit
has failed.

Jira: None.
Test: Memory doesn't increase with commit failures.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant opeartions.
Kalyan Kondapally [Tue, 13 Feb 2018 17:59:33 +0000 (09:59 -0800)]
Remove redundant opeartions.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove LayerHashGenerator to Native display
Harish Krupo [Tue, 13 Feb 2018 10:05:26 +0000 (15:35 +0530)]
Move LayerHashGenerator to Native display

Moving the implementation of LayerHashGenerator from Physical
diplay to nativedisplay as other classes directly implement
nativedisplay.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoPartial revert of "ff92a05232c5c56c63b99865dd149c4c9bcf59de"
Kalyan Kondapally [Tue, 13 Feb 2018 10:39:53 +0000 (02:39 -0800)]
Partial revert of "ff92a05232c5c56c63b99865dd149c4c9bcf59de"

Jira: None.
Test: "Rendering Layer outside Damaged Region" warnings are not seen
       when compositor trace is enabled.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we dont allocate more than once for the plane in a given frame.
Kalyan Kondapally [Tue, 13 Feb 2018 07:48:06 +0000 (23:48 -0800)]
Ensure we dont allocate more than once for the plane in a given frame.

As we can be doing incremental validation, we dont want to allocate
buffers if it has already been allocated during GetCachedLayers.

Jira: None.
Test: No garbage seen on APL when moving around views which are 3D composited.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we clear surface in case layers are replaced.
Kalyan Kondapally [Mon, 12 Feb 2018 02:06:30 +0000 (18:06 -0800)]
Ensure we clear surface in case layers are replaced.

Currently, we don't track this case. Now, we ensure we take
this account before deciding if we need to do a full or partial
clear of the surface.

Jira: None.
Test: No new flickers seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd basic tracking to refresh surfaces within planestate.
Kalyan Kondapally [Sun, 11 Feb 2018 09:20:22 +0000 (01:20 -0800)]
Add basic tracking to refresh surfaces within planestate.

Jira: None.
Test: No new flicker seen when navigating between different views
      on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTrack within plane state if last plane surface can be re-used.
Kalyan Kondapally [Sun, 11 Feb 2018 02:05:08 +0000 (18:05 -0800)]
Track within plane state if last plane surface can be re-used.

Instead of DisplayQueue doing this for us, we can do it within
plane state as we have all needed information here.

Jira: None.
Test: No new regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReplace InUse usage with SurfaceAge.
Kalyan Kondapally [Sun, 11 Feb 2018 00:40:58 +0000 (16:40 -0800)]
Replace InUse usage with SurfaceAge.

Jira: None.
Test: Build passes on Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoNo need to reset composition regions if only damage has changed.
Kalyan Kondapally [Sun, 11 Feb 2018 00:15:57 +0000 (16:15 -0800)]
No need to reset composition regions if only damage has changed.

We should be already resetting the regions if rect has updated,
or if previous scanout layers have changed.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSwapsurface implicitly in PlaneState.
Kalyan Kondapally [Sun, 11 Feb 2018 00:01:25 +0000 (16:01 -0800)]
Swapsurface implicitly in PlaneState.

Instead of tracking this in different places, let's handle this
internal to Plane state.

Jira: None.
Test: no new regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPixelBuffer: Align width and height of pixelbuffer
Harish Krupo [Tue, 6 Feb 2018 07:42:23 +0000 (13:12 +0530)]
PixelBuffer: Align width and height of pixelbuffer

The size of the raw data for the cursor layer can be too
small sometimes. In such cases make the size of the
allocated buffer to 256,256.

Jira: None
Test: Cursor shows up with the linux backend

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoMakefile.am: Add wsi, common as dependency
Harish Krupo [Mon, 5 Feb 2018 12:46:34 +0000 (18:16 +0530)]
Makefile.am: Add wsi, common as dependency

Currently libhwcomposer_{common, wsi} are built as static libraries and
linked into libhwcomposer.so as whole archives. Linking them in this
fashion doesn't add them as a dependency for libhwcomposer.so, as a result
when these libraries are modified, they are not relinked again into
libhwcomposer.so. So, adding them in LIBADD to ensure libhwcomposer.so
is dependent on them.

Jira: None
Test: testlayers and linux_test apps should work properly.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agolinux_frontend: Add Destroy layer API
Harish Krupo [Mon, 5 Feb 2018 08:17:04 +0000 (13:47 +0530)]
linux_frontend: Add Destroy layer API

Jira: None
Test: No regressions in linux_test app.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agolinux_frontend: Add support for setting raw pixel data.
Harish Krupo [Mon, 5 Feb 2018 02:31:04 +0000 (08:01 +0530)]
linux_frontend: Add support for setting raw pixel data.

This is for cases where the buffer data is shared between processes
as a shared memory.

Jira: None
Test: Cursor shows up with Linux Backend.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix warnings.
Kalyan Kondapally [Fri, 9 Feb 2018 08:58:34 +0000 (00:58 -0800)]
Fix warnings.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoHwcRect: Set all members to 0 on initialization.
Harish Krupo [Tue, 6 Feb 2018 14:20:38 +0000 (19:50 +0530)]
HwcRect: Set all members to 0 on initialization.

Jira: None
Test: No regressions in linux_test and testlayers apps

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoHandle case where one of the rects is empty in CalculateRect.
Kalyan Kondapally [Tue, 6 Feb 2018 06:02:09 +0000 (22:02 -0800)]
Handle case where one of the rects is empty in CalculateRect.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevert "hyper dmabuf sharing"
Kalyan Kondapally [Tue, 6 Feb 2018 06:16:12 +0000 (22:16 -0800)]
Revert "hyper dmabuf sharing"

This reverts commit 574eff44e7caf39def6771d2d39f919f1d755278.