OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
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.

6 years agoCorrect video plane damage rect caculation.
Lin Johnson [Tue, 6 Feb 2018 05:30:38 +0000 (21:30 -0800)]
Correct video plane damage rect caculation.

Video plane does not need combation of display
rects from layers. Instead it should use the
display rect of its source layer

Jira: None
Test: Video display frame rect is always correct.

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agohyper dmabuf sharing
xue.yifei [Tue, 6 Feb 2018 05:23:39 +0000 (21:23 -0800)]
hyper dmabuf sharing

Add hyper dmabuf sharing feature in NestedDisplay which can
share buffers in an virtualized environment.

Jira: None
Test: tested on android
Signed-off-by: xue.yifei <yifei.xue@intel.com>
6 years agoAdd support for raw pixel data.
Kalyan Kondapally [Sun, 4 Feb 2018 11:49:17 +0000 (03:49 -0800)]
Add support for raw pixel data.

We have cases on Linux where content is CPU rendered and
needs to be scanned out or composited together with other
layers. Add support for this case. If we are unable to mmap
prime handle than we fall back to texture upload path.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd initial support for HDCP.
Kalyan Kondapally [Sat, 3 Feb 2018 09:29:41 +0000 (01:29 -0800)]
Add initial support for HDCP.

We try to program the pipe if kernel exposes "Content Protection"
property.

Jira: None.
Test: On KBL, we are able to print the property and supported values in
      logcat.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoLinux Backend Support
Harish Krupo [Fri, 17 Nov 2017 20:47:05 +0000 (02:17 +0530)]
Linux Backend Support

Jira: None.
Test: Build passes on Linux.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoAdd API and functionality to query and store supported modifiers.
Yuanjun Huang [Thu, 1 Feb 2018 08:36:22 +0000 (00:36 -0800)]
Add API and functionality to query and store supported modifiers.

Jira: https://jira01.devtools.intel.com/browse/AREQ-23273
Test: Build passes and validates with hwcomposer testlayer APP.
Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
6 years agoNativeDisplay: Layer Hash Generator
Harish Krupo [Wed, 31 Jan 2018 05:34:39 +0000 (11:04 +0530)]
NativeDisplay: Layer Hash Generator

The LayerHashGenerator are a set of utility methods in NativeDisplay
which can be used to get layer ids. It maintains with a pool of ids whose
initial size is determined by the size parameter passed to
InitializeLayerHashGenerator. Call AcquireId when a new id is required
and release that id with ReleaseId. The size of the pool is variable
and increases when required.

Jira: None
Test: The device should boot to homescreen.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agotravis-ci: install all packages in same command
Harish Krupo [Wed, 31 Jan 2018 12:56:36 +0000 (18:26 +0530)]
travis-ci: install all packages in same command

Install all the required packages in the same apt-get command.

Jira: None
Test: Travis should properly build hwcomposer and the build
      should pass

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoAdd helper for checking down scaling factor.
Kalyan Kondapally [Mon, 29 Jan 2018 02:16:08 +0000 (18:16 -0800)]
Add helper for checking down scaling factor.

Instead of having this in too many places, lets have similar
helper function as Transform and UpScaling validation.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we validate Display Transform as needed.
Kalyan Kondapally [Mon, 29 Jan 2018 01:55:17 +0000 (17:55 -0800)]
Ensure we validate Display Transform as needed.

Instead of checking this during validation of individual
layers, let's do it in FinalizeValidation. This should ensure
we are checking at plane level and rotation type in planestate
is always correct.

Jira: None.
Test: Rotated layers are always shown in right plane and don't
      undergo both GPU and plane rotation.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse GPUDevice to monitor HWCLock.
Kalyan Kondapally [Sun, 28 Jan 2018 20:38:40 +0000 (12:38 -0800)]
Use GPUDevice to monitor HWCLock.

We can avoid HWCLock thread as we initialize thread in
GPUDevice now. We can use that to monitor these events and
kill it once done.

Jira: None.
Test: Boots up to home screen on Android IA.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSplit drm and HWC specific initialization.
Kalyan Kondapally [Sun, 28 Jan 2018 11:21:55 +0000 (03:21 -0800)]
Split drm and HWC specific initialization.

Goal is to make these initializations in parallel and reduce
the time consumed by HWC during boot up.

Jira: None.
Test: No isses seen during boot up on Android IA.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agohash_combine_hwc: get seed parameter as reference.
Harish Krupo [Sun, 28 Jan 2018 02:42:49 +0000 (18:42 -0800)]
hash_combine_hwc: get seed parameter as reference.

Jira: None.
Test: Buffers are retrieved correctly from cache.
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoInitial support for Downscaling as needed.
Kalyan Kondapally [Tue, 23 Jan 2018 07:57:03 +0000 (23:57 -0800)]
Initial support for Downscaling as needed.

We fallback to 3D composition in case layer cannot be scanned out
directly or we don't have enough planes for all layers. In case
we fall back to 3D, we now check if we can actually downscale
the width by a given scaling factor and upscale it in display
side. We do this for offscreen surface layers only and not for
individual layer. Currently, we try to downscale only
width and not height. We ignore this in case either width or
height is less than 500 pixels. We also have a flag ENABLE_DOWNSCALING
to disable this if in case we see regressions to be fixed before
enabling this on stable.

Jira: None.
Test: No new artifacts.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoValidate rect even if clear_surface is true.
Kalyan Kondapally [Tue, 23 Jan 2018 07:18:15 +0000 (23:18 -0800)]
Validate rect even if clear_surface is true.

We ignored updating rects which resulted in us having wrong
display frame rect in the following case:
Plane had multiple layers, one of the layer was removed and
another layer display frame was updated.

Jira: None.
Test: Bottom navigation bar is always present when running
      different benchmarks.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd more test case in hwcservice_test.
Wang,Fei [Tue, 23 Jan 2018 02:01:26 +0000 (10:01 +0800)]
Add more test case in hwcservice_test.

1. Add sharpness test case.
2. Add RestoreDefaultDeinterlace implementation

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

Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoAdded Support for 64bit RGB format
Poornima [Mon, 22 Jan 2018 04:48:16 +0000 (10:18 +0530)]
Added Support for 64bit RGB format

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

Jira: None
Tests: Buffer Created successfully.
       CTS command: run cts -m CtsHardwareTestCases

Signed-off-by: Poornima <poornima.y.n@intel.com>
6 years agoTake Layer Content and validate into account in OverlayLayer.
Kalyan Kondapally [Mon, 22 Jan 2018 08:15:20 +0000 (00:15 -0800)]
Take Layer Content  and validate into account in OverlayLayer.

If these states are true, layer should be re-rendered.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTake layer's state into consideration during idle frame.
Kalyan Kondapally [Sun, 21 Jan 2018 23:08:26 +0000 (15:08 -0800)]
Take layer's state into consideration during idle frame.

If we requested for idle frame update, no layer should have
changed. We now check for this and if anything has changed, we
don't treat it as idle frame.

Jira: None.
Test: We still fall abck to single plane composition when preparing
      for idle frame.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMake sure we are setting display frame correctly always.
Kalyan Kondapally [Sun, 21 Jan 2018 20:31:23 +0000 (12:31 -0800)]
Make sure we are setting display frame correctly always.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove unused define in make files.
Kalyan Kondapally [Sun, 21 Jan 2018 19:16:42 +0000 (11:16 -0800)]
Remove unused define in make files.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRe-work Idle time logic.
Kalyan Kondapally [Sun, 21 Jan 2018 06:54:43 +0000 (22:54 -0800)]
Re-work Idle time logic.

We increase the thresholds to 350 now. Also, idle_reset_frames_counter_
is not needed anymore and hence removed.

Jira: None.
Test: We dont toggle between validation for idle mode and normal layer
      validation when running some of the gfx benchmarks.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoIgnore Idle Frame request in case a layer has changed.
Kalyan Kondapally [Sat, 20 Jan 2018 23:23:17 +0000 (15:23 -0800)]
Ignore Idle Frame request in case a layer has changed.

This means content has actually changed and system is not
really in idle mode. Let's ignore any idle update requests
in this case.

Jira: None.
Test: We still fall back to single plane composition when nothing
      has changed for the given idle frame threshold.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoForce render layers when force_media_composition is true.
Kalyan Kondapally [Sat, 20 Jan 2018 13:36:05 +0000 (05:36 -0800)]
Force render layers when force_media_composition is true.

We need to fall back to Media Renderer in this case.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoIgnore Idleframe request in case effects state has changed.
Kalyan Kondapally [Sat, 20 Jan 2018 13:32:30 +0000 (05:32 -0800)]
Ignore Idleframe request in case effects state has changed.

In this case we still want to use planes and Media renderer
in case effects support is enabled.

Jira: None.
Test: We validate layers in case idle frame is requested but effects
      state has changed.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove the duplication of the function call
Kishore Kadiyala [Wed, 17 Jan 2018 09:02:06 +0000 (14:32 +0530)]
Remove the duplication of the function call

Process State is already initialized at beginning of the process,
and again calling the same is duplication.

Jira: None
Test: GPA launching 3rd party App shouldn't cause any SIGSEGV
      & also HWC tests should PASS.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoSet scaling mode through environment variable.
Wang,Fei [Thu, 18 Jan 2018 22:25:57 +0000 (14:25 -0800)]
Set scaling mode through environment variable.

Jira: None.
Test: Build passes on Linux and Android.

Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoMark NeedsOffScreenComposition const.
Kalyan Kondapally [Tue, 16 Jan 2018 08:36:01 +0000 (00:36 -0800)]
Mark NeedsOffScreenComposition const.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCheck source and display frame rects separately.
Kalyan Kondapally [Tue, 16 Jan 2018 08:12:58 +0000 (00:12 -0800)]
Check source and display frame rects separately.

Source rect changes are interesting when using display
scalar, if not display frame should be enough.

Jira: None.
Test: No new regressions when using 3D Composition for Mouse.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove separate damage tracking in NativeSurface.
Kalyan Kondapally [Tue, 16 Jan 2018 00:05:33 +0000 (16:05 -0800)]
Remove separate damage tracking in NativeSurface.

We do this tracking in hwclayer now. Instead of seprately
tracking another damage in NativeSurface, we just let it
use the newly calculated one. We make sure any new damage
is propogated to all offscreen surfaces. Layers with a
transform are forced to use their display frame rect as
their damage rect.

Jira: None.
Test: Sliders still update correctly. Moving mouse when rotated
      in 90 degrees doesn't leave any garbage.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTake Surface Damage into account before reseting kLayerContentChanged.
Kalyan Kondapally [Mon, 15 Jan 2018 08:35:44 +0000 (00:35 -0800)]
Take Surface Damage into account before reseting kLayerContentChanged.

If SurfaceDamage is not empty we need to render the damaged
content in this frame. We didn't check for this earlier.

Jira: None.
Test: No partial rendered frames are shown when launching apps from
      launcher.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMinimize flickers when layer is replaced with another.
Kalyan Kondapally [Sun, 14 Jan 2018 21:05:40 +0000 (13:05 -0800)]
Minimize flickers when layer is replaced with another.

Let's make sure Surface Damage of current layer includes the
display frame of the replaced layer.

Jira: None.
Test: Flicker is minimized when views having VKB are launched.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure Media surface state is updated correctly.
Kalyan Kondapally [Sun, 14 Jan 2018 20:29:46 +0000 (12:29 -0800)]
Ensure Media surface state is updated correctly.

GL Backend reset's clear surface state correctly, which we
relied in DisplayQueue to determine if we need to refresh
the surface in case of partial update. VA backend never
did that resulting in display frame never getting updated
after set once. Now, we ensure we refresh surfaces in case
we need partial clear.

Jira: None.
Test: Video layer scales correctly when changing between full
      screen and non-fullscreen mode.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSkip Revalidation in case layer buffer has changed.
Kalyan Kondapally [Sun, 14 Jan 2018 19:03:24 +0000 (11:03 -0800)]
Skip Revalidation in case layer buffer has changed.

Revalidation has no value in case the layer is going
through 3D Composition pass, let's skip it in this
case.

Jira: None.
Test: No new test commit failures.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove all display transform checks to PlaneState.
Kalyan Kondapally [Sun, 14 Jan 2018 11:23:23 +0000 (03:23 -0800)]
Move all display transform checks to PlaneState.

This should given us ability to check if rotation can be
supported by individual layers or offscreen surface of an
plane. This should ensure we are able to validate the
support propertly before trying to use the display capabilities
or fall back to handle the rotation with 3D Compositor.

Jira: None.
Test: 180 rotation works as before.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse plane for 180 rotation.
Kalyan Kondapally [Thu, 11 Jan 2018 10:10:47 +0000 (02:10 -0800)]
Use plane for 180 rotation.

We can support this directly using Display Planes.
Ideally, we need to check first if this is supported or not
before deciding to use between 3D or Display for rotation.

Jira: None.
Test: All layers are rotated correctly.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we update Video layer when effects state change.
Kalyan Kondapally [Wed, 10 Jan 2018 21:30:50 +0000 (13:30 -0800)]
Ensure we update Video layer when effects state change.

Jira: None.
Test: Any change to Video effects support is taken into
      account immediately.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd deinterlace on VA module.
Wang,Fei [Tue, 9 Jan 2018 07:24:50 +0000 (15:24 +0800)]
Add deinterlace on VA module.

Jira: None.
Test: Build passes on Linux and Android.

Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoAdd a threshold before we use SurfaceDamage.
Kalyan Kondapally [Tue, 9 Jan 2018 10:08:03 +0000 (02:08 -0800)]
Add a threshold before we use SurfaceDamage.

Layers having displayframewidth and height less than 500, seem
to report wrong surface damage for some reason. This patch adds
a threshold of 1000 before we take advantage of SurfaceDamage.

Jira: None.
Test: Drop down menu's still work fine.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't assume plane always needs rendering.
Kalyan Kondapally [Tue, 9 Jan 2018 09:19:27 +0000 (01:19 -0800)]
Don't assume plane always needs rendering.

We should check if the plane surface is being re-cycled and set
our rendering state accordingly instead of assuming it to be
always true.

Jira: None.
Test: Cursor visibility change doesn't force us to render the full
      content of all planes.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont refresh surfaces if not needed.
Kalyan Kondapally [Tue, 9 Jan 2018 10:11:07 +0000 (02:11 -0800)]
Dont refresh surfaces if not needed.

We should update the surfaces only if something has really
changed in the plane state. However, we ended up setting
the full damage whenever RefreshSurfacesIfNeeded was called.
This patch fixes it.

Jira: None.
Test: No rendering artifacts seen with Linux apps.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoApply video effect immediately for current frame
Xiaosong Wei [Mon, 8 Jan 2018 08:08:22 +0000 (16:08 +0800)]
Apply video effect immediately for current frame

The current video effect settings should be applied immediately
for the current frame

Jira: None
Test: video effect works as expected

Change-Id: I1abe484c78f3bc616587bcbd32760bf7c1e896c9
Tracked-On:
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix width/height setting in vaCreateSurfaces.
Lin Johnson [Mon, 8 Jan 2018 10:00:11 +0000 (18:00 +0800)]
Fix width/height setting in vaCreateSurfaces.

Tests:video playback sucessful
Jira:None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoFix flicker when partial clears are used.
Kalyan Kondapally [Mon, 8 Jan 2018 10:41:13 +0000 (02:41 -0800)]
Fix flicker when partial clears are used.

We updated this state only for current offscreen surface but
not for all surfaces. This fixes flicker seen with some
apps when we clear only the damaged rect.

Jira: None.
Test: No flicker seen when partial clears are used.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset Validationstate when adding layers.
Kalyan Kondapally [Mon, 8 Jan 2018 05:45:31 +0000 (21:45 -0800)]
Reset Validationstate when adding layers.

After removing layers, we might have decided to re-check
the plane for direct scanout. However, we can be adding layers
later, let's reset this state when we do so.

Jira: None.
Test: Bottom layers don't disappear when navigating back to
      home screen. We dont see the following warning
      when SURFACE_PLANE_LAYER_MAP_TRACING is 1:
      "Plane has more than one layer associated when its type is
        kScanout. This needs to be fixed."

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMake sure we check SurfaceDamage and rect when clear_surface is false.
Kalyan Kondapally [Mon, 8 Jan 2018 04:48:32 +0000 (20:48 -0800)]
Make sure we check SurfaceDamage and rect when clear_surface is false.

We where checking if remove_index != -1, instead we should check
if clear_surface is true.This flag is set only for planes which
have been reset.

Jira: None.
Test: No regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont reset Damage more than we should do.
Kalyan Kondapally [Mon, 8 Jan 2018 04:14:02 +0000 (20:14 -0800)]
Dont reset Damage more than we should do.

Jira: None.
Test: Popups showup fine on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd helper to reset rect.
Kalyan Kondapally [Mon, 8 Jan 2018 01:07:31 +0000 (17:07 -0800)]
Add helper to reset rect.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoClip regions to Damage Rect.
Kalyan Kondapally [Sun, 7 Jan 2018 02:18:07 +0000 (18:18 -0800)]
Clip regions to Damage Rect.

While calculating the regions in disjoint_layers, lets clip
them to damage rect as this is the region which really needs
to be rendered again.

Jira: None.
Test: Dialog boxes, sliders all update correctly.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant clear surface checks.
Kalyan Kondapally [Sun, 7 Jan 2018 02:09:45 +0000 (18:09 -0800)]
Remove redundant clear surface checks.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid re-compositing planes in case removed layer was scanned out.
Kalyan Kondapally [Sun, 7 Jan 2018 01:33:58 +0000 (17:33 -0800)]
Avoid re-compositing planes in case removed layer was scanned out.

Jira: None.
Test: Popups and switching views doesn't show any rendering issues.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMake sure we set correct plane transform when display is rotated 180.
Kalyan Kondapally [Sun, 7 Jan 2018 00:34:07 +0000 (16:34 -0800)]
Make sure we set correct plane transform when display is rotated 180.

Jira: None.
Test: Layer content is rotated 180 when
      PHYSICAL_DISPLAY_ROTATION="0:2" is set in hwc_display.ini file.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTake Damage rect into account in disjoint_layers.
Kalyan Kondapally [Sat, 6 Jan 2018 23:24:02 +0000 (15:24 -0800)]
Take Damage rect into account in disjoint_layers.

We want to only render layers which are impacted by the damaged
region.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset Composition region as needed.
Kalyan Kondapally [Sat, 6 Jan 2018 21:24:47 +0000 (13:24 -0800)]
Reset Composition region as needed.

We need to do this every time we clear the surface and surface
damage has changed.

Jira: None.
Test: Popups are rendered correctly when moving between different
      views

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove include.
Kalyan Kondapally [Thu, 4 Jan 2018 16:00:29 +0000 (08:00 -0800)]
Remove include.

This is not present anymore.

Jira: None.
Test: Tests build on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAlways reset current damage to be same as surface_damage.
Kalyan Kondapally [Thu, 4 Jan 2018 04:51:25 +0000 (20:51 -0800)]
Always reset current damage to be same as surface_damage.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix MosaicDisplay.
Kalyan Kondapally [Wed, 3 Jan 2018 15:55:05 +0000 (07:55 -0800)]
Fix MosaicDisplay.

We now stricly check our state before doing any updates.
In Mosaic Case, same layer is used for all displays by just
traslating the source crop and display frame. Let's make sure
we don't invalidate the state till all displays are done.

Jira: None.
Test: Mosaic display feature works with 2 displays connected.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPrefer display with highest refresh rate.
Kalyan Kondapally [Wed, 3 Jan 2018 15:21:00 +0000 (07:21 -0800)]
Prefer display with highest refresh rate.

In case of Mosaic, we alway wait on the last connected
display update to finish before requesting a new update.
Instead let's use the fence from display with higest refresh
rate.

Jira: None.
Test: Mosaic mode works as now.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTrack render state correctly.
Kalyan Kondapally [Wed, 3 Jan 2018 13:57:30 +0000 (05:57 -0800)]
Track render state correctly.

We need to render layers in case plane has more than one layer
/needs gpu composition.

Jira: None.
Test: Content is correct after rendering idle frame on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPostpone re-validation when only removing layers.
Kalyan Kondapally [Wed, 3 Jan 2018 13:48:25 +0000 (05:48 -0800)]
Postpone re-validation when only removing layers.

In this case we shouldn't be showing any new content but only
removing old layers. We can avoid full revalidation.

Jira: None.
Test: We dont trigget a full revalidation in case cursor layer
      becomes invisible.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix indentation.
Kalyan Kondapally [Wed, 3 Jan 2018 13:46:39 +0000 (05:46 -0800)]
Fix indentation.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd more traces.
Kalyan Kondapally [Wed, 3 Jan 2018 13:43:47 +0000 (05:43 -0800)]
Add more traces.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix cursor layer check in DrmPlane.
Kalyan Kondapally [Wed, 3 Jan 2018 12:24:15 +0000 (04:24 -0800)]
Fix cursor layer check in DrmPlane.

We might be using Overlay to show cursor. Let's check
if the layer is a cursor layer instead of assuming we will
use only cursor plane for cursor layer.

Jira: None.
Test: Cursor layer size is correct ir-respective of the plane
      in use.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't ignore alpha when using overlays.
Kalyan Kondapally [Wed, 3 Jan 2018 12:22:37 +0000 (04:22 -0800)]
Don't ignore alpha when using overlays.

The preffered format order always had x* components as first.
We want to prefer these only in case of primary.

Jira: None.
Test: Right format is used with overlays on APL.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoLet's make sure we use single plane when in idle mode.
Kalyan Kondapally [Wed, 3 Jan 2018 12:20:59 +0000 (04:20 -0800)]
Let's make sure we use single plane when in idle mode.

We ignored this state and continued to use multiple planes.

Jira: None.
Test: Only single plane is used when we are rendering an idle
      frame.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable Damage support.
Kalyan Kondapally [Tue, 2 Jan 2018 15:36:23 +0000 (07:36 -0800)]
Enable Damage support.

We now keep track of both surface damage of buffer and any
damage incurred due to geometry changes i.e. Transform change,
alpha value change etc. We rely on this and not just buffer
damage. With this we are able to now do partial updates, doing
full, partial or no clear as needed.

Jira: None.
Test: Sliders work fine, Mouse GPU composition doesn't show any
      artifacts.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we reset composition region cache when we add new layers.
Kalyan Kondapally [Tue, 2 Jan 2018 14:19:45 +0000 (06:19 -0800)]
Ensure we reset composition region cache when we add new layers.

Jira: None.
Test: Check that we re-calculate the region when ever new layers
      are added.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we clear surface when display rect has changed.
Kalyan Kondapally [Tue, 2 Jan 2018 11:28:09 +0000 (03:28 -0800)]
Ensure we clear surface when display rect has changed.

Jira: None.
Test: Cursor doesn't render garbage when being gpu composited.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we swap surface as needed.
Kalyan Kondapally [Tue, 2 Jan 2018 09:22:11 +0000 (01:22 -0800)]
Ensure we swap surface as needed.

We should do this when we add new layers.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix Logical Display.
Kalyan Kondapally [Tue, 2 Jan 2018 08:07:30 +0000 (00:07 -0800)]
Fix Logical Display.

We assume cursor layer is always the top layer. Let's make sure
this is valid in case of logicaldisplaymanager.

Jira: None.
Test: No crashes when using logical displays.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid redundant test commit.
Kalyan Kondapally [Mon, 1 Jan 2018 00:01:56 +0000 (16:01 -0800)]
Avoid redundant test commit.

We now track if validatelayers did a test commit with current
combination of layers. In this case we can avoid the same in
ReValidatePlanes.

Jira: None.
Test: No commit failures seen on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix commit failure when rotating the screen.
Kalyan Kondapally [Sun, 31 Dec 2017 13:31:09 +0000 (05:31 -0800)]
Fix commit failure when rotating the screen.

Let's ensure we do a test commit when layers are added, even
if they are for last plane. DisplayQueue assumed PlaneManager
handled this even though it didn't. Let's track this
information and pass to DisplayQueue.

Jira: None.
Test: No commit failures while rotating the screen to 90 degress.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMinor cleanup.
Kalyan Kondapally [Sun, 31 Dec 2017 12:02:59 +0000 (04:02 -0800)]
Minor cleanup.

Only call SetLayerComposition from RenderState. This is when
we know that the layer is actually going through GPU composition.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support to track when surfaces need to be refreshed.
Kalyan Kondapally [Sun, 31 Dec 2017 08:28:22 +0000 (00:28 -0800)]
Add support to track when surfaces need to be refreshed.

We can avoid redundant validation of NativeSurface in case
nothing has actually changed. Let's keep a track of this
without DisplayPlaneState.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove UsePlaneScalar from OverlayLayer.
Kalyan Kondapally [Sun, 31 Dec 2017 08:05:34 +0000 (00:05 -0800)]
Remove UsePlaneScalar from OverlayLayer.

Same can be queried from DisplayPlaneState.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCombine all incremental plane checks to one.
Kalyan Kondapally [Sun, 31 Dec 2017 01:20:27 +0000 (17:20 -0800)]
Combine all incremental plane checks to one.

We currently do checks whenever a layer needs to be revalidated
and also whenever a particular plane needs revalidation. Let's
combine all these checks into one instead of splitting them up.

Jira: None.
Test: Layer scaling works as now and dont see any commit failures.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoLet's ensure we test layers as rects change.
Kalyan Kondapally [Sat, 30 Dec 2017 23:19:58 +0000 (15:19 -0800)]
Let's ensure we test layers as rects change.

As we start to enable scaling, let's make sure we do a test
commit every time display frame or source rect change
compared to previous frame.

Jira: None.
Test: Video works as now.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTrack source correctly in displayplanestate.
Kalyan Kondapally [Sat, 30 Dec 2017 22:58:12 +0000 (14:58 -0800)]
Track source correctly in displayplanestate.

We currently use scalars only for media but in future this
could be used for any layer. Let's make sure we track this
correctly and internally decide if source_rect should remain
the union of rects of all layers or equal to display frame.
This decision depends if display scalar flag is enabled
or disabled in displayplanestate.

Jira: None.
Test: Video still uses scaling as now.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we do a test commit in case cursor checks fail.
Kalyan Kondapally [Fri, 29 Dec 2017 19:31:42 +0000 (11:31 -0800)]
Ensure we do a test commit in case cursor checks fail.

Jira: None.
Test: No Atomic commit failures seen when rotating screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant inputs to validate layers.
Kalyan Kondapally [Fri, 29 Dec 2017 14:47:38 +0000 (06:47 -0800)]
Remove redundant inputs to validate layers.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCache cursor test results.
Kalyan Kondapally [Fri, 29 Dec 2017 14:33:01 +0000 (06:33 -0800)]
Cache cursor test results.

Adds basic caching to save last test results for cursor layer
with a given plane. This should avoid redundant test checks
for cursor when other layers have been added or removed.

Jira: None.
Test: No test commit is requested if same transform and plane is
      used for cursor.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid surfacedamage/rects calculations in case layers are removed.
Kalyan Kondapally [Fri, 29 Dec 2017 03:58:07 +0000 (19:58 -0800)]
Avoid surfacedamage/rects calculations in case layers are removed.

This is redundant as we will be clearing surface and also all
display rects would have been re-calculated when layers are
reset.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd RestoreDefaultVideoColor implementation
Xiaosong Wei [Mon, 25 Dec 2017 04:44:51 +0000 (12:44 +0800)]
Add RestoreDefaultVideoColor implementation

Restore the default values for VPP and then remove the effect applied
before.

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

Change-Id: Ied474e6e37124b35a80e96c5f2b9c403bb38c3a7
Tracked-On:
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAvoid extra test commit checks.
Kalyan Kondapally [Thu, 28 Dec 2017 00:56:59 +0000 (16:56 -0800)]
Avoid extra test commit checks.

We don't need to do this if we have already done while
validating the layers. Let's keep track of it and do
final validation if still needed.

Jira: None.
Test: No commit fails on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid full validation when adding new layers.
Kalyan Kondapally [Tue, 26 Dec 2017 09:49:04 +0000 (01:49 -0800)]
Avoid full validation when adding new layers.

We can avoid re-validating whole commit when a layer is added
like we do for cursor. This is useful as complexity increases
with various combinations i.e. down/upscaling.

Also added tracing support to track down any duplicate layers
being added to a plane or in case we miss to add any layer.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid full validation when layers are removed.
Kalyan Kondapally [Mon, 25 Dec 2017 16:08:42 +0000 (08:08 -0800)]
Avoid full validation when layers are removed.

We now reset layers for the plane and check if this commit
passes before doing a full validation. One case which is
yet to be handled is when we have free planes and determining
if we can distrbiute layers to these planes.

Jira: None.
Test: No crashes when navigating between different views on
      Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevert "Clip Viewport to DisplayFrame bounds when not using Scalar."
Kalyan Kondapally [Sun, 24 Dec 2017 17:08:42 +0000 (09:08 -0800)]
Revert "Clip Viewport to DisplayFrame bounds when not using Scalar."

Fixes bugs related to popups being displayed in wrong position.

This reverts commit 644a9828859793da2b39689caa004985cfc5d47e.

6 years agoRevert "Always use source crop to set viewport."
Kalyan Kondapally [Sun, 24 Dec 2017 17:07:56 +0000 (09:07 -0800)]
Revert "Always use source crop to set viewport."

This reverts commit e937df968d2077a98a8d0842e53021aa5df224a4.

6 years agoRemove redundant checks in overlaylayer.
Kalyan Kondapally [Sat, 23 Dec 2017 10:36:46 +0000 (02:36 -0800)]
Remove redundant checks in overlaylayer.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't track Primary plane separately.
Kalyan Kondapally [Sat, 23 Dec 2017 08:13:46 +0000 (00:13 -0800)]
Don't track Primary plane separately.

This should simplify logic when validating layers. Also,
these changes fix case where we added cursor layer to an
overlay and also to the cursor plane separately.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCache DisplayPlaneState.
Kalyan Kondapally [Sat, 23 Dec 2017 03:36:12 +0000 (19:36 -0800)]
Cache DisplayPlaneState.

This patch adds support to cache relevant private data, instead
of having to manually track it for every frame. This simplifies
lot of things like keeping track of any new surfaces when commit
has failed for that frame, display rect changes etc. Also, this
avoids redundant copies of plane state every frame.

Jira: None.
Test: No flicker seen while moving between different views.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRework DisplayPlaneState API.
Kalyan Kondapally [Sat, 23 Dec 2017 02:22:36 +0000 (18:22 -0800)]
Rework DisplayPlaneState API.

This is to make sure they align with rest of the classes in
code base.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>