summaryrefslogtreecommitdiffstats
path: root/Android.bp
blob: d074e46dfd9204b4a609e6857b2efb9a6330b95a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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"],
}