From 7afc31560ad220ac0514aba940b995a3f52b08ac Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Tue, 29 Dec 2020 12:08:32 +0200 Subject: [PATCH] minigbm: Add dri_generic driver to Android.bp Depends on mainline mesa3d with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8259 merged. Signed-off-by: Roman Stratiienko Change-Id: Ic54d3444cdb2a6b536e9faca63ef21e5c592545d --- Android.bp | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Android.bp b/Android.bp index 9b3d5ff..04112b2 100644 --- a/Android.bp +++ b/Android.bp @@ -6,6 +6,8 @@ cc_defaults { srcs: [ "amdgpu.c", + "dri.c", + "dri_generic_driver.c", "drv.c", "dumb_driver.c", "exynos.c", @@ -20,7 +22,10 @@ cc_defaults { "virtio_gpu.c", ], + include_dirs: ["external/mesa3d/include"], + cflags: [ + "-DDRI_GENERIC_DRV", "-D_GNU_SOURCE=1", "-D_FILE_OFFSET_BITS=64", "-Wall", @@ -32,6 +37,15 @@ cc_defaults { ], cppflags: ["-std=c++14"], + + multilib: { + lib32: { + cflags: ["-DDRI_DRIVER_DIR=/vendor/lib/dri"], + }, + lib64: { + cflags: ["-DDRI_DRIVER_DIR=/vendor/lib64/dri"], + }, + }, } cc_defaults { @@ -61,6 +75,8 @@ cc_defaults { static_libs: ["libarect"], + whole_static_libs: ["libmesa_loader"], + export_static_lib_headers: ["libarect"], vendor: true, @@ -87,28 +103,6 @@ cc_defaults { 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_headers"], - }, - android: { - shared_libs: [ - "libdrm", - "liblog" - ], - }, - }, -} - cc_library_static { name: "libminigbm_cros_gralloc", defaults: ["minigbm_cros_gralloc_defaults"], @@ -122,6 +116,7 @@ cc_library_shared { name: "gralloc.minigbm", defaults: ["minigbm_cros_gralloc_defaults"], srcs: ["cros_gralloc/gralloc0/gralloc0.cc"], + relative_install_path: "hw", } cc_library_shared { @@ -136,6 +131,7 @@ cc_library_shared { enabled: true, }, }, + relative_install_path: "hw", cflags: ["-DDRV_I915"], srcs: ["cros_gralloc/gralloc0/gralloc0.cc"], } @@ -143,6 +139,7 @@ cc_library_shared { cc_library_shared { name: "gralloc.minigbm_meson", defaults: ["minigbm_cros_gralloc_defaults"], + relative_install_path: "hw", cflags: ["-DDRV_MESON"], srcs: ["cros_gralloc/gralloc0/gralloc0.cc"], } -- 2.11.0