OSDN Git Service
Chih-Wei Huang [Fri, 22 Sep 2017 09:16:23 +0000 (17:16 +0800)]
Merge remote-tracking branch 'chromium/master' into nougat-x86
Adrian Salido [Thu, 21 Sep 2017 22:32:22 +0000 (15:32 -0700)]
drm_hwcomposer: reorder source layers according to zorder
Precomp layers may be added to the back at different points which may
cause elements to be unsorted. Make sure that these are sorted after
provisioning planes to ensure right composition based on zorder.
Bug:
65587393
Change-Id: Ica6d12093818341eaeca6c63735c558511679f7b
Signed-off-by: Adrian Salido <salidoa@google.com>
Adrian Salido [Fri, 1 Sep 2017 20:22:17 +0000 (13:22 -0700)]
drm_hwcomposer: fix typo in formats switch statement
Change-Id: I71e116fff098860a2aecf587298e7696d4bef012
Adrian Salido [Tue, 29 Aug 2017 20:28:18 +0000 (13:28 -0700)]
drm_hwcomposer: enumerate additional formats for tegra downscale limits
There are additional formats that can be provided and are not handled.
Bug:
36731060
Change-Id: I9f1356762df71e38402ad01f96a650adf2a3cbdc
Signed-off-by: Adrian Salido <salidoa@google.com>
Adrian Salido [Tue, 22 Aug 2017 00:07:18 +0000 (17:07 -0700)]
drm_hwcomposer: skip layers with non-premult blending
Tegra driver assumes that all layers with alpha component have premult
alpha. This can cause issues if blending is different since the alpha
component is supposed to be ignored in that case.
Fixes:
62401826
Test: share location in hangouts and drag around map
Change-Id: Iff870697f7efbf5d075a5925d63a8f0f672ee725
Signed-off-by: Adrian Salido <salidoa@google.com>
Chih-Wei Huang [Fri, 28 Jul 2017 16:17:52 +0000 (00:17 +0800)]
drm_hwcomposer: add back HWC1 support
We still use the legacy drm_gralloc for GPUs that don't support
atomic mode setting. To support these GPUs in one SurfaceFlinger
implementation, we have to stay with HWC1.
Chih-Wei Huang [Fri, 21 Jul 2017 10:15:15 +0000 (18:15 +0800)]
Merge remote-tracking branch 'robherring/android-m' into nougat-x86
Conflicts:
Android.mk
drmdisplaycompositor.cpp
hwcomposer.cpp
Adrian Salido [Tue, 18 Jul 2017 00:58:50 +0000 (17:58 -0700)]
drm_hwcomposer: add checks for tegra hardware limitation
Current approach is to allow atomic_check figure out any issues with
composition strategy and fallback to squash if there the atomic_check
fails. This leads to issues when there's a protected content as it
cannot be handled in squash.
Adding a new provisioning stage to check for hardware limitations and
address them early so a proper fall back can be in place.
Bug:
36731060
Change-Id: I6482953044bcea9c9a655f28672927b32ac57097
Sean Paul [Fri, 12 May 2017 18:07:07 +0000 (14:07 -0400)]
drm_hwcomposer: Add Marissa and remove Haixia
Adding Marissa to OWNERS to get her listed on reviews.
While I'm in here, remove Haixia from OWNERS.
Change-Id: I6e07a686796c1d0cf3539be9bbdfc2b46dfb9938
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 4 May 2017 18:03:11 +0000 (18:03 +0000)]
Merge "drm_hwcomposer: Add support for GetColorModes & SetCursorPosition"
Adrian Salido [Tue, 25 Apr 2017 20:23:45 +0000 (13:23 -0700)]
drm_hwcomposer: avoid potential race condition between worker init and exit
Protect worker initialization and exit with lock in case Exit is called
in different thread.
Change-Id: Ibddfce192deeea9d33575de8abf859fdca5f74ed
Signed-off-by: Adrian Salido <salidoa@google.com>
Adrian Salido [Thu, 16 Feb 2017 18:29:46 +0000 (10:29 -0800)]
drm_hwcomposer: refactor Worker
Make use of standard library mutex and conditions which simplifies use
of condition variables and benefits from things like scoped locking.
Also add tests to make sure it runs as expected.
Change-Id: Iaf92e17e1f6757dce490eddee61f84cb1f953b0c
Kalyan Kondapally [Thu, 10 Nov 2016 18:59:50 +0000 (10:59 -0800)]
drm_hwcomposer: Add support for GetColorModes & SetCursorPosition
For now we just return HAL_COLOR_MODE_NATIVE and store cursor
position.
BUG=None.
TEST=None.
Change-Id: Id6a7e157dbd9fc41fc53c0e33a6eb523632b9b7a
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Sean Paul [Thu, 10 Mar 2016 21:00:26 +0000 (16:00 -0500)]
drm_hwcomposer: Partially implement HWC2 API
Implement the HWC2 API for drm_hwcomposer. There are still
a few TODOs sprinkled around, the biggest of which is virtual
display support.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib3d48dabce1941b341d5a966d767baab8db1db10
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Thu, 10 Mar 2016 20:35:40 +0000 (15:35 -0500)]
drm_hwcomposer: Initial stub HWC2
This patch adds the HWC2 interface to drm_hwc, and stubs out all
functionality.
Change-Id: I65b09e7266e887dd184c0c345016d5a768f6349a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Rob Clark [Wed, 19 Oct 2016 14:48:14 +0000 (10:48 -0400)]
drm_hwcomposer: Move eglCreateImageKHR into Importer
Since NV has a "special" nonstandard way to get an EGLImage from a
handle, move this into Importer where the other NV specialness is
abstracted. For the platformdrmgeneric case, use the dmabuf EGL
Extension.
Change-Id: I5353f4c95f55174df55ba92931cdc9a9eab80dca
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Wed, 12 Apr 2017 16:40:51 +0000 (16:40 +0000)]
Merge "drm_hwcomposer: Move some utilities out of hwcomposer.cpp"
Sean Paul [Wed, 12 Apr 2017 16:40:33 +0000 (16:40 +0000)]
Merge "drm_hwcomposer: Remove source_damage from DrmHwcLayer"
Sean Paul [Wed, 12 Apr 2017 16:40:18 +0000 (16:40 +0000)]
Merge "drm_hwcomposer: Break out of sync_wait loop on success"
Sean Paul [Wed, 12 Apr 2017 16:40:00 +0000 (16:40 +0000)]
Merge "drm_hwcomposer: Harvest min/max resolutions from drm"
Sean Paul [Wed, 12 Apr 2017 16:39:43 +0000 (16:39 +0000)]
Merge "drm_hwcomposer: Don't pass hwc_procs_t to VsyncWorker"
Sean Paul [Wed, 12 Apr 2017 16:38:32 +0000 (16:38 +0000)]
Merge "drm_hwcomposer: Clean up error conditions"
Adrian Salido [Tue, 11 Apr 2017 04:44:21 +0000 (21:44 -0700)]
drm_hwcomposer: fix pre comp regions during protected playback
During protected video playback an issue could happen when there are layers
below the protected video surface. The current logic in protected plane
provisioning logic includes all layers below the protected layer in precomp
plane in order to draw holes in these. However, when there are other layers in
place, in particular one that has blending (ex. PREMULT). For example:
Layers: count=3
[0] blending[a=255]=NONE display_frame[x/y/w/h]=0/125/2560/1438
[1] protected blending[a=255]=NONE display_frame[x/y/w/h]=0/181/2560/1438
[2] blending[a=255]=PREMULT display_frame[x/y/w/h]=0/0/2560/1800
Planes: count=3
[0] plane=17 type=LAYER source_layer=1
[1] plane=22 type=LAYER source_layer=2
[2] plane=23 type=PRECOMP source_layer=0
Squash Regions: count=0
Pre-Comp Regions: count=0
In this case, layer[0] is below protected surface (layer[1]). This causes
issues because precomp plane is setup to be on the highest z-order all the
time, and any time it isn't it expects any layers with higher z-order will
obscure some contents of the precomp layer. But in this case the layer on top
(layer[2]) has blending enabled (PREMULT) and is transparent so expectation is
that layer[0] is also rendered and blended with layer[2].
By merging any layer that is of higher z-order (layer[2] in example) to precomp
plane, all these layers can be handled during pre composition.
Bug:
36879178
Change-Id: I9b63b37fef0ae828c4a781e0d1da264d8a3d7a76
Daniel Stone [Fri, 7 Apr 2017 14:37:48 +0000 (15:37 +0100)]
drm_hwcomposer: Use correct DRM event context version
Explicitly declare which DRM event context version we want to use,
rather than just the latest one libdrm supports. New versions may change
semantics, or extend the structure, in ways we're unaware of.
Stick with version 2, which is the version that introduced
page_flip_handler.
Change-Id: I71e33f787b2b724596f8289d95311730f7aff8ff
Signed-off-by: Daniel Stone <daniels@collabora.com>
Rob Clark [Thu, 30 Mar 2017 03:08:06 +0000 (20:08 -0700)]
drm_hwcomposer: Fix invalid rotation value
Change-Id: If718d3eee03575e011ae5d13dc9088ed73fbeab6
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
John Stultz [Wed, 29 Mar 2017 18:31:53 +0000 (11:31 -0700)]
drm_hwcomposer: Add a minimum DPI to keep things sane
Currently the drm_hwcomposer can look at EDID data to determine
the DPI for the screen. However, on many 21"+ monitors, the DPI may
be quite low (sub-100), despite having resonable resolution.
Since Android will scale the display to the DPI with touch targets
sized for a phone (assuming you're holding the device), this
results in insanely tiny fonts and very small icons, providing a
bad expeirence on a standard monitor.
To try to remedy this, set a minimum DPI (160dpi) to ensure that
we don't try to scale things down too far.
Change-Id: I39a1376a2c2ed1c27f09e5d716a6941b507fc5f8
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Vishal Bhoj <vishal.bhoj@linaro.org>
Cc: Amit Pundir <amit.pundir@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Wed, 29 Mar 2017 13:00:22 +0000 (08:00 -0500)]
Switch to gbm_gralloc repo instead of drm_gralloc
Change-Id: I13cb42e54e06492af14f964ee35c431044c378ae
Signed-off-by: Rob Herring <robh@kernel.org>
Sean Paul [Thu, 10 Mar 2016 20:35:13 +0000 (15:35 -0500)]
drm_hwcomposer: Move some utilities out of hwcomposer.cpp
There are some utility functions in hwcomposer.cpp that will
be useful for hwc2. Move them into hwcutils.cpp so they can
be used when hwcomposer.cpp is not compiled.
Change-Id: I66a332e3e6afc4dc64217a528db50d5adbe02ef6
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Thu, 10 Mar 2016 20:20:41 +0000 (15:20 -0500)]
drm_hwcomposer: Remove source_damage from DrmHwcLayer
We don't use it, so get rid of it.
Change-Id: I63fc6bd06c0bfd4e7ad8315856e8f2372133624e
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Thu, 10 Mar 2016 20:18:42 +0000 (15:18 -0500)]
drm_hwcomposer: Break out of sync_wait loop on success
Don't call sync_wait kAcquireWaitTries times if it returns successfully.
Change-Id: Iebdc2229966bfce4aaf35a07ef59aef405e301c6
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Wed, 10 Feb 2016 23:35:17 +0000 (15:35 -0800)]
drm_hwcomposer: Harvest min/max resolutions from drm
Store the minimum and maximum resolutions from drm in DrmResources
BUG=None
TEST=None
Change-Id: I21b9a3fc5f220585295733cc754fe0f6df0abae9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Wed, 10 Feb 2016 18:00:08 +0000 (10:00 -0800)]
drm_hwcomposer: Don't pass hwc_procs_t to VsyncWorker
Introduce a new class to limit the hwc_procs_t callback
structure scope to hwcomposer.cpp
Change-Id: I68ec62e7947ca87702b3d6d0169ae850cfbf5d85
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Tue, 28 Feb 2017 18:25:26 +0000 (13:25 -0500)]
drm_hwcomposer: Clean up error conditions
Clean up error checking for some failure cases.
BUG=None
TEST=Tested on Qemu+drm_hwcomposer
Change-Id: I98bca1aef09060b5a023375dce564252a6073b96
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Robert Foss [Mon, 20 Feb 2017 16:43:48 +0000 (11:43 -0500)]
drm_hwcomposer: Add missing assert.h include
drm_hwcomposer fails to compile on aosp/master due to
assert.h not being included.
This patch fixes this issue.
BUG=None
TEST=make
Change-Id: Icb5d5d8a33c9898a5aefa00c1bdbf29965de62a7
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Rob Herring [Wed, 1 Feb 2017 22:52:28 +0000 (16:52 -0600)]
Add explicit include of assert.h
AOSP master broke as it seems an implicit include of assert.h got removed.
Change-Id: If4e7ac035599c16071875862bf3d946bb385ba22
Signed-off-by: Rob Herring <robh@kernel.org>
Adrian Salido [Fri, 21 Oct 2016 02:35:55 +0000 (19:35 -0700)]
drm_hwcomposer: fix type size check for separate rects
Bug:
32218819
Change-Id: Ic8f2c5d078a5ee9a48862a8e8faca051f199b78e
Signed-off-by: Adrian Salido <salidoa@google.com>
Sean Paul [Thu, 23 Jun 2016 03:26:29 +0000 (23:26 -0400)]
drm_hwcomposer: Count all layers with content in SquashFrame
SquashFrame previously didn't run if there was only one overlay
layer in the layer stack. This would cause false failures when
the incoming composition was composed of one or more layers with
a precomposition or squash layer.
To fix this, count all layers which are not disabled, and only
skip squashing if there is just one content layer.
BUG=b/
29122961
TEST=Tested on smaug with vertical multi-window YouTube
Change-Id: Icb175b7701928136730442a39c4717a780d34cfd
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 23 Jun 2016 02:48:22 +0000 (22:48 -0400)]
drm_hwcomposer: On error, free active composition
If we drop a frame while compositing, free the active composition.
Assume a frame pipeline of A->B->A. If we drop frame B, it will become
the active composition, which means the fences for A will not be released,
causing us to block A on A --> DEADLOCK.
BUG=b/
29122961
TEST=Tested on smaug, no longer hangs
Change-Id: I98817bb361f1d0669395ddac5d96cf4f19d4b26a
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 12 May 2016 18:28:05 +0000 (14:28 -0400)]
drm_hwcomposer: Use Planner interface to provision planes
Use the new Planner interface to handle the layer->plane mapping.
This allows us to simplify the Plan() function by offloading the
plane provisioning to the platform specific code.
BUG=b/
28117135
TEST=Tested on ryu with a variety of window layouts/workloads
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I75a0c5d87a9096e7a83ecbc848c75fee42ee1131
Sean Paul [Tue, 10 May 2016 08:19:24 +0000 (04:19 -0400)]
drm_hwcomposer: Introduce Planner interface
This patch introduces a new Planner interface to the platform specific
code. This new interface will allow for platform-specific plane provisioning
decisions to cover various hardware quirks.
Each platform must provide a Planner with one or more PlanStage steps. These
stages are run in order and are used to move the given layers onto composition
planes.
There are two generic stages provided by the platform:
- Protected: Places layers on dedicated planes
- Greedy: Provisions as many layers to planes and sticks the rest in precomp
There is also one platform-specific stage included:
- ProtectedRotated: Places any protected & rotated layer on the primary plane
BUG=b/
28117135
TEST=Tested on ryu with a variety of window layouts
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib6062ab4779166753afaf122450bb63126bf9161
Sean Paul [Tue, 3 May 2016 23:40:59 +0000 (16:40 -0700)]
drm_hwcomposer: Don't use Plan() in SquashAll
Simplify the SquashAll() function by generating the composition
without using Plan(). This allows us to specify exactly what we
want on the screen without involving the normal plane provisioning
code.
BUG=b/
28117135
TEST=Tested on ryu, squashing still works
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ieec9c323941e2a80252b33d14563c4d218d38dfb
Sean Paul [Tue, 10 May 2016 08:17:31 +0000 (04:17 -0400)]
drm_hwcomposer: Move SeparateLayers into a member function
Instead of passing a bunch of member data to a static function, make
SeparateLayers a member of DrmDisplayComposition. This will be simplified
further once the Planner interface is implemented.
BUG=b/
28117135
TEST=Tested on ryu
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ia4e15aa20b6dc14b044ee1dec7b5fce514278be7
Sean Paul [Wed, 11 May 2016 20:57:26 +0000 (16:57 -0400)]
drm_hwcomposer: Move DrmCompositionPlaneType into DrmCompositionPlane
Now that DrmCompositionPlane is classified, move the type into it
as a subclass.
BUG=b/
28117135
TEST=Tested on ryu
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I774f477e75b3a2e2916c5d98931730dac46d3877
Sean Paul [Wed, 11 May 2016 20:29:45 +0000 (16:29 -0400)]
drm_hwcomposer: Use a vector for composition source_layers
Instead of a 1:1 mapping of layer:plane, use a vector to store
source layers for a composition plane. This will allow us to
represent squash compositions more easily by adding all source
layers to the vector.
This should also facilitate hardware which allows multiple fbs per plane.
BUG=b/
28117135
TEST=Tested on ryu
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I5d4bfc6e9da022eaab047f948cc874d6a8a25746
Sean Paul [Wed, 11 May 2016 17:50:28 +0000 (13:50 -0400)]
drm_hwcomposer: Add type to DrmCompositionPlane
Instead of encoding the plane/composition type in source_layer,
move it to its own explicit type. This will allow us to expand
source_layer to include more than one layer.
BUG=b/
28117135
TEST=compiles and runs on smaug
Change-Id: I19b1ed8e395347bbefb0fb6a0ab02d6ac0e5c1c1
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Wed, 11 May 2016 17:49:38 +0000 (13:49 -0400)]
drm_hwcomposer: Fix up some printf warnings and a clang-style nit
BUG=None
TEST=Compiles
Change-Id: Ie95aad60b225784c36d411ec16a34ff32ea8acc6
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 10 May 2016 08:08:10 +0000 (04:08 -0400)]
drm_hwcomposer: Update platform log tags
So they now say "platform" instead of "importer"
BUG=b/
28117135
TEST=None
Change-Id: I7fe6bc7d31ca448ef561d78f7806fa487eb612f6
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Fri, 22 Apr 2016 13:11:09 +0000 (09:11 -0400)]
drm_hwcomposer: Move drmgeneric and nv importer cpp files
Final step in the platform renaming, move the drmgeneric and
nvimporter files to their new place.
BUG=b/
28117135
TEST=compiles
Change-Id: Ied60a82526f42f13a64192373cb49f3dfffef74f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 21 Apr 2016 20:26:27 +0000 (16:26 -0400)]
drm_hwcomposer: Update the platform precompiler guards
Rename the guards in the platform headers to match their
filename. This wasn't done in the previous commits so the
diff remained clean.
BUG=b/
28117135
TEST=compiles
Change-Id: Ie495bd8e00784da1d48f200c6981f23448b7c6d2
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 21 Apr 2016 20:39:02 +0000 (16:39 -0400)]
drm_hwcomposer: Move platform-specific importer headers
Now that importer.h is platform.h, move the platform-specific
headers to match.
BUG=b/
28117135
TEST=compiles
Change-Id: I08563505b77529257892841845ef4117d2992bb0
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 21 Apr 2016 20:25:06 +0000 (16:25 -0400)]
drm_hwcomposer: Move importer.h to platform.h
We're going to need more platform-specific stuff, so lump it
all in the same header.
BUG=b/
28117135
TEST=compiles
Change-Id: Idfe82e9a29a0bcd284a02b2e58af0e620fdc542b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Wed, 4 May 2016 01:49:17 +0000 (18:49 -0700)]
drm_hwcomposer: Remove unused variable
BUG=None
TEST=Compiles
Change-Id: I8a003dc14828ed0c10fd161b00d1bc1c5069431f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 10 May 2016 07:42:55 +0000 (03:42 -0400)]
drm_hwcomposer: Fix protected layer hole punch
The old code didn't dereference the layer index from the
bitmask which caused it to subtract layers it shouldn't
have. In order to do this right, we need to look at the
layer index corresponding to the bit in the id_set to
ensure we're excluding the correct layers.
BUG=None
TEST=Precomposition doesn't draw over dedicated layers
Change-Id: I8531e1ef3b2beb4674041145e2b38ce4b3dbe346
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 3 May 2016 18:29:03 +0000 (11:29 -0700)]
drm_hwcomposer: Use linear scaling instead of nearest neighbor
So scaled layer transitions between hw plane and gl plane look better.
BUG=b/
28431632
TEST=Tested on low resolution paused YouTube video
Change-Id: I507722c28c5b8ec4e8d16ae436a04afc8cffaa0f
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Rob Herring [Wed, 13 Jan 2016 03:00:51 +0000 (21:00 -0600)]
Force framebuffer target
GL compositing doesn't want to work, so force disable it.
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Tue, 12 Jan 2016 21:41:53 +0000 (15:41 -0600)]
HACK: Add HDMI connector as built-in
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Fri, 8 Jan 2016 22:07:22 +0000 (16:07 -0600)]
HACK: disable gralloc buffer usage call
No signs of any gralloc implementation supporting this.
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Thu, 4 Feb 2016 20:01:49 +0000 (14:01 -0600)]
HACK: add rotation defines
These should come from kernel headers
Sean Paul [Mon, 18 Apr 2016 19:53:36 +0000 (15:53 -0400)]
drm_hwcomposer: Don't composite over protected layers
This patch changes two things with respect to protected layers:
1- It provisions the HW plane in the correct position. ie: if
the background layer is slated for a HW plane, it will be
placed on the primary layer and the protected layer will be
placed on top of it.
2- It punches a hole through the precomposite and squash layers
such that when they are placed on top of the protected layer,
they do not obstruct it.
BUG=b/
27502957
TEST=Tested on smaug with multi-window with a variety of different
layouts and visible layers
Change-Id: Ie30939f2bb750dbe3faa558ddb094b677f41f45e
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Fri, 1 Apr 2016 20:32:09 +0000 (20:32 +0000)]
Merge "drm_hwcomposer: remove unnecessary gralloc_drm_bo_t dependency"
Rob Herring [Fri, 1 Apr 2016 15:06:54 +0000 (10:06 -0500)]
drm_hwcomposer: remove unnecessary gralloc_drm_bo_t dependency
gralloc_bo is not used anywhere and depending on it pulls in unnecessary
dependencies from drm_gralloc, so remove it.
Change-Id: I81b9dc88124ea6a0e66e188656d44215e735d177
Signed-off-by: Rob Herring <robh@kernel.org>
Sean Paul [Tue, 29 Mar 2016 17:55:35 +0000 (13:55 -0400)]
drm_hwcomposer: Fix build warnings
A cleanup patch to fix the build warnings that have surfaced
from the new build system.
BUG=None
TEST=Builds without warnings
Change-Id: I2ad898e627d451f87705d2bdf06a315b8e1c7a1c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Mon, 26 Oct 2015 19:37:06 +0000 (15:37 -0400)]
drm_hwcomposer: Add hotplug event handler
Add a hotplug event handler to handle hotplug events. Upon
hotplug, the handler is responsible for finding and setting
the preferred mode of the new display.
BUG=chrome-os-partner:41682
TEST=Tested on ryu with DP
Change-Id: Ide57382624c7839ed81a712bc29ea2e1cc19dcae
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 29 Mar 2016 14:51:38 +0000 (10:51 -0400)]
drm_hwcomposer: Set DPMS ON when setting active config
Ensure we turn the connector on after we set the active mode.
BUG=chrome-os-partner:41682
TEST=Tested on smaug with DP
Change-Id: I3410a1ac261fb0848d668c5baef2d77eb860017b
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 28 Jul 2015 18:15:42 +0000 (14:15 -0400)]
drm_hwcomposer: Add DrmEventListener worker
This patch adds a worker which listens to drm events. If the
drm event has a handler associated with it, the listener will
call the handler.
BUG=chrome-os-partner:41682
TEST=Tested on ryu with DP
Change-Id: I5d691d191425604766a00be3e72111095d025d06
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 24 Mar 2016 18:50:53 +0000 (14:50 -0400)]
drm_hwcomposer: Protect autofd.h with #ifdef/#define
So we don't end up redeclaring its classes.
BUG=None
TEST=Compiles
Change-Id: Ic15ba4412f11bad8ef7ec4f68af6ad87e0d674cc
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Mon, 26 Oct 2015 19:36:37 +0000 (15:36 -0400)]
drm_hwcomposer: Add connection state to DrmConnector
So we can determine if it's connected or not.
BUG=chrome-os-partner:41682
TEST=Tested on ryu with DP
Change-Id: Ie0dadb2737d3a98257fb6e4fa02f17d7dae44f6c
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Rob Herring [Thu, 4 Feb 2016 20:01:24 +0000 (14:01 -0600)]
drm_hwcomposer: Convert to upstream DRM atomic interfaces
drm_hwcomposer is currently using preliminary version of the atomic API.
The final version merged upstream is slightly different. Convert it to the
upstream API.
The most significant change is positive return values for
drmModeAtomicAddProperty are not a failure, so we need to test for
negative return values instead of non-zero.
BUG=none
TEST=Tested with 4.4 kernel on virtio-gpu and freedreno
Change-Id: I0b1f4bcd7766a3053a484f55e01c8b2ba56d716d
Signed-off-by: Rob Herring <robh@kernel.org>
Sean Paul [Wed, 10 Feb 2016 22:35:25 +0000 (22:35 +0000)]
Merge "drm_hwcomposer: Add support for virtual connectors"
Rob Herring [Fri, 4 Dec 2015 23:14:31 +0000 (17:14 -0600)]
drm_hwcomposer: Add support for virtual connectors
Allow virtual connector type in order to support virtio-gpu.
BUG=none
TEST=Tested with virtio-gpu on QEMU
Change-Id: I7ae5091d3587bcae75da6bff23d7bc85aa6164f1
Signed-off-by: Rob Herring <robh@kernel.org>
David Ung [Wed, 20 Jan 2016 01:24:49 +0000 (17:24 -0800)]
drm_hwcomposer: Increase fence timeout upto 5x
Increase the fence wait value each time by a factor of 2.
Bug: chrome-os-partner:48289
Test: Run apps and see no frame drops
Change-Id: I9b7b910e5a8c9d287ea69b13dca0d4c1194ac86c
Signed-off-by: David Ung <davidu@nvidia.com>
Sean Paul [Thu, 14 Jan 2016 18:38:22 +0000 (10:38 -0800)]
drm_hwcomposer: Add OWNERS file
So people know who to bug for reviews.
BUG=None
TEST=None
Change-Id: I20bb80929a7fac59ca2137b415c9d0e000d79c54
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Mon, 30 Nov 2015 19:35:45 +0000 (14:35 -0500)]
drm_hwcomposer: Always call PrepareFrame() for compositions
Previously this was not called for compositions which were known to
fail the atomic test. Unfortunately this left the composition in a
state which could not be processed by SquashFrame (only one layer and
source_layer was still set to kSourceSquash).
So call PrepareFrame() on every composition so SquashFrame stays happy.
Change-Id: I976e344ce4970370d9ca4307c2f2c45025199b64
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Wed, 25 Nov 2015 16:04:25 +0000 (11:04 -0500)]
drm_hwcomposer: Save the atomic_test result between tests
Previously, we would only test the first frame when the geometry
changed. However, if SF sent us the same composition with different
FBs, we could end up sending invalid frames to the kernel.
This change saves the result of the atomic_test between geometry
changes so we avoid using hw composition for all invalid frames.
Bug:
25866352
Test: Tested on smaug, observed squashes between geometry changes
Change-Id: I3b5d9e83a870481bf2e6869900eafaf0ca66a0d5
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Haixia Shi [Tue, 24 Nov 2015 20:42:45 +0000 (12:42 -0800)]
drm_hwcomposer: only check the composition after a geometry change
Do not check the composition with kernel for every frame. We are currently
using synchronous atomic ioctl calls, so all test-only calls are serialized
with the actual commits.
BUG=
25866352
TEST=same test procedure as crosbug.com/p/47206
Change-Id: Ia423243c279fc677ff6213115a8f20efa40c235e
Sean Paul [Tue, 24 Nov 2015 18:13:42 +0000 (18:13 +0000)]
Merge "drm_hwcomposer: Skip layers which aren't on-screen" into mnc-dr-dev
Sean Paul [Tue, 24 Nov 2015 16:52:37 +0000 (11:52 -0500)]
drm_hwcomposer: Skip layers which aren't on-screen
Don't composite layers whose bounds are entirely off screen, or
which have width or height of 0.
Bug: chrome-os-partner:47938
Test: Swipe between videos in Google Photos
Change-Id: I29671db6763caf3cb764b06d1ff955276ebecd80
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Haixia Shi [Mon, 23 Nov 2015 19:34:36 +0000 (11:34 -0800)]
drm_hwcomposer: set blending mode to kPreMult for GL output
The correct blending mode for the GL output is actually premult, because
regardless of the original layer blending mode, the result RGB components
are always pre-multiplied with alpha already.
This prevents the result of a SquashAll() from getting multiplied by
alpha twice.
BUG=
25838542
TEST=verify the blinking is fixed on the status bar icons
Change-Id: Ie5bbc53110c342576b81818da6069cba201db609
David Riley [Fri, 20 Nov 2015 22:24:09 +0000 (22:24 +0000)]
Merge "drm_hwcomposer: Check the composition before sending to frame worker" into mnc-dr-dev
Sean Paul [Fri, 20 Nov 2015 21:42:15 +0000 (21:42 +0000)]
Merge "drm_hwcomposer: Allow for multiple transforms at once" into mnc-dr-dev
Sean Paul [Fri, 20 Nov 2015 02:46:11 +0000 (21:46 -0500)]
drm_hwcomposer: Allow for multiple transforms at once
Because sometimes one just ain't enough, allow more than
one transform at a time.
Bug: chrome-os-partner:46710
Test: Tested with the CTS Verifier "Camera Orientation" test
Change-Id: Ie5f9bbbc7c89964feafc78150e18512861c85b69
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 19 Nov 2015 18:55:48 +0000 (13:55 -0500)]
drm_hwcomposer: Check the composition before sending to frame worker
Before we send a composition to the frame worker and display, run it
through the kernel to test whether it can be put on hardware. If the
kernel rejects the composition, use the squashing code to flatten it
on one layer and send the result to the frame worker.
Bug:
25379136
Test: Tested on smaug, frames were squashed, fun was had
Change-Id: Icac3c034d0eb4c0becbdc0f8ace1de75ab8ae2b8
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Wed, 18 Nov 2015 19:12:51 +0000 (14:12 -0500)]
drm_hwcomposer: Split DrmDisplayCompositor::SquashAll()
Split the SquashAll function into SquashAll and SquashFrame. This
will allow us to squash arbitrary compositions without using the
active composition or applying it to the screen.
Bug:
25379136
Test: Tested on smaug
Change-Id: I1767f731e14f36540151556ce07373848b604030
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 17 Nov 2015 21:38:10 +0000 (16:38 -0500)]
drm_hwcomposer: Add test_only mode to CommitFrame
Allow the caller of CommitFrame to run the commit in "test only" mode
which will send the frame to the kernel, but won't actually change any
registers.
Bug:
25379136
Test: Tested on smaug
Change-Id: I831b5f17d433bc60d9f107689feb1d7672c100a9
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Tue, 17 Nov 2015 19:46:56 +0000 (14:46 -0500)]
drm_hwcomposer: Create mode blob on modeset queue
Instead of creating the mode blob right before doing the modeset,
create it as soon as the modeset is queued. This will allow us to
use the blob for both atomic test as well as commit.
In addition to keeping the blob around, store the blob's id while
the mode is active so we don't need to look it up when/if the next
modeset comes in.
Bug:
25379136
Test: Tested on smaug
Change-Id: I60e6f83310ea0601388bb31b63d25c6fd7b8fc4d
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Zach Reizner [Wed, 18 Nov 2015 21:54:31 +0000 (13:54 -0800)]
drm_hwcomposer: during SquashAll, skip layers with kSourceNone
This complicates returning layers to the active composition on failure. They
will not go back in the correct order and this will confuse all subsequent
attempts to use the active composition.
Change-Id: Iab6fae7b4a88f97206bac08237d574ff1bfd802f
Zachary Reizner [Tue, 17 Nov 2015 18:21:00 +0000 (18:21 +0000)]
Merge "drm_hwcomposer: composite down to a primary plane after a timeout" into mnc-dr-dev
Zachary Reizner [Tue, 17 Nov 2015 18:20:00 +0000 (18:20 +0000)]
Merge "drm_hwcomposer: avoid creating release fences for invalid OutputFd" into mnc-dr-dev
Zachary Reizner [Tue, 17 Nov 2015 18:19:45 +0000 (18:19 +0000)]
Merge "drm_hwcomposer: add AutoLock to automatically handle pthread_mutex_lock" into mnc-dr-dev
Zach Reizner [Mon, 16 Nov 2015 19:08:46 +0000 (11:08 -0800)]
drm_hwcomposer: composite down to a primary plane after a timeout
DrmDisplayCompositor::SquashAll is triggered after a constant timeout in
DrmCompositorWorker::Routine. It will not be triggered more than one time
between genuine hwc_set calls. SquashAll has no effect if there are protected
layers, only one layer, or any errors. On success, SquashAll produces a new
DrmDisplayComposition that owns the layers in the planes of the active
composition and makes that the new active composition. SquashAll has no effect
on SquashState.
Change-Id: I975edb21847dcf2d93245f92a6e53a4e366c6a3b
Sean Paul [Mon, 16 Nov 2015 18:47:19 +0000 (13:47 -0500)]
drm_hwcomposer: Increase the virtual display compositor's fence timeout
50ms isn't enough time for some CTS tests (namely testSetLocalFocus). Increase
the timeout to 3 seconds, since we're not too worried about recovery time
from fence timeouts any longer.
Bug:
24362649
Test: Run cts test in a loop, ensuring the virtual compositor doesn't time out:
run cts --loop --class android.view.cts.WindowTest --method testSetLocalFocus --disable-reboot --min-loop-time 100 --max-random-loop-time 200
Change-Id: I5552ece3f6fe95d78a4e0770c1e30c96f2e75313
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Zach Reizner [Sat, 14 Nov 2015 00:11:37 +0000 (16:11 -0800)]
drm_hwcomposer: avoid creating release fences for invalid OutputFd
This change also adds a check for OutputFd to see if it is valid.
Change-Id: If992d523c707cc5e6e660de721938a26f27477d8
Zach Reizner [Sat, 14 Nov 2015 00:09:39 +0000 (16:09 -0800)]
drm_hwcomposer: add AutoLock to automatically handle pthread_mutex_lock
For functions that need to hold locks and also handle errors, using AutoLock
will make them much simpler and less prone to mutex handling errors.
Change-Id: Ida6545850e89186c552e3d58b2973c14852494ad
Zach Reizner [Tue, 10 Nov 2015 23:18:08 +0000 (15:18 -0800)]
drm_hwcomposer: add optional timeout for WaitForSignalOrExitLocked
Change-Id: I5beef0833cc0a384aa76e821694183e024a8850c
Zach Reizner [Tue, 27 Oct 2015 23:18:06 +0000 (16:18 -0700)]
drm_hwcomposer: always put protected layers on hardware planes
Protected layers will not work inside of the GLWorker, so we are forced to put
them into planes directly.
Because we can now receive display contents which can never be properly
composited (e.g. 4 protected layers on hardware with only 3 planes), some
compromises had to be made for the composition planning algorithm. First all
protected layers are given a plane. Then the remaining planes are used by the
remaining layers, pre-composite buffer, and squash buffer. In the case where
there are too few planes for both a pre-composite buffer and squash buffer,
everything gets pushed into the pre-composite buffer and the squash buffer
will not be composited onto the screen. Another major limitation is that any
unprotected layers appearing behind a protected layer will actually appear on
top of that protected layer.
BUG=chrome-os-partner:43674
TEST=run protected content with lots of other layers
Change-Id: I94620d93f68ca14dc1966422dc89035ab84e3ff4
Haixia Shi [Mon, 2 Nov 2015 18:54:29 +0000 (10:54 -0800)]
drm_hwcomposer: fix spelling of "separate".
It is spelled "separate", not "seperate".
Change-Id: Id92d12aba42989a8a72e4596d425b2a9eea4e5ec
Haixia Shi [Mon, 2 Nov 2015 18:04:49 +0000 (10:04 -0800)]
drm_hwcomposer: filter out empty or invalid rects.
We can safely ignore zero-area rects because they do not affect the outcome
of the separate_rects() function. Furthermore the line sweep algorithm would
break when two identical START or END events are added to the same set.
Additionally any rect with |left| greater than |right| or |top| greater than
|bottom| is invalid and shall be ignored.
Added test cases with empty and invalid rects. This case would have crashed (or
failed the assert in a debug build) without this fix.
BUG=chrome-os-partner:47103
TEST=verify no crash with Photos app
Change-Id: I80950ef376390a14a892c58b563eb3c0f79db71c
Sean Paul [Thu, 29 Oct 2015 19:00:17 +0000 (15:00 -0400)]
drm_hwcomposer: Handle HWC_SKIP_LAYER properly
Instead of ignoring skip layers, set all layers between the first
and last skip layer as HWC_FRAMEBUFFER in prepare(). In set(), substitute
the HWC_FRAMEBUFFER_TARGET in place of those layers.
Bug:
25366235
Test: Tested with gmail modal and rotation
Change-Id: Ife0fd569caf505263b00e5d0e8217a339aa09031
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Haixia Shi [Thu, 29 Oct 2015 21:33:37 +0000 (14:33 -0700)]
drm_hwcomposer: add ATRACE_CALL.
The DrmDisplayCompositor::CommitFrame() has been moved to a separate
worker thread so it's helpful to add it to systrace.
Change-Id: I82031f56ddc0587266f9a213208134f045f66b9a
Zach Reizner [Thu, 29 Oct 2015 17:11:16 +0000 (10:11 -0700)]
drm_hwcomposer: update #include's for drm_hwcomposer.h
That's the second most important part of renaming a file.
Change-Id: If9280f3b360389ef17b798e162a9c3b0c0a3133b