OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
5 years agoSet HWC as DRM master when got exclusive lock of /vendor/hwc.lock.
Wan Shuang [Mon, 15 Oct 2018 02:40:49 +0000 (10:40 +0800)]
Set HWC as DRM master when got exclusive lock of /vendor/hwc.lock.

This is to ensure HWC could take over the DRM master role when earlyEvs
exits and make the Android UI rendering correctly as expected.

Jira: OAM-70073
Tests: Boot into Android home screen
Signed-off-by: Wan Shuang <shuang.wan@intel.com>
5 years agoAdd function to transfrom source damage to rendering damage
Lin Johnson [Tue, 16 Oct 2018 03:28:29 +0000 (11:28 +0800)]
Add function to transfrom source damage to rendering damage
this paritial incorparate 145bf9c5853cb5b0de0136a076d1a8b9b0b1c8dc
aftering reverting it.
Also consider the situation source corp is not the same size with
display_rect. That means we also have to scale the output rendering
damage rect

Jira: None
Tests: On Android, HVAC should behave normally
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agofix compliation error caused by rebase 05cda00f4c6322c1af75d0d28bf8b1789f050940
Lin Johnson [Mon, 15 Oct 2018 03:45:24 +0000 (11:45 +0800)]
fix compliation error caused by rebase 05cda00f4c6322c1af75d0d28bf8b1789f050940

Jira: None
Tests: Should not be only compilation error

5 years agoChange decryption prop name
Lin Johnson [Thu, 19 Jul 2018 01:42:52 +0000 (09:42 +0800)]
Change decryption prop name
GPU compositor should set target protected to false

Jira: None
Tests:None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoHWC to support protected buffer display
Lin Johnson [Thu, 12 Jul 2018 08:16:42 +0000 (16:16 +0800)]
HWC to support protected buffer display
It should be trough RRB2 propery accroding
the design

Jira: OAM-65937
Tests: None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
Conflicts:
common/core/overlaylayer.h

5 years agoProtected layer should always choose video path
Lin Johnson [Wed, 27 Jun 2018 07:33:02 +0000 (15:33 +0800)]
Protected layer should always choose video path

For CSC and composition. Mesa will not support
Encrypted surface yet

Jira: None
Tests:None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoDrmDisplay: check if sink supports DCI-P3.
Harish Krupo [Sun, 16 Sep 2018 04:30:47 +0000 (10:00 +0530)]
DrmDisplay: check if sink supports DCI-P3.

The sink exposes whether it supports the DCI-P3 color space in the
colorimetry block present in the EDID. This patch implemnets an EDID
parser to get DCI-P3 support from the sink.

Jira: None
Test: When a DCI-P3 capable display is connected, "DCI-P3 support available"
      log will be present in the logcat.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Conflicts:
public/nativedisplay.h
wsi/drm/drmdisplay.h

5 years agoHDCP: Add Set SRM support
Lin Johnson [Tue, 9 Oct 2018 01:29:33 +0000 (09:29 +0800)]
HDCP: Add Set SRM support

Jira: None
Tests: Android UI workes nomrally
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoImplement PAVP tear down support
Lin Johnson [Sun, 30 Sep 2018 02:09:59 +0000 (10:09 +0800)]
Implement PAVP tear down support
When any PAVP session disabled, HWC suppose to
not compose any protected video

Jira: https://jira01.devtools.intel.com/browse/OAM-68867
Tests: None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoAdded ignore_updates_ to track if HWC needs to ignore rendering request.
Wan Shuang [Sat, 29 Sep 2018 02:07:50 +0000 (10:07 +0800)]
Added ignore_updates_ to track if HWC needs to ignore rendering request.
Don't invoke display's ForceRefresh if ignore_updates_ is true.

Jira: OAM-68565
Tests: Boot with RVC and no flicking

Signed-off-by: Wan Shuang <shuang.wan@intel.com>
5 years agoRevert "Apply damage transformations in GetLayerDamage"
Lin Johnson [Fri, 28 Sep 2018 08:28:06 +0000 (16:28 +0800)]
Revert "Apply damage transformations in GetLayerDamage"
Flicker is observed when start an APK after this patch.
for example use Car Launcher

This reverts commit 145bf9c5853cb5b0de0136a076d1a8b9b0b1c8dc.

Conflicts:
common/core/hwclayer.cpp
public/hwclayer.h
public/hwcutils.h

5 years agoFix the memory leak in virtualdisplay.cpp.
HeYue [Sat, 29 Sep 2018 06:59:21 +0000 (14:59 +0800)]
Fix the memory leak in virtualdisplay.cpp.
The memory leak causing the dmabuf fd that hwc opened increase all the time.
Causing the UI hang or reboot.
1: The buffer handle is without any 3D or framebuffer resource, thus it can
be destoryed directly instead of in the compositor thread
2: This will decoule the SetOuputBuffer and Present call. Previous it assumed
that SetOutputBuffer and Present is 1:1, but actually there is no guarantee from
the framework that it will be 1: This will decouple the SetOuputBuffer and Present call.
Previous it assumed that SetOutputBuffer and Present is 1:1, but actually there is no
guarantee from the framework that it will be 1:1

Jira:  https://jira01.devtools.intel.com/browse/OAM-67797
Tests: play video and UI doesn't hang or reboot. The fd that hwc opened is stable.

Signed-off-by: HeYue <yue.he@intel.com>
5 years agoImplement display rotation.
Harish Krupo [Sat, 29 Sep 2018 06:21:18 +0000 (14:21 +0800)]
Implement display rotation.

When display rotation is applied (not layer rotation)
especially configured in hwc_display.ini (Android),
it is necessary to recalculate the layer's display frame
(position) of each plane.

If the plane needs GPU render and rotation type is GPU rotation,
re-calculate its source layers's display frame before
GPU composit and rotate; for other scan out plane
re-calculate its overlay layer's display frame before DRM commit.

Jira: https://jira01.devtools.intel.com/browse/OAM-67979
Tests: display rotation works on Android platform.
Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
5 years agoRemove blocking commit wrongly merged
Lin Johnson [Wed, 26 Sep 2018 03:38:09 +0000 (11:38 +0800)]
Remove blocking commit wrongly merged
It is wrongly added in SolidColor support

Jira: None
Tests: None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoSetOverlayLayer: DisplayPlaneState should also update
Lin Johnson [Tue, 25 Sep 2018 08:47:04 +0000 (16:47 +0800)]
SetOverlayLayer: DisplayPlaneState should also update
displayframe and source crop,Otherwise if GetDisplayFrame etc
is called for this plane state, it will not be correct

Jira: None
Tests: Android UI normal
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoAdd support for SolidColor Type layer in HWC
Lin Johnson [Wed, 19 Sep 2018 08:20:48 +0000 (16:20 +0800)]
Add support for SolidColor Type layer in HWC
It is a layer without buffer handler,
it expected HWC can fill the layer with
color(0,0,0) and multiplay with an Alpha value

Jira: https://jir01.devtoosl.intel.com/browse/OAM-68857
Tests: SolidColor composition layer can be rendered
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoRemoving deinterlace frame by frame check as
Lin Johnson [Thu, 13 Sep 2018 01:39:50 +0000 (09:39 +0800)]
Removing deinterlace frame by frame check as
it cause FPS regression for video
Also fixed performance regression caused by
21c2f60dfd5044cfa0e640b09d9c42e52a669f00
validate_Layers shoud apply only when video effect
changes

Jira://jira01.devtools.intel.com/browse/OAM-68648
Tests: Video FPS no regression
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoUpdate AliOS support
Caiwen Zhang [Thu, 30 Aug 2018 07:28:28 +0000 (15:28 +0800)]
Update AliOS support

1) align with AliOS HAL and clean up the implementation
2) Fix compile issues on AliOS

Signed-off-by: Caiwen Zhang <caiwen.zhang@intel.com>
5 years agodeinterlacing: avoid to use HQ scale as VPP driver bug.
Lin Johnson [Tue, 4 Sep 2018 14:50:15 +0000 (22:50 +0800)]
deinterlacing: avoid to use HQ scale as VPP driver bug.
Need use GetInteralce to fetch interlace information

Tests: Video playback with deinterlace working on Android
Jira: https://jira01.devtools.intel.com/browse/OAM-65167

5 years agoShould make sure separate plane for video
Lin Johnson [Fri, 31 Aug 2018 07:09:09 +0000 (15:09 +0800)]
Should make sure separate plane for video
when required media effects, since VPP path only applies to a separate plane.
Add a variable in display queue to track if media effect changes
If it changed, should not use idle frame

Jira: None
Tests: video playback with media effect changes

5 years agoAdd file CONTRIBUTING.md
Kelly Ledford [Fri, 24 Aug 2018 22:54:58 +0000 (15:54 -0700)]
Add file CONTRIBUTING.md

When this file is added, Github creates a popup reminder for any new contributor
to the project -- reminding them to view the contribution guidelines before
creating their first issue and pull request.

JIRA: GSE-1575
Test: none
Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
5 years ago Add syntax for parsing "ANDROID_P" required by GP2.0.
Michele Lim [Tue, 28 Aug 2018 19:57:14 +0000 (12:57 -0700)]
  Add syntax for parsing "ANDROID_P" required by GP2.0.

  Current parser only works up to "ANDROID_O".

  Jira: GSE-1615
  Test: Displayed "ANDROID_VERSION 9" as expected.

Signed-off-by: Michele Lim <michele.lim@intel.com>
5 years ago GP2.0 Renderer interlaced video mode control
Michele Lim [Mon, 27 Aug 2018 03:35:56 +0000 (20:35 -0700)]
  GP2.0 Renderer interlaced video mode control

  Many interlaced video clips still exist despite the fact that
  most modern computer monitors do not support interlaced video.
  Since this capability does not currently exist in Android,
  provide the interface to deinterlace the video frames prior to
  rendering to enhance the user experience.

  Jira: GSE-1618
  Test: To be tested on KabyLake NUC

Signed-off-by: Michele Lim <michele.lim@intel.com>
5 years ago Fix for Antutu Regression
Aravindan Muthukumar [Mon, 27 Aug 2018 07:14:57 +0000 (12:44 +0530)]
  Fix for Antutu Regression

  The issue here is canvas color was updated to kernel everytime
  during the display update eventhough there was no update in
  the color from the upper layer. Because of these redundant
  ioctl calls to kernel,3D scores of antutu KPI regressed.
  The fix here is to call the ioctls only when there is
  a set/update in the canvas pipe color.

Signed-off-by: Aravindan M <aravindan.muthukumar@intel.com>
Signed-off-by: Kedar Karanje <kedar.j.karanje@intel.com>
  JIRA: https://jira01.devtools.intel.com/browse/OAM-65913

5 years agoFix crash when ReValidatePlanes is called
Lin Johnson [Mon, 27 Aug 2018 03:13:58 +0000 (11:13 +0800)]
Fix crash when ReValidatePlanes is called
Should make sure render target before GetOffScreenTarget

Jira: None
Tests: No crash when test independant rotation of displays
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoRobustness for AaaG: when there is no pipe assigned,
Lin Johnson [Fri, 24 Aug 2018 03:01:40 +0000 (11:01 +0800)]
Robustness for AaaG: when there is no pipe assigned,
HWC should return false instead of crash

Jira: None
Tests: Android boot with no pipe assigned in AaaG
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoRe-map display rotation values before calculation
Harish Krupo [Fri, 24 Aug 2018 05:46:58 +0000 (11:16 +0530)]
Re-map display rotation values before calculation

the display rotation values are one of {kIdentity, kTransform90,
kTransform180, kTransform270}. First remap them to 0..3 before adding it to
the layer's transform.

Jira: None
Test: The display's rotation should reflect based on the setting in hwc_display.ini

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFully isolate travisCI builds
Kelly Ledford [Fri, 24 Aug 2018 22:15:24 +0000 (15:15 -0700)]
Fully isolate travisCI builds

'sudo: required' fully seperates each build into their own, isolated & clean,
Google Compute Engine vm -- so no more shared state between builds.

Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
5 years agoFix screen flicker when selecting option in setting menu
renchenglei [Mon, 20 Aug 2018 07:20:56 +0000 (15:20 +0800)]
Fix screen flicker when selecting option in setting menu

This help fix screen flicker when selecting any option in the
setting menu screen with touch screen. We should return empty
rectangle when rmin <= lmax or bmin <= tmax.

Jira: OAM-67240
Test: Screen won't flicker when selecting option in setting menu

5 years agonew design of the hyper dmabuf sharing base on VDS
xue.yifei [Tue, 21 Aug 2018 07:56:02 +0000 (15:56 +0800)]
new design of the hyper dmabuf sharing base on VDS

this patch include 3 components
1. fix the VDS fd leak casue of not purge the imported buffer
2. improve the VDS implementation to support multi-VDS
3. abandon the Nestedisplay, using VDS to sharing hyper dmabuf

Jira: https://jira01.devtools.intel.com/browse/OAM-63356
Tests: function test on Android
Signed-off-by: xue.yifei <yifei.xue@intel.com>
5 years agoShould check input parameters for function GetDisplayConfigs
Lin Johnson [Thu, 16 Aug 2018 14:42:22 +0000 (22:42 +0800)]
Should check input parameters for function GetDisplayConfigs

Jira: None
Tests: Compile and run for Android
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoQueueUpdate refractory: add separate function for overlay layer initialize
Lin Johnson [Mon, 13 Aug 2018 03:19:58 +0000 (11:19 +0800)]
QueueUpdate refractory: add separate function for overlay layer initialize
This help to reduce the lines of QueueUpdate functions

Jira: None
Tests: Compilation and HWC works normal in Android
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoAdd RBC enabled log.
Yuanjun Huang [Tue, 14 Aug 2018 08:07:19 +0000 (16:07 +0800)]
Add RBC enabled log.

This is for the RBC feature test case, providing information to
indicate if RBC is working.

Jira: https://jira01.devtools.intel.com/browse/OAM-65434
Tests: test on APL.
Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
5 years agoRemove ResourceManager comment
Kelly Ledford [Mon, 20 Aug 2018 19:11:34 +0000 (12:11 -0700)]
Remove ResourceManager comment

Comment applies to ResourceManager class located in
common/core/resourcemanager.h, not to the FrameBufferManager class.

Jira: GSE-1575
Tests: None
Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
5 years agoEnsure last plane valid when calling IsVideoPlane
renchenglei [Sun, 5 Aug 2018 16:13:01 +0000 (00:13 +0800)]
Ensure last plane valid when calling IsVideoPlane

This help fix the crash when running Antutu 7.x. If function
GetLastUsedOverlay didn't return a valid value, HWC would crash
with "null pointer dereference" when calling IsVideoPlane function

Jira: OAM-67193
Test: Antutu 7.x won't have HWC crash

5 years agoAdd documentation to logicaldisplaymanager.h
Richard Avelar [Wed, 1 Aug 2018 17:30:43 +0000 (10:30 -0700)]
Add documentation to logicaldisplaymanager.h

This patch adds documentation for doxygen for the file
logicaldisplaymanager.h

Jira: GSE-1575
Tests: Run Doxygen
Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoAdd file command to documented files
Richard Avelar [Wed, 8 Aug 2018 20:08:02 +0000 (13:08 -0700)]
Add file command to documented files

The \file command at the top of a file allows doxygen to know
the file is documented and the documentation should be used in the
generation of documentation output to html/latex

Jira: GSE-1575
Tests: Run Doxygen, examine file tab page in html
Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoAdd note to doxy installation instructions readme.
Richard Avelar [Mon, 30 Jul 2018 17:24:09 +0000 (10:24 -0700)]
Add note to doxy installation instructions readme.

Since we are using the HAVE_DOT option in the doxygen config file,
we should make a note to the user that they may need to install
graphviz if they do not already have it installed on their machine.

Tests: Run Doxygen
Jira: None
Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoAdd support for future doxygen comments in both *.h and *.cpp files
Kelly Ledford [Thu, 2 Aug 2018 18:07:49 +0000 (11:07 -0700)]
Add support for future doxygen comments in both *.h and *.cpp files

With these changes, every file will be listed, but only those files that
contain doxygen comments will be available for viewing. Each *.h or *.cpp with
doxygen comments will contain the \file command, indicating to doxygen that
comments should be parsed within the file and displayed.

Jira: GSE-1575
Tests: Run Doxygen

Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
5 years ago Omit extraneous metadata copy in DrmBuffer and replace image_
Michele Lim [Tue, 7 Aug 2018 20:06:24 +0000 (13:06 -0700)]
  Omit extraneous metadata copy in DrmBuffer and replace image_
  metadata parameter handler with shorthand METADATA(x).

  DRM buffer details such as width, height, pitch, etc are already
  present in the image metadata.  Reference the HwcBuffer image
  metadata handle instead to eliminate unnecessary copying.
  METADATA(x) macro serves the purpose of improving code
  readability.

  Jira: GSE-1509
  Test: Tested on KabyLake NUC

Signed-off-by: Michele Lim <michele.lim@intel.com>
5 years agoTravis overhaul
Kevin Strasser [Thu, 26 Jul 2018 03:40:23 +0000 (20:40 -0700)]
Travis overhaul

There are a number of improvements here, many inspired by the upstream Mesa
script. The main focus is isolating build variations and using official release
archives wherever possible.

Jira: None
Test: Check that Travis is all green

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
5 years agoFix virtual display regression
Lin Johnson [Thu, 2 Aug 2018 03:49:37 +0000 (11:49 +0800)]
Fix virtual display regression
caused by b6ff1590f362fefadbc0ad3b3128fef9895e28be
virtual display and nested display should have fb_manager in
constructor because compositor is intialized in constructor

Jira: https://jira01.devtools.intel.com/browse/OAM-67091
Tests: virtual display on Android P GP2.0
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoAndroid: workaound for 3 display underrun issue.
Lin Johnson [Mon, 30 Jul 2018 15:15:37 +0000 (23:15 +0800)]
Android: workaound for 3 display underrun issue.
Without modificator no serious unerrun when
3 display in use
Need to revert this when root fix in kernel

Tests: 3 display in Android clone mode or mosaic mode
Jira: None
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoAdd doxygen config and document some of the public APIs
Kevin Strasser [Tue, 3 Jul 2018 20:30:16 +0000 (13:30 -0700)]
Add doxygen config and document some of the public APIs

The APIs defined in the public headers represent the boundary between core
IA-Hardware-Composer and the platform specific implementations. Start adding
documentation to help specify the expected API behaviors.

Jira: GSE-1575
Test: doxygen Doxyfile
Test: firefox html/index.html

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
5 years ago Fix hwcomposer ANDROID_VERSION parser
Michele Lim [Wed, 18 Jul 2018 01:45:11 +0000 (18:45 -0700)]
  Fix hwcomposer ANDROID_VERSION parser

  Current parser yields the major version only and not the
  ANDROID_VERSION as intended. This fix first evaluates the
  major version, which is then used to map to the corresponding
  ANDROID_VERSION correctly.

  Jira: GSE-1615
  Test: Compiled successfully on Celadon

Signed-off-by: Michele Lim <michele.lim@intel.com>
5 years agoAdd documentation for framebuffermanager.
Richard Avelar [Wed, 18 Jul 2018 20:38:25 +0000 (13:38 -0700)]
Add documentation for framebuffermanager.

This patch is meant to add documentation to the file framebuffermanager
in anticipation of the doxygen patch that will be added. If you have
any feedback or comments on the documentation in this patch feel free
to comment below. Hopefully we can add enough documentation throughout
the project that'll promote increased open source contributions.

Jira: GSE-1575
Test: doxygen Doxyfile and generated index.html

Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoAdd documentation information to the readme.
Richard Avelar [Thu, 19 Jul 2018 21:58:39 +0000 (14:58 -0700)]
Add documentation information to the readme.

This patch adds instructions on how to add documentation to the
project.

Jira: GSE-1575
Test: None
Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoClone mode: it should also ammulate fence to HwcLayers
Lin Johnson [Fri, 20 Jul 2018 05:17:07 +0000 (13:17 +0800)]
Clone mode: it should also ammulate fence to HwcLayers

Jira: None
Test: Clone mode works fine
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoClone mode: Add remove_index and add_index logic to avoid
Lin Johnson [Thu, 19 Jul 2018 01:44:13 +0000 (09:44 +0800)]
Clone mode: Add remove_index and add_index logic to avoid
crash in GetCachedLayers.

Jira:OAM-65548
Tests: 3 diaplay clone mode works on GP2.0

5 years agoVarenderer: fix code error
Lin Johnson [Thu, 19 Jul 2018 06:19:40 +0000 (14:19 +0800)]
Varenderer: fix code error
'break' should be add in switch case

Jira:None
Test: Video rotation on all directions(no mirror)
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoHWC layer set release fence should accumulate fences
Lin Johnson [Thu, 19 Jul 2018 01:16:18 +0000 (09:16 +0800)]
HWC layer set release fence should accumulate fences
instead of just replace it
This fix potential mosaic mode bug

Jira:None
Tests: Mosaic mode works fine

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoWeston: Migrate to head based API
Harish Krupo [Fri, 13 Jul 2018 12:01:29 +0000 (17:31 +0530)]
Weston: Migrate to head based API

Jira: None
Test: Weston boots up properly and no regressions seen.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoHwclayer: Don't transform when full damage
Harish Krupo [Mon, 9 Jul 2018 08:44:36 +0000 (14:14 +0530)]
Hwclayer: Don't transform when full damage

When the surface damage rects set are 0, the surface_damage_
is equal to the display_frame_. Dont apply transformations in
this case.

Jira: None
Test: Cube test in ApiDemos on android renders correctly

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoMosaicMode: return more reliable fences
Harish Krupo [Fri, 29 Jun 2018 05:34:49 +0000 (11:04 +0530)]
MosaicMode: return more reliable fences

Currently we pick a display with the maximum refresh rate
as the preferred display and return its fence.
Instead, merge the fences from all the displays and return it.
Such merged fences are signaled only when all the individual
fences are signaled.

Jira: None
Test: No regressions seen on Linux and Android

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFix Klockwork indirect path traversal issue.
Harish Krupo [Fri, 29 Jun 2018 04:11:19 +0000 (09:41 +0530)]
Fix Klockwork indirect path traversal issue.

Jira: None
Test: File path on
      Android: /vendor/etc/hwc_display.ini
      Linux: {prefix}/etc/hwc_display.ini

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoHwcLayer: Apply rotation transformation to damage.
Harish Krupo [Tue, 12 Jun 2018 20:58:26 +0000 (02:28 +0530)]
HwcLayer: Apply rotation transformation to damage.

This enables us to remove the workaround in Overlaylayer.

Jira: None
Test: No regressions seen on Android and Linux.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFix missing mapping for display_transform
Harish Krupo [Sun, 24 Jun 2018 11:21:21 +0000 (16:51 +0530)]
Fix missing mapping for display_transform

Currently the display transform set in the hwc_display.ini file
is according to the HWCRotation enums but the values expected in
Validate transfrom are 0,4,8,16. Instead of directly mapping 0..3
to 0,4,8,16, accept 0..3 as inputs as it simplifies the calculation
of the final plane rotation because 0..3 forms a circulant matrix
over modulo 4 arithmetic.

Jira: None
Tests: If the requested layer rotation if 0 degree and the display
       rotation set in ini file is 90 then the final rotation should
       be 90 degrees.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoAdd option to disable video vpp if va driver is not ready.
Lin Johnson [Thu, 21 Jun 2018 02:55:36 +0000 (10:55 +0800)]
Add option to disable video vpp if va driver is not ready.

For certain reason on some platform the va driver is not enabled,
then video vpp path should be disabled.

Test: video playback normal and no other side effect.
Signed-off-by: Yuanjun Huang <yuanjun.huang@intel.com>
Singed-off-by: Lin Johnson <johnson.lin@intel.com>
5 years agoignore interlace modes
Liu Zhiquan [Wed, 6 Jun 2018 03:15:58 +0000 (11:15 +0800)]
ignore interlace modes

In AOSP PPR1.180528.001 version code, connector mode config list
reported to SurfaceFlinger are changed to unsorted.
Interlace mode config will be chosen and set in display. This will cause
display shake issue. Interlace mode configs are not requirement on
android, so we ignore them(the flags with DRM_MODE_FLAG_INTERLACE).

Change-Id: I2397045ce127046b942b974f30f1d4d8618a3f80
Tracked-On: https://jira01.devtools.intel.com/browse/OAM-64528
Signed-off-by: Liu Zhiquan <zhiquan.liu@intel.com>
5 years agoWeston: Don't use vblank for frame completion.
Harish Krupo [Sun, 10 Jun 2018 11:02:28 +0000 (16:32 +0530)]
Weston: Don't use vblank for frame completion.

For some reason when using vblank callback as an indication
of frame completion the weston-simple-egl app reports a fps
of ~30-40. Thus instead of using the vblank callback, use the
received release fence.
This patch adds the release fence to the fds polled in the main
loop to use as an indication of frame completion.

Jira: None
Test: The weston-simple-egl app should report ~60 FPS

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoGpudevice: Return total_displays_ as reference.
Harish Krupo [Tue, 5 Jun 2018 04:01:16 +0000 (09:31 +0530)]
Gpudevice: Return total_displays_ as reference.

This is to avoid un-necessary copies of the vector.

Jira: None
Test: No regressions seen on Android and Linux.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFix compilation Errors for Nested Display
Kishore Kadiyala [Thu, 7 Jun 2018 05:34:56 +0000 (11:04 +0530)]
Fix compilation Errors for Nested Display

Jira: None
Test: Compilation with Nested Display enabled should PASS

Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
5 years agoUpdate README.md
kalyan kondapally [Tue, 5 Jun 2018 18:24:13 +0000 (11:24 -0700)]
Update README.md

5 years agoFix compilation warnings.
Harish Krupo [Mon, 4 Jun 2018 08:38:12 +0000 (14:08 +0530)]
Fix compilation warnings.

As a consequence of this change, linux_test app doesn't
crash when compiled using gcc 8.1.0

Jira: None
Test: Compile the test app with gcc 8.1.0 and run. It shouldn't
      crash.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agolinux: Only build against Mesa GBM
Kevin Strasser [Fri, 27 Apr 2018 20:42:30 +0000 (13:42 -0700)]
linux: Only build against Mesa GBM

Remove minigbm bindings from the Linux platform code and make Mesa GBM the
only target. This will simplify the build process on the Linux side and
drops an untested build configuration.

Jira: GSE-1565
Test: Try demo apps on Linux

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
5 years agoFix Mesa GBM support
Kevin Strasser [Fri, 11 May 2018 22:35:29 +0000 (15:35 -0700)]
Fix Mesa GBM support

With the introduction of RBC support in commit 45e7bb0 the Mesa GBM Linux
build has been hitting an error. It seems that this path was just left
behind. Add handling for Mesa GBM with modifiers.

GH-351
Jira: GSE-1565
Test: Configure with '--enable-gbm' and try demo apps on Linux

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
5 years agoApply damage transformations in GetLayerDamage
Harish Krupo [Fri, 1 Jun 2018 08:32:22 +0000 (14:02 +0530)]
Apply damage transformations in GetLayerDamage

This patch drops UpdateRenderingDamage() call and
instead applies the required transformations in
GetLayerDamage() and intersects it with the visible
region (if set) to calculate the layer's damage.

Jira: None
Test: The full ball is rendered correctly when
      weston-simple-damage application is run.
      No regressions on Android and Linux.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFix dump information
Harish Krupo [Fri, 1 Jun 2018 13:38:18 +0000 (19:08 +0530)]
Fix dump information

Currently the ReflectY property is being dumped twice instead
of the Transform90.

Jira: None
Test: When ENABLE_DISPLAY_DUMP is enabled, the information is
      properly dumped.

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoSet lock file path at build time.
Harish Krupo [Thu, 31 May 2018 09:36:03 +0000 (15:06 +0530)]
Set lock file path at build time.

Jira: None
Test: File path on
      Android: /vendor/etc/hwc.lock
      Linux: {prefix}/etc/hwc.lock

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFrameBufferManager Instance owned by GPUDevice
Richard Avelar [Mon, 21 May 2018 18:50:42 +0000 (11:50 -0700)]
FrameBufferManager Instance owned by GPUDevice

This patch addresses issue #303 and has the GpuDevice take ownership
of the FrameBufferManager Instance which then gets passed to all
displays on initialization to pass to the drmbuffer and the
compositorthread as needed in place of calling the instances from
FrameBufferManager directly.

Jira: None
Test: HWC build passes without errors
Signed-off-by: Richard Avelar richard.avelar@intel.com
5 years agoFix crash in SetCloneMode.
Kalyan Kondapally [Fri, 1 Jun 2018 06:23:10 +0000 (23:23 -0700)]
Fix crash in SetCloneMode.

We might be calling into this API during initialization, even
if display is disconnected. This means DisplayQueue is not
fully initialized during this time. Let's check if all objects
are properly initialized before using them.

Jira: None.
Test: No crash seen during boot up.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
5 years agoStop assuming that enums is a valid pointer when count_enums > 0
Kevin Strasser [Tue, 29 May 2018 23:03:40 +0000 (16:03 -0700)]
Stop assuming that enums is a valid pointer when count_enums > 0

If libdrm fails to allocate enums for some reason it will still give us a
value in count_enums that it meant to allocate. This would be a rare
condition but we ought to handle it.

Test: Build and boot on Android
Bug: GSE-1586

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
5 years agoFixed the HWC crash due to improper thread initialization sequence.
Wan Shuang [Mon, 28 May 2018 11:45:18 +0000 (19:45 +0800)]
Fixed the HWC crash due to improper thread initialization sequence.

The thread of GpuDevice is started before DRM Display Manager's
Initialization method, there is a chance that GpuDevice thread
call method of display manager but underlying DRM display manager
implementation still not fully initialized yet. This will lead
HWC crash.

JIRA: OAM-63288
Test: Switch clone & mosaic mode and no crash during boot.

Signed-off-by: Wan Shuang <shuang.wan@intel.com>
5 years agoPartial revert of c72b95e622cf0c5a31f258851425070e24bf1f3c.
Kalyan Kondapally [Mon, 28 May 2018 07:12:52 +0000 (00:12 -0700)]
Partial revert of c72b95e622cf0c5a31f258851425070e24bf1f3c.

Jira: None.
Test: Fixes crash during boot up when u have more than 1
      app holding the lock.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
5 years agoEnable surface damage support for cloned display.
Kalyan Kondapally [Sun, 27 May 2018 21:44:33 +0000 (14:44 -0700)]
Enable surface damage support for cloned display.

We always invalidated all layers in case of cloned display.
Instead we could track the damage of any gpu composited layers
and only re-render those layers even in case of cloned
display.

Jira: None.
Test: No rendering artifacts seen with cloned display on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
5 years agoTrack Surface Damage as part of OverlayLayer only.
Kalyan Kondapally [Sat, 26 May 2018 22:10:35 +0000 (15:10 -0700)]
Track Surface Damage as part of OverlayLayer only.

We had this in both places NativeSurface and OverlayLayer.
Let's track this in overlaylayer only.

Jira: None.
Test: No new flickers/artifacts seen on Android.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAdd support to dynamically disable last overlay usage.
Kalyan Kondapally [Sun, 27 May 2018 08:45:07 +0000 (01:45 -0700)]
Add support to dynamically disable last overlay usage.

Jira: None.
Test: APL boards don't reboot when multi monitors are connected
      and all planes are in use.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoEnsure DisplayManager is initialized before accessing it.
Kalyan Kondapally [Fri, 25 May 2018 18:18:52 +0000 (11:18 -0700)]
Ensure DisplayManager is initialized before accessing it.

Jira: None.
Test: No crash observed when IgnoreUpdates is called from
      Worker Thread.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't compose Nesteddisplay surface while no SOS side connection.
xue.yifei [Thu, 24 May 2018 01:36:23 +0000 (09:36 +0800)]
Don't compose Nesteddisplay surface while no SOS side connection.

Nesteddisplay leverage SurfaceFlinger do composition, skip it
while no SOS side buffer sharing request to optimize GPU
consumption.

Jira: None
Test: Tested on android
Signed-off-by: xue.yifei <yifei.xue@intel.com>
6 years agoFix warning.
Kalyan Kondapally [Thu, 24 May 2018 06:43:37 +0000 (23:43 -0700)]
Fix warning.

Jira: None.
Test: Build passes without any warnings.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoMove display fence polling to DrmDisplay.
Kalyan Kondapally [Wed, 23 May 2018 07:39:35 +0000 (00:39 -0700)]
Move display fence polling to DrmDisplay.

This should give us bit extra time to populate things like
plane properties needed for that given commit.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoDon't clear surface if only src rect has changed.
Kalyan Kondapally [Wed, 23 May 2018 07:31:53 +0000 (00:31 -0700)]
Don't clear surface if only src rect has changed.

We clear surface as needed depending on Display rect
changes. This should be enough to handle all cases.

Jira: None.
Test: No new regressions seen on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoFixed HWC crash caused by index out of range.
Wan Shuang [Thu, 24 May 2018 02:41:26 +0000 (10:41 +0800)]
Fixed HWC crash caused by index out of range.

HWC run into crash if physical display numbers defined in
  hwc_config.ini large than the displays enumerated from DRM API.

JIRA: OAM-63201
Test: Boot into Android UI home screen.

Signed-off-by: Wan Shuang <shuang.wan@intel.com>
6 years agoAdd README file.
Kalyan Kondapally [Wed, 23 May 2018 22:55:54 +0000 (15:55 -0700)]
Add README file.

Jira: None.
Test: None.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoVarenderer should call vaSyncSurface before commit.
Lin Johnson [Wed, 23 May 2018 08:32:10 +0000 (01:32 -0700)]
Varenderer should call vaSyncSurface before commit.

This seems needed to ensure we have a consistent FPS
as we don't have fence support when using VPP.

Jira: https://jira01.devtools.intel.com/browse/OAM-63127
Test: We hit 60 fps with Video Playback.

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
6 years agoAdd explicit type to HWCTransform enum
Kevin Strasser [Mon, 21 May 2018 23:55:14 +0000 (16:55 -0700)]
Add explicit type to HWCTransform enum

There are several places in the code where we make an assumption about the
data type of this enum. Lets make it official in the definition.

Jira: GSE-1599
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoHwcDisplay: disable assignment operator
Kevin Strasser [Mon, 21 May 2018 22:38:24 +0000 (15:38 -0700)]
HwcDisplay: disable assignment operator

Given that we have already disabled the default copy constructor, we probably
don't want assignment operator.

Jira: GSE-1599
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoCompositor: disable assignment operator
Kevin Strasser [Mon, 21 May 2018 22:27:31 +0000 (15:27 -0700)]
Compositor: disable assignment operator

Given that we have already disabled the default copy constructor, we probably
don't want assignment operator.

Jira: GSE-1599
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoVirtualDisplay: disable copy constructor and assignment operator
Kevin Strasser [Mon, 21 May 2018 22:17:27 +0000 (15:17 -0700)]
VirtualDisplay: disable copy constructor and assignment operator

Otherwise the destructor could cause double free.

Jira: GSE-1599
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoFix buffer creation check
Kevin Strasser [Thu, 17 May 2018 23:10:09 +0000 (16:10 -0700)]
Fix buffer creation check

We should be checking the result of the second CreateBuffer call,
otherwise this check is redundant. Also, taking the opportunity
to avoid binding handles in error paths.

Jira: GSE-1597
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoDrop unused variable
Kevin Strasser [Thu, 17 May 2018 23:27:09 +0000 (16:27 -0700)]
Drop unused variable

configIndex is never accessed, just drop it.

Jira: GSE-1597
Test: Build and boot to graphics on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoBeginFrame should have void return type
Kevin Strasser [Thu, 17 May 2018 22:43:04 +0000 (15:43 -0700)]
BeginFrame should have void return type

This function can only return true so just drop the return type and
stop checking for false at call sites.

Jira: GSE-1597
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoCalculateRenderState should have void return type
Kevin Strasser [Thu, 17 May 2018 22:01:18 +0000 (15:01 -0700)]
CalculateRenderState should have void return type

This function can only return true so just drop the return type and
stop checking for false at call sites.

Jira: GSE-1597
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoFix flicker during boot up.
Wan Shuang [Thu, 17 May 2018 10:05:06 +0000 (18:05 +0800)]
Fix flicker during boot up.

Skip rendering Android system UI if /vendor/hwc.lock
is present and exclusively locked by another process.
This is to avoid screen flash if earlyEVS and HWC both
rendering content into DRM. The Android system UI will
be rendered once we get the exclusive clock.

JIRA: OAM-60710
Test: Boot into home screen in normal boot flow;
      Show earlyEVS camera content if boot with showing rear view
        camera mode;
      Show Android system UI if exit showing rear view camera mode.
      Unplug/Plug the HDMI displays several times

Signed-off-by: Wan Shuang <shuang.wan@intel.com>
6 years agoFix Klockwork NULL pointer dereference issue
Michele Lim [Wed, 16 May 2018 16:40:32 +0000 (09:40 -0700)]
Fix Klockwork NULL pointer dereference issue

Results of function that can return NULL may be dereferenced and
cause catastrophic failure.

Jira: GSE-1592
Test: Builds on Android

Signed-off-by: Michele Lim <michele.lim@intel.com>
[strassek: cleanup 1 NULL check]
Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoFree drm objects before returning
Kevin Strasser [Thu, 17 May 2018 20:37:46 +0000 (13:37 -0700)]
Free drm objects before returning

This memory needs to be freed before we return or it will be a leak.

Jira: GSE-1595
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoAdd fourcc defines.
Kalyan Kondapally [Thu, 17 May 2018 06:33:51 +0000 (23:33 -0700)]
Add fourcc defines.

This removes need to carry extra patches in libdrm side.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
6 years agoAlso ensure blob data field is non-null
Kevin Strasser [Thu, 17 May 2018 00:33:31 +0000 (17:33 -0700)]
Also ensure blob data field is non-null

The kernel is allowed to return blob.length=0, and so the data
field would be unallocated. Add a check for that too.

Jira: GSE-1593
Test: Build and boot on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agoFix uninitialized variables
Kevin Strasser [Wed, 16 May 2018 23:24:30 +0000 (16:24 -0700)]
Fix uninitialized variables

Initialize member variables found in Klocwork scan. Also, do all
initialization in constructor init list.

Jira: GSE-1594
Test: Build and boot to graphics on Android

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
6 years agova: Avoid storing references to local variables outside of scope
Kevin Strasser [Mon, 14 May 2018 22:45:56 +0000 (15:45 -0700)]
va: Avoid storing references to local variables outside of scope

The member variable 'param_' gets a couple of its fields set to the
addresses of local stack memory, which become dangling pointers once the
Draw() call completes. This currently doesn't cause any issues as that
memory doesn't get accessed outside of the Draw() function, but lets take
the opportunity to improve our book keeping and don't allow invalid
references.

Also, simplify the process of getting the filter_flags field.

KW-122240
KW-122241

Jira: GSE-1587
Test: Build and try media demo apps

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>