1//
2// Copyright 2022 The Android Open-Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    // See: http://go/android-license-faq
19    default_applicable_licenses: [
20        "device_generic_goldfish-opengl_license",
21    ],
22}
23
24cc_binary {
25    name: "android.hardware.graphics.composer3-service.ranchu",
26
27    defaults: [
28        "android.hardware.graphics.composer3-ndk_shared",
29    ],
30
31    relative_install_path: "hw",
32    vendor: true,
33
34    shared_libs: [
35        "android.hardware.graphics.composer@2.1-resources",
36        "android.hardware.graphics.composer@2.2-resources",
37        "libbase",
38        "libbinder_ndk",
39        "libcutils",
40        "libdrm",
41        "libgralloctypes",
42        "libhidlbase",
43        "libjsoncpp",
44        "liblog",
45        "libsync",
46        "libui",
47        "libutils",
48        "libOpenglSystemCommon",
49        "libui",
50    ],
51
52    static_libs: [
53        "libaidlcommonsupport",
54        "libyuv_static",
55    ],
56
57    header_libs: [
58        "libminigbm_gralloc_headers",
59    ],
60
61    srcs: [
62        "AlternatingImageStorage.cpp",
63        "ClientFrameComposer.cpp",
64        "Common.cpp",
65        "Composer.cpp",
66        "ComposerClient.cpp",
67        "ComposerResources.cpp",
68        "Device.cpp",
69        "Display.cpp",
70        "DisplayConfig.cpp",
71        "DisplayFinder.cpp",
72        "Drm.cpp",
73        "DrmSwapchain.cpp",
74        "DrmAtomicRequest.cpp",
75        "DrmBuffer.cpp",
76        "DrmClient.cpp",
77        "DrmConnector.cpp",
78        "DrmCrtc.cpp",
79        "DrmDisplay.cpp",
80        "DrmEventListener.cpp",
81        "DrmMode.cpp",
82        "DrmPlane.cpp",
83        "EdidInfo.cpp",
84        "Gralloc.cpp",
85        "GuestFrameComposer.cpp",
86        "HostFrameComposer.cpp",
87        "HostUtils.cpp",
88        "Layer.cpp",
89        "Main.cpp",
90        "NoOpFrameComposer.cpp",
91        "VsyncThread.cpp",
92    ],
93
94    cflags: [
95        "-Wall",
96        "-Werror=conversion",
97        "-Wthread-safety",
98    ],
99
100    vintf_fragments: ["hwc3.xml"],
101    init_rc: ["hwc3.rc"],
102
103}
104
105apex {
106    name: "com.android.hardware.graphics.composer.ranchu",
107    key: "com.android.hardware.key",
108    certificate: ":com.android.hardware.certificate",
109    file_contexts: "apex_file_contexts",
110    manifest: "apex_manifest.json",
111    vendor: true,
112    updatable: false,
113
114    binaries: [
115        "android.hardware.graphics.composer3-service.ranchu",
116    ],
117    prebuilts: [
118        "hwc3.xml",
119        "hwc3-apex.rc",
120    ],
121}
122
123prebuilt_etc {
124    name: "hwc3.xml",
125    src: "hwc3.xml",
126    sub_dir: "vintf",
127    installable: false,
128}
129
130prebuilt_etc {
131    name: "hwc3-apex.rc",
132    src: ":gen-hwc3-apex.rc",
133    installable: false,
134}
135
136genrule {
137    name: "gen-hwc3-apex.rc",
138    srcs: ["hwc3.rc"],
139    out: ["hwc3-apex.rc"],
140    cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.graphics.composer.ranchu/bin/@' $(in) > $(out)",
141}
142
143