drm_hwcomposer: CI: Increase coverage
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>
diff --git a/.ci/.common.sh b/.ci/.common.sh
index fce6eee..93f7f95 100644
--- a/.ci/.common.sh
+++ b/.ci/.common.sh
@@ -1,21 +1,42 @@
-INCLUDE_DIRS="-I. -I../libdrm/include/drm -Iinclude -I/usr/include/libdrm -I./.ci/android_headers"
+INCLUDE_DIRS="-I. -I../libdrm/include/drm -Iinclude -I/usr/include/libdrm -I./.ci/android_headers -I./tests/test_include"
CLANG="clang++-11"
CLANG_TIDY="clang-tidy-11"
-CXXARGS="-fPIC -Wall -Werror -DPLATFORM_SDK_VERSION=30 -Wsign-promo -Wimplicit-fallthrough"
+CXXARGS="-fPIC -Wall -Werror -DPLATFORM_SDK_VERSION=30 -D__ANDROID_API__=30 -Wsign-promo -Wimplicit-fallthrough"
CXXARGS+=" -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-gnu-include-next "
CXXARGS+=" -fvisibility-inlines-hidden -std=gnu++17 -DHWC2_USE_CPP11 -DHWC2_INCLUDE_STRINGIFICATION -fexceptions -fno-rtti"
BUILD_FILES=(
+backend/BackendClient.cpp
+backend/Backend.cpp
+backend/BackendManager.cpp
+backend/BackendRCarDu.cpp
bufferinfo/BufferInfoGetter.cpp
+#bufferinfo/BufferInfoMapperMetadata.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/DrmConnector.cpp
drm/DrmCrtc.cpp
drm/DrmDevice.cpp
drm/DrmEncoder.cpp
drm/DrmEventListener.cpp
+drm/DrmGenericImporter.cpp
drm/DrmMode.cpp
drm/DrmPlane.cpp
drm/DrmProperty.cpp
+DrmHwcTwo.cpp
+drm/ResourceManager.cpp
+drm/VSyncWorker.cpp
+tests/worker_test.cpp
+utils/autolock.cpp
+#utils/hwcutils.cpp
utils/Worker.cpp
)
diff --git a/.ci/.gitlab-ci-clang-tidy-coarse.sh b/.ci/.gitlab-ci-clang-tidy-coarse.sh
index 4ecf19e..de0c024 100755
--- a/.ci/.gitlab-ci-clang-tidy-coarse.sh
+++ b/.ci/.gitlab-ci-clang-tidy-coarse.sh
@@ -35,5 +35,5 @@
for source in "${TIDY_FILES[@]}"
do
- $CLANG_TIDY $source --checks=$TIDY_COARSE_CHECKS -- -x c++ $INCLUDE_DIRS
+ $CLANG_TIDY $source --checks=$TIDY_COARSE_CHECKS -- -x c++ $INCLUDE_DIRS $CXXARGS
done
diff --git a/.ci/.gitlab-ci-clang-tidy-fine.sh b/.ci/.gitlab-ci-clang-tidy-fine.sh
index fdc0883..644f621 100755
--- a/.ci/.gitlab-ci-clang-tidy-fine.sh
+++ b/.ci/.gitlab-ci-clang-tidy-fine.sh
@@ -3,7 +3,6 @@
. ./.ci/.common.sh
TIDY_FILES=(
-utils/gralloc.h
utils/log.h
utils/properties.h
)
@@ -12,5 +11,5 @@
for source in "${TIDY_FILES[@]}"
do
- $CLANG_TIDY $source -- -x c++ $INCLUDE_DIRS
+ $CLANG_TIDY $source -- -x c++ $INCLUDE_DIRS $CXXARGS
done
diff --git a/.ci/android_headers/hardware/gralloc.h b/.ci/android_headers/hardware/gralloc.h
index 1193b1f..260140e 100644
--- a/.ci/android_headers/hardware/gralloc.h
+++ b/.ci/android_headers/hardware/gralloc.h
@@ -29,7 +29,9 @@
#include <cutils/native_handle.h>
#include <hardware/hardware.h>
+#if 0 /* Header below is not used by drm_hwcomposer */
#include <hardware/fb.h>
+#endif
__BEGIN_DECLS
diff --git a/.ci/android_headers/hardware/hwcomposer2.h b/.ci/android_headers/hardware/hwcomposer2.h
index a10f526..df5670f 100644
--- a/.ci/android_headers/hardware/hwcomposer2.h
+++ b/.ci/android_headers/hardware/hwcomposer2.h
@@ -24,6 +24,13 @@
#include "hwcomposer_defs.h"
+/* Missing in glibc, pull from BIONIC */
+#if defined(__cplusplus)
+#define __BIONIC_CAST(_k,_t,_v) (_k<_t>(_v))
+#else
+#define __BIONIC_CAST(_k,_t,_v) ((_t) (_v))
+#endif
+
__BEGIN_DECLS
/*
diff --git a/.ci/android_headers/ndk/sync.h b/.ci/android_headers/ndk/sync.h
index dcc35f3..2ca389b 100644
--- a/.ci/android_headers/ndk/sync.h
+++ b/.ci/android_headers/ndk/sync.h
@@ -67,7 +67,7 @@
*
* Available since API level 26.
*/
-int32_t sync_merge(const char* name, int32_t fd1, int32_t fd2) __INTRODUCED_IN(26);
+int32_t sync_merge(const char* name, int32_t fd1, int32_t fd2) /* __INTRODUCED_IN(26) */;
/**
* Retrieve detailed information about a sync file and its fences.
@@ -76,7 +76,7 @@
*
* Available since API level 26.
*/
-struct sync_file_info* sync_file_info(int32_t fd) __INTRODUCED_IN(26);
+struct sync_file_info* sync_file_info(int32_t fd) /* __INTRODUCED_IN(26) */;
/**
* Get the array of fence infos from the sync file's info.
@@ -100,7 +100,7 @@
*
* Available since API level 26.
*/
-void sync_file_info_free(struct sync_file_info* info) __INTRODUCED_IN(26);
+void sync_file_info_free(struct sync_file_info* info) /* __INTRODUCED_IN(26) */;
#endif /* __ANDROID_API__ >= 26 */