In preparation for rebuilding all CI containers to use Android 16,
update CI/build variables to use Android 16 and Android SDK 36.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
The IStats service provides an interface for reporting metrics from
vendor processes through the IStats::reportVendorAtom interface.
The type and ordering of the data in a VendorAtom are determined by a
proto definition which is typically OEM-specific. The code to construct
the VendorAtom is generated from the proto definition.
Add a soong config variable in the DRMHWC config namespace to enable the
atom reporting. Currently there is only one such implementation.
atom_reporter: Set this to configure OEM-specific atom reporting.
With the config variable omitted, reporting will be disabled and a stub
implementation is used, ensuring no build or runtime dependency or usage
of the IStats service.
Change-Id: I832adbd42412db1ab4c9403c1da60fa075443caa
Signed-off-by: Drew Davenport <ddavenport@google.com>
This will allow us to cherry-pick downstream changes from Android16
without breaking those using the Android15 source tree.
Add Android15 target to CXXFLAGS so that Android16 APIs are
ignored on CI.
Add ANDROID_SDK_VERSION to ci builds.
Change-Id: I4e37e5ce5b2c2b5dc5134dc8c33f284fe26d4019
Signed-off-by: Sasha McIntosh <sashamcintosh@google.com>
CompositionStats struct is a copy of HwcDisplay::Stats and is extracted
from HwcDisplay as a prestep for supporting stats reporting beyond
dumpsys.
CompositionStatsProvider interface can be implemented by a class that
will poll all displays and return a display->CompositionStats map for
the cumulative stats for each display.
CompositionStatsTracker is a helper class that tracks the state of the
last queried stats and calculates the delta between the last stats and
the currently pulled stats. A Callback function can be passed into the
Report function which will be called for each display, with the
cumulative and delta stats as arguments.
Change-Id: I4200df5b41a4dbc612160aec038c83336b68bc4b
Signed-off-by: Drew Davenport <ddavenport@google.com>
See https://clang.llvm.org/docs/ThreadSafetyAnalysis.html for details.
Define thread annotation macros according to the example provided in the
documentation, and use these to annotate VSyncWorker members that can be
accessed from multiple threads.
Thread safety analysis does not yet work with std::unique_lock, so
disable the warnings when it is used.
Change-Id: I8b3b503fbaf0923588fbe3d0180f6fe6ec228350
Signed-off-by: Drew Davenport <ddavenport@google.com>
Enabling this check doesn't require changes in the code.
Change-Id: I190f8af9cca51bac9fc624501eac8a2bcb3e0637
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
... and fix the following warning:
hwc3/ComposerClient.cpp:1326:19: error: static member accessed through
instance [readability-static-accessed-through-instance]
Change-Id: Ia52431259d45d9400f4e7dc6626e20a203612500
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
... and fix the following warning:
hwc3/ComposerResources.cpp:30:56: error: function 'ToHwc2Display' can be
made static or moved into an anonymous namespace to enforce internal
linkage [misc-use-internal-linkage,-warnings-as-errors]
Change-Id: I97dcfcf6db3ad3bcf9379f0f896a66b377a730c8
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
... and fix the following warning:
hwc3/ComposerClient.cpp:1492:5: error: 'push_back' is called inside a loop;
consider pre-allocating the container capacity before the loop
[performance-inefficient-vector-operation,-warnings-as-errors]
Change-Id: Ie3e8d2a56e12d09a3c40791bebb198f5f9e631ec
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
In the previous version, build flags pointed to Android API v33, while
headers were from Android API v35. This caused issues when using
"if __ANDROID_API__ >= 35" preprocessor macros.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Why:
The aospless file from Android-15 contains compiler flags that
clang-15 does not understand.
Additionally, new tidy findings were suppressed.
It would be nice to fix them in the future instead.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Remove misc-const-correctness from clang-tidy. This check detects local
variables which could be declared as const. See
https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html
Change-Id: Ibbce8d8c6fa4cb1631776b5dde5c33ca73b6510d
Signed-off-by: Drew Davenport <ddavenport@google.com>
TODOs in the project are of the form TODO(nobody). It seems pointless to
enforce Google TODO format if the TODOs are not actually assigned to a
person or issue
Change-Id: Ie6c7299ea463aaac98442843cb02485a3bcc49cd
Signed-off-by: Drew Davenport <ddavenport@google.com>
The freedesktop instance provides a docker container registry with
ubuntu 23.04 based images ready to be used for building drm_hwcomposer.
Migrate to using that container image in order to:
- Avoid apt-get installing all dependencies for each job
- Remove duplication between the Dockerfile and the .gitlab-ci.yml
Since the container image provides aospless, we no longer need to download it
for each pipeline stage.
Also, this updates the folder structure:
Before:
/builds/drm-hwcomposer/drm-hwcomposer/
/builds/drm-hwcomposer/aospless
After:
/builds/drm-hwcomposer/drm-hwcomposer/
/home/user/aospless
For "tidy", this new structure requires to override the BASE_DIR variable.
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Since we're now using aospless archive for meson.build, we can use
headers from there and remove .ci/android_headers/ directory completely.
Adding aospless cflags also raised some new tidy checks fails,
which were fixed by this commit.
Since clang-tidy now relies on aospless files, running CI on the host
can't be supported and removed. Running CI within the docker container
is the only option left.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
We use too much dup() system calls for present fence propagating.
Also when propagating acquire fence we use additional logic for
skipping such propagation for the validate/test cycle.
Both issues can be solved by introducing SharedFd, which will track
reference count of fd object.
After that the UniqueFd is used very rarely and can be simplified by
wrapping it into std::unique_ptr without caring too much of adding
an extra malloc/free operation.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
utils/worker is no longer used and can be removed.
Change-Id: I5fc9bd2b3b8b0375622ee2446044d3b893756b30
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
utils/worker just complicates the logic without providing any benefit.
Change-Id: I7b3c91aee9c0507d9ca35792d24ba6c8c3870033
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
__ANDROID_API__ definition is available by default in AOSP and NDK.
It also exported by standard system clang when the user sets
the '-target <ARCH>-linux-android<LEVEL>' compiler flag.
Reason for this change is integration of meson build script, where
otherwise the user has to provide the API level manually.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Address new clang-tidy findings, in most cases 'misc-const-correctness'
check was addressed by adding 'const' modifier, or in some cases changed
to 'auto' (where it's better for formatting).
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Additionally:
1. Fix new clang-tidy findings
2. Disable readability-identifier-length check for all tidy levels
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Dumping uevents is useful for debugging purposes.
1. Extract logic related to uevent socket into utils/UEvent.h class.
2. Use it by both UEventListener.cpp and tests/uevent_print.cpp.
Bump clang-tidy level of UEventListener.cpp to normal.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Primary responsibilities of this class are:
1. Send composition/mode/active state over DRM atomic commit IOCTL
to the kernel
2. Track commit state and keep planes owned by the Pipeline while they
are either displayed or staged for displaying.
3. Keep framebuffers alive while they are in use or staged.
Not much related to composition itself, therefore rename it to
DrmAtomicStateManager and move it to drm folder.
Bump clang-tidy level of DrmAtomicStateManager.c to normal by fixing
minor clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
1. Move drm/DrmConnector.h to Normal clang-tidy checks list by fixing
clang-tidy findings.
2. Remove DrmDevice self-reference.
3. Replace shared_ptr reference to DrmDevice in DrmFbImporter with a
pointer, making ResourceManager only owner of DrmDevice and its
chilren.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Implement DrmConnector instantiation through CreateInstance() static method,
which helps to reduce complexity of DrmDevice::Init() function.
Move Connector-to-CRTC binding information to the DrmDevice class.
Move drm/DrmConnector.h to Normal clang-tidy checks list by fixing
clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Implement DrmEncoder instantiation through CreateInstance() static method,
which helps to reduce complexity of DrmDevice::Init() function.
Move Encoder-to-CRTC binding information to the DrmDevice class.
Move drm/DrmEncoder.h to Normal clang-tidy checks list by fixing
clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Implement DrmCrtc instantiation through CreateInstance() static method,
which helps to reduce complexity of DrmDevice::Init() function.
Move CRTC-to-Display binding information to the DrmDevice class.
Move drm/DrmCrtc.h to Normal clang-tidy checks list by fixing
clang-tidy findings.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
We have single fail case of -readability-use-anyofallof.
Use NOLINTNEXTLINE comment instead.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
This improves visibility and helps to distinguish which
particular checks are disabled at every level.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Goals:
1. Follow clang-tidy rules to maintain project clean.
2. Do not allow new code to break goal #1.
Requirements for CI:
1. In case new file appears in the project, it should be picked-up by CI
automatically and CI should assign NORMAL clang-tidy check level.
2. CI makefile should have SKIP list to define files for which build
by CI is impossible for some reason.
3. CI makefile should have ability to override clang-tidy check level for
every file.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Previous dependencies relations was triggering FULL 'clang-tidy'
re-validation, even in case single source file has changed.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
This won't make much benefits for CI, but for local native builds will
significantly speed-up build cycle by allowing parallel build and by
using dependency tracking logic.
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>