blob: 7e85db8591c7331a4333aaa6e529e56a675e3e14 [file] [log] [blame]
Bill Yanga1525fa2024-09-16 04:11:19 +00001// Copyright (C) 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//###############################################################################
16package {
17 // See: http://go/android-license-faq
18 default_applicable_licenses: [
19 "hardware_interfaces_license",
20 ],
21}
22
23soong_config_module_type {
24 name: "surfaceflinger_cc_defaults_type",
25 module_type: "cc_defaults",
26 config_namespace: "surfaceflinger",
27 value_variables: [
28 "vsync_event_phase_offset_ns",
29 "sf_vsync_event_phase_offset_ns",
30 "present_time_offset_from_vsync_ns",
31 "max_virtual_displat_dimension",
32 "num_framebuffer_surface_buffers",
33 "sf_primary_display_orientation",
34 ],
35 bool_variables: [
36 "use_context_priority",
37 "has_wide_color_display",
38 "has_hdr_display",
39 "force_hwc_copy_for_virtual_displays",
40 "running_without_sync_framework",
41 "use_vr_flinger",
42 "sf_start_graphics_allocator_service",
43 ],
44 properties: [
45 "cflags",
46 ],
47}
48
49surfaceflinger_cc_defaults_type {
50 name: "surfaceflinger_cc_defaults",
51 srcs: [
52 "SurfaceFlingerConfigs.cpp",
53 ],
54 soong_config_variables: {
55 vsync_event_phase_offset_ns: {
56 cflags: ["-DVSYNC_EVENT_PHASE_OFFSET_NS=%s"],
57 },
58 sf_vsync_event_phase_offset_ns: {
59 cflags: ["-DSF_VSYNC_EVENT_PHASE_OFFSET_NS=%s"],
60 },
61 present_time_offset_from_vsync_ns: {
62 cflags: ["-DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=%s"],
63 },
64 max_virtual_displat_dimension: {
65 cflags: ["-DMAX_VIRTUAL_DISPLAY_DIMENSION=%s"],
66 },
67 num_framebuffer_surface_buffers: {
68 cflags: ["-DNUM_FRAMEBUFFER_SURFACE_BUFFERS=%s"],
69 },
70 sf_primary_display_orientation: {
71 cflags: ["-DPRIMARY_DISPLAY_ORIENTATION=%s"],
72 },
73 use_context_priority: {
74 cflags: ["-DUSE_CONTEXT_PRIORITY=1"],
75 },
76 has_wide_color_display: {
77 cflags: ["-DHAS_WIDE_COLOR_DISPLAY"],
78 },
79 has_hdr_display: {
80 cflags: ["-DHAS_HDR_DISPLAY"],
81 },
82 force_hwc_copy_for_virtual_displays: {
83 cflags: ["-DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS"],
84 },
85 running_without_sync_framework: {
86 cflags: ["-DRUNNING_WITHOUT_SYNC_FRAMEWORK"],
87 },
88 use_vr_flinger: {
89 cflags: ["-DUSE_VR_FLINGER"],
90 },
91 sf_start_graphics_allocator_service: {
92 cflags: ["-DSTART_GRAPHICS_ALLOCATOR_SERVICE"],
93 },
94 },
95}
96
97cc_binary {
98 name: "android.hardware.configstore@1.1-service",
99 srcs: ["service.cpp"],
100 vendor: true,
101 relative_install_path: "hw",
102 init_rc: ["android.hardware.configstore@1.1-service.rc"],
103 shared_libs: [
104 "libhidlbase",
105 "libbase",
106 "libhwminijail",
107 "liblog",
108 "libutils",
109 "android.hardware.configstore@1.0",
110 "android.hardware.configstore@1.1",
111 ],
112 defaults: [
113 "surfaceflinger_cc_defaults",
114 ],
115 required: select((arch(), soong_config_variable("ANDROID", "GCOV_COVERAGE")), {
116 ("arm64", false): ["configstore@1.1.policy"],
117 (default, default): [],
118 }),
119}
120
121// Only build for arm64
122prebuilt_etc {
123 name: "configstore@1.1.policy",
124 relative_install_path: "seccomp_policy",
125 proprietary: true,
126 enabled: false,
127 arch: {
128 arm64: {
129 src: "seccomp_policy/configstore@1.1-arm64.policy",
130 enabled: true,
131 },
132 },
133}
134
135// disable configstore
136cc_binary {
137 name: "disable_configstore",
Bill Yanga1525fa2024-09-16 04:11:19 +0000138 srcs: ["disable_configstore.cpp"],
139 overrides: ["android.hardware.configstore@1.1-service"],
140 vendor: true,
141}