Browse Source

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>
Roman Stratiienko 2 years ago
parent
commit
cf80b9b158
6 changed files with 11 additions and 9 deletions
  1. 1 1
      .ci/.gitlab-ci-checkcommit.sh
  2. 3 2
      .ci/Makefile
  3. 2 2
      .gitlab-ci.yml
  4. 1 1
      README.md
  5. 2 2
      drm/DrmFbImporter.cpp
  6. 2 1
      utils/Worker.h

+ 1 - 1
.ci/.gitlab-ci-checkcommit.sh

@@ -50,7 +50,7 @@ git log --pretty='%h' FETCH_HEAD..HEAD | while read h; do
 		exit 1
 	fi
 
-	git show "$h" -- | clang-format-diff-13 -p 1 -style=file > /tmp/format-fixup.patch
+	git show "$h" -- | clang-format-diff-14 -p 1 -style=file > /tmp/format-fixup.patch
 	if [ -s  /tmp/format-fixup.patch ]; then
 		cat /tmp/format-fixup.patch >&2
 		exit 1

+ 3 - 2
.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++-13
-CLANG_TIDY := clang-tidy-13
+CLANG := clang++-14
+CLANG_TIDY := clang-tidy-14
 OUT_DIR := /tmp/drm_hwcomposer/build
 SRC_DIR := .
 
@@ -43,6 +43,7 @@ TIDY_CHECKS_FINE := *                                   \
     -cppcoreguidelines-pro-type-vararg                  \
     -hicpp-vararg                                       \
     -hicpp-signed-bitwise                               \
+    -readability-identifier-length                      \
 
 TIDY_CHECKS_NORMAL :=                                   \
     $(TIDY_CHECKS_FINE)                                 \

+ 2 - 2
.gitlab-ci.yml

@@ -1,11 +1,11 @@
-image: ubuntu:21.10
+image: ubuntu:22.04
 
 variables:
   DEBIAN_FRONTEND: noninteractive
 
 before_script:
   - apt-get --quiet update --yes >/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
+  - apt-get --quiet install --yes clang-14 clang-tidy-14 clang-format-14 git libdrm-dev blueprint-tools libgtest-dev make >/dev/null
 
 stages:
   - build

+ 1 - 1
README.md

@@ -16,7 +16,7 @@ A short list of contribution guidelines:
   you with formatting of your patches:
 
     ```
-    git diff | clang-format-diff-13 -p 1 -style=file
+    git diff | clang-format-diff-14 -p 1 -style=file
     ```
 
 * Hardware specific changes should be tested on relevant platforms before

+ 2 - 2
drm/DrmFbImporter.cpp

@@ -69,11 +69,11 @@ auto DrmFbIdHandle::CreateInstance(hwc_drm_bo_t *bo, GemHandle first_gem_handle,
   /* Create framebuffer object */
   if (!has_modifiers) {
     err = drmModeAddFB2(drm.GetFd(), bo->width, bo->height, bo->format,
-                        &local->gem_handles_[0], &bo->pitches[0],
+                        local->gem_handles_.data(), &bo->pitches[0],
                         &bo->offsets[0], &local->fb_id_, 0);
   } else {
     err = drmModeAddFB2WithModifiers(drm.GetFd(), bo->width, bo->height,
-                                     bo->format, &local->gem_handles_[0],
+                                     bo->format, local->gem_handles_.data(),
                                      &bo->pitches[0], &bo->offsets[0],
                                      &bo->modifiers[0], &local->fb_id_,
                                      DRM_MODE_FB_MODIFIERS);

+ 2 - 1
utils/Worker.h

@@ -44,9 +44,10 @@ class Worker {
     return initialized_;
   }
 
+  virtual ~Worker();
+
  protected:
   Worker(const char *name, int priority);
-  virtual ~Worker();
 
   int InitWorker();
   virtual void Routine() = 0;