OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
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>
6 years agoAdd package config file
Harish Krupo [Tue, 5 Dec 2017 12:45:08 +0000 (18:15 +0530)]
Add package config file

Add package config file to export the necessary flags.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoMakefile: Remove unneeded LDADDs
Harish Krupo [Sun, 26 Nov 2017 00:11:43 +0000 (05:41 +0530)]
Makefile: Remove unneeded LDADDs

The LDADD for libhwcomposer_{common,wsi} is not needed as it is
already linked into libhwcomposer.so in the linker flags as whole
archives. Adding this causes "multiple definition" errors during
linking.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoifdef guard for GBM_BO_USE_CAMERA_{WRITE,READ}
Harish Krupo [Mon, 20 Nov 2017 13:26:02 +0000 (18:56 +0530)]
ifdef guard for GBM_BO_USE_CAMERA_{WRITE,READ}

This fixes compilation error when compiled using --enable-gbm
as gbm doesn't have these definitions.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agotravis: Add compilation check against libgbm (mesa)
Harish Krupo [Thu, 30 Nov 2017 17:10:23 +0000 (22:40 +0530)]
travis: Add compilation check against libgbm (mesa)

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix build with Debug logs.
Kalyan Kondapally [Fri, 22 Dec 2017 08:31:27 +0000 (00:31 -0800)]
Fix build with Debug logs.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoForce full re-validation in case last commit failed.
Kalyan Kondapally [Fri, 22 Dec 2017 08:16:53 +0000 (00:16 -0800)]
Force full re-validation in case last commit failed.

In this case their are too many combinations to take care of.
Instead, let's just force a full validation.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd surface age to NativeSurface.
Kalyan Kondapally [Fri, 22 Dec 2017 08:41:00 +0000 (00:41 -0800)]
Add surface age to NativeSurface.

We need to track how many frames before a surface can be
re-cycled. Otherwise, we will end up updating the surface
while it's still on-screen. Once the age is zero it can be
re-cycled for other planes. If age is 2 or 1 it means we need
to wait that many frames before the surface is free to be
re-used for another plane.

Jira: None.
Test: No flicker seen when navigating between views.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont try to use cursor plane always for non cursor layers.
Kalyan Kondapally [Fri, 22 Dec 2017 03:03:27 +0000 (19:03 -0800)]
Dont try to use cursor plane always for non cursor layers.

We should use this only when cursor is reported as an universal
plane.

Jira: None.
Test: Check the cursor plane is not used for other layers during
      test commit.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse consumer_usage instead of usage from gralloc side.
Kalyan Kondapally [Fri, 22 Dec 2017 02:27:22 +0000 (18:27 -0800)]
Use consumer_usage instead of usage from gralloc side.

Minigbm structure has changed and we should be using this.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd DRM_FORMAT_ARGB8888 checks in drmplane.
Kalyan Kondapally [Fri, 22 Dec 2017 01:35:52 +0000 (17:35 -0800)]
Add DRM_FORMAT_ARGB8888 checks in drmplane.

We support this for Cursor Plane. Also, add verbose
to print when we are using pixel_format = 0 and layer
is Video.

Jira: None.
Test: Check that we are allocating buffers of this format for
      Cursor Plane and not using 0.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we track layer usage correctly.
Kalyan Kondapally [Fri, 22 Dec 2017 00:25:25 +0000 (16:25 -0800)]
Ensure we track layer usage correctly.

As we now can interchange between different usage and buffer's
cached, let's make sure we track this state correctly.

Jira: None.
Test: Video plays correctly in multi mode.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPop Out of scope Cached Buffers as part of PreparePurgedResources.
Kalyan Kondapally [Thu, 21 Dec 2017 20:59:00 +0000 (12:59 -0800)]
Pop Out of scope Cached Buffers as part of PreparePurgedResources.

This would have all buffer destruction in one place and also
make sure we have last 4 frame buffer cache while current is
being populated.

Jira: None.
Test: Build passes on Android. Also, gemhandle failures are
      minimized.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we clear surfaces when last commit fails.
Kalyan Kondapally [Thu, 21 Dec 2017 10:55:33 +0000 (02:55 -0800)]
Ensure we clear surfaces when last commit fails.

This should make sure we don't see garbage in these cases.

Jira: None.
Test: Surfaces are cleared when commit fails on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd more tests in hwcservice_test
Xiaosong Wei [Thu, 21 Dec 2017 09:16:41 +0000 (17:16 +0800)]
Add more tests in hwcservice_test

Add more tests for setting/restoring video colors

Jira: None
Test: tests work as expected

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoNo need to delete fb if we already have one.
Lin Johnson [Wed, 20 Dec 2017 09:11:56 +0000 (17:11 +0800)]
No need to delete fb if we already have one.

Jira: None
Tests: Build passes on Android.

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoRemove unused cursor related code.
Kalyan Kondapally [Thu, 21 Dec 2017 10:01:59 +0000 (02:01 -0800)]
Remove unused cursor related code.

We added code to create cursor buffers but are not really
using it. Remove this code, same time add error logs in case
we end up creating rgb buffers to store YUV data.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant code.
Kalyan Kondapally [Thu, 21 Dec 2017 09:06:00 +0000 (01:06 -0800)]
Remove redundant code.

We now check for preffered format from plane before
creating the buffer. We can remove these checks.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix error log.
Kalyan Kondapally [Thu, 21 Dec 2017 07:12:22 +0000 (23:12 -0800)]
Fix error log.

We where reporting about resources even though the draw
failed.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd sharp adjustment on VA module.
Wang,Fei [Thu, 21 Dec 2017 05:46:30 +0000 (13:46 +0800)]
Add sharp adjustment on VA module.

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

Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoMinimize locking while purging resources.
Kalyan Kondapally [Thu, 21 Dec 2017 00:43:18 +0000 (16:43 -0800)]
Minimize locking while purging resources.

We destroy all resources in thread handling present call
but postpone the destruction of gl, media and Native
resources to be done in compositor thread. To handle
synchronization we lock every purge call. Instead, of
this what we do now is store the request for destorying
these resources in same thread, at end of present call
we copy these requests which are then read from
compositor thread. This way we just need to have the locks
only during this copy.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPrint more data when GEM handle fails to close.
Kalyan Kondapally [Thu, 21 Dec 2017 00:13:30 +0000 (16:13 -0800)]
Print more data when GEM handle fails to close.

This is useful to help understand which buffers have issues.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoNo need to reset composition results in case of idle frame.
Kalyan Kondapally [Thu, 21 Dec 2017 00:01:48 +0000 (16:01 -0800)]
No need to reset composition results in case of idle frame.

If we are here than the composition should be exactly same as
previous frame.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we mark on-screen & in-flight surface as in use always.
Kalyan Kondapally [Wed, 20 Dec 2017 23:58:30 +0000 (15:58 -0800)]
Ensure we mark on-screen & in-flight surface as in use always.

We recycle surfaces when validating new commits. We set only
the current onscreen surface as in use. However, we might have
a surface in flight to be shown during current vblank. Ensure
we mark both these surfaces in use. This was highlighted now
as we seem to fail test commits/fb creations with AB24 format
for some reason in certain cases.

Jira: None.
Test: No garbage seen when moving between different views on
      Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTrigger a full validation in case fb creation fails.
Kalyan Kondapally [Wed, 20 Dec 2017 14:50:59 +0000 (06:50 -0800)]
Trigger a full validation in case fb creation fails.

In this case we should fallback to gpu composition and be able
to create a fb which we support. We cannot determine this without
full validation of layers. Let's force that in this case.

Jira: None.
Test: No atomic commit failues seen on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove gem_handle_ as part of handle.
Kalyan Kondapally [Wed, 20 Dec 2017 12:23:40 +0000 (04:23 -0800)]
Remove gem_handle_ as part of handle.

This is already part of meta data.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMake Initialize private in drmbuffer.
Kalyan Kondapally [Wed, 20 Dec 2017 12:15:47 +0000 (04:15 -0800)]
Make Initialize private in drmbuffer.

This is not expected to be used by anyone else.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoNo need to clear surface when rect is updated.
Kalyan Kondapally [Wed, 20 Dec 2017 10:14:33 +0000 (02:14 -0800)]
No need to clear surface when rect is updated.

As we now keep proper track of damage, display, src
rects we can avoid this completely.

Jira: None.
Test: No regressions on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPartial revert of SufaceDamage.
Kalyan Kondapally [Wed, 20 Dec 2017 09:13:46 +0000 (01:13 -0800)]
Partial revert of SufaceDamage.

Sliders, Progress bar where not getting updated correctly.
For some reason, the damage area is always constant in these
cases. For now, we only consider when surface damage is zero,
otherwise fall back to display frame rect always.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAlways use source crop to set viewport.
Kalyan Kondapally [Wed, 20 Dec 2017 01:56:34 +0000 (17:56 -0800)]
Always use source crop to set viewport.

Jira: None.
Test: Popups are positioned correctly.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove vasurface.
Kalyan Kondapally [Wed, 20 Dec 2017 01:41:34 +0000 (17:41 -0800)]
Remove vasurface.

This is just a dummy class doing nothing. Instead just use
NativeSurface.

Jira: None.
Test: Build compiles on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUnify resource tracking for Media and 3D buffers.
Kalyan Kondapally [Wed, 20 Dec 2017 00:39:51 +0000 (16:39 -0800)]
Unify resource tracking for Media and 3D buffers.

We want to make sure we re-use caching, resource management
for all backends. We didn't take this into use for va backend.
This patchs adds the needed support for this.

Jira: None.
Test: Video continues to work as now.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we release all surfaces.
Kalyan Kondapally [Tue, 19 Dec 2017 09:54:29 +0000 (01:54 -0800)]
Ensure we release all surfaces.

When doing full validation, we don't mark current on-screen
surface as not in use. This is not tracked after the validation
and state is never set again for this surface to be re-cycled.
Let's make sure we track these surfaces and recycle them.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoNo need to handle VideoEffect state in PlaneManager.
Kalyan Kondapally [Tue, 19 Dec 2017 08:03:56 +0000 (00:03 -0800)]
No need to handle VideoEffect state in PlaneManager.

Now, we have an helper function in Queue which can handle
this, let's use it.

Jira: None.
Test: Video plays as now on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove Composition state in displayplanestate.
Kalyan Kondapally [Tue, 19 Dec 2017 03:20:23 +0000 (19:20 -0800)]
Remove Composition state in displayplanestate.

We are now having too many combinations and will get bit more
complicated when we start adding under/over scaling support
completely. Let's hide all this different combination complexity
in DisplayPlaneState and add API to query if offscreen composition
is needed for displayplane.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd a common function to reset queue state.
Kalyan Kondapally [Mon, 18 Dec 2017 23:41:07 +0000 (15:41 -0800)]
Add a common function to reset queue state.

We have bunch of state which needs to be re-initialized everytime
queue is re started. We where now doing this in Exit and Initialize
call. Instead let's have a helper function do this.

Jira: None.
Test: No new regressions in Linux tests and Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure video effect status change doesn't trigger full validation.
Kalyan Kondapally [Sun, 17 Dec 2017 21:50:20 +0000 (13:50 -0800)]
Ensure video effect status change doesn't trigger full validation.

In this case we only need to make sure all Video layers are
gpu rendered. We can avoid a full validation if we are not
already doing it for any other reason.

Jira: None.
Test: Video works as now.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUpdateCaps & Param only when they have really changed.
Kalyan Kondapally [Mon, 18 Dec 2017 11:58:00 +0000 (03:58 -0800)]
UpdateCaps & Param only when they have really changed.

Jira: None.
Test: No new regressions when playing Video.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRecycle vasurface.
Kalyan Kondapally [Fri, 15 Dec 2017 23:23:12 +0000 (15:23 -0800)]
Recycle vasurface.

This will be similar to what we do with 3D Backend. One vasurface
which backs up the native surface.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoClip Viewport to DisplayFrame bounds when not using Scalar.
Kalyan Kondapally [Mon, 18 Dec 2017 05:35:50 +0000 (21:35 -0800)]
Clip Viewport to DisplayFrame bounds when not using Scalar.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we flip surfaces when source rect has changed.
Kalyan Kondapally [Mon, 18 Dec 2017 03:02:50 +0000 (19:02 -0800)]
Ensure we flip surfaces when source rect has changed.

Jira: None.
Test: No flicker seen with layers using scalars.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoNo need to pass clear_surface to draw call.
Kalyan Kondapally [Mon, 18 Dec 2017 01:44:30 +0000 (17:44 -0800)]
No need to pass clear_surface to draw call.

We already have NativeSurface pointer here which should
have all the information we need.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we reset video buffer in case of layers > 1.
Kalyan Kondapally [Sun, 17 Dec 2017 21:34:21 +0000 (13:34 -0800)]
Ensure we reset video buffer in case of layers > 1.

We always try to find a separate plane for Video. However, we
can be constrained by no of planes and in this case blend
layers for the last available plane. In this case we should
ensure we are resetting buffer to something which our
3DCompositor can write into.

Jira: None.
Test: No regressions found with cursor layer when using Logical
      Display.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix plane scaling issues with 3D backend.
Kalyan Kondapally [Sun, 17 Dec 2017 11:02:35 +0000 (03:02 -0800)]
Fix plane scaling issues with 3D backend.

We didn't track source rect properly in case the plane was
not using scalar. This caused rendering artifacts.

Jira: None.
Test: Don't see content scaled incorrectly in home screen.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSimplify cursor layer tracking in DisplayQueue.
Kalyan Kondapally [Sun, 17 Dec 2017 09:32:36 +0000 (01:32 -0800)]
Simplify cursor layer tracking in DisplayQueue.

Jira: None.
Test: We dont re-validate layers when cursor layer is added
      or removed on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove HasLayerAttributesChanged in Overlaylayer.
Kalyan Kondapally [Sun, 17 Dec 2017 06:21:14 +0000 (22:21 -0800)]
Remove HasLayerAttributesChanged in Overlaylayer.

This is not used anymore.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRevalidate layers when rects change and using scalar.
Kalyan Kondapally [Sun, 17 Dec 2017 06:13:49 +0000 (22:13 -0800)]
Revalidate layers when rects change and using scalar.

When using plane scalar, we need to ensure when either
display frame or source rect change the commit can still pass.
Instead of doing full validation, we first do a test commit to
check if the combination is still valid. If the test commit
fails than we fall back to full validation of layers.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTake DisplayScalar usage into account in Renderstate.
Kalyan Kondapally [Sun, 17 Dec 2017 04:26:28 +0000 (20:26 -0800)]
Take DisplayScalar usage into account in Renderstate.

In this case we should use source rect for display frame
too.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoKeep track of src rect.
Kalyan Kondapally [Sun, 17 Dec 2017 02:10:27 +0000 (18:10 -0800)]
Keep track of src rect.

We need this information to determine when we need to
do a test commit in case we are using plane scalars for
scaling content of a layer.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support to copy common displayplanestates between frames.
Kalyan Kondapally [Sun, 17 Dec 2017 00:54:47 +0000 (16:54 -0800)]
Add support to copy common displayplanestates between frames.

We now need to copy source rect, display frame, cursor state,
plane scalar state. Let's have a handy function which can do all
this rather than manually setting them in Display Queue.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support for using PlaneScalar for Video.
Kalyan Kondapally [Sat, 16 Dec 2017 23:57:56 +0000 (15:57 -0800)]
Add support for using PlaneScalar for Video.

We can fall back to use our compositor for video layer
for various reasons i.e. Not supported format, video effects
etc. In this case if display frame and source crop are not
same, we scale it today using our Compositor. This patch
adds support to use Plane Scalars as much as possible(when upscaling)
and fall back to current solution in case Display cannot
support it or we need to downscale.

Jira: None.
Test: Check that Video layer is scaled when playing full screen
      and source rect is smaller than display resolution.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix float value read/write in IControls
Xiaosong Wei [Wed, 20 Dec 2017 07:40:28 +0000 (15:40 +0800)]
Fix float value read/write in IControls

Fix the float value read/write in Parcel for IControls

Jira: None
Test: SetColorParam works as expected.

Change-Id: I94625eccc2d001b0ff5d4fe237df7f4f46e8f273
Tracked-On:
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoDon't create VA context for each drawing
Xiaosong Wei [Fri, 15 Dec 2017 07:37:19 +0000 (15:37 +0800)]
Don't create VA context for each drawing

vaCreateContext takes long time to initialize video driver
so we don't create the context in each drawing.

Jira: OAM-54014
Test: Build passes on both Android & Linux and video playback works

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoNo need to copy rects.
Kalyan Kondapally [Sat, 16 Dec 2017 04:02:33 +0000 (20:02 -0800)]
No need to copy rects.

We are not changing the rect in any way here.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix error code in RegisterCallback.
Kalyan Kondapally [Sat, 16 Dec 2017 03:32:15 +0000 (19:32 -0800)]
Fix error code in RegisterCallback.

If it's not a valid callback registration, we should
return HWC2::Error::BadParameter.

Jira: None.
Test: Related tests in frameworks/native/services/surfaceflinger/tests/hwc2 should pass.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd color balance(Hue, Saturation, Brightness, Contrast) adjustment on VA module.
Wang,Fei [Tue, 12 Dec 2017 02:13:21 +0000 (10:13 +0800)]
Add color balance(Hue, Saturation, Brightness, Contrast) adjustment on VA module.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Wang,Fei <fei.w.wang@intel.com>
6 years agoFix for external display hot plug/unplug
Pallavi G [Fri, 15 Dec 2017 06:19:17 +0000 (11:49 +0530)]
Fix for external display hot plug/unplug

with current code the nested display is also having the display id of 0
and we are wrongly notifying the plug/unplug of the external display to
the primary display.

Looke like the nested display support is not completed,
So just moved the nested display hotplug notification under the
NESTED_DISPLAY_SUPPORT flag which is not defined

Jira: None
Test: External display Hot plug and unplug works fine
Signed-off-by: Pallavi G <pallavi.g@intel.com>
6 years agoEnsure we release all virtual display resources.
Kalyan Kondapally [Mon, 11 Dec 2017 04:06:28 +0000 (20:06 -0800)]
Ensure we release all virtual display resources.

We didn't purge resources when destroying the display.

Jira: None.
Test: No new regressions for Virtual Display on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable SurfaceDamage.
Kalyan Kondapally [Mon, 11 Dec 2017 02:09:00 +0000 (18:09 -0800)]
Enable SurfaceDamage.

With most of the display frame, scissor rect bugs fixed, let's
enable this support.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix Linux build.
Kalyan Kondapally [Sun, 10 Dec 2017 12:26:56 +0000 (04:26 -0800)]
Fix Linux build.

Jira: None.
Test: Build passes on Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAllow to create FB with preferred format.
Kalyan Kondapally [Sun, 10 Dec 2017 12:02:00 +0000 (04:02 -0800)]
Allow to create FB with preferred format.

On primary plane, we sometimes fallback to use XRGB format if
ARGB is not supported. As we cache buffers now, we check if fb is
present and if so ignore the request. In this case we should
delete existing fb and create a new one.

Jira: None.
Test: All hwc-val tests pass on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCall ReleaseGraphicsBuffer only for imported handles.
Kalyan Kondapally [Sun, 10 Dec 2017 10:18:01 +0000 (02:18 -0800)]
Call ReleaseGraphicsBuffer only for imported handles.

This is the only time when we have valid GEM handles.

Jira: None.
Test: Ensure app open/close doesn't show memory leak on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant code.
Kalyan Kondapally [Sun, 10 Dec 2017 10:11:25 +0000 (02:11 -0800)]
Remove redundant code.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse Gralloc 1.0 API directly.
Kalyan Kondapally [Sun, 10 Dec 2017 09:26:25 +0000 (01:26 -0800)]
Use Gralloc 1.0 API directly.

Instead of using GrallocMapper API, let's use Gralloc
API directly. This is needed to set modifiers in future.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse ResourceManager to release Virtual display resources.
Kalyan Kondapally [Sun, 10 Dec 2017 08:08:08 +0000 (00:08 -0800)]
Use ResourceManager to release Virtual display resources.

Similar to other resources, let's use ResourceManager to
handle this.

Jira: None.
Test: Virtual Display still works on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't try to check for GPU resources if we dont have one.
Kalyan Kondapally [Sun, 10 Dec 2017 03:28:09 +0000 (19:28 -0800)]
Don't try to check for GPU resources if we dont have one.

We now check if we have valid GPU resources to release
before trying to delete them in CompositorThread. This avoids
the need to initialize gl context if not needed.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix build when RESOURCE_CACHE_TRACING is enabled.
Kalyan Kondapally [Sun, 10 Dec 2017 03:02:34 +0000 (19:02 -0800)]
Fix build when RESOURCE_CACHE_TRACING is enabled.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove drmfb deletion to Compositor thread.
Kalyan Kondapally [Sun, 10 Dec 2017 02:47:50 +0000 (18:47 -0800)]
Move drmfb deletion to Compositor thread.

This is part of moving all resource de-allocation to
Compositor thread.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont mark resources owned by HWC for deletion twice.
Kalyan Kondapally [Sun, 10 Dec 2017 01:57:48 +0000 (17:57 -0800)]
Dont mark resources owned by HWC for deletion twice.

We where doing this in GLSurface and drmbuffer.

Jira: None.
Test: Check we dont mark same texture for deletion twice.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRename HwcLayerBufferManager as ResourceManager.
Kalyan Kondapally [Sun, 10 Dec 2017 00:41:39 +0000 (16:41 -0800)]
Rename HwcLayerBufferManager as ResourceManager.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoGet NativeHandler from BufferManager.
Kalyan Kondapally [Sun, 10 Dec 2017 03:12:07 +0000 (19:12 -0800)]
Get NativeHandler from BufferManager.

Instead of passing two to every place, lets query this from
BufferManager.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd external layer buffer cache management.
Lin Johnson [Tue, 28 Nov 2017 08:38:20 +0000 (16:38 +0800)]
Add external layer buffer cache management.

This is to avoid import and generate eglImage and
texture for every frame.

Jira: None
Tests: UI, Video, Camera work as before.
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoresolve HWC2_VSYNC_DISABLE correctly
Mingwei Wang [Wed, 27 Sep 2017 07:15:41 +0000 (15:15 +0800)]
resolve HWC2_VSYNC_DISABLE correctly

Jira: None.
Test: adb shell stop/start no regression.

Change-Id: Ife0eae217b648d859637c38e419361df24ed8fcc
Signed-off-by: Mingwei Wang <mingwei.wang@intel.com>
6 years agoFix the scissor area calculation.
Lin Johnson [Fri, 8 Dec 2017 08:36:56 +0000 (16:36 +0800)]
Fix the scissor area calculation.

We should use as small area as possible.

Jira: None
Test: No new rendering artifacts on Android.
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoAdd hooks to pass video color control to varenderer
Xiaosong Wei [Wed, 15 Nov 2017 08:56:08 +0000 (16:56 +0800)]
Add hooks to pass video color control to varenderer

Add hooks for passing video color control information to VARenderer.
Video effect functions will be implemented based on these hooks.

Jira: GSE-488
Test: Build passes on Android
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd P010 pixel format support in VARenderer
Xiaosong Wei [Mon, 4 Dec 2017 07:43:46 +0000 (15:43 +0800)]
Add P010 pixel format support in VARenderer

p010 pixel format support in VARenderer is needed to support
playing back 10bits video

Jira: None
Test: Build passed on both Android & Linux and works as expected
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix Linux build
Kevin Strasser [Thu, 30 Nov 2017 18:12:48 +0000 (10:12 -0800)]
Fix Linux build

Seeing the following linker error on Linux since commit 674b37e8e6:
../.libs/libhwcomposer.so: undefined reference to `hwcomposer::NestedDisplay::NestedDisplay()'

Just need to add the new file to the Makefile

Jira: None
Test: Build passes on Linux

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoAdd settings file for virtualized environment
Randy Xu [Wed, 22 Nov 2017 05:00:34 +0000 (13:00 +0800)]
Add settings file for virtualized environment

Export default setting in virtualized environment for Android

Jira: None
Test: Boot with default settings in virtualized env
Signed-off-by: Randy Xu <randy.xu@intel.com>
6 years agoAdd nested display support in hwc
Mingwei Wang [Tue, 21 Nov 2017 03:17:30 +0000 (11:17 +0800)]
Add nested display support in hwc

This display can be client to a real physical
display.

Jira: None.
Test: Build passes on Android. Tests still work as now.
Signed-off-by: Mingwei Wang <mingwei.wang@intel.com>
6 years agohwc.lock moved to vendor partition
Yang, Dong [Wed, 22 Nov 2017 06:58:56 +0000 (14:58 +0800)]
hwc.lock moved to vendor partition

the hwc.lock moved from rootfs to vendor partition

Jira: None.
Test: Boots to homescreen on Android.
Signed-off-by: Yang, Dong <dong.yang@intel.com>
6 years agoExtend the search scope of c header files
Chen Yu Y [Tue, 21 Nov 2017 08:57:39 +0000 (16:57 +0800)]
Extend the search scope of c header files

When VNDK enabled, system strict the header file search
scope, this patch extend the c includes search scope

Change-Id: I2b950484dabc5487fc5756fac599ec365263cb22
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-53160
Signed-off-by: Chen Yu Y <yu.y.chen@intel.com>
6 years agoFix display frame rect and source crop issue in Mosaic Display.
Fan, Yugang [Tue, 28 Nov 2017 07:03:44 +0000 (15:03 +0800)]
Fix display frame rect and source crop issue in Mosaic Display.

Also update the frame rect and source crop besides the first
display of Mosaic mode.

Jira: None.
Test: Play video with the different resolution or run testlayers with
      different source size and frame rect in mosiac mode, without reg
      issues, and video show normally(parts of different screen) in
      mosaic mode.

Signed-off-by: Yugang, Fan <yugang.fan@intel.com>
6 years agoRemove UpdateDisplayFrame in NativeSurface.
Kalyan Kondapally [Sun, 26 Nov 2017 06:24:21 +0000 (22:24 -0800)]
Remove UpdateDisplayFrame in NativeSurface.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove surface damage calculations to a separate function.
Kalyan Kondapally [Sun, 26 Nov 2017 06:16:11 +0000 (22:16 -0800)]
Move surface damage calculations to a separate function.

This way we can use common logic with Mosaic.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix display frame rect calculations for Mosaic.
Kalyan Kondapally [Sat, 25 Nov 2017 11:21:42 +0000 (03:21 -0800)]
Fix display frame rect calculations for Mosaic.

We calculated right co-ordinates incorrectly. We should
be translating it w.r.t left_constraint.

Jira: None.
Test: Mosaic shows content correctly in second display.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAvoid invalidating cache if all attributes are same for new layer.
Kalyan Kondapally [Sat, 25 Nov 2017 11:02:37 +0000 (03:02 -0800)]
Avoid invalidating cache if all attributes are same for new layer.

Currently, we invalidate all cache if a layer is re-created with
same attributes. Now, we make sure we invalidate the cache only
if attributes have really changed.

Jira: None.
Tests: All linux tests pass, hwc-val tests pass as now and no
       new regressions seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd a helper to handle cursor layer.
Kalyan Kondapally [Sun, 26 Nov 2017 06:36:19 +0000 (22:36 -0800)]
Add a helper to handle cursor layer.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant checks.
Kalyan Kondapally [Sat, 25 Nov 2017 11:17:20 +0000 (03:17 -0800)]
Remove redundant checks.

Jira: None.
Test: No graphics flickers seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd utility function to check if two rects overlap or not.
Kalyan Kondapally [Sun, 26 Nov 2017 03:34:32 +0000 (19:34 -0800)]
Add utility function to check if two rects overlap or not.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd utility function to reset rect based on Region.
Kalyan Kondapally [Sun, 26 Nov 2017 02:53:36 +0000 (18:53 -0800)]
Add utility function to reset rect based on Region.

This will be used in test suite in follwup patches.

Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix linux builds.
Kalyan Kondapally [Sat, 25 Nov 2017 11:46:27 +0000 (03:46 -0800)]
Fix linux builds.

Jira: None.
Test: Build passes on Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>