OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
6 years agoRevert "Fix Primary display order issues on Android."
Kishore Kadiyala [Wed, 22 Nov 2017 08:26:31 +0000 (13:56 +0530)]
Revert "Fix Primary display order issues on Android."

This reverts commit 4ff7d579227cdfa3c53bb779a03850021359d253.

This patch creates regression of making one display blank when booted
with target connected to than one display

Jira: None
Test: Cold/Warm reboot with displays connected should not result in
        blank screen in any display

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoReplace GRALLOC_USAGE_* flags with GRALLOC1 equivalents.
Kalyan Kondapally [Tue, 21 Nov 2017 22:43:16 +0000 (14:43 -0800)]
Replace GRALLOC_USAGE_* flags with GRALLOC1 equivalents.

Jira: None.
Test: No new regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable hwcservice
Kishore Kadiyala [Tue, 21 Nov 2017 16:02:34 +0000 (21:32 +0530)]
Enable hwcservice

Jira: None
Test: hwcmode  [displayId <print/get/set <displayconfigindex>>] works.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoFix "format" compile warnings on Android
renchenglei [Tue, 21 Nov 2017 11:01:19 +0000 (19:01 +0800)]
Fix "format" compile warnings on Android

Jira: None.
Test: Build passes on Android and no warnings reported.

6 years agoIgnore updates for a pipe which has no planes.
Kalyan Kondapally [Tue, 21 Nov 2017 08:03:26 +0000 (00:03 -0800)]
Ignore updates for a pipe which has no planes.

On some platforms we might not have any planes allocated
for us to work with. In this case ignore any updates for
this display queue.

Jira: None.
Test: We dont crash when planes are not associated for a
      given pipe.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@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 agoAdd Meta data field to our NativeHandle.
Kalyan Kondapally [Mon, 20 Nov 2017 01:30:56 +0000 (17:30 -0800)]
Add Meta data field to our NativeHandle.

This can be used to query buffer specific attributies. This
helps remove OS specific calls in our test suites.

Jira: None.
Test: Build passes on Android and Linux. Tests still work as
      today.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove support for Gralloc backends older than 1.0.
Kalyan Kondapally [Mon, 20 Nov 2017 01:08:59 +0000 (17:08 -0800)]
Remove support for Gralloc backends older than 1.0.

As I know, no one is using older Gralloc API with our
HWC. As we change things we are not testing the older
backends. Let's bring the support back if someone
really needs this.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove support for non Minigbm backends on Android.
Kalyan Kondapally [Mon, 20 Nov 2017 01:07:55 +0000 (17:07 -0800)]
Remove support for non Minigbm backends on Android.

We are not testing these backends and we have got to a stage
where it's getting hard to maintain both. Let's get them
back if the need arises.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove WA in DisplayQueue.
Kalyan Kondapally [Sat, 18 Nov 2017 20:33:27 +0000 (12:33 -0800)]
Remove WA in DisplayQueue.

We shouldn't need this now as we ensure we clear surfaces
as needed.

Jira: None.
Test: No garbage seen when content is being moved around.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we clear surfaces correctly when recycling composition results.
Kalyan Kondapally [Sat, 18 Nov 2017 19:59:27 +0000 (11:59 -0800)]
Ensure we clear surfaces correctly when recycling composition results.

As we cache results, let's make sure we clear them when anything
results in clearing one of the surface. This should ensure we
take into account any display region changes in all surfaces.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove unused format.
Kalyan Kondapally [Tue, 14 Nov 2017 08:08:09 +0000 (00:08 -0800)]
Remove unused format.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix Primary display order issues on Android.
Kalyan Kondapally [Fri, 17 Nov 2017 22:27:03 +0000 (14:27 -0800)]
Fix Primary display order issues on Android.

We respect the display order in hwc_display.ini, but we
might not have the display connected. In this case we
need to treat the first connected display as primary.

Jira: None.
Test: Any combination of display order, connection status
      works.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix incorrect region width/height calculation.
Lin Johnson [Wed, 15 Nov 2017 13:30:06 +0000 (21:30 +0800)]
Fix incorrect region width/height calculation.

Jira:https://jira01.devtools.intel.com/browse/OAM-52773
Tests: Video should be in the middle even if it does not scale
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agofix the screencap black screen issue
Yang Shi [Tue, 14 Nov 2017 02:54:06 +0000 (10:54 +0800)]
fix the screencap black screen issue

When there is no display to connect device, the original HWC module
will create only 1*1 framebuffer.
So screencap will not works properly, it only can get a black screen.
This will block many test case.

In order to fix this issue, we make the default width and height to
1080p format for most HDMI device use this format.

JIRA: https://jira01.devtools.intel.com/browse/OAM-50818
TEST: screencap can works well when don't connect any display device
Signed-off-by: Yang Shi <yang.a.shi@intel.com>
6 years agoLet's not override Ignoreupdate state in Initialzation.
Dong Yang [Mon, 13 Nov 2017 09:03:49 +0000 (01:03 -0800)]
Let's not override Ignoreupdate state in Initialzation.

DisplayQueue Initialization is called during Connect() call
and we set idle_tracker_.state_ as 0. This conflicts if
hwclock thread is still waiting for the lock to be released.
Let's make sure we respect this setting always.

Jira: None.
Test: No flicker seen during boot up on Android.
Signed-off-by: Dong Yang <dong.yang@intel.com>
6 years agoHandleWait when lock_fd is -1.
Kalyan Kondapally [Sun, 12 Nov 2017 07:00:05 +0000 (23:00 -0800)]
HandleWait when lock_fd is -1.

Instead of going in a continuous loop between HandleRoutine
and Wait, let's wait using poll till someone kills hwclock
thread.

Jira: None.
Test: Dont see 100% cpu usage consumed by hwcservice on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoExplicitly inform queue when to ignore updates.
Kalyan Kondapally [Fri, 10 Nov 2017 12:48:35 +0000 (04:48 -0800)]
Explicitly inform queue when to ignore updates.

Jira: None.
Test: HWCLock thread is destroyed correctly on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTrack Source rect instead of position.
Kalyan Kondapally [Mon, 13 Nov 2017 00:24:02 +0000 (16:24 -0800)]
Track Source rect instead of position.

In 3D composition case, change in source rect means content
has changed and we can avoid clearing the complete surface unless
display frame has changed. Also, in plane composition case we
can avoid re-validating the cached results in case the width
and height remain same i.e. Should't impact any scaling ratio
results vs display frame.

Jira: None.
Test: No new artifacts seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support to rotate displays independent of each other.
Kalyan Kondapally [Sun, 12 Nov 2017 23:32:34 +0000 (15:32 -0800)]
Add support to rotate displays independent of each other.

This adds initial plumbing needed to apply rotations for
different physical displays independent of each other. This
is again a boot time setting in hwc_display.ini which cannot
be changed during run time.

One needs to change ROTATION to true in hwc_display.ini to test
this. Layers are not scaled correctly, still some work to be done
to take plane rotations into use and scale layers correctly when
rotation if 3D composition is needed.

Jira: None.
Test: When "ROTATION" is set to true, Physical Display 1 content
      is rotated 90 and Display 0 is having a rotation of 0 on
      Linux and Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd PlaneTransform API.
Kalyan Kondapally [Sun, 12 Nov 2017 22:02:41 +0000 (14:02 -0800)]
Add PlaneTransform API.

We have use cases where the whole physical display may be
rotated and hence rotation needs to be applied on top of
any layer specific transformations. Let Overlaylayer take
this into consideration and Plane will use this when
applying rotation for a given plane. It would be ideal if
we can have a property which would take the rotation into
account after all the plane output is put together.

Jira: None.
Test: No regressions on current Android use cases.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMake Mosaic Display work for different heights.
Kalyan Kondapally [Sun, 12 Nov 2017 06:51:20 +0000 (22:51 -0800)]
Make Mosaic Display work for different heights.

We use max height of all Physical displays. If size of
physical display is smaller than the maximum height, we still
continue to use it. This is wrong and we should limit our
display frame to maximum of Display height.

Jira: None.
Test: Connect two displays of different physical heights and
      enable Mosaic mode. Now, it should display content
      correctly and not show any commit failures.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix build when ENABLE_DISPLAY_DUMP is 1.
Kalyan Kondapally [Sun, 12 Nov 2017 06:49:13 +0000 (22:49 -0800)]
Fix build when ENABLE_DISPLAY_DUMP is 1.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix MosaicDisplay when display reports a single mode.
Kalyan Kondapally [Sun, 12 Nov 2017 06:06:27 +0000 (22:06 -0800)]
Fix MosaicDisplay when display reports a single mode.

We hardcoded the config index to 1, but now we change it
to 0 as that should also have the preffered mode for a
given display. Also added few traces which would help
debug similar issues in future.

Jira: None.
Test: Mosaic Display comes up properly when connected display
      reports only single mode.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset variable outside for loop.
Kalyan Kondapally [Sun, 12 Nov 2017 04:21:15 +0000 (20:21 -0800)]
Reset variable outside for loop.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support for Clone mode.
Kalyan Kondapally [Sun, 12 Nov 2017 01:48:29 +0000 (17:48 -0800)]
Add support for Clone mode.

This was already available but only enabled on Linux. Let's
enabled this on Android when you have 3 displays connected.
By default 2 & 3 display will be cloned.This combination
can be managed by CLONE_DISPLAY in hwc_display.ini and
can be disabled by setting CLONE=false in hwc_display.ini

Jira: None.
Test: 2 and 3 display get cloned correctly on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix service name.
Kalyan Kondapally [Fri, 10 Nov 2017 13:42:54 +0000 (05:42 -0800)]
Fix service name.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDisable TTY usage on Android.
Kalyan Kondapally [Thu, 9 Nov 2017 11:09:42 +0000 (03:09 -0800)]
Disable TTY usage on Android.

Jira: None.
Test: Able to run kmscube test application on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove un-necessary include in Android.mk file.
Kalyan Kondapally [Thu, 9 Nov 2017 10:53:38 +0000 (02:53 -0800)]
Remove un-necessary include in Android.mk file.

Tests have a dependency on staic build of HWC. Since, no
other thing depends on the static build, this neither the
tests get built and we have to manually build them
going into tests folder.

Jira: None.
Test: We are able to build tests on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix tests build for Android
Xiaosong Wei [Thu, 9 Nov 2017 08:56:18 +0000 (16:56 +0800)]
Fix tests build for Android

Jira: None.
Test: We are able to build tests on Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix compilation issue for Android IA.
Kishore Kadiyala [Wed, 8 Nov 2017 13:37:44 +0000 (19:07 +0530)]
Fix compilation issue for Android IA.

Jira: None
Test: Build pass on Android IA.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoFix build error for libva.
Kishore Kadiyala [Tue, 7 Nov 2017 13:29:47 +0000 (18:59 +0530)]
Fix build error for libva.

Jira: None.
Test: Compilation should pass on Android O.

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoFIX to get correct Rectangle IDs for the output layers
Avinash Reddy Palleti [Tue, 7 Nov 2017 02:27:04 +0000 (18:27 -0800)]
FIX to get correct Rectangle IDs for the output layers

If start of one rectangle and end of another rectangle overlap, one
case was missed earlier to update rectangle IDs in the out structure.

Jira: OAM-52047.
Test: Verified output layers by giving 8 input rectangles.

Signed-off-by: Avinash Reddy Palleti <avinash.reddy.palleti@intel.com>
6 years agoFix frame width and height calculations for Mosaic mode.
Kalyan Kondapally [Mon, 6 Nov 2017 06:08:20 +0000 (22:08 -0800)]
Fix frame width and height calculations for Mosaic mode.

We need to re-calculate these taking into account the
constraints.

Jira: None.
Test: Frame buffer is split correctly across displays when
      Mosaic mode is enabled.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoTreat Cursor & Primary as another Overlay.
Kalyan Kondapally [Sat, 28 Oct 2017 08:43:21 +0000 (01:43 -0700)]
Treat Cursor & Primary as another Overlay.

Jira: None.
Test: Cursor works as now on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReserve memory for vector in case we know how much is needed.
Kalyan Kondapally [Sat, 28 Oct 2017 05:42:38 +0000 (22:42 -0700)]
Reserve memory for vector in case we know how much is needed.

Jira: None.
Test: Boots to home screen on Android IA.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix usage_ checks in drmbuffer.
Kalyan Kondapally [Sat, 28 Oct 2017 08:11:22 +0000 (01:11 -0700)]
Fix usage_ checks in drmbuffer.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd enum for rotation.
Kalyan Kondapally [Sun, 5 Nov 2017 09:30:22 +0000 (01:30 -0800)]
Add enum for rotation.

This is going to be used by test suite and for independent
display rotation in future.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoUse drmClose to close the fd.
Kalyan Kondapally [Sun, 5 Nov 2017 01:24:10 +0000 (18:24 -0700)]
Use drmClose to close the fd.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoBuild tests by default on Eng builds.
Kalyan Kondapally [Sat, 4 Nov 2017 20:44:03 +0000 (13:44 -0700)]
Build tests by default on Eng builds.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove common includes in platformdefines.h.
Kalyan Kondapally [Sat, 4 Nov 2017 20:41:57 +0000 (13:41 -0700)]
Move common includes in platformdefines.h.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix string length.
Kalyan Kondapally [Fri, 3 Nov 2017 22:11:23 +0000 (15:11 -0700)]
Fix string length.

By subtracting -1, we ended up not having the last character.

Reported and fix proposal by Michael Goffioul in IRC.

Jira: None.
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable VA support by default.
Xiaosong Wei [Fri, 3 Nov 2017 21:50:36 +0000 (14:50 -0700)]
Enable VA support by default.

We should be able to build this on our target environments now,
let's enable the support for media format conversions by default.

Jira: None.
Test: Build passes on Android and Video works as before.

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix for crash during rotation
Pallavi G [Thu, 2 Nov 2017 08:29:48 +0000 (13:59 +0530)]
Fix for crash during rotation

The cursor z_order is not the highest in one of the corner case,
so we end up with segmentation fault in cursor layer getbuffer becoz the
hwc implementation is based on the assumption that the cursor is always on the top.

Jira: None
Test: Able to rotate the screen without system reboot
Signed-off-by: Pallavi G <pallavi.g@intel.com>
6 years agoFix display frame rect with Mosaic Display.
Kalyan Kondapally [Fri, 3 Nov 2017 00:25:34 +0000 (17:25 -0700)]
Fix display frame rect with Mosaic Display.

We should map Display Frame to display co-ordinate's, otherwise
we will end up showing wrong content.

Jira: None.
Test: Content doesn't get scaled to wrong displays when using
      Mosaic mode.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Yugang, Fan <yugang.fan@intel.com>
6 years agoAdd support to handle any late initializations in Display.
Kalyan Kondapally [Tue, 31 Oct 2017 07:32:33 +0000 (00:32 -0700)]
Add support to handle any late initializations in Display.

This should allow us to handle things like destroying HWCLock
and any other things which need to wait till display is
up and running.

Jira: None.
Test: HWCLock thread is killed after first present call.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoDon't dup client target fd.
Kalyan Kondapally [Tue, 31 Oct 2017 00:35:19 +0000 (17:35 -0700)]
Don't dup client target fd.

Instead of duping the fd, let's take ownership of it as otherwise
we seem to leak the fd.

Jira: AIA-437.
Test: Device doesn't crash running out of fd's when explicit
      sync support is disabled on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we clean up fences in DrawState always.
Kalyan Kondapally [Tue, 31 Oct 2017 00:48:08 +0000 (17:48 -0700)]
Ensure we clean up fences in DrawState always.

If tasks in compositor thread are cancelled, it could
potentially leak fd's as ownership is passed to the
thread. Let's add checks so that we close all fences
if DrawState is destroyed and has valid fences.

Jira: None.
Test: Build passes on Android and boots to home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSilence error logs when error is EAGAIN.
Kalyan Kondapally [Tue, 31 Oct 2017 01:00:20 +0000 (18:00 -0700)]
Silence error logs when error is EAGAIN.

Jira: None
Test: Build passes on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoSquash Static and Android.mk to use Android.common.mk
Kalyan Kondapally [Mon, 30 Oct 2017 09:47:32 +0000 (02:47 -0700)]
Squash Static and Android.mk to use Android.common.mk

Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnable build testlayers for Android with hwc's static lib
Xiaosong Wei [Tue, 10 Oct 2017 07:28:49 +0000 (15:28 +0800)]
Enable build testlayers for Android with hwc's static lib

As Android build system doesn't recognize shared library name like
hwcomposer.xx.so, previously in order to build testlayers we have to
modify Android.mk to rename hwcomposer.xx.so to libhwcomposer.xx.so.
This patch provides an easy way to build testlayers without renaming
the library name back and forth.

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix the issue that the HWCLock thread will not exit.
Zhongmin Wu [Mon, 30 Oct 2017 07:40:23 +0000 (15:40 +0800)]
Fix the issue that the HWCLock thread will not exit.

The displaymanager thread is blocked in "read" call,
so it will never get chance to disable HWClock.

As we already use "select" to receive the "POLL IN" event of
the fd, we had better to set the "Non Blocking" flag on.

Jira: None.
Test: HWCLock thread is closed on Android after booting to
      homescreen.
Signed-off-by: Zhongmin Wu <zhongmin.wu@intel.com>
6 years agoEnsure we handle hotplug notifications even if primary is disconnected.
Kalyan Kondapally [Sat, 28 Oct 2017 05:18:23 +0000 (22:18 -0700)]
Ensure we handle hotplug notifications even if primary is disconnected.

We handle hotplug notifications of extended displays only in
case primary is connected. Let's ensure we handle these even
when primary is disconnected.

Jira: None.
Test: No hot plug related regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAndroid: Enable color correction and inversion
Gao Chun [Thu, 26 Oct 2017 15:47:21 +0000 (23:47 +0800)]
Android: Enable color correction and inversion

Add setColorTransform to HWC2. Get 4x4 color transform matrix (CTM)
from SurfaceFlinger, and convert the matrix to 3x3 DRM CSC matrix
and DRM CSC post offset.

Jira: OAM-49721,OAM-50246
Test: Go to Settings-Accessibility-Color correction, set it to On
and choose the Correction mode; Go to Settings-Accessibility-Color
inversion, set it to On.

Signed-off-by: Gao Chun <chun.gao@intel.com>
6 years agoSuppress compile warnings on Android
renchenglei [Fri, 27 Oct 2017 05:29:17 +0000 (13:29 +0800)]
Suppress compile warnings on Android

Jira: None.
Test: Build passes on Android and no warnings reported.

6 years agoEnsure to install everything to vendor partition
Mingwei Shi [Mon, 23 Oct 2017 06:03:49 +0000 (14:03 +0800)]
Ensure to install everything to vendor partition

For shared library, ensure to install everything to vendor partition.
For static library, declare the module as vendor module also.

Jira: None.
Test: Build passes on Android.
Signed-off-by: Mingwei Shi <mingwei.shi@intel.com>
6 years agojsonlayerstest: Restore vt on exit
Harish Krupo [Sun, 22 Oct 2017 02:24:09 +0000 (07:54 +0530)]
jsonlayerstest: Restore vt on exit

Exit and restore vt on SIGINT and other signals.

Jira: None
Test: On SIGINT the app should exit properly and restore
      the vt.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
6 years agoFix the typo
Fan, Yugang [Wed, 25 Oct 2017 22:40:58 +0000 (18:40 -0400)]
Fix the typo

Jira: None.
Test: Test case run normally just like before, especially for logical
      and mosaic mode.

Signed-off-by: Fan, Yugang <yugang.fan@intel.com>
6 years agoUpdate the HWC config path
Kishore Kadiyala [Tue, 24 Oct 2017 18:44:01 +0000 (00:14 +0530)]
Update the HWC config path

Let's have everything under vendor/.

Jira: None.
Test: Verified Mosaic mode works for Android.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
6 years agoRemove Redundant code.
Kalyan Kondapally [Tue, 24 Oct 2017 02:35:48 +0000 (19:35 -0700)]
Remove Redundant code.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDont hardcode virtual display id.
Kalyan Kondapally [Tue, 24 Oct 2017 02:15:50 +0000 (19:15 -0700)]
Dont hardcode virtual display id.

When AOSP framework has support for two external displays, let's
ensure we can handle in in our side. We assume all physical display
id's supported by surface flinger are less than HWC_DISPLAY_VIRTUAL.

Jira: None.
Test: Dual display support is not broken and Virtual display works
      as expected on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't assume primary display if pipe_ == 0.
Kalyan Kondapally [Tue, 24 Oct 2017 02:11:30 +0000 (19:11 -0700)]
Don't assume primary display if pipe_ == 0.

We support re-odering displays from settings file which may
or may not match the physical pipe order. Take this into
account when determining primary display.

Jira: None.
Test: Check external display shows Android logo first in case
      PHYSICAL_DISPLAY="1:0:2" is set in hwc_display.ini.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAlign rotation enums with 4.14 headers.
Kalyan Kondapally [Mon, 23 Oct 2017 03:47:11 +0000 (20:47 -0700)]
Align rotation enums with 4.14 headers.

Now, that these are merged upstream let's move to the new
defines. Also, move this to drmplane, so the core doesn't
need to know about them.

Jira: None.
Test: Build passes on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix Android Oreo build error
Qiming Shi [Wed, 20 Sep 2017 07:13:12 +0000 (15:13 +0800)]
Fix Android Oreo build error

Jira: None.
Test: Pass build on Android Oreo

Signed-off-by: Qiming Shi <qiming.shi@intel.com>
6 years agoAdd support to re-order physical displays.
Kalyan Kondapally [Sat, 21 Oct 2017 09:37:31 +0000 (02:37 -0700)]
Add support to re-order physical displays.

We may want to change the order of physical display, extended
display etc reported to Surface Flinger on certain platforms.
Let's add an option to our setting file to be able to do this.
This order is not expected to change dynamically after boot
up. We now add a new setting "PHYSICAL_DISPLAY" to be able
to configure this.

Jira: None.
Test: Displays are ordered in GPUDevice based on hwc_display.ini
      settings.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix build for Linux
Xiaosong Wei [Thu, 19 Oct 2017 11:38:52 +0000 (19:38 +0800)]
Fix build for Linux

Fix va support for Linux

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd missing unlock.
Tong Bo [Tue, 17 Oct 2017 04:33:19 +0000 (10:03 +0530)]
Add missing unlock.

We forgot to call unlock here, causing us to wait on this lock
for ever in other places.

Jira: None.
Test: System should not get stuck
Signed-off-by: Tong Bo <bo.tong@intel.com>
6 years agoAdd config handling for logical and mosiac.
Fan, Yugang [Thu, 12 Oct 2017 21:08:23 +0000 (17:08 -0400)]
Add config handling for logical and mosiac.

The HWC will read the display config for logical and mosiac, the
config file will be pointed out by ENV var HWC_DISPLAY_CONFIG, and
use default path /etc/hwc_display.ini if no HWC_DISPLAY_CONFIG found.

Pls see comments of the config for detailed config format and usages.

Jira: None.
Test: Change the config file and connect some displays, the cube test
      can show logical and mosiac normally according to the config
      parameters.

Signed-off-by: Fan, Yugang <yugang.fan@intel.com>
6 years agoAdd P010 support
Lin Johnson [Mon, 16 Oct 2017 07:49:50 +0000 (00:49 -0700)]
Add P010 support

P010 is need for HEVC 10 bit
Jira: https://jira01.devtools.intel.com/browse/GSE-390
Test: H265_4K2K_10bit playback successfuly

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoReport maximum virtual displays as 2.
Kalyan Kondapally [Sun, 15 Oct 2017 11:52:28 +0000 (04:52 -0700)]
Report maximum virtual displays as 2.

Jira: None.
Test: Goto Developer Options and simulate secondary display. Device
      shouldn't reboot with options for 2 virtual display.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoW/A: Disable cursor plane usage on APL platforms.
Kalyan Kondapally [Fri, 13 Oct 2017 08:33:30 +0000 (01:33 -0700)]
W/A: Disable cursor plane usage on APL platforms.

This is causing lot of rendering issues, for now let's squash
cursor layer rendering with last layer when this WA
is enabled.

Jira: None.
Test: Multi display renders without any issues.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFix build for Android
Xiaosong Wei [Fri, 13 Oct 2017 00:52:04 +0000 (08:52 +0800)]
Fix build for Android

This is needed to find VA header files.

Jira: None.
Test: Build passes on linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoRemove vaSyncSurface
Xiaosong Wei [Thu, 12 Oct 2017 08:53:29 +0000 (16:53 +0800)]
Remove vaSyncSurface

vaSyncSurface is not required on intel h/w and it's incompatible with
vpg's driver.

Jira: None.
Test: Build passes on linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoLinux: Get Mosiac mode working on Linux.
Fan, Yugang [Tue, 10 Oct 2017 08:30:57 +0000 (01:30 -0700)]
Linux: Get Mosiac mode working on Linux.

During start up we always check for the connected displays
and present content for these displays in tests. In MosiacDisplay,
we expect a hot plug event, before we query for the connected
displays. Instead, let's force atleast once that we populate
connected displays.

Jira: None.
Test: Linux apps work with Logical and Mosiac Display Support
      Enabled.

Signed-off-by: Fan, Yugang <yugang.fan@intel.com>
6 years agoRe-work cursor layer tracking in DisplayPlaneState.
Kalyan Kondapally [Tue, 10 Oct 2017 06:57:11 +0000 (23:57 -0700)]
Re-work cursor layer tracking in DisplayPlaneState.

We don't use cursor layer index anymore, this can be replaced
with a bool to check if a plane has a cursor layer or not.

Jira: None.
Test: No graphics regression seen when using Logical Displays.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoCheck if layer is actually cursor before removing it.
Kalyan Kondapally [Tue, 10 Oct 2017 00:50:00 +0000 (17:50 -0700)]
Check if layer is actually cursor before removing it.

We tracked indexs so far which was fine in normal cases.
However, with logcal display we have double the layers and
cause confusion with index. Instead of index, let's explicitly
check from layer itself.

Jira: None.
Test: No flicker occurs when Logical display is enabled and Video
      is running.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant code.
Kalyan Kondapally [Tue, 10 Oct 2017 00:19:30 +0000 (17:19 -0700)]
Remove redundant code.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoPass false in case layer is not cursor.
Kalyan Kondapally [Mon, 9 Oct 2017 23:39:16 +0000 (16:39 -0700)]
Pass false in case layer is not cursor.

Most of the IsCursorLayer() checks are redundant as these
are done early on and cursor layers are tracked separately.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure VA processing the buffer with correct crop/frame
Xiaosong Wei [Mon, 9 Oct 2017 08:33:34 +0000 (16:33 +0800)]
Ensure VA processing the buffer with correct crop/frame

The surface region for VA input must be from layer's SourceCrop
and the output region for VA output must be from layer's DisplayFrame

Jira: None.
Test: Video uses packed YUV formats and is displayed correctly on Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoInitial Mosiac Display support.
Kalyan Kondapally [Sun, 8 Oct 2017 00:11:38 +0000 (17:11 -0700)]
Initial Mosiac Display support.

This support is disabled by default. We also move
logicaldisplay* to common/core.

Jira: None.
Test: Framebuffer is scaled across multiple monitors when
      more than one monitor is connected.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support for Logical Displays.
Kalyan Kondapally [Thu, 5 Oct 2017 09:14:06 +0000 (02:14 -0700)]
Add support for Logical Displays.

This patch adds support to split Primary Display into two
logical displays. Eventually, we want to be able to configure
the Physical display and the no of logical displays it need's
to be split into. Support is disabled by default.

Jira: None.
Test: Primary display is split into two logical displays and
      content is shown.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove implicit assumption of 1 Cursor layer.
Kalyan Kondapally [Sat, 7 Oct 2017 04:02:06 +0000 (21:02 -0700)]
Remove implicit assumption of 1 Cursor layer.

We want to enable support for spliting 1 physical display to
"n" logical displays. Each logical display can have it's own
cursor layer. Currently, we always assume 1 Cursor per physical
display, remove this assumption.

Jira: None.
Test: No regressions on Android with and without Logical Display.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoRemove redundant logs.
Kalyan Kondapally [Thu, 5 Oct 2017 04:25:23 +0000 (21:25 -0700)]
Remove redundant logs.

Jira: None.
Test: Build passes on Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure we don't refresh if display is not on.
Kalyan Kondapally [Tue, 3 Oct 2017 22:23:37 +0000 (15:23 -0700)]
Ensure we don't refresh if display is not on.

Jira: None.
Test: We don't send refresh request for disconnected displays on
      Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoImprove Cursor plane tracking.
Kalyan Kondapally [Tue, 3 Oct 2017 18:27:41 +0000 (11:27 -0700)]
Improve Cursor plane tracking.

We ignored setting the right state in certain cases, this patch
fixes it.

Jira: None.
Test: Primary plane doesn't get disabled when cursor plane is disabled
      on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove HWCLock to DrmDisplayManager.
Kalyan Kondapally [Wed, 27 Sep 2017 08:02:57 +0000 (01:02 -0700)]
Move HWCLock to DrmDisplayManager.

Instead of having this per display, let's move it
to displaymanager and inform Displays as needed.

Jira: None.
Test: Applications are still able to block HWC updates as needed
     on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd needed changes for travis.
Kalyan Kondapally [Tue, 3 Oct 2017 01:50:00 +0000 (18:50 -0700)]
Add needed changes for travis.

Add support to build with and without libva support enabled.

Jira: None.
Test: All builds pass on TravisCI.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoReset cursor plane as needed.
Kalyan Kondapally [Mon, 2 Oct 2017 23:48:08 +0000 (16:48 -0700)]
Reset cursor plane as needed.

We reset all planes when cursor is removed/added. Instead,
we can just reset the plane which actully has Cursor.

Jira: None.
Test: Moving cursor doesn't leave any rendering artifacts when
      in Landscape mode.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd initial support to convert Media buffers to packed formats.
Xiaosong Wei [Mon, 2 Oct 2017 23:20:14 +0000 (16:20 -0700)]
Add initial support to convert Media buffers to packed formats.

This patch basically enables needed support in CompositorThread,
DisplayPlaneManager to enable support to convert Media buffers
to a preferred Packed/Planar format rather that RGB always.
This will be enabled only when BOARD_USES_LIBVA is set to
true. Video output sometimes shows frames from previous frames
which needs to be fixed before enabling this by default. Also,
changes are needed in Vaapi driver, fixing some of the wrong
asserts in there. These issues will be fixed in followup patches.

Jira: None.
Test: Video output continues to work fine when BOARD_USES_LIBVA is
      not set. Video doesn't crash when BOARD_USES_LIBVA is set to
      true on Android.

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoUse HWCLayerType to keep track of layer type in OverlayLayer.
Kalyan Kondapally [Mon, 2 Oct 2017 19:10:00 +0000 (12:10 -0700)]
Use HWCLayerType to keep track of layer type in OverlayLayer.

Jira: None.
Test: Video is still composited on a separate plane on Android and
      Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support to track VideoPlanes.
Xiaosong Wei [Mon, 2 Oct 2017 18:55:12 +0000 (11:55 -0700)]
Add support to track VideoPlanes.

Add support to keep track of planes which are compositing only
Media content. This is used in later patches to allocate
appropriate buffers  for this plane.

Jira: None.
Test: Video and other content play fine on Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd support to query supported format from DisplayPlane.
Xiaosong Wei [Mon, 2 Oct 2017 07:22:49 +0000 (00:22 -0700)]
Add support to query supported format from DisplayPlane.

When unable to directly use Display Composition for layers,
we want to fall back to a optimal format which can be scanned out.
This information needs to be queried from DisplayPlane. We now
add the needed support and use this format when creating offscreen
buffers, rather than hardcoding it like now.

Jira: None.
Test: Build passes on Linux and Android. No regressions on Linux
      and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd API to initialize Media Renderer/Back buffer in Factory.
Xiaosong Wei [Mon, 2 Oct 2017 06:45:07 +0000 (23:45 -0700)]
Add API to initialize Media Renderer/Back buffer in Factory.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoIntroduce VaRenderer.
Xiaosong Wei [Mon, 2 Oct 2017 06:22:57 +0000 (23:22 -0700)]
Introduce VaRenderer.

VaRenderer represents Media renderer backend used to
convert Media buffers to different formats. This will
be taken into use in future patches. For, now this files
will be compiled only when BOARD_USES_LIBVA is set to
TRUE.

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

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoIntroduce VASurface.
Xiaosong Wei [Mon, 2 Oct 2017 05:54:37 +0000 (22:54 -0700)]
Introduce VASurface.

VASurface represents Media offscreen surface. This
will be taken into use in followup patches.

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

Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoFix indentation of DUMP_CURRENT_COMPOSITION_PLANES.
Xiaosong Wei [Mon, 2 Oct 2017 05:30:56 +0000 (22:30 -0700)]
Fix indentation of DUMP_CURRENT_COMPOSITION_PLANES.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd support to query needed buffer data from OverlayBuffer.
Xiaosong Wei [Mon, 2 Oct 2017 05:23:01 +0000 (22:23 -0700)]
Add support to query needed buffer data from OverlayBuffer.

We need information Like pitches, prime handle etc when converting
content from one format to another. Let's expose needed API's
in OverlayBuffer.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd support to query supported Media format from DisplayPlane.
Xiaosong Wei [Mon, 2 Oct 2017 05:17:27 +0000 (22:17 -0700)]
Add support to query supported Media format from DisplayPlane.

We want to fall back to a optimal packed/planar format, when
Display Plane is unable to handle a given Media buffer. This
information needs to be queried from DisplayPlane. We add
an API in DisplayPlane to query this information, this will
be used in followup patches to convert Media content to a
format which can be scanned out directly.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoInitial Plumbing to provide Media Renderer.
Xiaosong Wei [Mon, 2 Oct 2017 05:04:45 +0000 (22:04 -0700)]
Initial Plumbing to provide Media Renderer.

Currently, we always convert Media content to RGB if YUV/NV12
formats cannot be directly scanned out. Instead of converting
to RGB, we can use VAAPI to convert it to a packed/planar YUV
format's supported by Display. This patch adds initial support
in Factory to provide a Media Renderer implementation.

Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Xiaosong Wei <xiaosong.wei@intel.com>
6 years agoAdd implementation for grallochandler Map, Unmap functions
Jeevaka Prabu Badrappan [Fri, 8 Sep 2017 08:11:55 +0000 (13:41 +0530)]
Add implementation for grallochandler Map, Unmap functions

Jira: None
Test: Build passes.

Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan@intel.com>