OSDN Git Service

Add support to build with Android.
authorKalyan Kondapally <kalyan.kondapally@intel.com>
Sat, 4 Feb 2017 20:10:50 +0000 (12:10 -0800)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 7 Mar 2017 00:28:33 +0000 (16:28 -0800)
BUG=None
TEST=Able to build Minigbm in a pure Android environment
     i.e. Android IA.

Change-Id: Ib12e8411b4ba42b8dd83974fc372bf4884ed6e41
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/448841
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Android.gralloc.mk [new file with mode: 0644]
Android.mk [new file with mode: 0644]

diff --git a/Android.gralloc.mk b/Android.gralloc.mk
new file mode 100644 (file)
index 0000000..4a0b125
--- /dev/null
@@ -0,0 +1,10 @@
+# Copyright 2017 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES += \
+       cros_gralloc/cros_alloc_device.cc \
+       cros_gralloc/cros_gralloc_helpers.cc \
+       cros_gralloc/cros_gralloc_module.cc
diff --git a/Android.mk b/Android.mk
new file mode 100644 (file)
index 0000000..d5225ec
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright 2017 The Chromium OS Authors. All rights reserved.
+# 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
+include $(CLEAR_VARS)
+
+SUBDIRS := cros_gralloc
+
+LOCAL_SHARED_LIBRARIES := \
+       libcutils \
+       libdrm
+
+LOCAL_SRC_FILES := \
+       amdgpu.c \
+       cirrus.c \
+       drv.c \
+       evdi.c \
+       exynos.c \
+       gma500.c \
+       helpers.c \
+       i915.c \
+       marvell.c \
+       mediatek.c \
+       nouveau.c \
+       rockchip.c \
+       tegra.c \
+       udl.c \
+       vc4.c \
+       vgem.c \
+       virtio_gpu.c
+
+include $(MINIGBM_GRALLOC_MK)
+
+LOCAL_CPPFLAGS += -std=c++11 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
+LOCAL_CFLAGS += -Wall -Wsign-compare -Wpointer-arith \
+               -Wcast-qual -Wcast-align \
+               -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
+
+ifneq ($(filter $(intel_drivers), $(BOARD_GPU_DRIVERS)),)
+LOCAL_CPPFLAGS += -DDRV_I915
+LOCAL_CFLAGS += -DDRV_I915
+LOCAL_SHARED_LIBRARIES += libdrm_intel
+endif
+
+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)
+include $(BUILD_SHARED_LIBRARY)
+
+#endif