1
0
Fork 0
Commit graph

34 commits

Author SHA1 Message Date
Roman Stratiienko
57ba08add7 drm_hwcomposer: CI: Upgrade Ubuntu and clang version
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>
2024-10-17 02:13:14 +03:00
Roman Stratiienko
0fea188c2c Revert "drm_hwcomposer: CI: use local container image for building"
This reverts commit ca89ea5a92.
2024-10-17 02:13:05 +03:00
Drew Davenport
8ac53efade drm_hwcomposer: CI: Remove misc-const-correctness
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>
2024-09-07 01:32:23 +00:00
Drew Davenport
6abf8193b0 drm_hwcomposer: CI: Remove google-readability-todo
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>
2024-08-30 22:15:14 +00:00
Mattijs Korpershoek
ca89ea5a92 drm_hwcomposer: CI: use local container image for building
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>
2024-07-12 16:36:49 +00:00
Roman Stratiienko
2a93e4c882 drm_hwcomposer: CI: Use aospext to provide headers for clang-tidy
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>
2023-11-21 18:50:58 +02:00
Roman Stratiienko
76892784ac drm_hwcomposer: Introduce SharedFd, use standard c++ RAII for UniqueFd
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>
2023-01-16 20:13:58 +02:00
Roman Stratiienko
14bc764de0 drm_hwcomposer: Remove utils/worker from the project
utils/worker is no longer used and can be removed.

Change-Id: I5fc9bd2b3b8b0375622ee2446044d3b893756b30
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-28 19:18:34 +02:00
Roman Stratiienko
d2cc73874c drm_hwcomposer: Rework VSyncWorker to work without utils/worker
utils/worker just complicates the logic without providing any benefit.

Change-Id: I7b3c91aee9c0507d9ca35792d24ba6c8c3870033
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-28 19:18:29 +02:00
Roman Stratiienko
6b40505a7e drm_hwcomposer: Use __ANDROID_API__ instead of PLATFORM_SDK_VERSION
__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>
2022-12-11 21:19:43 +02:00
Roman Stratiienko
df3120f9f3 drm_hwcomposer: Rework DrmMode class
Simplify code and raise-up clang-tidy level of DrmMode class
to 'normal'.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-11 21:19:43 +02:00
Roman Stratiienko
abd8e534d9 drm_hwcomposer: Rework DrmProperty class
Simplify code and raise-up clang-tidy level of DrmProperty class
to 'normal'.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
2022-12-11 21:19:43 +02:00
Roman Stratiienko
a7913de518 drm_hwcomposer: CI: Bump-up clang toolchain to v15
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>
2022-10-20 14:14:33 +03:00
Roman Stratiienko
cf80b9b158 drm_hwcomposer: CI: Bump clang toolchain version to v14
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>
2022-05-09 18:19:45 +03:00
Roman Stratiienko
bd9731713b drm_hwcomposer: Add test utility to listen for uevents
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>
2022-02-18 17:16:00 +02:00
Roman Stratiienko
4e994055a3 drm_hwcomposer: Rename DrmDisplayCompositor->DrmAtomicStateManager
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>
2022-02-09 17:40:35 +02:00
Roman Stratiienko
9362cef4c3 drm_hwcomposer: Rework KMS composition planner + plane sharing support
Rewrite Layer-to-Plane planner. Get rid of ~200 redundant lines of code
+ added plane sharing functionality.

Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/11
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-02-04 11:19:40 +02:00
Roman Stratiienko
7d89911c32 drm_hwcomposer: Tidy-up DrmDevice class
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>
2022-01-31 21:48:40 +02:00
Roman Stratiienko
650299a235 drm_hwcomposer: Tidy-up DrmConnector class
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>
2022-01-31 21:48:40 +02:00
Roman Stratiienko
027987b1fe drm_hwcomposer: Tidy-up DrmEncoder class
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>
2022-01-31 21:31:32 +02:00
Roman Stratiienko
10be875de0 drm_hwcomposer: Tidy-up DrmCrtc class
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>
2022-01-31 21:31:32 +02:00
Roman Stratiienko
780f7dacf9 drm_hwcomposer: CI: Upgrade to clang-13 && clang-tidy-13
+ address new clang-tidy findings.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-20 17:21:46 +02:00
Roman Stratiienko
3e1689054d drm_hwcomposer: Move DrmHwcTwo.{cpp|h} to hwc2_device/ directory
To keep all frontend-related files in a single directory.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 11:27:09 +02:00
Roman Stratiienko
3627bebf7b drm_hwcomposer: Move HwcDisplay out of DrmHwcTwo class
Reduces code complexity.

Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/35
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 11:27:07 +02:00
Roman Stratiienko
568e5981ca drm_hwcomposer: CI: Remove -readability-use-anyofallof from COARSE list
We have single fail case of -readability-use-anyofallof.
Use NOLINTNEXTLINE comment instead.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:47:23 +02:00
Roman Stratiienko
25311dd62b drm_hwcomposer: CI: Remove duplicate tidy checks
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>
2022-01-12 10:47:23 +02:00
Roman Stratiienko
c46896d6e2 drm_hwcomposer: CI: Move tidy FINE checklist to Makefile
To make checklists definitions aligned and allow inheritance.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:47:23 +02:00
Roman Stratiienko
f815d38c2a drm_hwcomposer: Raise clang-tidy level of some files to NORMAL
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:47:23 +02:00
Roman Stratiienko
5741bbd6d8 drm_hwcomposer: CI: Find all source files instead of hardcoding them.
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>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
fc014f5792 drm_hwcomposer: CI: Set clang-tidy level to NORMAL for some files
Some of files require small adjustments to move into NORMAL checks list.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
e78235c0be drm_hwcomposer: CI: Raise clang-tidy level from NONE to COARSE for *.h
To improve CI coverage.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
24a7fc43eb drm_hwcomposer: CI: Process every file with clang-tidy.
Currently part of header files isn't processed by CI.

Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
35112734ac drm_hwcomposer: CI: Fix Makefile dependencies
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>
2022-01-12 10:33:55 +02:00
Roman Stratiienko
cef5c77ef9 drm_hwcomposer: CI: Replace shell scripts with Makefile
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>
2021-12-22 17:31:54 +02:00