1# Copyright (C) 2021-2023 HiHope Open Source Organization .
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 = [ system_base_dir ]
76  relative_install_dir = "chipset-sdk"
77  subsystem_name = "hdf"
78  part_name = "drivers_peripheral_display"
79}
80
81ohos_shared_library("display_gfx") {
82  sources = [ "src/display_gfx/display_gfx.c" ]
83  include_dirs = [
84    "include",
85    "//drivers/peripheral/display/interfaces/include",
86    "//drivers/peripheral/base",
87    "//commonlibrary/c_utils/base/include",
88    "//foundation/graphic/standard/utils/include",
89    "//device/soc/rockchip/rk3568/hardware/rga/include/",
90    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
91  ]
92  output_name = "display_gfx"
93  cflags = [ "-Wno-macro-redefined" ]
94  deps = [
95    ":display_gralloc",
96    "//device/soc/rockchip/rk3568/hardware/rga:librga",
97  ]
98
99  external_deps = [
100    "c_utils:utils",
101    "hdf_core:libhdf_utils",
102    "hilog:libhilog",
103  ]
104
105  install_enable = true
106  install_images = [ system_base_dir ]
107  relative_install_dir = "chipset-sdk"
108  subsystem_name = "hdf"
109  part_name = "drivers_peripheral_display"
110}
111
112ohos_shared_library("display_device") {
113  sources = [
114    "src/display_device/drm_connector.cpp",
115    "src/display_device/drm_crtc.cpp",
116    "src/display_device/drm_device.cpp",
117    "src/display_device/drm_display.cpp",
118    "src/display_device/drm_encoder.cpp",
119    "src/display_device/drm_plane.cpp",
120    "src/display_device/drm_vsync_worker.cpp",
121    "src/display_device/hdi_composer.cpp",
122    "src/display_device/hdi_device_interface.cpp",
123    "src/display_device/hdi_display.cpp",
124    "src/display_device/hdi_drm_composition.cpp",
125    "src/display_device/hdi_drm_layer.cpp",
126    "src/display_device/hdi_gfx_composition.cpp",
127    "src/display_device/hdi_layer.cpp",
128    "src/display_device/hdi_netlink_monitor.cpp",
129    "src/display_device/hdi_session.cpp",
130  ]
131  output_name = "display_device"
132  include_dirs = [
133    "src/display_device",
134    "include",
135    "//drivers/peripheral/display/interfaces/include",
136    "//drivers/peripheral/base",
137    "//commonlibrary/c_utils/base/include",
138    "//foundation/graphic/standard/utils/include",
139    "//foundation/graphic/standard/prebuilts/librarys/drm/include",
140    "//base/hiviewdfx/interfaces/innerkits/libhilog/include",
141  ]
142  deps = [
143    ":display_gfx",
144    ":display_gralloc",
145    "//third_party/libdrm:libdrm",
146  ]
147  cflags_cc = [
148    "-Wno-error=unused-function",
149    "-Wno-error=missing-braces",
150    "-Wno-error=#warnings",
151  ]
152  external_deps = [
153    "c_utils:utils",
154    "hdf_core:libhdf_utils",
155    "hilog:libhilog",
156  ]
157
158  install_enable = true
159  install_images = [ system_base_dir ]
160  relative_install_dir = "chipset-sdk"
161  subsystem_name = "hdf"
162  part_name = "drivers_peripheral_display"
163}
164
165group("display_layer") {
166  deps = [
167    ":display_device",
168    ":display_gfx",
169    ":display_gralloc",
170    ":higbm",
171  ]
172}
173