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>
diff --git a/.ci/.gitlab-ci-checkcommit.sh b/.ci/.gitlab-ci-checkcommit.sh
index e59ad9f..c9c2e49 100755
--- a/.ci/.gitlab-ci-checkcommit.sh
+++ b/.ci/.gitlab-ci-checkcommit.sh
@@ -50,7 +50,7 @@
exit 1
fi
- git show "$h" -- | clang-format-diff-12 -p 1 -style=file > /tmp/format-fixup.patch
+ git show "$h" -- | clang-format-diff-13 -p 1 -style=file > /tmp/format-fixup.patch
if [ -s /tmp/format-fixup.patch ]; then
cat /tmp/format-fixup.patch >&2
exit 1
diff --git a/.ci/Makefile b/.ci/Makefile
index 4ca14d6..7f43a8a 100644
--- a/.ci/Makefile
+++ b/.ci/Makefile
@@ -2,8 +2,8 @@
INCLUDE_DIRS := . ../libdrm/include/drm include ./.ci/android_headers ./tests/test_include
SYSTEM_INCLUDE_DIRS := /usr/include/libdrm
-CLANG := clang++-12
-CLANG_TIDY := clang-tidy-12
+CLANG := clang++-13
+CLANG_TIDY := clang-tidy-13
OUT_DIR := /tmp/drm_hwcomposer/build
SRC_DIR := .
@@ -57,6 +57,7 @@
TIDY_CHECKS_NORMAL := \
$(TIDY_CHECKS_FINE) \
-hicpp* \
+ -bugprone-easily-swappable-parameters \
-cppcoreguidelines-special-member-functions \
-cppcoreguidelines-avoid-c-arrays \
-cppcoreguidelines-pro-bounds-array-to-pointer-decay \
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9a54b44..89ac1b8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,11 +1,11 @@
-image: ubuntu:21.04
+image: ubuntu:21.10
variables:
DEBIAN_FRONTEND: noninteractive
before_script:
- apt-get --quiet update --yes >/dev/null
- - apt-get --quiet install --yes clang-12 clang-tidy-12 clang-format-12 git libdrm-dev blueprint-tools libgtest-dev make >/dev/null
+ - apt-get --quiet install --yes clang-13 clang-tidy-13 clang-format-13 git libdrm-dev blueprint-tools libgtest-dev make >/dev/null
stages:
- build
diff --git a/README.md b/README.md
index c142266..05ddc79 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
you with formatting of your patches:
```
- git diff | clang-format-diff-12 -p 1 -style=file
+ git diff | clang-format-diff-13 -p 1 -style=file
```
* Hardware specific changes should be tested on relevant platforms before
diff --git a/compositor/DrmDisplayCompositor.cpp b/compositor/DrmDisplayCompositor.cpp
index 89e7f2d..bff88bc 100644
--- a/compositor/DrmDisplayCompositor.cpp
+++ b/compositor/DrmDisplayCompositor.cpp
@@ -60,7 +60,7 @@
DrmCrtc *crtc = drm->GetCrtcForDisplay(display_);
if (!crtc) {
ALOGE("Failed to find crtc for display = %d", display_);
- return std::unique_ptr<DrmDisplayComposition>();
+ return {};
}
return std::make_unique<DrmDisplayComposition>(crtc);
diff --git a/drm/DrmConnector.cpp b/drm/DrmConnector.cpp
index bd5277f..7cbec95 100644
--- a/drm/DrmConnector.cpp
+++ b/drm/DrmConnector.cpp
@@ -102,12 +102,12 @@
uint64_t blob_id = 0;
int ret = UpdateEdidProperty();
if (ret != 0) {
- return DrmModePropertyBlobUnique();
+ return {};
}
std::tie(ret, blob_id) = edid_property().value();
if (ret != 0) {
- return DrmModePropertyBlobUnique();
+ return {};
}
return MakeDrmModePropertyBlobUnique(drm_->fd(), blob_id);
diff --git a/drm/DrmDevice.cpp b/drm/DrmDevice.cpp
index a679bf5..18ce270 100644
--- a/drm/DrmDevice.cpp
+++ b/drm/DrmDevice.cpp
@@ -494,7 +494,7 @@
int ret = drmIoctl(fd(), DRM_IOCTL_MODE_CREATEPROPBLOB, &create_blob);
if (ret) {
ALOGE("Failed to create mode property blob %d", ret);
- return DrmModeUserPropertyBlobUnique();
+ return {};
}
return DrmModeUserPropertyBlobUnique(
diff --git a/drm/DrmFbImporter.cpp b/drm/DrmFbImporter.cpp
index 25f32b7..6f2abe8 100644
--- a/drm/DrmFbImporter.cpp
+++ b/drm/DrmFbImporter.cpp
@@ -124,7 +124,7 @@
if (err != 0) {
ALOGE("Failed to import prime fd %d ret=%d", bo->prime_fds[0], err);
- return std::shared_ptr<DrmFbIdHandle>();
+ return {};
}
auto drm_fb_id_cached = drm_fb_id_handle_cache_.find(first_handle);
diff --git a/drm/VSyncWorker.cpp b/drm/VSyncWorker.cpp
index 6e92838..8d1cb99 100644
--- a/drm/VSyncWorker.cpp
+++ b/drm/VSyncWorker.cpp
@@ -77,7 +77,7 @@
last_timestamp_;
}
-static const int64_t kOneSecondNs = 1 * 1000 * 1000 * 1000;
+static const int64_t kOneSecondNs = 1LL * 1000 * 1000 * 1000;
int VSyncWorker::SyntheticWaitVBlank(int64_t *timestamp) {
struct timespec vsync {};
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 9055a9a..9f7bcd8 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -505,7 +505,7 @@
* https://cs.android.com/android/platform/superproject/+/android-11.0.0_r3:hardware/libhardware/include/hardware/hwcomposer2.h;l=1805
*/
HWC2::Error HwcDisplay::PresentDisplay(int32_t *present_fence) {
- HWC2::Error ret;
+ HWC2::Error ret{};
++total_stats_.total_frames_;