OSDN Git Service

drm_hwcomposer: CI: Add more source files to the build
authorRoman Stratiienko <r.stratiienko@gmail.com>
Fri, 26 Feb 2021 15:49:40 +0000 (17:49 +0200)
committerRoman Stratiienko <r.stratiienko@gmail.com>
Wed, 3 Mar 2021 14:12:22 +0000 (16:12 +0200)
Build bufferinfo/BufferInfoGetter.cpp and drm/DrmPlane.cpp

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
.ci/.common.sh
.ci/.gitlab-ci-clang-tidy-fine.sh
bufferinfo/BufferInfoGetter.cpp
bufferinfo/BufferInfoGetter.h
drm/DrmPlane.cpp
utils/gralloc.h [new file with mode: 0644]

index 4dbe745..9cf3683 100644 (file)
@@ -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
 )
index f4c11de..fdc0883 100755 (executable)
@@ -3,6 +3,7 @@
 . ./.ci/.common.sh
 
 TIDY_FILES=(
+utils/gralloc.h
 utils/log.h
 utils/properties.h
 )
index 477228b..cae7f96 100644 (file)
 #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() {
index 60ca985..c1dc74a 100644 (file)
 #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
index 570905f..2967a7a 100644 (file)
@@ -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 (file)
index 0000000..fe3182e
--- /dev/null
@@ -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