aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Stratiienko <r.stratiienko@gmail.com>2021-02-26 17:49:40 +0200
committerRoman Stratiienko <r.stratiienko@gmail.com>2021-03-03 16:12:22 +0200
commit2640cd88d1931d0031cf21fafef2f133c5d8473e (patch)
tree00769c63681a9a518ccc628620e1fd9d6973e0ef
parentb3b5c1e937d6bbbd44b65f5c36305bdc8fbb3246 (diff)
downloaddrm_hwcomposer-2640cd88d1931d0031cf21fafef2f133c5d8473e.tar.gz
drm_hwcomposer: CI: Add more source files to the build
Build bufferinfo/BufferInfoGetter.cpp and drm/DrmPlane.cpp Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
-rw-r--r--.ci/.common.sh2
-rwxr-xr-x.ci/.gitlab-ci-clang-tidy-fine.sh1
-rw-r--r--bufferinfo/BufferInfoGetter.cpp7
-rw-r--r--bufferinfo/BufferInfoGetter.h2
-rw-r--r--drm/DrmPlane.cpp4
-rw-r--r--utils/gralloc.h67
6 files changed, 75 insertions, 8 deletions
diff --git a/.ci/.common.sh b/.ci/.common.sh
index 4dbe745..9cf3683 100644
--- a/.ci/.common.sh
+++ b/.ci/.common.sh
@@ -8,12 +8,14 @@ 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=(
+bufferinfo/BufferInfoGetter.cpp
drm/DrmConnector.cpp
drm/DrmCrtc.cpp
drm/DrmDevice.cpp
drm/DrmEncoder.cpp
drm/DrmEventListener.cpp
drm/DrmMode.cpp
+drm/DrmPlane.cpp
drm/DrmProperty.cpp
utils/Worker.cpp
)
diff --git a/.ci/.gitlab-ci-clang-tidy-fine.sh b/.ci/.gitlab-ci-clang-tidy-fine.sh
index f4c11de..fdc0883 100755
--- a/.ci/.gitlab-ci-clang-tidy-fine.sh
+++ b/.ci/.gitlab-ci-clang-tidy-fine.sh
@@ -3,6 +3,7 @@
. ./.ci/.common.sh
TIDY_FILES=(
+utils/gralloc.h
utils/log.h
utils/properties.h
)
diff --git a/bufferinfo/BufferInfoGetter.cpp b/bufferinfo/BufferInfoGetter.cpp
index 477228b..cae7f96 100644
--- a/bufferinfo/BufferInfoGetter.cpp
+++ b/bufferinfo/BufferInfoGetter.cpp
@@ -22,13 +22,12 @@
#include "BufferInfoMapperMetadata.h"
#endif
-#include <cutils/properties.h>
-#include <gralloc_handle.h>
-#include <hardware/gralloc.h>
-#include <log/log.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
+#include "utils/log.h"
+#include "utils/properties.h"
+
namespace android {
BufferInfoGetter *BufferInfoGetter::GetInstance() {
diff --git a/bufferinfo/BufferInfoGetter.h b/bufferinfo/BufferInfoGetter.h
index 60ca985..c1dc74a 100644
--- a/bufferinfo/BufferInfoGetter.h
+++ b/bufferinfo/BufferInfoGetter.h
@@ -18,10 +18,10 @@
#define ANDROID_BUFFERINFOGETTER_H_
#include <drm/drm_fourcc.h>
-#include <hardware/gralloc.h>
#include "drm/DrmDevice.h"
#include "drmhwcgralloc.h"
+#include "utils/gralloc.h"
#ifndef DRM_FORMAT_INVALID
#define DRM_FORMAT_INVALID 0
diff --git a/drm/DrmPlane.cpp b/drm/DrmPlane.cpp
index 570905f..2967a7a 100644
--- a/drm/DrmPlane.cpp
+++ b/drm/DrmPlane.cpp
@@ -18,9 +18,7 @@
#include "DrmPlane.h"
-#include <errno.h>
-#include <stdint.h>
-
+#include <algorithm>
#include <cerrno>
#include <cinttypes>
#include <cstdint>
diff --git a/utils/gralloc.h b/utils/gralloc.h
new file mode 100644
index 0000000..fe3182e
--- /dev/null
+++ b/utils/gralloc.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef UTILS_GRALLOC_H_
+#define UTILS_GRALLOC_H_
+
+#ifdef ANDROID
+#include <hardware/gralloc.h>
+#else
+
+/* STUBS */
+
+#include <cstdint>
+
+using buffer_handle_t = int;
+
+// NOLINTNEXTLINE(readability-identifier-naming)
+constexpr auto GRALLOC_HARDWARE_MODULE_ID = "gralloc";
+
+enum {
+ HAL_PIXEL_FORMAT_RGBA_8888 = 1, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_RGBX_8888 = 2, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_RGB_888 = 3, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_RGB_565 = 4, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_BGRA_8888 = 5, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_RGBA_FP16 = 22, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 34, // NOLINT(readability-identifier-naming)
+ HAL_PIXEL_FORMAT_YV12 = 842094169, // NOLINT(readability-identifier-naming)
+};
+
+// NOLINTNEXTLINE(readability-identifier-naming)
+struct hw_module_t {
+ uint32_t tag{};
+ uint16_t module_api_version{};
+ uint16_t hal_api_version{};
+ const char *id{};
+ const char *name{};
+ const char *author{};
+ void *dso{};
+};
+
+// NOLINTNEXTLINE(readability-identifier-naming)
+struct gralloc_module_t {
+ hw_module_t common;
+};
+
+auto inline hw_get_module(const char * /*id*/,
+ const struct hw_module_t ** /*module*/) -> int {
+ return -1;
+}
+
+#endif
+
+#endif