--- /dev/null
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cc_defaults {
+ name: "minigbm_defaults",
+
+ srcs: [
+ "amdgpu.c",
+ "drv.c",
+ "evdi.c",
+ "exynos.c",
+ "helpers_array.c",
+ "helpers.c",
+ "i915.c",
+ "marvell.c",
+ "mediatek.c",
+ "meson.c",
+ "msm.c",
+ "nouveau.c",
+ "radeon.c",
+ "rockchip.c",
+ "tegra.c",
+ "udl.c",
+ "vc4.c",
+ "vgem.c",
+ "virtio_gpu.c",
+ ],
+
+ cflags: [
+ "-D_GNU_SOURCE=1",
+ "-D_FILE_OFFSET_BITS=64",
+ "-Wall",
+ "-Wsign-compare",
+ "-Wpointer-arith",
+ "-Wcast-qual",
+ "-Wcast-align",
+ "-Wno-unused-parameter",
+ ],
+
+ cppflags: ["-std=c++14"],
+}
+
+cc_defaults {
+ name: "minigbm_cros_gralloc_defaults",
+
+ defaults: ["minigbm_defaults"],
+
+ header_libs: [
+ "libhardware_headers",
+ "libnativebase_headers",
+ "libnativewindow_headers",
+ "libsystem_headers",
+ ],
+
+ export_header_lib_headers: [
+ "libhardware_headers",
+ "libnativebase_headers",
+ "libnativewindow_headers",
+ "libsystem_headers",
+ ],
+
+ srcs: [
+ "cros_gralloc/cros_gralloc_buffer.cc",
+ "cros_gralloc/cros_gralloc_helpers.cc",
+ "cros_gralloc/cros_gralloc_driver.cc",
+ ],
+
+ static_libs: ["libarect"],
+
+ export_static_lib_headers: ["libarect"],
+
+ vendor: true,
+
+ shared_libs: [
+ "libcutils",
+ "libdrm",
+ "libnativewindow",
+ "libsync",
+ "liblog",
+ ],
+}
+
+cc_defaults {
+ name: "gbm_defaults",
+
+ defaults: ["minigbm_defaults"],
+
+ srcs: [
+ "gbm.c",
+ "gbm_helpers.c",
+ ],
+
+ export_include_dirs: ["."],
+}
+
+cc_library {
+ name: "libgbm",
+ defaults: ["gbm_defaults"],
+ host_supported: true,
+
+ target: {
+ host: {
+ // Avoid linking to another host copy of libdrm; this library will cause
+ // binary GPU drivers to be loaded from the host, which might be linked
+ // to a system copy of libdrm, which conflicts with the AOSP one
+ allow_undefined_symbols: true,
+ header_libs: ["libdrm"],
+ },
+ android: {
+ shared_libs: [
+ "libdrm",
+ "liblog"
+ ],
+ },
+ },
+}
+
+cc_library_static {
+ name: "libminigbm_cros_gralloc",
+ defaults: ["minigbm_cros_gralloc_defaults"],
+ shared_libs: ["liblog"],
+ static_libs: ["libdrm"],
+
+ export_include_dirs: ["."],
+}
+
+cc_library_shared {
+ name: "gralloc.minigbm",
+ defaults: ["minigbm_cros_gralloc_defaults"],
+ srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
+}
+
+cc_library_shared {
+ name: "gralloc.minigbm_intel",
+ defaults: ["minigbm_cros_gralloc_defaults"],
+ enabled: false,
+ arch: {
+ x86: {
+ enabled: true,
+ },
+ x86_64: {
+ enabled: true,
+ },
+ },
+ cflags: ["-DDRV_I915"],
+ srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
+}
+
+cc_library_shared {
+ name: "gralloc.minigbm_meson",
+ defaults: ["minigbm_cros_gralloc_defaults"],
+ cflags: ["-DDRV_MESON"],
+ srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
+}
+++ /dev/null
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-ifeq ($(strip $(BOARD_USES_MINIGBM)), true)
-
-MINIGBM_GRALLOC_MK := $(call my-dir)/Android.gralloc.mk
-LOCAL_PATH := $(call my-dir)
-intel_drivers := i915 i965
-
-MINIGBM_SRC := \
- amdgpu.c \
- dri.c \
- drv.c \
- dumb_driver.c \
- exynos.c \
- helpers_array.c \
- helpers.c \
- i915.c \
- mediatek.c \
- meson.c \
- msm.c \
- radeon.c \
- rockchip.c \
- tegra.c \
- vc4.c \
- virtio_gpu.c
-
-MINIGBM_CPPFLAGS := -std=c++14
-MINIGBM_CFLAGS := \
- -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
- -Wall -Wsign-compare -Wpointer-arith \
- -Wcast-qual -Wcast-align \
- -Wno-unused-parameter
-
-ifneq ($(filter $(intel_drivers), $(BOARD_GPU_DRIVERS)),)
-MINIGBM_CPPFLAGS += -DDRV_I915
-MINIGBM_CFLAGS += -DDRV_I915
-LOCAL_SHARED_LIBRARIES += libdrm_intel
-endif
-
-ifneq ($(filter meson, $(BOARD_GPU_DRIVERS)),)
-MINIGBM_CPPFLAGS += -DDRV_MESON
-MINIGBM_CFLAGS += -DDRV_MESON
-endif
-
-include $(CLEAR_VARS)
-
-SUBDIRS := cros_gralloc
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- libdrm
-
-LOCAL_SRC_FILES := $(MINIGBM_SRC)
-
-include $(MINIGBM_GRALLOC_MK)
-
-LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
-LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
-
-LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM)
-LOCAL_MODULE_TAGS := optional
-# The preferred path for vendor HALs is /vendor/lib/hw
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
-LOCAL_HEADER_LIBRARIES += \
- libhardware_headers libnativebase_headers libsystem_headers
-LOCAL_SHARED_LIBRARIES += libnativewindow libsync liblog
-LOCAL_STATIC_LIBRARIES += libarect
-include $(BUILD_SHARED_LIBRARY)
-
-
-include $(CLEAR_VARS)
-LOCAL_SHARED_LIBRARIES := libcutils
-LOCAL_STATIC_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES += $(MINIGBM_SRC) gbm.c gbm_helpers.c
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_CFLAGS := $(MINIGBM_CFLAGS)
-LOCAL_CPPFLAGS := $(MINIGBM_CPPFLAGS)
-
-LOCAL_MODULE := libminigbm
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_SHARED_LIBRARY)
-
-endif
--- /dev/null
+name: "minigbm"
+description:
+ ""
+
+third_party {
+ url {
+ type: HOMEPAGE
+ value: "https://www.chromium.org/"
+ }
+ url {
+ type: GIT
+ value: "https://chromium.googlesource.com/chromiumos/platform/minigbm/"
+ }
+ version: ""
+ last_upgrade_date { year: 2018 month: 6 day: 25 }
+ license_type: NOTICE
+}
--- /dev/null
+adelva@google.com
+natsu@google.com
.lockAsync = gralloc0_lock_async,
.unlockAsync = gralloc0_unlock_async,
.lockAsync_ycbcr = gralloc0_lock_async_ycbcr,
+ .validateBufferSize = NULL,
+ .getTransportSize = NULL,
},
.alloc = nullptr,
--- /dev/null
+//
+// Copyright (C) 2020 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.
+
+cc_binary {
+ name: "android.hardware.graphics.allocator@3.0-service.minigbm",
+ relative_install_path: "hw",
+ vendor: true,
+ init_rc: ["android.hardware.graphics.allocator@3.0-service.minigbm.rc"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+
+ shared_libs: [
+ "android.hardware.graphics.allocator@3.0",
+ "android.hardware.graphics.mapper@3.0",
+ "libbase",
+ "libcutils",
+ "libhidlbase",
+ "liblog",
+ "libsync",
+ "libutils",
+ ],
+
+ static_libs: [
+ "libdrm",
+ "libminigbm_cros_gralloc",
+ ],
+
+ srcs: [
+ "CrosGralloc3Allocator.cc",
+ "CrosGralloc3AllocatorService.cc",
+ "CrosGralloc3Utils.cc",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.mapper@3.0-impl.minigbm",
+ relative_install_path: "hw",
+ vendor: true,
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+
+ shared_libs: [
+ "android.hardware.graphics.mapper@3.0",
+ "libbase",
+ "libcutils",
+ "libhidlbase",
+ "liblog",
+ "libsync",
+ "libutils",
+ ],
+
+ static_libs: [
+ "libdrm",
+ "libminigbm_cros_gralloc",
+ ],
+
+ srcs: [
+ "CrosGralloc3Mapper.cc",
+ "CrosGralloc3Utils.cc",
+ ],
+}
--- /dev/null
+//
+// Copyright (C) 2020 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.
+
+cc_binary {
+ name: "android.hardware.graphics.allocator@4.0-service.minigbm",
+ relative_install_path: "hw",
+ vendor: true,
+ init_rc: ["android.hardware.graphics.allocator@4.0-service.minigbm.rc"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+
+ shared_libs: [
+ "android.hardware.graphics.allocator@4.0",
+ "android.hardware.graphics.mapper@4.0",
+ "libbase",
+ "libcutils",
+ "libgralloctypes",
+ "libhidlbase",
+ "liblog",
+ "libsync",
+ "libutils",
+ ],
+
+ static_libs: [
+ "libdrm",
+ "libminigbm_cros_gralloc",
+ ],
+
+ srcs: [
+ "CrosGralloc4Allocator.cc",
+ "CrosGralloc4AllocatorService.cc",
+ "CrosGralloc4Utils.cc",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.graphics.mapper@4.0-impl.minigbm",
+ relative_install_path: "hw",
+ vendor: true,
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+
+ shared_libs: [
+ "android.hardware.graphics.mapper@4.0",
+ "libbase",
+ "libcutils",
+ "libgralloctypes",
+ "libhidlbase",
+ "liblog",
+ "libsync",
+ "libutils",
+ ],
+
+ static_libs: [
+ "libdrm",
+ "libminigbm_cros_gralloc",
+ ],
+
+ srcs: [
+ "CrosGralloc4Mapper.cc",
+ "CrosGralloc4Utils.cc",
+ ],
+}