summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-06-25Merge branch 'master' of git://anongit.freedesktop.org/drm_hwcomposer into ↵forAOSPSumit Semwal
forAOSP
2018-06-21drm_hwcomposer: Avoid filling the log with warnings when test compositions failJohn Stultz
We frequently test compositions that might fail due to various reasons. On db820 we see: W HwcComposer: command 0x4010000 generated error 8 E hwc-drm-display-compositor: Alpha is not supported on plane 29 E hwc-drm-two: Failed to apply the frame composition ret=-22 over and over So to avoid filling the log with errors when those test compsitions don't work out, this patch tries to quiet down those error messages when we are doing test compositions. Change-Id: Iab19628bd7488c7d104e2c775310989bb59e140d Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-06-14drm_hwcomposer: platformhisi: Add support for importing DRM_FORMAT_YVU420 ↵John Stultz
buffers When trying to play fullscreen video, I started seeing import errors, which were caused by us trying to call drmModeAddFB2() with fmt DRM_FORMAT_YVU420 but only setting the a single set of handle/pitch/offset values. In the kernel, the framebuffer_check() function would then fail with "no buffer object handle for plane 1" since we only passed one plane in. Thus this patch calculates and sets the pitch/offset values for the separate planes in the single gem_handle buffer. Many thanks to Stefan Schake and Rob Herring for helping me understand some of the subtleties of image plans vs display planes, etc. Change-Id: I2d9bdfc66c504e6446a4f9c6287ab675201afa30 Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-06-14drm_hwcomposer: platformdrmgeneric: Handle closing gem_handles if we have ↵John Stultz
duplicate handles In some cases some multi-plane bo's may have multiple gem_handles/offsets/pitches set. And its possible to have multiple planes that use the same gem_handle with different offsets/pitches. Thus, when closing the gem_handles, if we're not careful we could close the same handle multiple times. So this patch avoids this by taking some old code from the nv importer: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/blob/aeccd89eaafec467cb9449cce5c64152a240c138/platformnv.cpp#L176 Many thanks to Stefan Schake for pointing me to that code. Change-Id: Ifecd0f95de5ada5280a0af807005d0b0186a068c Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-06-14drm_hwcomposer: Set client composition buffer at the bottom.Alexandru Gheorghe
Currently, we allocate layers to device composition from bottom to top and save the last DrmPlane from the top to be used by the client target buffer. However, we don't know much about client layer, so information for layers which we decided to set as ClientComposition, will be lost. For example, in BlendMode case if we have the following scene, with 2 DrmPlanes available. z0: LAYER0 AR24 BlendNone. z1: LAYER1 AR24 BlendPremulti. z2: LAYER2 AR24 BlendPremulti. We decide: z0: LAYER0 DeviceComposition z1: LAYER1 ClientComposition z2: LAYER2 ClientComposition LAYER1+LAYER2 will be in client target buffer, but we don't know nothing about the blending for client_target_layer. Which Android actually expects to be still BlendPremulti. So, we are kind of stucked we the default value which is BlendNone. I think there are two ways to solve this issue: 1) This commit, allocate layers as DeviceComposition from top to bottom and save the bottom for ClientComposition. 2) A smarter logic for detecting what should be the actual properties of client_layer_target, but I still think it makes more sense to actually have the client_layer_target at the bottom. Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
2018-05-30drm_hwcomposer: Support assigning planes in ValidateDisplayRob Herring
In order to assign planes to layers in ValidateDisplay, testing compositing with a DRM atomic modeset test is needed as PresentDisplay is too late. This means most of PresentDisplay needs to be run from ValidateDisplay, so refactor PresentDisplay to a common function adding a test only option. Signed-off-by: Rob Herring <robh@kernel.org>
2018-05-30drm_hwcomposer: remove separate_rectsRob Herring
As part of removing GL compositing, separate_rects.cpp is no long needed. Use hwc_rect_t and hwc_frect_t in places instead of our own class. Signed-off-by: Rob Herring <robh@kernel.org>
2018-05-30drm_hwcomposer: Remove GL compositing supportRob Herring
The GL based compositing adds alot of complexity and was only ever well tested on closed stacks. It also only supports GLES3.x and still relies on sw_sync timeline which is now a debugfs feature. Those are just the known issues. Removing the GL compositor means everything related to squashing layers and pre-compositing can be removed. The planner is left as it may be useful when adding back support for overlay planes. With this change, only a single plane is supported until ValidateDisplay learns to do atomic modesetting test for overlay planes. Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org>
2018-05-30Revert "drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag"Rob Herring
This reverts commit 3b0c69d3477d3601b1dbcb75fdd748254e297e7e.
2018-05-30Revert "drm_hwcomposer: Fall back to client compositon if the gl ↵Rob Herring
precompostior fails" This reverts commit acc4dcf1787b9fc43c5748ce06e79f045e07a3ff.
2018-05-30drm_hwcomposer: Try to fix clang-format pipelineJohn Stultz
The clang-format pipeline generates false negatives sometimes, with: $ git diff -U0 --no-color master...HEAD | clang-format-diff-3.5 -p 1 -style=file > format-fixup.patch fatal: ambiguous argument 'master...HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: as seen here: https://gitlab.freedesktop.org/john.stultz/drm-hwcomposer/-/jobs/932 This tries to address the issue by explictly fetching freedesktop/master and referencing FETHC_HEAD instead of master which doesn't always exist. Change-Id: I7a07d412eae164841427da90dfc7298697c5e783 Reviewed-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-05-17drm_hwcomposer: Remove gralloc from generic codeAndrii Chepurnyi
Clean up direct gralloc usage from generic code. Because of gralloc0/gralloc1 difference, it should be only used by platform* part. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
2018-05-17drm_hwcomposer: Use GraphicBufferMapper for copy buffer handleAndrii Chepurnyi
Due to gralloc0/gralloc1 API incompatibility(register/unregister vs retain/release) it is preferred to use generic GraphicBufferMapper API for copy buffer handle. It will use an appropriate adapter for the present version of gralloc. For the reference: hardware/interfaces/graphics/mapper Change-Id: Ia4740ed3b2ffd43fa3c107eb22d792eaabd4df40 Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
2018-05-10drm_hwcomposer: Ignore context in clang-format-diffStefan Schake
Signed-off-by: Stefan Schake <stschake@gmail.com>
2018-05-08drm_hwcomposer: vsyncworker: Fix deadlock on exit pathAlexandru Gheorghe
vsyncworker::Routine assumes that when -EINTR is returned by WaitForSignalOrExitLocked the lock as been released, which is not true, so it hangs if a vsyncworker is never enabled and Exit is called. Fixed by releasing lock in vsynworker::Routine on all code paths. Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
2018-05-07drm_hwcomposer: Add pass/fail CI step for clang format-diffStefan Schake
Signed-off-by: Stefan Schake <stschake@gmail.com>
2018-05-07drm_hwcomposer: Add README.mdSean Paul
Although we had CONTRIBUTING.md, gitlab didn't really highlight it. So I tried putting this info in the wiki, but that was equally hard to discover. _then_ I thought gitlab pages was the right way to go, but no. Turns out README.md will be harvested by gitlab and shown on the project's frontpage \o/ Signed-off-by: Sean Paul <seanpaul@chromium.org>
2018-05-04drm_hwcomposer: Make sure we check for new 16bit alpha valueJohn Stultz
In commit 025d0a65 ("Use 16 bit value for plane alpha"), the alpha value was bumped to a 16bit value. Unfortunately in drmdisplaycompositor.cpp we are still comparing it against a 8bit 0xff value, which now fails causing the display to not start. So fix this comparing to the 16bit 0xffff value. With this change the display starts up again. Change-Id: Ic796b16fb57ae7cea58b5c66c456a58e3fb57ba5 Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-05-04drm_hwcomposer: Use -Werror in external/drm_hwcomposerChih-Hung Hsieh
* Suppress non-critical warnings. I'm submitting this patch to try to align aosp/master with the upstream fdo/master branch. Bug: 66996870 Change-Id: I48e87526e408980c90e8a45e134f95da7a89a19d Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-05-04drm_hwcomposer: License NOTICE file and metadata from AOSPBill Yi
This is a forward ported patch from the AOSP/master branch which adds the Apache2 license notice and a empty MODULE_LICENCE_APACHE2 file. I'm submitting these to try to align aosp/master with upstream fdo/master BUG:67772237 Change-Id: I65396852e1b64d2052232b38740e6ede20e81776 Signed-off-by: John Stultz <john.stultz@linaro.org>
2018-05-04drm_hwcomposer: Use 16 bit value for plane alphaStefan Schake
The upstream version of the alpha property uses 16 bits to make it future proof. Since HWC2 already passes in a float expand our internal representation instead of just shifting for DRM. Signed-off-by: Stefan Schake <stschake@gmail.com>
2018-05-04drm_hwcomposer: Remove unused init from HWC1 layerStefan Schake
The HWC1 code isn't being compiled anymore. Signed-off-by: Stefan Schake <stschake@gmail.com>
2018-05-03drm_hwcomposer: Remove NVIDIA importer headerAlistair Strachan
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>
2018-05-03drm_hwcomposer: Add platform backend for minigbmAlistair Strachan
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>
2018-05-03drm_hwcomposer: Drop obsolete drm_gralloc include pathAlistair Strachan
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>
2018-05-03drm_hwcomposer: Mark tests as vendor, fix buildAlistair Strachan
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>
2018-04-27drm_hwcomposer: Fall back to client compositon if the gl precompostior failsJohn Stultz
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>
2018-04-27drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flagJohn Stultz
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>
2018-04-27drm_hwcomposer: Use log/log.h instead of cutils/log.hJohn Stultz
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>
2018-04-27drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor moduleSumit Semwal
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>
2018-04-19force single planeRob Herring
Change-Id: Ic963c356ab1ef241d92fde6c890936b560f52051 Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
2018-04-17drm_hwcomposer: drmeventlistener: Set nl_pid to 0Alexandru Gheorghe
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>
2018-04-17drm_hwcomposer: vsyncworker: Fix uninitialized enabled_ fieldAlexandru Gheorghe
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>
2018-04-04drm_hwcomposer: Rework platformdrmgeneric.cpp to use libdrm's gralloc handleJohn Stultz
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>
2018-03-22Delete CONTRIBUTING, migrated information to the gitlab wikiSean Paul
2018-03-14drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960John Stultz
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>
2018-02-28drm_hwcomposer: Enable and refactor Separate Rects testRhys Kidd
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>
2018-02-28drm_hwcomposer: Fix comment on worker_testRhys Kidd
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>
2018-02-14drm_hwcomposer: fix check for valid fence fd for in fencesRob Herring
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>
2018-01-24drm_hwcomposer: Make sure we set the active state when doing modesetsJohn Stultz
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>
2018-01-09drm_hwcomposer: Update external connectors listMauro Rossi
DVID, DVII and VGA are required by discrete and integrated GPUs. Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
2017-11-30drm_hwcomposer: fix warnings on unused variables and parametersRob Herring
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>
2017-11-01drm_hwcomposer: Add HDMI connector as a valid typeRobert Foss
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>
2017-11-01drm_hwcomposer: correct handling of DRM_MODE_ROTATE_0Rob Herring
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>
2017-10-25drm_hwcomposer: remove unnecessary external includesRob Herring
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>
2017-10-17drm_hwcomposer: make sure primary plane is allocated for squashAdrian Salido
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>
2017-10-09drm_hwcomposer: fix return values for ValidateDisplayRob Herring
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>
2017-10-09drm_hwcomposer: remove NVIDIA importerRob Herring
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>
2017-10-09platformdrmgeneric: get the gralloc usage directly from the handleRob Herring
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>
2017-10-09drm_hwcomposer: use upstream DRM_MODE_{ROTATE, REFLECT} definesRob Herring
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>