Age | Commit message (Collapse) | Author |
|
Change-Id: I20f9bb1906a073b9d7cf680f0f9d160347beaed4
|
|
The trout virtual device was broken by the recent move to HWC 2.4
as it was not able to execute the new calls in HWC 2.4; bring in
AOSP drm_hwc in order to support HWC 2.4 on trout
Bug: 202850907
Test: build and boot trout
Change-Id: I418234d51a8674ed348774a02f7b28ed6495e7ac
|
|
am: 38163fdedc
Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1809159
Change-Id: I97b4652389ac4dd30b56e7992431a1cf831e73c7
|
|
Just updates the branch to match upstream.
This merge contains a number of cleanups as well as
some follow-on fixups.
* aosp/upstream-main:
drm_hwcomposer: Don't close same handle several times.
drm_hwcomposer: Quiet noisy errors when planes don't support various attributes
drm_hwcomposer: Fix sync_file fd leak from "Rework audofd"
drm_hwcomposer: Add links to the HWC2 API description
drm_hwcomposer: Rework autofd
drm_hwcomposer: cleanup hwcutils
drm_hwcomposer: Stop importing native_handle_t into the mapper
drm_hwcomposer: Tracking of the DRM FB objects using RAII
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I9f733a6d9adb71b6c8b24d764e881904f66de146
|
|
Video (YUV) frames can have several planes in the same buffer,
in this case all the planes will be represented by the same
gem_handle, which must be closed only once.
Fixes logcat noise during video playback.
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
If a plane doesn't support alpha or rotation, and IsValidForLayer()
fails, we see lots of logcat noise to the effect of:
08-24 04:45:42.957 453 453 E hwc-platform: Failed to emplace layer 0, dropping it
08-24 04:45:42.957 453 453 E hwc-platform: Failed provision stage with ret -22
08-24 04:45:42.957 453 453 E hwc-drm-display-composition: Planner failed provisioning planes ret=-22
08-24 04:45:42.957 453 453 E hwc-drm-two: Failed to plan the composition ret=-22
This noise is unneccessarily worrisome, as they don't really
help explain why things fail, and we still fall back to client
composing and frames are correctly composited.
Thus, this patch switches the errors to verbose-level warnings,
which match the level in IsValidForLayer() which explain what
actually is going wrong.
Change-Id: I7ed06906b8d9e02e6ec0ac50a94346e9f9c05ac6
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
In commit 0fade37afd60 ("drm_hwcomposer: Rework autofd"),
a change to some very subtle existing code caused a resource
leak such that after 10 minutes or so of active display
output, we would start seeing:
android.hardware.graphics.composer@2.3-service: failed to dup fence 10
over and over in logcat. Moving the mouse would cause black
frame to flicker and eventually Surfaceflinger would crash
and restart.
The problem was subtle change in the following hunk:
@@ -1047,10 +1049,9 @@ HWC2::Error DrmHwcTwo::HwcLayer::SetLayerBlendMode(int32_t mode) {
HWC2::Error DrmHwcTwo::HwcLayer::SetLayerBuffer(buffer_handle_t buffer,
int32_t acquire_fence) {
supported(__func__);
- UniqueFd uf(acquire_fence);
set_buffer(buffer);
- set_acquire_fence(uf.get());
+ acquire_fence_ = UniqueFd(fcntl(acquire_fence, F_DUPFD_CLOEXEC));
return HWC2::Error::None;
}
The core of the problem being, that the UniqueFd class calls
close(fd_) in its descructor. So while the change using
fcntl(...,F_DUPFD_CLOEXEC) matches what was burried in
set_acquire_fence(), dropping the creation (and more importantly
the destruction when it goes out of scope) of uf changes the
logic so we don't end up calling close on the aquire_fence fd
argument passed in.
One can confirm this resource leak by doing:
adb shell lsof | grep composer
And noticing the number of sync_file fds growing over time.
Thus, this patch fixes the logic, so instead of dup()'ing the
passed in fd, (and then closing it as done before Roman's
patch), we can just set aquire_fence_ to a new UniqueFd directly
using the aquire_fence fd passed in.
This pattern actually occured twice, so I've fixed it in both
places.
Fixes: 0fade37afd60 ("drm_hwcomposer: Rework autofd")
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Iff2ca1c0b6701abbdc10c6ee92edb21a4b84a841
|
|
Some part of the API is not streightforward and wrong implementation
may cause leaks and other hard-to-debug runtime issues.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Motivation:
Current implementation of UniqueFd can be used in a different ways,
making analytical tracking of FD lifecycle much harder than it may be.
Keep this part clean is very important, since any wrong code may open
a hard-to-detect runtime bugs and fd leaks, which may accidentally slip
into the production.
Implementation:
1. Combine UniqueFd anf OutputFd into single class.
2. Reduce the API to be minimal and sufficient.
3. Document the API and use cases.
4. Move to utils/UniqueFd.h.
5. dup(fd) was replaced with fcntl(fd, F_DUPFD_CLOEXEC)) to
address clang-tidy findings. Find more information at [1]
[1]: https://clang.llvm.org/extra/clang-tidy/checks/android-cloexec-dup.html
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
82288efb3a
Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1714669
Change-Id: If18723bda10941e12869cd0d586bfc7f6acaa69a
|
|
Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1714669
Change-Id: I2f79b8d88dd378050c41cd982153e290445c0fa1
|
|
This updates the AOSP/master branch to include the current
upstream gitlab/main branch, which includes a fair amount of
updates.
Most are connected to the gitlab CI improvements, but there
are also a fair amount of code cleanups and new functionality
like composer@2.4 support.
* gitlab/main:
drm_hwcomposer: update README for clang-format-diff-11 and touch up formatting
drm_hwcomposer: remove unused variable blend
drm_hwcomposer: reject rotations reported as unsupported by hardware
drm_hwcomposer: add DRM_PROPERTY_TYPE_BITMASK
drm_hwcomposer: Fix regression after composition creation cleanup
drm_hwcomposer: Move ValidatePlane method into DrmPlane
drm_hwcomposer: Remove useless setters from DrmHwcLayer
drm_hwcomposer: Add GetOrderLayersByZPos method
drm_hwcomposer: Move HardwareSupportsLayerType into Backend
drm_hwcomposer: Move MarkValidated into Backend
drm_hwcomposer: Add GetExtraClientRange method
drm_hwcomposer: Move CalcPixOps into Backend
drm_hwcomposer: Remove ctrc from DrmCompositionPlane
drm_hwcomposer: Remove SquashState class declaration
drm_hwcomposer: Remove DrmCompositionDisplayLayersMap
drm_hwcomposer: Remove DrmCompositionRegion struct
drm_hwcomposer: Cleanup DrmDisplayComposition initialization
drm_hwcomposer: CI: Increase coverage
drm_hwcomposer: CI: Pull headers from the AOSPv11
drm_hwcomposer: Fix client range selection logic
drm_hwcomposer: Remove writeback-based flattening logic
drm_hwcomposer: add missing HAL pixel format
drm_hwcomposer: CI: Add more source files to the build
drm_hwcomposer: clang-tidy: enable cppcoreguidelines-* checks
drm_hwcomposer: clang-tidy: enable clang-analyzer-* checks
drm_hwcomposer: enable code analysis using clang-tidy
drm_hwcomposer: CI: Use bpfmt to check Android.bp files style
drm_hwcomposer: CI: Initial build and clang-tidy checks
drm_hwcomposer: CI: Use clang-11 for the CI
drm_hwcomposer: Create make target to test filegroups
drm_hwcomposer: Fix drmSetMaster() usage
drm_hwcomposer: Initial composer@2.4 HAL support
drm_hwcomposer: Add support for color encoding and range properties
drm_hwcomposer: Add minigbm video and format_modifier support
drm_hwcomposer: Support unique fd for every YUV plane
drm_hwcomposer: Ensure composer has master access to DRM/KMS
drm_hwcomposer: Reorganize modifiers handling logic
drm_hwcomposer: libdrmgetter: fix RGB565 format translation
Change-Id: I3a9801bd858bc869844ac5d2d81383767029b09e
Signed-off-by: John Stultz <john.stultz@linaro.org>
|
|
Remove DrmHwcBuffer class. Wrap remaining logic into
DrmHwcLayer class.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Composer service is already importing buffers from binder pipe
into the mapper and caches them making native handles valid
for a whole composition processing cycle.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
DRM framebuffer objects must be kept registered in DRM/KMS
while used for scanning-out (After atomic commit applied
for processing by display controller and until next atomic
commit is applied for processing).
Existing logic for tracking current state is overcomplicated and
needs to be redesigned. Also further developing of drm_hwc will
require migration to asynchronous atomic commit, so additional
asynchronous FB cleanup logic must be created.
Buffer caching logic will also benefit from this.
With the RAII all further changes will be less painful and more robust.
By this commit I also renamed DrmGenericImporter to DrmFbImporter:
'Fb' word is present in most of existing composers (android and linux)
so it will be easier to compare different implementations.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
The README.md is out of date -- clang-format-diff-5.0 is not what runs on
CI anymore. To help contributors better test their changes locally before
submitting a merge request, update to the actual linting command being run
in CI.
Signed-off-by: Benjamin Li <benl@squareup.com>
|
|
The first tuple element returned by GetEnumValueWithName is just the index
of that enum, which is not useful.
Signed-off-by: Benjamin Li <benl@squareup.com>
|
|
Currently we only check for the presence of any rotation support -- but
hardware may choose to, say, only support 180 degree rotation. Respect
the specific rotation capabilities reported through DRM properties.
Signed-off-by: Benjamin Li <benl@squareup.com>
|
|
Bitmask properties are integers that additionally have strings associated
with each bit. For example, the "rotation" property's bits are described
as "rotate-90", "reflect-x", and so on.
The bitmask integer is not actually passed to us -- instead, the interface
for enums is used, except that more than one value can be set. This means we
must query using the associated strings, rather than use bit index mappings
provided as constants in the public kernel header drm_mode.h.
Signed-off-by: Benjamin Li <benl@squareup.com>
|
|
During rebasing of the local integration branch, one code chunk was not
updated accidentally and the client range was not selected properly which
leads to jank frames appearance.
The issue has been already fixed by the commit 3f89182bb9df
("drm_hwcomposer: Fix client range selection logic").
Issue: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/53
Fixes: b3b15166f9da ("drm_hwcomposer: Add GetExtraClientRange method")
Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
It is more common to validate the layer for the proper object.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
SetDisplayFrame and SetSourceCrop methods are unnecessary in
the DrmHwcLayer structure without any private members.
Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The GetOrderLayersByZPos copies an ordered list of layer pointers.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The HardwareSupportsLayerType function is used only for display validation
which is implemented in the generic backend.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The MarkValidated function is used only for display validation which is
implemented in the generic backend.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
Separate the correction of client range into the separate method.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The CalcPixOps is used only for display validation which is implemented
in the generic backend.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
CRTC is set at CreateComposition function and it matches the current
display.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
There is no use of SquashState class, so the declaration could be removed
in the scope of cleanup.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The structure is used only at the CreateComposition function.
Data consolidation is unnecessary in this case.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The structure is currently unused.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
Remove unused members (drm, importer, frame_no). Move initialization
from the proper function to the constructor.
Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
Add the following files to the build:
backend/BackendClient.cpp
backend/Backend.cpp
backend/BackendManager.cpp
backend/BackendRCarDu.cpp
bufferinfo/legacy/BufferInfoImagination.cpp
bufferinfo/legacy/BufferInfoLibdrm.cpp
bufferinfo/legacy/BufferInfoMaliHisi.cpp
bufferinfo/legacy/BufferInfoMaliMediatek.cpp
bufferinfo/legacy/BufferInfoMaliMeson.cpp
bufferinfo/legacy/BufferInfoMinigbm.cpp
compositor/DrmDisplayComposition.cpp
compositor/DrmDisplayCompositor.cpp
compositor/Planner.cpp
drm/DrmGenericImporter.cpp
DrmHwcTwo.cpp
drm/ResourceManager.cpp
drm/VSyncWorker.cpp
tests/worker_test.cpp
utils/autolock.cpp
Files 'bufferinfo/BufferInfoMapperMetadata.cpp' and 'utils/hwcutils.cpp' require
a lot of additional headers, therefore move them out of the scope of this commit.
'utils/gralloc.h' isn't planned to use in pure-linux builds, therefore remove
it from 'utils' and put it into '.ci/android_headers/hardware/'
Fix minor tidy fails.
Fix linux build fails (missing includes) due to differences between libc and
bionic.
Comment-out some sections in 'tests/test_include' which aren't used by drm_hwc
but causing build failures for CI due to missing dependencies.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
The goal is to check compilation and clang-tidy at CI stage.
For both compile and tidy all dependent headers are required.
Compilation and tidy-check enabled by the next commit.
Done by invoking the following bash commands:
cp system/core/libcutils/include/cutils/native_handle.h \
system/core/libcutils/include/cutils/compiler.h \
system/core/libcutils/include/cutils/trace.h \
external/drm_hwcomposer/.ci/android_headers/cutils/
cp external/libdrm/android/gralloc_handle.h \
external/drm_hwcomposer/.ci/android_headers/gralloc_handle.h
cp hardware/libhardware/include/hardware/gralloc.h \
hardware/libhardware/include/hardware/hardware.h \
hardware/libhardware/include/hardware/hwcomposer.h \
hardware/libhardware/include/hardware/hwcomposer2.h \
hardware/libhardware/include/hardware/hwcomposer_defs.h \
external/drm_hwcomposer/.ci/android_headers/hardware/
cp system/core/libsync/include/sync/sync.h \
external/drm_hwcomposer/.ci/android_headers/sync/sync.h
cp system/core/libsync/include/ndk/sync.h \
external/drm_hwcomposer/.ci/android_headers/ndk/sync.h
cp system/core/libsystem/include/system/graphics-base-v1.0.h \
system/core/libsystem/include/system/graphics-base-v1.1.h \
system/core/libsystem/include/system/graphics-base-v1.2.h \
system/core/libsystem/include/system/graphics-base.h \
system/core/libsystem/include/system/graphics-sw.h \
system/core/libsystem/include/system/graphics.h \
external/drm_hwcomposer/.ci/android_headers/system/
cp frameworks/native/libs/ui/include/ui/GraphicBuffer.h \
external/drm_hwcomposer/.ci/android_headers/ui/GraphicBuffer.h
cp system/core/libutils/include/utils/Trace.h \
external/drm_hwcomposer/.ci/android_headers/utils/Trace.h
Turn off clang-format check for these files.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Matvii Zorin <matvii.zorin@globallogic.com>
|
|
Original change aimed to fix clang-tidy checks, but
accidentally it caused wrong client range selection.
Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/53
Fixes: e2f2c929243f ("drm_hwcomposer: enable code analysis using clang-tidy")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Writeback Pros:
a. Very tiny reduction in power consumption required for
rendering the composition compared to CLIENT-based flattening.
Writeback Cons:
a. A lot of extra code. High maintenance cost(effort).
Nobody tests it as for now.
b. Writeback isn't implemented by the set of KMS drivers
c. Require separate memory buffer to be allocated
Part of: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/47
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
using Android-11 (android-11.0.0_r27 )on i500 MediaTek SoC we can
see some log floods with the following trace:
E hwc-platform-drm-generic: Cannot convert hal format to drm format 43
Adding the conversion of this format : HAL_PIXEL_FORMAT_RGBA_1010102
resolves the log flood
Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
|
|
Build bufferinfo/BufferInfoGetter.cpp and drm/DrmPlane.cpp
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Our code isn't ready for the following checks therefore keep disabled
-cppcoreguidelines-pro-bounds-array-to-pointer-decay
-cppcoreguidelines-pro-bounds-constant-array-index
-cppcoreguidelines-pro-bounds-pointer-arithmetic
-cppcoreguidelines-pro-type-cstyle-cast
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-avoid-magic-numbers
-cppcoreguidelines-macro-usage
-cppcoreguidelines-avoid-c-arrays
+ fixed existing tidy warnings for these checks.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
+ fixed existing tidy warnings for these checks.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Drm hwcomposer project has some code-style inconsistencies.
This is the initial step to unify code-style of the code.
Clang-tidy is a great tool which can not only suggest correct styling,
but also allow predicting the errors in the code and suggest correct
coding approaches to avoid potential weaknesses.
CI was tuned to check clang-tidy recommendation for some part of the
code which is ready ATM (can be built outside AOSP tree).
For this part a limited set of clang-tidy checks has applied (coarse check).
Header files aren't checked at all.
Starting from now new code files must be included into the list that is
checked by almost all clang-tidy checks (fine checklist). New header files
should be also included into this list.
See '.gitlab-ci-clang-tidy-fine.sh'.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Fix available errors by executing:
$ find -name "*.bp" -exec bpfmt -d -s -w {} \;
Suggested-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Build android-agnostic code in linux environment.
Enable static code analysis using clang-tidy.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Android.bp contains filegroups that are not built by default
(e.g. using $ mmma external/drm_hwcomposer)
Fix it.
To ensure build will work on wide range of Android versions,
pull depended headers from AOSP-11 tree:
1. Mali: "device/linaro/hikey/gralloc960"
2. Imagination: "hardware/ti/am57x/libhwcomposer"
and put it into ./tests/test_include directory.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
|
|
Change-Id: I6ba37e70fabcb29a7bec07d0048c7ab68c6e8769
|
|
ours am: 1b4a72f29e -s ours
am skip reason: Change-Id Ia13ce2304a0527f626ceeb9fee3331b0b3178661 with SHA-1 d92b471251 is in history
Original change: undetermined
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I454fb72e5d01ee217c012f7ba803f89c88fd299b
|
|
am skip reason: Change-Id Ia13ce2304a0527f626ceeb9fee3331b0b3178661 with SHA-1 d92b471251 is in history
Original change: undetermined
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I534bef112deb4e48b33a8c22fdc25ddebf0dd92e
|
|
Bug: 180401296
Merged-In: Ia13ce2304a0527f626ceeb9fee3331b0b3178661
Change-Id: Id847c813c51f4d578dea4e497303a4520c0309e3
|
|
Change-Id: I2ebd5bfdc418d28dc5c6f767c5eb4aad6cea81c2
|