OSDN Git Service
Chih-Wei Huang [Fri, 2 Nov 2018 07:58:42 +0000 (15:58 +0800)]
Merge remote-tracking branch 'origin/master' into oreo-x86
Conflicts:
Android.mk
drmconnector.cpp
drmeventlistener.cpp
Chih-Wei Huang [Wed, 19 Sep 2018 14:57:32 +0000 (22:57 +0800)]
drm_hwcomposer: allow to force mode by a property
The desired resolution could be set by property debug.drm.mode.force.
The other modes are ignored.
Mauro Rossi [Tue, 2 Jan 2018 14:27:27 +0000 (15:27 +0100)]
Take Connection state into account. (v2)
(v2) porting of original commit
76fb87e675 of android-ia master
with additional external connector types and removal of redundant HDMIA internal
(v1) There are various places where we should be really taking connection
state into account before querying the properties or assuming it
as primary. This patch fixes them.
BUG=None.
TEST=System boots up and shows UI.
(v1) Signed-off-by: Jim Bish <jim.bish@intel.com>
Chih-Wei Huang [Fri, 2 Nov 2018 06:45:27 +0000 (14:45 +0800)]
Merge remote-tracking branch 'origin/master' into oreo-x86
Alistair Strachan [Wed, 2 May 2018 23:53:20 +0000 (16:53 -0700)]
drm_hwcomposer: Remove NVIDIA importer header
Commit
0f7487f drm_hwcomposer: remove NVIDIA importer removed most of
the implementation, but not the platformnv.h header file. Remove this
header now.
Cc: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Robert Foss <robert.foss@collabora.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Alistair Strachan [Thu, 3 May 2018 00:01:49 +0000 (17:01 -0700)]
drm_hwcomposer: Add platform backend for minigbm
This adds support for the chromiumos (not AOSP) version of minigbm. Like
hisi, the gralloc handle is not the same as the common libdrm handle
(just yet), so we do need a separate backend for now.
Tested with a pending change to the 'cuttlefish' android virtual device
in AOSP with its custom gralloc switched to minigbm.
Cc: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Greg Hartman <ghartman@google.com>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Alistair Strachan [Wed, 2 May 2018 23:56:12 +0000 (16:56 -0700)]
drm_hwcomposer: Drop obsolete drm_gralloc include path
In commit
d12274d, "drm_hwcomposer: Rework platformdrmgeneric.cpp
to use libdrm's gralloc handle", the use of drm_gralloc was removed.
Cc: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Stefan Schake <stschake@gmail.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Alistair Strachan [Wed, 2 May 2018 23:55:22 +0000 (16:55 -0700)]
drm_hwcomposer: Mark tests as vendor, fix build
After commit
94bb596, the tests for drm_hwcomposer no longer build,
because the build system detects that they are linking other vendor
modules (but installing themselves elsewhere).
This change also adds the libhardware include path explicitly, as the
implicit include of hardware/libhardware/include is going away.
Cc: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
John Stultz [Thu, 26 Apr 2018 19:05:57 +0000 (12:05 -0700)]
drm_hwcomposer: Fall back to client compositon if the gl precompostior fails
If the gl precompositor isn't being used, we cannot accept
every layer as a device composited layer.
Thus this patch adds some extra logic in the validate function
to fall back to client side compositing if the gl precompositor
did not initialize properly.
This does force everything to a single plane even if we have
a few available, but a deeper rework of the validate step
planning is needed before we can reliably make use of them.
Credit to Rob Herring, who's single plane patch was what this
was originally based on.
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
John Stultz [Thu, 26 Apr 2018 19:05:56 +0000 (12:05 -0700)]
drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag
The drm_hwcomposer has its own GL pre-compositor which is used
to squish layers when there are more layers then planes on the
display hardware. In many ways this duplicates the client-side
GL compositing that is done in SurfaceFlinger, but in theory can
be more highly optimized for the hardware.
Unfortunately, due to these optimizations, the drm_hwcomposer's
pre-compositor becomes somewhat hardware specific (originally
targeting nvidia hardware, I believe).
So on some hardware, the gl precompositor may not actually
initialize due to hardware missing features, or the hardware
supporting different shader APIs.
Rather then try to rework the drm_hwcomposers precompositor
to be more generic, I instead suggest that when the
precompositor fails to initialize, we simply fall back to the
already more widely compatible client compositor in
SurfaceFlinger.
Thus, this patch cleans up some of the precompositor
initialization, which didn't handle failures well.
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
John Stultz [Thu, 26 Apr 2018 19:05:55 +0000 (12:05 -0700)]
drm_hwcomposer: Use log/log.h instead of cutils/log.h
When enabling Treble, Android builds are complaining about using
cutils/log.h so instead use log/log.h
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Sumit Semwal [Thu, 26 Apr 2018 19:05:54 +0000 (12:05 -0700)]
drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module
To allow drm_hwcomposer to build with Treble, set
the libdrmhwc_utils library as a vendor module.
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
[jstultz: commit message tweaks]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Alexandru Gheorghe [Wed, 11 Apr 2018 15:22:14 +0000 (16:22 +0100)]
drm_hwcomposer: drmeventlistener: Set nl_pid to 0
By setting nl_pid to 0, we let the kernel to assign a port for us.
In the current implementation there is no way we could create more
than one instance for drmeventlistener.
Acked-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Alexandru Gheorghe [Wed, 11 Apr 2018 15:22:12 +0000 (16:22 +0100)]
drm_hwcomposer: vsyncworker: Fix uninitialized enabled_ field
Acked-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
John Stultz [Tue, 3 Apr 2018 03:57:21 +0000 (20:57 -0700)]
drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handle
Rework the platformdrmgeneric buffer importer to use the libdrm
generic gralloc handle definition.
This is just to get the drm_hwcomposer project building in AOSP
along with the libdrm freedesktop/master branch. Similar changes
may also be needed to gbm_gralloc and other projects not used
in AOSP.
Mostly just sending this out for review feedback.
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sean Paul <seanpaul@google.com>
Cc: Stefan Schake <stschake@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Thu, 22 Mar 2018 18:22:57 +0000 (18:22 +0000)]
Delete CONTRIBUTING, migrated information to the gitlab wiki
John Stultz [Tue, 13 Mar 2018 23:51:12 +0000 (16:51 -0700)]
drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960
This allows for importing buffers allocated from the
hikey and hikey960 gralloc implementations.
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Cc: Alistair Strachan <astrachan@google.com>
Acked-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Rhys Kidd [Mon, 26 Feb 2018 06:18:54 +0000 (01:18 -0500)]
drm_hwcomposer: Enable and refactor Separate Rects test
Plumb through the existing test based on known sample data for the
Separate Rect algorithm via Android's NATIVE_TEST harness.
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Rhys Kidd [Mon, 26 Feb 2018 06:17:42 +0000 (01:17 -0500)]
drm_hwcomposer: Fix comment on worker_test
Reflect the boolean logic of the accompanying code, which is run after
Worker.InitWorker() has completed in test setup.
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Rob Herring [Mon, 12 Feb 2018 22:03:35 +0000 (16:03 -0600)]
drm_hwcomposer: fix check for valid fence fd for in fences
The check for a valid fence fd is inverted, so we're failing to pass
IN_FENCE_FD's to the kernel when we have a valid fence.
Reported-by: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
John Stultz [Tue, 23 Jan 2018 23:16:36 +0000 (15:16 -0800)]
drm_hwcomposer: Make sure we set the active state when doing modesets
In trying to use drm_hwcomposer with HiKey/HiKey960 boards, I
found that the crtc wouldn't intitalize and the atomic commit
calls were failing.
I initially chased this down to following check in the kernel
drm_atomic_crtc_check() function failing:
if (state->event && !state->active && !crtc->state->active) {
DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requesting event but off\n",
crtc->base.id, crtc->name);
return -EINVAL;
}
Where because a fence was submitted state->event was set, but
the crtc state was not active. This results in the atomic commit
to fail and no mode to be set.
After hacking around this in the kernel, Sean Paul helped me
understand that it was the kernel complaining about the crtc
state being provided in the atomic commit which did not have the
active flag set.
Thus, the proper fix is to make sure when we do the modesetting
that we also set the crtc state active flag in property set.
With this change, the kernel no longer rejects the atomic commit
and the crtc initializes properly.
Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Mauro Rossi [Fri, 5 Jan 2018 23:59:59 +0000 (00:59 +0100)]
drm_hwcomposer: Update external connectors list
DVID, DVII and VGA are required by discrete and integrated GPUs.
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Rob Herring [Wed, 29 Nov 2017 16:19:57 +0000 (10:19 -0600)]
drm_hwcomposer: fix warnings on unused variables and parameters
AOSP master now builds by default with -Werror, so fix all the warnings.
All the warnings are related to unused variables and parameters.
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Chih-Wei Huang [Fri, 3 Nov 2017 04:39:37 +0000 (12:39 +0800)]
Android: add CleanSpec.mk
The file contains rules that are executed on incremental builds.
Since commit
4f7dc9b6 the library was moved to /vendor so
the old file must be removed.
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Chih-Wei Huang [Thu, 2 Nov 2017 07:16:31 +0000 (15:16 +0800)]
Revert "drm_hwcomposer: Remove threading"
This reverts commit
ed45a8eb01d5927e36e34acd7bac46abbbecb304.
Chih-Wei Huang [Thu, 2 Nov 2017 07:16:12 +0000 (15:16 +0800)]
Merge remote-tracking branch 'origin/master' into oreo-x86
Conflicts:
Android.mk
drmdisplaycompositor.cpp
hwcutils.cpp
Robert Foss [Wed, 1 Nov 2017 17:50:04 +0000 (12:50 -0500)]
drm_hwcomposer: Add HDMI connector as a valid type
Accept DRM_MODE_CONNECTOR_HDMIA connector type.
Look for primary DrmConnector amongst external connectors
after looking for primary amongst internal ones first.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Wed, 1 Nov 2017 16:21:48 +0000 (11:21 -0500)]
drm_hwcomposer: correct handling of DRM_MODE_ROTATE_0
If the rotation property is supported for a plane, then the rotation
value must be non-zero. For the case of 0 degree rotation,
DRM_MODE_ROTATE_0 needs to be set.
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Wed, 25 Oct 2017 00:06:43 +0000 (19:06 -0500)]
drm_hwcomposer: remove unnecessary external includes
Linking to libraries will add necessary include paths, so we don't need to
list them explicitly.
Still need libsync for sw_sync.h until this dependency is removed.
Tested-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Rob Herring <robh@kernel.org>
Adrian Salido [Mon, 2 Oct 2017 18:31:27 +0000 (11:31 -0700)]
drm_hwcomposer: make sure primary plane is allocated for squash
There are instances where the primary plane may have been disabled, look
through disabled planes as well to find primary plane to use for squash.
Signed-off-by: Adrian Salido <salidoa@google.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Rob Herring [Fri, 9 Jun 2017 20:15:55 +0000 (15:15 -0500)]
drm_hwcomposer: fix return values for ValidateDisplay
According to the API documentation, if we've set num_types, then the
return value should be HWC2::Error::HasChanges.
Signed-off-by: Rob Herring <robh@kernel.org>
Rob Herring [Fri, 6 Oct 2017 22:02:03 +0000 (17:02 -0500)]
drm_hwcomposer: remove NVIDIA importer
There's no opensource implementation for the NVIDIA gralloc implementation,
so remove it as it is not testable.
As all of the gralloc perform() operations are specific to it, they can be
removed, too.
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Rob Herring [Fri, 6 Oct 2017 22:20:05 +0000 (17:20 -0500)]
platformdrmgeneric: get the gralloc usage directly from the handle
There's no point in using a gralloc perform() op to retrieve the usage as
it is already stored in the handle like width, height, format, etc. So just
copy it to the hwc_drm_bo_t and get it directly.
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Rob Herring [Fri, 6 Oct 2017 21:46:48 +0000 (16:46 -0500)]
drm_hwcomposer: use upstream DRM_MODE_{ROTATE, REFLECT} defines
The DRM_REFLECT_* and DRM_ROTATE_* defines were not upstream, but now
they are. Convert to using the upstream version which are defined as a
bit mask rather than a bit position.
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Sean Paul [Tue, 28 Feb 2017 18:17:34 +0000 (13:17 -0500)]
drm_hwcomposer: Remove threading
Since HWC2 doesn't require the use of threads to implement correct
synchronization, remove some of these threads.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Robert Foss [Wed, 27 Sep 2017 17:28:15 +0000 (19:28 +0200)]
drm_hwcomposer: Add out-fence support
Add support for out-fences through the OUT_FENCE_PTR property.
Out-fences signal when their associated buffer may be read by a device.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Robert Foss [Thu, 20 Oct 2016 15:07:57 +0000 (11:07 -0400)]
drm_hwcomposer: Add crtc() fetcher to DrmResources
This is a fetcher for getting the vector of DrmCrtc objects
in DrmResources.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Robert Foss [Thu, 20 Oct 2016 14:14:43 +0000 (10:14 -0400)]
drm_hwcomposer: Add FENCE_OUT_PTR property to DrmCrtc
Add support for handling the FENCE_OUT_PTR property to DrmCrtc
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Robert Foss [Wed, 19 Oct 2016 14:46:22 +0000 (10:46 -0400)]
drm_hwcomposer: Submit in-fence to DRM
Add support for in-fences through the IN_FENCE_FD property. In-fences signal
when their associated buffer may be read by DRM/KMS.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Robert Foss [Fri, 30 Sep 2016 14:27:23 +0000 (10:27 -0400)]
drm_hwcomposer: Add support for IN_FENCE_FD property to DrmPlane
Add support for the IN_FENCE_FD property to DrmPlane.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Rob Herring [Fri, 15 Sep 2017 13:48:55 +0000 (08:48 -0500)]
drm_hwcomposer: move library to /vendor
As part of Treble project in Android O, all the device specific files have
to be located in a separate vendor partition. This is done by setting
LOCAL_PROPRIETARY_MODULE (the name is misleading). This change will not
break existing platforms without a vendor partition as it will just move
files to /system/vendor.
Signed-off-by: Rob Herring <robh@kernel.org>
Robert Foss [Fri, 22 Sep 2017 00:35:07 +0000 (02:35 +0200)]
drm_hwcomposer: Add CONTRIBUTING file
Some basic guidelines for contributions could come in handy.
These are copied from IGT and modified to be suitable.
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Adrian Salido [Thu, 21 Sep 2017 23:53:48 +0000 (16:53 -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.
Signed-off-by: Adrian Salido <salidoa@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Sean Paul [Thu, 21 Sep 2017 21:46:11 +0000 (14:46 -0700)]
drm_hwcomposer: Remove OWNERS
Where we're going, we don't need no stickin' OWNERS.
Now that drm_hwcomposer is hosted on fdo, we're going to support the
de-centralised committer model.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Robert Foss <robert.foss@collabora.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