1# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15
16group("display_group") {
17  deps = [
18    ":display_device",
19    ":display_gfx",
20    ":display_gralloc",
21    ":higbm",
22  ]
23}
24
25ohos_static_library("higbm") {
26  sources = [ "src/display_gralloc/hi_gbm.c" ]
27  include_dirs = [
28    "include",
29    "//commonlibrary/c_utils/base/include",
30    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
31  ]
32  output_name = "higbm"
33  cflags = [
34    "-DGRALLOC_GBM_SUPPORT",
35    "-Wno-macro-redefined",
36  ]
37  deps = [ "//third_party/libdrm:libdrm" ]
38  external_deps = [
39    "c_utils:utils",
40    "hilog:libhilog",
41  ]
42}
43
44ohos_shared_library("display_gralloc") {
45  sources = [
46    "src/display_gralloc/display_gralloc.c",
47    "src/display_gralloc/display_gralloc_gbm.c",
48  ]
49  include_dirs = [
50    "include",
51    "//drivers/peripheral/display/interfaces/include",
52    "//drivers/peripheral/base",
53    "//commonlibrary/c_utils/base/include",
54    "//foundation/graphic/standard/utils/include",
55    "//foundation/graphic/standard/prebuilts/librarys/drm/include",
56    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
57  ]
58  output_name = "display_gralloc"
59  cflags = [
60    "-DGRALLOC_GBM_SUPPORT",
61    "-Wno-macro-redefined",
62  ]
63  deps = [
64    ":higbm",
65    "//third_party/libdrm:libdrm",
66  ]
67
68  external_deps = [
69    "c_utils:utils",
70    "hdf_core:libhdf_utils",
71    "hilog:libhilog",
72  ]
73
74  install_enable = true
75  install_images = [ chipset_base_dir ]
76  subsystem_name = "hdf"
77  part_name = "drivers_peripheral_display"
78}
79
80ohos_shared_library("display_gfx") {
81  sources = [ "src/display_gfx/display_gfx.c" ]
82  include_dirs = [
83    "include",
84    "//drivers/peripheral/display/interfaces/include",
85    "//drivers/peripheral/base",
86    "//commonlibrary/c_utils/base/include",
87    "//foundation/graphic/standard/utils/include",
88    "//device/soc/rockchip/common/hardware/rga/include/",
89    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
90  ]
91  output_name = "display_gfx"
92  cflags = [ "-Wno-macro-redefined" ]
93  deps = [
94    ":display_gralloc",
95    "//device/soc/rockchip/common/hardware/rga:librga",
96  ]
97
98  external_deps = [
99    "c_utils:utils",
100    "hdf_core:libhdf_utils",
101    "hilog:libhilog",
102  ]
103
104  install_enable = true
105  install_images = [ chipset_base_dir ]
106  subsystem_name = "hdf"
107  part_name = "drivers_peripheral_display"
108}
109
110ohos_shared_library("display_device") {
111  sources = [
112    "src/display_device/drm_connector.cpp",
113    "src/display_device/drm_crtc.cpp",
114    "src/display_device/drm_device.cpp",
115    "src/display_device/drm_display.cpp",
116    "src/display_device/drm_encoder.cpp",
117    "src/display_device/drm_plane.cpp",
118    "src/display_device/drm_vsync_worker.cpp",
119    "src/display_device/hdi_composer.cpp",
120    "src/display_device/hdi_device_interface.cpp",
121    "src/display_device/hdi_display.cpp",
122    "src/display_device/hdi_drm_composition.cpp",
123    "src/display_device/hdi_drm_layer.cpp",
124    "src/display_device/hdi_gfx_composition.cpp",
125    "src/display_device/hdi_layer.cpp",
126    "src/display_device/hdi_netlink_monitor.cpp",
127    "src/display_device/hdi_session.cpp",
128  ]
129  output_name = "display_device"
130  include_dirs = [
131    "src/display_device",
132    "include",
133    "//drivers/peripheral/display/interfaces/include",
134    "//drivers/peripheral/base",
135    "//commonlibrary/c_utils/base/include",
136    "//foundation/graphic/standard/utils/include",
137    "//foundation/graphic/standard/prebuilts/librarys/drm/include",
138    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
139  ]
140  deps = [
141    ":display_gfx",
142    ":display_gralloc",
143    "//third_party/libdrm:libdrm",
144  ]
145  cflags_cc = [
146    "-Wno-error=unused-function",
147    "-Wno-error=missing-braces",
148    "-Wno-error=#warnings",
149  ]
150  external_deps = [
151    "c_utils:utils",
152    "hdf_core:libhdf_utils",
153    "hilog:libhilog",
154  ]
155
156  symlink_target_name = [ "libdisplay_layer.z.so" ]
157
158  install_enable = true
159  install_images = [ chipset_base_dir ]
160  subsystem_name = "hdf"
161  part_name = "drivers_peripheral_display"
162}
163
164group("display_layer") {
165  deps = [
166    ":display_device",
167    ":display_gfx",
168    ":display_gralloc",
169    ":higbm",
170  ]
171}
172