OSDN Git Service

android-x86/external-IA-Hardware-Composer.git
7 years agoAlgorithm to detect disjoint regions for gpu composition.
arpallet [Sun, 29 Jan 2017 06:55:11 +0000 (22:55 -0800)]
Algorithm to detect disjoint regions for gpu composition.

This algorithm traverse through x co-ordinates and at each
intersection of x co-ordinates, it will traverse through y
axis for intersections. At each y co-ordinate intersection
it will give out new layer with input layer ids active at
that point.

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

Signed-off-by: arpallet <avinash.reddy.palleti@intel.com>
7 years agoWe should have only one primary and cursor per display.
Kalyan Kondapally [Mon, 30 Jan 2017 02:36:09 +0000 (18:36 -0800)]
We should have only one primary and cursor per display.

We expected one primary and maximum of one cursor plane to be
dedicated per display. There is no need to maintain a list of
these planes like now.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoHandle DPMS mode setting immediately.
Kalyan Kondapally [Sun, 29 Jan 2017 22:02:41 +0000 (14:02 -0800)]
Handle DPMS mode setting immediately.

We handle any pending modeset, dpms related operations together
while presenting layers. While this is fine for modeset, we may not
have another present call when application requested us to set the
mode to DPMS_OFF. Handle these calls immediately.

Jira: None.
Test: No regressions on Android or Linux test apps.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoDo proper clean up of modeset blobs.
Kalyan Kondapally [Sun, 29 Jan 2017 21:45:47 +0000 (13:45 -0800)]
Do proper clean up of modeset blobs.

We dont release the old modeset blobs until SetActiveConfig is
called. This may not be true if app expects us to handle this
ourselves (using preferred config). Lets ensure when ever we do
modeset, we clear the old blob and create a new one.

Jira: None.
Test: Check we dont leak memory related to modeset blobs with test
      apps on Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoEnsure we have internal display first in list of connected displays.
Kalyan Kondapally [Sun, 29 Jan 2017 11:54:36 +0000 (03:54 -0800)]
Ensure we have internal display first in list of connected displays.

We connect possible displays, than iterate through all of them to
populate connected displays. This was fine when pipe 0 was always
connected to internal/primary display. However on devices which
use pipe 1 as primary we ended up still using pipe 0. Now,
we populated connected displays list as we make the connection.

Jira: AIA-120
Test: Boots to Android Screenshot on BDW device. No regressions on
      Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoCheck for supported formats before creating fbs for native
Kalyan Kondapally [Sun, 29 Jan 2017 03:00:09 +0000 (19:00 -0800)]
Check for supported formats before creating fbs for native
 surface.

We always create RGBA buffers for these surfaces but we might not
be able to support this format during scanout. Now, instead of
making an assumption, we check if this format is supported and
if not fall back to RGBX.

Jira: AIA-120
Test: No graphics regressions on Android and Linux. Home screen
      is visible on HSW device.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoFix surfaceflinger crash when not connected to an display.
Kalyan Kondapally [Sat, 28 Jan 2017 09:28:17 +0000 (01:28 -0800)]
Fix surfaceflinger crash when not connected to an display.

Surfaceflinger expects atleast one active config and GetActiveConfig
to succeed. We should be returning true in GetActiveConfig call
after setting the config but we returned false causing crashes
in Surfaceflinger side.

Jira: None.
Test: No crashes seen when no display is connected.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoAdd support for extending tests and configuring them in json file.
Johnson Lin [Thu, 26 Jan 2017 08:46:52 +0000 (16:46 +0800)]
Add support for extending tests and configuring them in json file.

We are able to configure the no of layers, type of layers etc from
json file. Video test doesnt work yet.

Main idea:
1: different layers can have different renderers
2: read configuration from json file for the parameters

thrid_pary Json_c is actually a submodule;
Use these commands:
cd tests/third_pary/json_c
./autogen.sh --prefix=$WLD
make
cd ../../../
./autogen.sh --prefix=$WLD
make

run the commands:
cd tests
./testlayers -j ./jsonconfigs/kmscube1layer.json

Jira: None.
Test: Build passes on linux and able to run kmscube demo.

Signed-off-by: johnson.lin <johnson.lin@intel.com>
7 years agoDont pass EGL_SYNC_FLUSH_COMMANDS_BIT_KHR.
Kalyan Kondapally [Thu, 26 Jan 2017 02:47:38 +0000 (18:47 -0800)]
Dont pass EGL_SYNC_FLUSH_COMMANDS_BIT_KHR.

Mesa generates invalid argument error with this and seems to
work fine without it.

Jira: None
Test: No more errors from Mesa related to EGL Fence in logcat.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoCorrect the RefreshRate Query in HWC
Randy Xu [Wed, 25 Jan 2017 00:33:59 +0000 (08:33 +0800)]
Correct the RefreshRate Query in HWC

The expected value of kRefreshRate is nanosecond in a vsync cycle, while the code return fps by mistake.
It causes wrong fps count in Android framework, and the "dumpsys display" shows the fps is 1.66666667e7.
The Choreographer shows below error continuously
"The application may be doing too much work on its main thread."

Jira: None.
Test: Build and boots to home screen.

Signed-off-by: Randy Xu <randy.xu@intel.com>
7 years agoSquash BoardConfig flags.
Kalyan Kondapally [Tue, 24 Jan 2017 10:00:23 +0000 (02:00 -0800)]
Squash BoardConfig flags.

Lets just use BOARD_DISABLE_EXPLICIT_SYNC to disable explicit sync
and Overlay support.

Jira: None.
Test: Build passes.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoMake Choregrapher happy.
Kalyan Kondapally [Tue, 24 Jan 2017 02:59:58 +0000 (18:59 -0800)]
Make Choregrapher happy.

We currently send Vblank callbacks only when we have a valid commit.
However, Choregrapher seems to expect for every vblank. We now
keep track of vblank events using drmWaitVBlank and send the
callbacks.

Jira: AIA-115.
Test: No complaints from Choregrapher about skipped frames and no
      regressions with test demos on Linux.

7 years agoManage sync time line within planemanager.
Kalyan Kondapally [Mon, 23 Jan 2017 23:28:46 +0000 (15:28 -0800)]
Manage sync time line within planemanager.

We now rely on PageFlipEevent to do this but we keep track of
buffers in use in PlaneManager anyway, lets do the same for sync
timeline. This way we dont need to depend on PageFlipEvent and
can just track vblank events in a separate thread in follow up
patch.

Jira: None.
Test: Builds and boots to home screen. No graphics regression.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agodrm_hwcomposer: in case of EBUSY, spin until commit succeeded
Tapani Pälli [Mon, 23 Jan 2017 22:03:21 +0000 (14:03 -0800)]
drm_hwcomposer: in case of EBUSY, spin until commit succeeded

Use this path when explicit fence is not supported.

Bug: #11
Test: AnTuTu Marooned demo works correctly
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
7 years agoOnly build if BOARD_USES_IA_HWCOMPOSER is set
Marta Lofstedt [Thu, 19 Jan 2017 14:28:29 +0000 (16:28 +0200)]
Only build if BOARD_USES_IA_HWCOMPOSER is set

Jira: None
Test: Build and boot to homescreen

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
7 years agoMaintain compatibility with existing GRALLOC_MODULE_PERFORM_DRM_IMPORT.
Kalyan Kondapally [Mon, 23 Jan 2017 14:56:46 +0000 (06:56 -0800)]
Maintain compatibility with existing GRALLOC_MODULE_PERFORM_DRM_IMPORT.

This way we can use drm_gralloc with no additional changes needed
specifically for us.

Jira: None.
Test: Builds and boots to home screen.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoUse GraphicBuffer APIS to allocate buffers.
Kalyan Kondapally [Mon, 23 Jan 2017 13:30:56 +0000 (05:30 -0800)]
Use GraphicBuffer APIS to allocate buffers.

This way we dont need any new APIS in Gralloc implementation which
are not required by anyone else.

Jira: None:
Test: Builds and boots to home screen.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoCleanup: Remove redundant logging.
Kalyan Kondapally [Sun, 22 Jan 2017 21:15:46 +0000 (13:15 -0800)]
Cleanup: Remove redundant logging.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoFix double deletion issue.
Kalyan Kondapally [Sun, 22 Jan 2017 20:49:17 +0000 (12:49 -0800)]
Fix double deletion issue.

We release native buffer in Surface and OverlayBuffer. We
need to do this only in NativeSurface as buffer is owned
by it.

Jira: None.
Test: Check Asan builds dont complain when test app is closed
      on Linux.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoEnsure we dont close gpu fd till all resources are released.
Kalyan Kondapally [Sun, 22 Jan 2017 20:49:17 +0000 (12:49 -0800)]
Ensure we dont close gpu fd till all resources are released.

We need to ensure we dont close the gpu fd till all resources
are released.

Jira: None.
Test: Run demos on linux and ensure we dont see any errors
      like "Failed to remove fb"

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoDont set wrap mode to GL_REPEAT.
Kalyan Kondapally [Sun, 22 Jan 2017 10:12:22 +0000 (02:12 -0800)]
Dont set wrap mode to GL_REPEAT.

From https://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt

"The default s and t wrap modes are CLAMP_TO_EDGE
        and it is an INVALID_ENUM error to set the wrap mode to any other
        value. "

Jira: None.
Test: Enable MESA_DEBUG=1 and check that Mesa doesnt throw INVALID_ENUM
      errors.

7 years agoRestore EGLContext state correctly during GLRenderer initialization.
Kalyan Kondapally [Sun, 22 Jan 2017 10:02:54 +0000 (02:02 -0800)]
Restore EGLContext state correctly during GLRenderer initialization.

We make our context current in GLRenderer initialization but never
restore it. This patch fixes it.

Jira: None.
Test: Test apps on Linux render correctly even when Overlay
      support is disabled.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoFix build warning.
Ragha Khandenahally [Sun, 22 Jan 2017 05:24:23 +0000 (21:24 -0800)]
Fix build warning.

Jira: None:
Test: No Graphics Regression.

Signed-off-by: Ragha Khandenahally <Ragha.Khandenahally@intel.com>
7 years agoAlways fall back to GPU when Overlay usage is disabled.
Ragha Khandenahally [Sun, 22 Jan 2017 05:21:47 +0000 (21:21 -0800)]
Always fall back to GPU when Overlay usage is disabled.

If DISABLE_OVERLAY_USAGE is defined, there is no need to do
atomic test commits as intention is that we will only recieve
final buffer which needs to be displayed.

Jira: None:
Test: No Graphics Regression.

Signed-off-by: Ragha Khandenahally <Ragha.Khandenahally@intel.com>
7 years agoEnsure format and usage are in right types.
Ragha Khandenahally [Sun, 22 Jan 2017 04:52:36 +0000 (20:52 -0800)]
Ensure format and usage are in right types.

In GRALLOC_MODULE_PERFORM_CREATE_BUFFER, expectation is
that usage and format are of type int. Lets make this explicit.

Jira: None.
Test: Boots to Animation screen on Android Things.

Signed-off-by: Ragha Khandenahally <Ragha.Khandenahally@intel.com>
7 years agoAdd Board Config option to disable Native Color Mode support.
Ragha Khandenahally [Sun, 22 Jan 2017 02:04:45 +0000 (18:04 -0800)]
Add Board Config option to disable Native Color Mode support.

Android Things frameworks still doesnt have support for this.
This patch adds support to disable this in HWC via Build Config
option.

Jira: None.
Test: Build passes.

Signed-off-by: Ragha Khandenahally <Ragha.Khandenahally@intel.com>
7 years agoNo need to maintain a cache of OverlayBuffers.
Kalyan Kondapally [Sat, 21 Jan 2017 08:18:09 +0000 (00:18 -0800)]
No need to maintain a cache of OverlayBuffers.

We cache imported buffers which is unneeded as Gralloc does it
already. Instead, what we try to ensure is have a reference to
the buffer till it is scanned out.

Jira: None.
Test: Doesnt regress Android, Test cases work on Linux.

7 years agoLinux: Make kmscube wait on the right fence.
Rafael Antognolli [Wed, 18 Jan 2017 18:23:32 +0000 (10:23 -0800)]
Linux: Make kmscube wait on the right fence.

Inside the main loop, when going to wait on the fence that informs that
the drm commit is finished, we need to wait on the fence from the
previous frame. The current frame is yet to be committed, so it has no
valid fence.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
7 years agoTests: Inital plumbing for connection change notifications.
johnson.lin [Wed, 18 Jan 2017 07:57:37 +0000 (15:57 +0800)]
Tests: Inital plumbing for connection change notifications.

In order to test multi monitor support, we need a way for test apps
to know when a display has been connected or disconnected. This
patch adds initial support for it but the hot plug events dont
yet work.

Jira:None.
Test:Kmscube works on external monitor.

Signed-off-by: johnson.lin <johnson.lin@intel.com>
7 years agoEnsure we are using the right connected display.
johnson.lin [Wed, 18 Jan 2017 07:54:32 +0000 (15:54 +0800)]
Ensure we are using the right connected display.

We assume that the first crtc is connected while it might
not be true depending on what you are using (i.e. HDMI, DP etc).
This patch fixes it.

Jira: None.
Test: KmsCube runs on external monitor connected via DP.

Signed-off-by: johnson.lin <johnson.lin@intel.com>
7 years agoLinux: Fix kms cube test case.
Kalyan Kondapally [Wed, 18 Jan 2017 00:08:40 +0000 (16:08 -0800)]
Linux: Fix kms cube test case.

When creating fbs to scanout buffers ensure they have the right
permissions. The buffer needs to be imported with card0 fd rather
than render node.

Jira: None.
Test: Builds on linux and kms cube demo works correctly.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoMake DisplayManager private in cpp file.
Kalyan Kondapally [Mon, 16 Jan 2017 10:09:13 +0000 (02:09 -0800)]
Make DisplayManager private in cpp file.

We dont need this in header file and avoids exposing other unneeded
headers like spinlock etc.

Jira: None.
Test: Builds and boots to home screen.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
7 years agoInitial import.
Kalyan Kondapally [Wed, 21 Dec 2016 21:06:52 +0000 (13:06 -0800)]
Initial import.

Includes Several commits:

commit aee43ab680941f5c7322cd62abb91b1ddf398852
Author: Kalyan Kondapally <kalyan.kondapally@intel.com>
Date:   Sat Jan 14 23:35:35 2017 -0800

    Fix issues related to Tests.

    This fixes the linking issues we had with some of the GL
    and EGL API. Test apps build and link but Atomic commit fails
    during run time.

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

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
commit 8ff76e215cfdb08a92382a11ea15ac3188ddf6fa
Author: Kalyan Kondapally <kalyan.kondapally@intel.com>
Date:   Sat Jan 14 16:47:26 2017 -0800

    Use sync wait instead of waiting in a loop to submit commit.

    Inspired by: https://github.com/rantogno/kmscube/commit/fc52268da79ed406da02c88f849f1ef70dab789f

    Jira: None.
    Test: Builds and boots to home screen. No Graphics regrssion.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
commit 3aa1ae042b9ccd7c4f768db0498a056b92903f71
Author: Johnson Lin <johnson.lin@intel.com>
Date:   Thu Jan 12 10:58:08 2017 +0800

    Add kmscube as test program

    Test program doesn't link yet. Imported from
    https://github.com/rantogno/kmscube

    Jira: None.
    Test: None.

commit 0f7cfbc9bc8fcec3e296433ac9d09e549cc4967c
Author: Tapani Pälli <tapani.palli@intel.com>
Date:   Tue Jan 10 06:58:27 2017 -0800

    hwcomposer: in case of EBUSY, spin until commit succeeded

    Bug: #11
    Test: AnTuTu Marooned demo works correctly
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Initial Linux support added by Johnson Lin <johnson.lin@intel.com>