OSDN Git Service

Merge 'aosp/upstream-master' into HEAD
authorJason Macnak <natsu@google.com>
Wed, 28 Oct 2020 20:27:30 +0000 (13:27 -0700)
committerJason Macnak <natsu@google.com>
Wed, 28 Oct 2020 20:27:30 +0000 (13:27 -0700)
... to pull in PlaneLayout metadata fix http://crrev.com/c/2503481

Bug: b/171019648
Test: launch_cvd
Test: launch_cvd --gpu_mode=gfxstream
Change-Id: I9c2a52e2eca3339c024154840cb91f65bb7ed577

Android.bp [new file with mode: 0644]
Android.mk [deleted file]
METADATA [new file with mode: 0644]
MODULE_LICENSE_BSD [new file with mode: 0644]
OWNERS.android [new file with mode: 0644]
cros_gralloc/gralloc0/gralloc0.cc
cros_gralloc/gralloc3/Android.bp [new file with mode: 0644]
cros_gralloc/gralloc4/Android.bp [new file with mode: 0644]

diff --git a/Android.bp b/Android.bp
new file mode 100644 (file)
index 0000000..d074e46
--- /dev/null
@@ -0,0 +1,154 @@
+// 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"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644 (file)
index 18c1bba..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# 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
diff --git a/METADATA b/METADATA
new file mode 100644 (file)
index 0000000..b281ea4
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,17 @@
+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
+}
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/OWNERS.android b/OWNERS.android
new file mode 100644 (file)
index 0000000..be55e00
--- /dev/null
@@ -0,0 +1,2 @@
+adelva@google.com
+natsu@google.com
index f67ddff..4ab73f2 100644 (file)
@@ -496,6 +496,8 @@ struct gralloc0_module HAL_MODULE_INFO_SYM = {
                .lockAsync = gralloc0_lock_async,
                .unlockAsync = gralloc0_unlock_async,
                .lockAsync_ycbcr = gralloc0_lock_async_ycbcr,
+                .validateBufferSize = NULL,
+                .getTransportSize = NULL,
            },
 
        .alloc = nullptr,
diff --git a/cros_gralloc/gralloc3/Android.bp b/cros_gralloc/gralloc3/Android.bp
new file mode 100644 (file)
index 0000000..eac6a33
--- /dev/null
@@ -0,0 +1,79 @@
+//
+// 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",
+    ],
+}
diff --git a/cros_gralloc/gralloc4/Android.bp b/cros_gralloc/gralloc4/Android.bp
new file mode 100644 (file)
index 0000000..48cd2a8
--- /dev/null
@@ -0,0 +1,81 @@
+//
+// 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",
+    ],
+}