OSDN Git Service
Kalyan Kondapally [Fri, 1 Sep 2017 23:22:57 +0000 (16:22 -0700)]
Fix segfault when shutting down.
DisplayQueue was calling a virtual function of Display in
SetPowerMode, which was getting called from destructor after
the object has been deleted. Let's make sure all the power off
operations are handled before display is destroyed.
Jira: None.
Test: No segfault during destruction of test apps on Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Johnson Lin [Fri, 1 Sep 2017 07:31:37 +0000 (15:31 +0800)]
Formats: Add HAL_PIXEL_FORMAT_YCbCr_422_888
Previously the format is not tested
Jira: None
Test: All formats from 61 to 77 are tested; YUV formats rendered correctly
Signed-off-by: Johnson Lin <johnson.lin@intel.com>
Fan, Yugang [Fri, 1 Sep 2017 14:04:22 +0000 (10:04 -0400)]
Fix wrong NV21 and ycbcr_444_888 lineBytes/height issue in video test.
Updated NV21 lineBytes and ycbcr_444_888 height to show test images
normally.
Rename the test image generated by ffmpeg with the same name style.
Jira: None
Test: Use video1layer_ycrcb_420_sp.json and video1layer_ycbcr_444_888.json
as the test json file to render the test images, the rendering shows
normally.
Signed-off-by: Yugang Fan <yugang.fan@intel.com>
Signed-off-by: johnson.lin <johnson.lin@intel.com>
Fan, Yugang [Fri, 1 Sep 2017 10:48:57 +0000 (06:48 -0400)]
Fix wrong NV16 lineBytes issue in video test.
NV16 have the same lineBytes with NV12, this commit just fixed old
wrong lineBytes.
Jira: None
Test: Use video1layer_yuv422sp.json as the test json file to render
the NV16 test image, the rendering shows normally.
Signed-off-by: Yugang Fan <yugang.fan@intel.com>
Signed-off-by: johnson.lin <johnson.lin@intel.com>
johnson.lin [Thu, 31 Aug 2017 20:02:42 +0000 (13:02 -0700)]
Add missing support for packed and planar YUV formats.
We where missing basic handling of some of these formats, which
this patch adds. We are now passing 8 tests related to Media format
handling.
Jira: None
Test: Run Format related tests on Linux and Android and check tests
related to NV* formats are all passing.
Signed-off-by: johnson.lin <johnson.lin@intel.com>
Fan, Yugang [Thu, 24 Aug 2017 07:06:26 +0000 (15:06 +0800)]
Add tool to generate test example images
This tool can be used to generate the test image for testlayers and
includes command lines examples for users reference.
Jira: None
Test: Follow the README.md to build and generate the test images which
can be used by testlayers for memory format testing.
Signed-off-by: Yugang Fan <yugang.fan@intel.com>
johnson.lin [Thu, 31 Aug 2017 07:49:26 +0000 (00:49 -0700)]
Add tests for YUV formats.
This patch adds support for testing YUV formats.
Jira: None.
Test: Build passes on Linux and Android. Test apps using
NV12 buffers is about to show content on screen.
Signed-off-by: johnson.lin <johnson.lin@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
johnson.lin [Thu, 31 Aug 2017 07:46:24 +0000 (00:46 -0700)]
Test: Fix data upload to bo.
Instead of using bo widht/height which may be different with source
width/height due to alignment, origin source width/height should be
remembered and used when upload data
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
johnson.lin [Tue, 4 Jul 2017 08:38:05 +0000 (16:38 +0800)]
Linux: correct logic for get fd for multiple planes format
Each plane should have it is own fd instead of only use
the first plane fd. Multiple plane format include NV12,
YUV420 etc
Jira: None.
Test: Importing YUV buffers succeds on Linux.
Signed-off-by: johnson.lin <johnson.lin@intel.com>
Kalyan Kondapally [Wed, 30 Aug 2017 22:26:07 +0000 (15:26 -0700)]
Re-calculate size after populating layers.
We may have skipped layers which are not visible and hence
size should be updated once we populate all OverlayLayers.
Jira: None.
Test: Build passes and no regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 28 Aug 2017 06:47:40 +0000 (23:47 -0700)]
Fix SurfaceDamage tracking.
We always marked the whole surface damaged as we used to
save lastsurfacedamage same as surface_damage_ in NativeSurface.
Instead, it should have been equal to current surface damage.
This patch fixes it.
Jira: None.
Test: Check the unnecessary layers are not re-rendered when moving
cursor.
Change-Id: Ic15c71dc90c56695fc833d15be03e37b7f3db247
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 26 Aug 2017 20:39:17 +0000 (13:39 -0700)]
Let's hold on to buffers for an extra frame before releasing them.
In cases where layers are changing in consecutive frames, we ended
up releasing and allocating memory. Instead let's hold onto back
buffers till we have frames where validation is not needed. This
way we are able to re-use already allocated buffers than ending
up in this loop of release/re-allocate memory.
Jira: None.
Test: Check that we dont do unnecessary reallocations when content
changes on screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 26 Aug 2017 03:25:35 +0000 (20:25 -0700)]
Remove un-used refresh variable.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 26 Aug 2017 09:23:09 +0000 (02:23 -0700)]
Ensure display rect has changed before allocating new buffers.
Sometimes, displayframe position is changed but doesn't affect
the size. Let's ensure we don't re-allocate buffers in this
case.
Jira: None.
Test: No regressions with tests on Linux
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 25 Aug 2017 22:08:26 +0000 (15:08 -0700)]
Move ValidatePreviousFrameState internal to OverlayLayer.
We can handle this during InitializeFromHwcLayer call and
can make it private.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 25 Aug 2017 20:02:56 +0000 (13:02 -0700)]
Mark back buffers free to be recycled.
When validating layers, let's mark any allocated back buffers free
to be re-cycled. This helps avoid un-necessary memory allocations.
Jira: None.
Test: No flickers on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 25 Aug 2017 07:10:14 +0000 (00:10 -0700)]
Move redundant calculations to hwclayer.
Displayframe, transforms might not change for every update, let's
cache them in hwclayer instead of re-calculating them every time
in Overlay Layer.
Change-Id: If2703449bc6e317cdd5b2d235982c08a74eafb1c
Jira: None.
Test: All tests on Linux pass as before.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 25 Aug 2017 05:03:49 +0000 (22:03 -0700)]
Allocate buffers of needed size only.
Currently, when falling back to 3D Composition, we allocate
buffers equal to that of resolution. Instead, let's allocate
buffer equal to size of the display rect of plane.
Change-Id: Ifb26a9d45af47926e0b0791aac191ad08243bddc
Jira: None.
Test: No graphics regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 22 Aug 2017 19:50:51 +0000 (12:50 -0700)]
Get source layers from current plane.
We can ignore cursor layer when populating current planes.
Let's take this into account when calculating surface damage
for the current frame.
Jira: None.
Test: No graphics artifacts on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Gao Chun [Tue, 30 May 2017 07:03:43 +0000 (15:03 +0800)]
Add color format mapping from native format to vulkan
Only add the vulkan corlor formats that has corresponding
gbm and drm formats.
Jira: IAHWC-40
Test: Build passes on Linux and Android.
Signed-off-by: Gao Chun <chun.gao@intel.com>
Gao Chun [Thu, 25 May 2017 05:55:15 +0000 (13:55 +0800)]
Android: Build with vulkan source files
To compile with vulkan backend, edit device/intel/android_ia/androidia_
64/BoardConfig.mk, and add the following content:
BOARD_USES_VULKAN := true
Jira: IAHWC-40
Test: Build passes on Linux and Android.
Signed-off-by: Gao Chun <chun.gao@intel.com>
Yugang [Thu, 10 Aug 2017 11:17:20 +0000 (19:17 +0800)]
Change the init_frames place to load test json firstly.
Old place of init_frames() will load json after setting the display
mode/color correction, that causes testlayers always use the default
parameters.
Jira: None.
Test: Change the value of test json files (e.g. gamma*, power_mode*),
the testlayers will change the effects accordingly.
Signed-off-by: Fan Yugang <yugang.fan@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 21:31:47 +0000 (14:31 -0700)]
Don't force client composition when layer color is black and opaque.
If no content is available for enabled plane, it defaults to black.
Instead of forcing SurfaceFlinger to blend this together, lets
ignore this.
Jira: None.
Test: No graphics regressions.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 20:43:18 +0000 (13:43 -0700)]
Ensure we re-validate layers when more than 1 layer has been destroyed.
Jira: None.
Test: No crash when powering off the device.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 20:12:33 +0000 (13:12 -0700)]
Rework idle state detection logic.
With current logic, we have following issues:
1) We go into idle state, any change to time/status bar forces
us to re-validate layers. Than we force ourselves immediately
to idle mode and cycle continues.
2) Our threshold is too low forcing us to go to single plane
composition in some of the offscreen benchmarks.
To address 1:
If we have continuous 5 frames, we reset idle frame counter
to zero. If updates are not continuous, we wait for same
no of frames before increasing idle frame counter.
To address 2:
Increased the threshold to 4000 vblank events of no activity
before assuming we are in idle mode.
Jira: None.
Test: We don't trigger unwanted idle frame updates.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 20:08:23 +0000 (13:08 -0700)]
Use flags instead of bool to track Cursor state.
Jira: None.
Test: Build passes and we don't invalidate layers when only cursor
visibility state has changed.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 08:52:07 +0000 (01:52 -0700)]
Ensure we fall back to GPU Composition when commit fails.
If only cursor layer is added and rest of layers remain same, we
add it to current set of planes to be composited. However, if the
test commit fails, we need to render cursor along with last layer
using GPU composition.
Jira: None.
Test: Cursor is visible on screen, even when test commit fails.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 04:25:27 +0000 (21:25 -0700)]
Add support to initialize Overlaylayer from HWCLayer.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 13 Aug 2017 09:30:37 +0000 (02:30 -0700)]
Dont invalidate Cache when cursor plane visibility state has changed.
Unless Cursor is GPU rendered, we have it in a separate plane.
There is no need to invalidate caches of all planes, in case only
cursor state has changed and nothing else.
Jira: None.
Test: Check that we dont invalidate cache when cursor becomes invisible/visible
and all other layers are same.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 10 Aug 2017 11:08:02 +0000 (04:08 -0700)]
Dont use MultiDisplayManager.
For some unknown reason surface flinger is failing to register
a new display for External ones. We where working around the
problem here which was fine for clone mode but extended mode
didn't work. Thus, remove this work around.
Jira: None.
Test: With changes in SurfaceFlinger, Extended and Cloned mode
both work.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
Kalyan Kondapally [Thu, 10 Aug 2017 09:29:03 +0000 (02:29 -0700)]
Ensure we dont set primary as clone for itself.
We where checking for type of display instead of the handle
to determine if display was primary or not. Type could be
same for primary and external displays. Let's ensure we use
handle to determine if display is primary or not.
Jira: None.
Test: Multi monitor cloned mode still works on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 10 Aug 2017 04:29:18 +0000 (21:29 -0700)]
Ensure we pick up the first connected display as Primary.
We pickup display randomly, instead we should check if it's connected
before choosing it as primary. If no display is connected, we
choose the first in list.
Jira: IAHWC-80
Test: Both displays come up on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Harish Krupo [Wed, 9 Aug 2017 06:11:29 +0000 (11:41 +0530)]
Disable SetCursorPosition usage
According to the spec setting the cursor composition to
device disables the use SetCursorPosition by SurfaceFlinger.
For now we are not using this so inform SurfaceFlinger
about the same
Jira: None
Tests: System doesn't crash when moving the mouse
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Lattannavar, Sameer [Wed, 9 Aug 2017 05:30:31 +0000 (22:30 -0700)]
Partial revert of "Clear Surface when display/src rect has changed".
Caused performance degration when panning/scrolling.
Jira: None.
Test: No garbage shown when moving virtual display.
Mostly in this case, we are either scrolling or panning.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Lattannavar, Sameer <sameer.lattannavar@intel.com>
Kalyan Kondapally [Wed, 9 Aug 2017 02:25:04 +0000 (19:25 -0700)]
Move all 3D rendering to a separate thread.
We might have different threads calling Present call. As, we
initialize context first time required, making it current on a
different thread will cause EGL_BAD_ACCESS errors.
Jira: None.
Test: System doesn't hang when using Virtual display (simulated display)
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kishore Kadiyala [Mon, 7 Aug 2017 05:52:53 +0000 (22:52 -0700)]
Add lock for mode setters/getters.
We set modes to drmdisplay in a separate thread and query these
values in a separate thread. Let's have a lock to ensure we handle
these operations in a synchronized fashion.
Jira: None.
Test: Boots to home screen without any crashes.
Signed-off-by: Kishore Kadiyala <kishore.kadiyala@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 08:29:01 +0000 (01:29 -0700)]
Fix flicker when moving layer position.
We where not saving the calculated surface damage in NativeSurface
but instead the one passed from DisplayQueue. This is not
correct as calculated one in NativeSurface might differ.
Jira: None.
Test: Simulate Secondary Display from Developer options on Android.
Moving secondary display around should not cause any flicker.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 07:50:08 +0000 (00:50 -0700)]
Insert acquire fences into 3D pipeline as needed.
When we fallback to 3D composition, we need to wait
for acquire fences to be signalled before reading from
the buffer. Instead of polling let's insert fence into the
3D queue.
Jira: None.
Test: Reduced flickering when launching applications
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 07:20:13 +0000 (00:20 -0700)]
Release surfaces after updating the state of current frame.
We currently release surfaces before setting appropriate state
for current frame. Releasing surfaces after this would ensure
we free surfaces which are freed in the current frame.
Jira: None.
Test: No flicker observed on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 04:42:18 +0000 (21:42 -0700)]
Track Scissor rect separately in RenderState.
Scissor rect should be clamped to surface damage in case
we are not clearing the surface. Calculate this in render
state seprately and set that as scissor rect when drawing
the layer.
Jira: None.
Test: No rendering artifacts on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 04:28:16 +0000 (21:28 -0700)]
Use SurfaceDamage of layer instead of DisplayFrame Rect.
Jira: None.
Test: No graphics regression on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 01:55:51 +0000 (18:55 -0700)]
Avoid creating render states for layers not part of surface damage.
We where rejecting these layers during draw call but we can already
do this during render state calculations.
Jira: None.
Test: No graphics regressions on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 6 Aug 2017 01:25:11 +0000 (18:25 -0700)]
Dont mark display as cloned when type == VirtualDisplay.
Jira: None.
Test: System doesn't hang when selecting secondary display from settings.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 5 Aug 2017 06:26:26 +0000 (23:26 -0700)]
Remove unused variables.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 5 Aug 2017 06:21:12 +0000 (23:21 -0700)]
Unify cpp flags with rest of stack.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Harish Krupo [Mon, 31 Jul 2017 16:49:57 +0000 (22:19 +0530)]
Fix hang during boot up
Jira: None
Tests: Boots to home screen.
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kalyan Kondapally [Fri, 28 Jul 2017 17:40:30 +0000 (13:40 -0400)]
Partial revert of
86099e12ed6b94b8f913c715da533a4156dc4dfd
Looks like this is causing issues on platforms
like Baytrail.
Jira: https://01.org/jira/browse/AIA-430
Test: Display comes back up when powering back on.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Michael Goffioul [Fri, 28 Jul 2017 16:54:46 +0000 (12:54 -0400)]
Fix screen-off problem.
There's a missing drmModeAtomicCommit call when disabling the display.
This can lead to display freeze when turning the screen back on.
Jira: https://01.org/jira/browse/AIA-430
Test: Display comes back up when powering back on.
Signed-off-by: Michael Goffioul <michael.goffioul@gmail.com>
Kalyan Kondapally [Wed, 26 Jul 2017 21:17:13 +0000 (17:17 -0400)]
Ensure we release any GL resources before shutting down display.
Jira: None.
Test: No regressions found on Android with SKL device.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 25 Jul 2017 07:08:52 +0000 (03:08 -0400)]
Rename HwcLayer to Hwc2Layer.
This is to avoid confusion between HWCLayer in core/
and in iahwc2.
Jira: None
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 24 Jul 2017 02:50:35 +0000 (22:50 -0400)]
Remove MarkBackBuffersForReUse.
We might end up re-using buffers for rendering which are being
scanned out. Remove this.
Jira: None.
Test: Flickers are minimized on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Poornima [Wed, 26 Jul 2017 09:32:53 +0000 (15:02 +0530)]
Fix for stack corruption and solve Multi-Mode config enumeration issue.
Multi-Mode config enumeration got broken in the commit ID
deb0866. Fixed the same.
Also stack corruption introduced while enabling HWC1.5 is
resolved by reverting usage of local var to store number
of config.
Jira: IAHWC-81
Test: No Stack corruption during HWC init on Android boot-up
Signed-off-by: Poornima <poornima.y.n@intel.com>
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
nkumarch [Mon, 17 Jul 2017 09:27:51 +0000 (14:57 +0530)]
Doing fresh clone for libdrm, mesa and minigbm for Travis CI
Jira: None.
Test: Travis CI build passes.
Signed-off-by: nkumarch <naveen.kumar.chaudhary@intel.com>
Kalyan Kondapally [Mon, 24 Jul 2017 17:12:15 +0000 (13:12 -0400)]
Comment out hwc-val include for now.
This broke eng builds as the files are not part of the
repo yet.
Jira: None.
Test: Eng build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 08:05:37 +0000 (04:05 -0400)]
HWC1.5: Skip layer if composition type is HWC_FRAMEBUFFER_TARGET.
From documentation:
" Always set by the caller before calling (*prepare)(), this value
indicates this layer is the framebuffer surface used as the target of
OpenGL ES composition. If the HWC sets all other layers to HWC_OVERLAY
or HWC_BACKGROUND, then no OpenGL ES composition will be done, and
this layer should be ignored during set()."
Jira: None.
Test: Check that we dont have garbage rendered when we have only
one layer which is being scanned out directly on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 07:26:06 +0000 (03:26 -0400)]
Replace BOARD_USES_HWC1 with TARGET_USES_HWC2.
Jira: None.
Test: Build passes on Android with HWC2 support enabled and disabled.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 04:48:40 +0000 (00:48 -0400)]
HWC1.5: Add dummy implementation for setCursorPositionAsync.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 04:19:14 +0000 (00:19 -0400)]
HWC1.5: Enable Surface damage support.
If handle of a given layer remains same over two consecutive Set calls,
we assume surface damage as Null.
Jira: None.
Test: No graphics regressions on Android with HWC 1.5.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 02:40:13 +0000 (22:40 -0400)]
Remove redundant code.
Jira: None.
Test: Build passes on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 23 Jul 2017 00:33:06 +0000 (20:33 -0400)]
HWC 1.5: Ensure we set overlay composition for layers as supported.
We should be able to handle all layers except for Background
and Sideband. Let's set that correctly in Prepare.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 22 Jul 2017 23:10:33 +0000 (19:10 -0400)]
Enable support to opt for Double/tripple buffering.
Android M seems to use double buffering while with 2.0 we expect
triple buffering. Also, our linux tests use double buffering.
Let's have an option for systems to define what they use, this
basically changes the way we wait on kms fence i.e. with double
buffering we poll on it once commit has been done.
Jira: None.
Test: No tearing seen with apps on Linux and HWC1.5.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 22 Jul 2017 08:15:44 +0000 (04:15 -0400)]
Android: Add HWC 1.5 support.
We want to enable Android M support but M only supports
version <2.0 HWC. Let's enable support for HWC 1.5.
Support is enabled only if BOARD_USES_HWC1 is set to
true in BoardConfig.
Jira: None.
Test: System boots up to Home screen.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Munish Bhardwaj [Fri, 21 Jul 2017 06:52:04 +0000 (12:22 +0530)]
Initial patch to enable HWC Validation code
This will use HWCService eventually to run the tests.
Jira: IAHWC-78.
Test: Build passes.
Signed-off-by: Munish Bhardwaj <munishx.bhardwaj@intel.com>
Fan, Yugang [Wed, 19 Jul 2017 08:36:26 +0000 (16:36 +0800)]
Update the HWC ebuild file to support .so and binary installation.
Latest HWC will install shared lib .so files and testlayers binary
will be generated after the "make install", to align with latest
HWC source, this commit will support .so files and testlayers
installation(not install test json example files).
Jira: None
Tests: Build HWC in Chrome OS SDK with this ebuild file without
error, and deploy the HWC package to Chrome OS device
without error, the testlayers can be executed normally
with the shared the libhwcomposer.so.* installed.
Signed-off-by: Yugang Fan <yugang.fan@intel.com>
Poornima [Tue, 18 Jul 2017 05:41:31 +0000 (11:11 +0530)]
Added Support to test displayModes related APIs using HWC service
Usage:
/system/bin/hwcmode [displayId <print/get/set <displayconfigindex>>]
Jira: IAHWC-78.
Test: Able to test all the display mode related APIs.
Signed-off-by: poornima.y.n@intel.com
Harish Krupo [Tue, 18 Jul 2017 07:33:26 +0000 (03:33 -0400)]
Fix tearing issue in multi display mode
Jira: IAHWC-80
Tests: No tearing is observed on all the displays
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kalyan Kondapally [Tue, 18 Jul 2017 07:26:00 +0000 (03:26 -0400)]
REVERTME: Android: Don't register more than one display for hot plug event.
For some reason this is causing tearing during scrolling.
Jira: IAHWC-80
Test: No tearing seen during scrolling.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 18 Jul 2017 01:21:06 +0000 (21:21 -0400)]
Add Basic DisplayManagement for Android.
This tracks down for displays in extended mode and ensuring we
fall back to cloned mode as needed.
Jira: IAHWC-80
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Harish Krupo [Mon, 17 Jul 2017 16:29:11 +0000 (21:59 +0530)]
Remove unneeded break if encoder is found
When an encoder is found for the first connector, the
variable found_encoder is set to true which then causes
the loop to terminate unnecessarily. This causes only one
connector to be detected at boot time.
Jira: IAHWC-80
Tests: On boot, more than one connected displays are identified.
Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
Kalyan Kondapally [Mon, 17 Jul 2017 01:09:03 +0000 (21:09 -0400)]
Android: Enable support for Extended mode.
There seems to be no definitive way to track extended and cloned
mode here. What we do is if we get a ValidateDisplay request
for a display in cloned mode, we assume we will have a separate
update request for this display and disable the cloned mode.
Jira: IAHWC-80
Test: Extended mode works as expected on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Mon, 17 Jul 2017 01:01:51 +0000 (21:01 -0400)]
Disable Idle frame tracking for displays in cloned mode.
This should be coming from display owning the presentation
of these cloned displays.
Jira: IAHWC-80.
Test: Multiple displays work fine on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 16 Jul 2017 22:57:32 +0000 (18:57 -0400)]
Add support for clone Mode.
Not sure how to determine if we want to be in extended
or cloned mode in multi montior case. For now we default
to Cloned mode and this will need finetuning when we
have a better understanding of extended mode on Android.
There is a known issue that if external display is not
connected during boot up of Android, than it is never
recognized after that for some reason.
Jira: IAHWC-80
Test: Linux test apps and Android switches to clone mode
automatically when multiple display are connected.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 16 Jul 2017 18:15:30 +0000 (14:15 -0400)]
Add support for scaling layers.
External display might have a difference resolution compared to
primary and when in clone mode we would need to scale layers to
match the resolution. For now this results in gpu composition of
all layers but in future we could use pipe scalar to scale the
layers.
Jira: IAHWC-80
Test: Linux test apps scale layers automatically when external
display and primary display resolutions don't match.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 15 Jul 2017 07:43:16 +0000 (03:43 -0400)]
Fix Linux builds.
Jira: None.
Test: Build passes on Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 09:58:24 +0000 (05:58 -0400)]
Initial plumbing to enable multi display support.
Android relies on HotPlug event call back to determine if certain
display is connected or disconnected. Hook this up to notify
Android as and when Display connection status change.
Jira: IAHWC-80
Test: Linux tests work fine in multi monitor case
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 15 Jul 2017 03:39:59 +0000 (23:39 -0400)]
Add missing license.
Jira: None.
Test: Build passes on Linux and Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 08:13:46 +0000 (04:13 -0400)]
Rename drmhwctwo to iahwc2.
Jira: None.
Test: Build compiles on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Fri, 14 Jul 2017 08:20:24 +0000 (04:20 -0400)]
Revert "Rename drmhwctwo to iahwc2."
This reverts commit
7315927a01fc6619bd03e25562b3dbe26ddf8e4e.
Kalyan Kondapally [Thu, 13 Jul 2017 23:41:50 +0000 (19:41 -0400)]
Use flags instead of bool to track state in DisplayQueue.
Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 13 Jul 2017 22:46:05 +0000 (18:46 -0400)]
Add support for other apps to control display during startup.
On certain platforms, there is a need to give applications
control of display during boot up and ignore updates in hwc
Jira: None.
Test: Boot to home screen with and without hwc.lock present.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 22:19:28 +0000 (18:19 -0400)]
Rename drmhwctwo to iahwc2.
Jira: None.
Test: Build compiles on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 08:13:20 +0000 (04:13 -0400)]
Remove redundant z_order variable in drmhwctwo.
Jira: None.
Test: Build passes on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 12 Jul 2017 07:59:42 +0000 (03:59 -0400)]
Remove redundant code.
Jira: None.
Test: Build passes.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 11 Jul 2017 06:54:03 +0000 (02:54 -0400)]
Resize viewport when display rect has changed.
We assumed that display rect of a given surface would never
change. However, this is not true with caching since, we re-use
the same surface and in case of 3D Composition we need to ensure
the viewport is updated to be same as Display frame rect.
Jira: IAHWC-79
Test: When resized to full screen, we don't see any intermediate
frames with old size.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Jeevaka Prabu Badrappan [Fri, 7 Jul 2017 09:21:55 +0000 (14:51 +0530)]
Replace Mutex with SpinLock
Jira: IAHWC-78
Test: Build compiles.
Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan@intel.com>
Kalyan Kondapally [Mon, 10 Jul 2017 05:57:47 +0000 (01:57 -0400)]
Reset continuous frames to 0 when we have idle frame.
When system is idle, we may still have update coming in every time
system time changes etc. Re-validating layers in this case is
redundant operation, instead let's reset continuous frame counter
to "0" in case we have a idle frame. This will ensure we dont
un-necessarily re-validate layers.
Jira: None.
Test: Check that we dont re-validate layers after going to idle mode
unless really needed.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 9 Jul 2017 22:09:58 +0000 (18:09 -0400)]
Release GPU Resources after rendering layers.
Instead of releasing GPU resources in DisplayQueue, handle it
in Compositor itself.
Jira: None.
Test: SHmem doesn't grow when u launch and close applications.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sun, 9 Jul 2017 21:37:16 +0000 (17:37 -0400)]
Close Buffer handle when we are done using it.
Jira: None.
Test: Gralloc handle is closed when NativeBufferHandler is closed.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 22:43:00 +0000 (18:43 -0400)]
Set correct state to layer when we fall back to GPU Composition.
We didn't set the correct state for overlay layer in case primary
layer had to go through GPU composition before being shown on
display. This patch fixes this.
Jira: None.
Test: Check that we dont re-validate layers during start up.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 08:45:45 +0000 (04:45 -0400)]
Reset surface damage when ever layer dimension changes.
Instead of complicating surface damage logic, if any layer position
changes let's reset the surface damage and clear the whole surface.
Jira: None.
Test: Check that bluetooth icon don't flicker during update.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Sat, 8 Jul 2017 05:34:00 +0000 (01:34 -0400)]
VirtualDisplay: Render layers only if content has changed.
Currently, we composite layers even though nothing might have
changed, instead lets continue to show previous composition
results in case nothing has changed.
Jira: None.
Test: No rendering artifacts with secondary display enabled
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 21:14:02 +0000 (17:14 -0400)]
Ignore idle refresh when power mode is set to off.
Surfaceflinger doesn't expect any updates to happen when system
goes to idle mode as it has already cleared buffer queue in this
case. We might end up calling idle refresh as we detect no
activity for last few frames, to avoid competing with Surface
flinger lets avoid requesting display refresh in case system is
in the process of being powered off.
Jira: None.
Test: From developer options enable secondary display and let system
go to idle mode. Ensure that system doesnt reboot but we can
bring it back to active state by moving cursor.
Kalyan Kondapally [Thu, 6 Jul 2017 19:42:05 +0000 (15:42 -0400)]
Explicitly delete GPU Resources with offscreen rendering.
We could fail offscreen rendering for various reasons, let's make
sure we are doing proper cleanup of GPU resources in this case.
Jira: None.
Test: System doesnt restart itself within 1-5 mins when simulating
secondary display.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 10:37:16 +0000 (06:37 -0400)]
Dont update VirtualDisplay when powermode state is not kon.
We can be doze mode or off mode. In these cases we should ignore
any update requests in virtual display.
Jira: None.
Test: When going to idle mode, we dont see any EGLContext related
errors in logcat eventually leading to system reboot.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Thu, 6 Jul 2017 08:46:55 +0000 (04:46 -0400)]
Clear surface when display/src rect has changed.
We track width/height changes as part of surface damage but dont
accurately track position changes causing rendering issues with
cursor. Let's ignore surface damage when position has changed till
we are able to accurately track this.
Jira: None.
Test: Cursor renders fine when GPU composited.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Wed, 5 Jul 2017 00:20:47 +0000 (20:20 -0400)]
Align Surfacedamage semantics with Android.
From Android hwc2 documentation:
"Once set through this function, the damage region remains
the same until a subsequent call to this function."
Let's align to this expectation and lot easier as there
should be no need to update Surfacedamage if it hasn't
changed over frames.
Jira: None.
Test: This is more for API alignment.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 16:37:25 +0000 (12:37 -0400)]
Dont re-validate layes if display/src rects/content attributes have changed.
We might be rendering layers using 3D or Display composition. In
case of 3D we don't have to worry re-validating the layers as we
blit them to an offscreen surface before scanning out.
Jira: None.
Test: No graphics regression on Android and Linux.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 13:53:50 +0000 (09:53 -0400)]
Release GPU resources agressively.
We now track all fb, texture resources and explicitly delete them
when surface is being deleted instead of how we do it today which
is after couple of frames.
Jira: None.
Test: Check that shmem doesn't increase dramatically when moving
between applications.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 12:49:06 +0000 (08:49 -0400)]
Release unused memory when commit is ignored.
Let's release any free surfaces when we ignore commits, so we
dont hold on to unnecessary memory.
Jira: None.
Test: Memory doesn't increase when commits are ignored.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Kalyan Kondapally [Tue, 4 Jul 2017 11:08:45 +0000 (07:08 -0400)]
Take into consideration previous layer damage.
Jira: None.
Test: When cursor is gpu rendered, one should not see the image
still in old position when it's being moved around.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>