From ad1506d5efab3611963e9098db38f3d53e13e8b6 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 09:22:29 +0800 Subject: [PATCH 01/14] chore: update LICENSE --- build/build.sh | 2 +- build/builder.py | 2 +- build/builder/__init__.py | 2 +- build/builder/commands/build.py | 2 +- build/builder/commands/format.py | 2 +- build/builder/commands/package.py | 2 +- build/builder/common/env_checker.py | 2 +- build/builder/common/logger.py | 2 +- build/builder/common/utils.py | 2 +- build/configs/requirements.txt | 2 +- build/configs/system_deps.toml | 4 ++-- build/gn/configs/system_libs/BUILD.gn | 2 +- build/gn/fangtian.gni | 2 +- build/gn/templates/build_targets.gni | 2 +- build/gn/templates/ft_executable.gni | 2 +- build/gn/templates/ft_shared_library.gni | 2 +- build/gn/templates/ft_source_set.gni | 2 +- build/gn/templates/ft_static_library.gni | 2 +- build/gn/toolchain/linux/BUILD.gn | 2 +- build/prebuild.sh | 2 +- display_server/drivers/hal/BUILD.gn | 2 +- display_server/drivers/hal/base/BUILD.gn | 2 +- display_server/drivers/hal/base/includes/current_thread.h | 2 +- .../drivers/hal/base/includes/event_loop/event_channel.h | 2 +- .../drivers/hal/base/includes/event_loop/event_loop.h | 2 +- .../drivers/hal/base/includes/event_loop/event_loop_thread.h | 2 +- .../drivers/hal/base/includes/event_loop/event_poller.h | 2 +- display_server/drivers/hal/base/includes/event_loop/timer.h | 2 +- .../drivers/hal/base/includes/event_loop/timer_queue.h | 2 +- display_server/drivers/hal/base/includes/log.h | 2 +- display_server/drivers/hal/base/includes/noncopyable.h | 2 +- display_server/drivers/hal/base/includes/timestamp.h | 2 +- display_server/drivers/hal/base/includes/types.h | 2 +- display_server/drivers/hal/base/src/current_thread.cpp | 2 +- display_server/drivers/hal/base/src/event_loop/BUILD.gn | 2 +- .../drivers/hal/base/src/event_loop/event_channel.cpp | 2 +- display_server/drivers/hal/base/src/event_loop/event_loop.cpp | 2 +- .../drivers/hal/base/src/event_loop/event_loop_thread.cpp | 2 +- .../drivers/hal/base/src/event_loop/event_poller.cpp | 2 +- display_server/drivers/hal/base/src/event_loop/timer.cpp | 2 +- .../drivers/hal/base/src/event_loop/timer_queue.cpp | 2 +- display_server/drivers/hal/base/src/timestamp.cpp | 2 +- display_server/drivers/hal/drm_backend/BUILD.gn | 2 +- .../drivers/hal/drm_backend/display_device/BUILD.gn | 2 +- .../hal/drm_backend/display_device/device_event_monitor.cpp | 2 +- .../hal/drm_backend/display_device/device_event_monitor.h | 2 +- .../hal/drm_backend/display_device/drm_atomic_committer.cpp | 2 +- .../hal/drm_backend/display_device/drm_atomic_committer.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_common.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_connector.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_connector.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_crtc.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_crtc.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_device.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_device.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_display.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_encoder.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_encoder.h | 2 +- .../hal/drm_backend/display_device/drm_frame_buffer.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_frame_buffer.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_layer.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_layer.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_mode_info.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_mode_info.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_plane.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_plane.h | 2 +- .../drivers/hal/drm_backend/display_device/drm_property.cpp | 2 +- .../drivers/hal/drm_backend/display_device/drm_property.h | 2 +- .../drivers/hal/drm_backend/display_device/hdi_layer.cpp | 2 +- .../drivers/hal/drm_backend/display_device/hdi_layer.h | 2 +- .../drivers/hal/drm_backend/display_device/hdi_session.cpp | 2 +- .../drivers/hal/drm_backend/display_device/hdi_session.h | 2 +- .../hal/drm_backend/display_device/udev_object_helper.h | 2 +- .../drivers/hal/drm_backend/display_gralloc/BUILD.gn | 2 +- .../drivers/hal/drm_backend/display_gralloc/allocator.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/allocator.h | 2 +- .../hal/drm_backend/display_gralloc/allocator_controller.cpp | 2 +- .../hal/drm_backend/display_gralloc/allocator_controller.h | 2 +- .../hal/drm_backend/display_gralloc/display_gralloc.cpp | 2 +- .../hal/drm_backend/display_gralloc/display_gralloc_utils.cpp | 2 +- .../hal/drm_backend/display_gralloc/display_gralloc_utils.h | 2 +- .../hal/drm_backend/display_gralloc/dumb_allocator.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/dumb_allocator.h | 2 +- .../drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/gbm_allocator.h | 2 +- .../drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/hi_drm_format.h | 2 +- .../drivers/hal/drm_backend/display_gralloc/hi_gbm_format.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/hi_gbm_format.h | 2 +- .../drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp | 2 +- .../drivers/hal/drm_backend/display_gralloc/shm_allocator.h | 2 +- display_server/drivers/hal/test/BUILD.gn | 2 +- display_server/drivers/hal/test/system_test/main.cpp | 2 +- 93 files changed, 94 insertions(+), 94 deletions(-) diff --git a/build/build.sh b/build/build.sh index 8b9587d..1fe4401 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder.py b/build/builder.py index a474f8c..8863d29 100755 --- a/build/builder.py +++ b/build/builder.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/__init__.py b/build/builder/__init__.py index 8858d32..b0d2321 100755 --- a/build/builder/__init__.py +++ b/build/builder/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/commands/build.py b/build/builder/commands/build.py index fb530b0..42804ea 100755 --- a/build/builder/commands/build.py +++ b/build/builder/commands/build.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/commands/format.py b/build/builder/commands/format.py index 40e725a..048d31b 100755 --- a/build/builder/commands/format.py +++ b/build/builder/commands/format.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/commands/package.py b/build/builder/commands/package.py index fb93a96..730d5d6 100755 --- a/build/builder/commands/package.py +++ b/build/builder/commands/package.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/common/env_checker.py b/build/builder/common/env_checker.py index 8ca0415..3f904f3 100755 --- a/build/builder/common/env_checker.py +++ b/build/builder/common/env_checker.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/common/logger.py b/build/builder/common/logger.py index 31f9463..79858c3 100755 --- a/build/builder/common/logger.py +++ b/build/builder/common/logger.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/builder/common/utils.py b/build/builder/common/utils.py index 8d8c9b0..f432d90 100755 --- a/build/builder/common/utils.py +++ b/build/builder/common/utils.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/configs/requirements.txt b/build/configs/requirements.txt index d2c1420..4267726 100755 --- a/build/configs/requirements.txt +++ b/build/configs/requirements.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/configs/system_deps.toml b/build/configs/system_deps.toml index 6810f40..d6d24ea 100755 --- a/build/configs/system_deps.toml +++ b/build/configs/system_deps.toml @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -29,9 +29,9 @@ package_deps = [ "cmake", "ninja-build", "libxml2-devel", + "libpng-devel", # DRM Backend "libdrm-devel", "systemd-devel", "mesa-libgbm-devel", - "libpng-devel", ] diff --git a/build/gn/configs/system_libs/BUILD.gn b/build/gn/configs/system_libs/BUILD.gn index 672a80f..1b5ab02 100644 --- a/build/gn/configs/system_libs/BUILD.gn +++ b/build/gn/configs/system_libs/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/fangtian.gni b/build/gn/fangtian.gni index 633f18a..66b38a0 100755 --- a/build/gn/fangtian.gni +++ b/build/gn/fangtian.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/templates/build_targets.gni b/build/gn/templates/build_targets.gni index 6e453a1..a5d5493 100755 --- a/build/gn/templates/build_targets.gni +++ b/build/gn/templates/build_targets.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/templates/ft_executable.gni b/build/gn/templates/ft_executable.gni index 97c060e..7024704 100755 --- a/build/gn/templates/ft_executable.gni +++ b/build/gn/templates/ft_executable.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/templates/ft_shared_library.gni b/build/gn/templates/ft_shared_library.gni index a3c0977..ed862dc 100755 --- a/build/gn/templates/ft_shared_library.gni +++ b/build/gn/templates/ft_shared_library.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/templates/ft_source_set.gni b/build/gn/templates/ft_source_set.gni index 328fb01..17b91de 100755 --- a/build/gn/templates/ft_source_set.gni +++ b/build/gn/templates/ft_source_set.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/templates/ft_static_library.gni b/build/gn/templates/ft_static_library.gni index fd88179..5b4997a 100755 --- a/build/gn/templates/ft_static_library.gni +++ b/build/gn/templates/ft_static_library.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/gn/toolchain/linux/BUILD.gn b/build/gn/toolchain/linux/BUILD.gn index 154a223..2ba759d 100755 --- a/build/gn/toolchain/linux/BUILD.gn +++ b/build/gn/toolchain/linux/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/build/prebuild.sh b/build/prebuild.sh index 4b76d96..0f1c7c1 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/BUILD.gn b/display_server/drivers/hal/BUILD.gn index 737a62d..1573a29 100644 --- a/display_server/drivers/hal/BUILD.gn +++ b/display_server/drivers/hal/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/BUILD.gn b/display_server/drivers/hal/base/BUILD.gn index d5faf8e..b3b36f2 100644 --- a/display_server/drivers/hal/base/BUILD.gn +++ b/display_server/drivers/hal/base/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/current_thread.h b/display_server/drivers/hal/base/includes/current_thread.h index 60e3cbb..95ba86a 100644 --- a/display_server/drivers/hal/base/includes/current_thread.h +++ b/display_server/drivers/hal/base/includes/current_thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/event_channel.h b/display_server/drivers/hal/base/includes/event_loop/event_channel.h index 93a554f..47a4886 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_channel.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_channel.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/event_loop.h b/display_server/drivers/hal/base/includes/event_loop/event_loop.h index 12242c1..4f01029 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_loop.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_loop.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h b/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h index 78cd62d..6121b0d 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_loop_thread.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/event_poller.h b/display_server/drivers/hal/base/includes/event_loop/event_poller.h index 54f8b83..6342ffb 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_poller.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_poller.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/timer.h b/display_server/drivers/hal/base/includes/event_loop/timer.h index 5a1641e..551e2cb 100644 --- a/display_server/drivers/hal/base/includes/event_loop/timer.h +++ b/display_server/drivers/hal/base/includes/event_loop/timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/event_loop/timer_queue.h b/display_server/drivers/hal/base/includes/event_loop/timer_queue.h index e48fccf..bc64de5 100644 --- a/display_server/drivers/hal/base/includes/event_loop/timer_queue.h +++ b/display_server/drivers/hal/base/includes/event_loop/timer_queue.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/log.h b/display_server/drivers/hal/base/includes/log.h index c5bd2c7..0e95fe6 100644 --- a/display_server/drivers/hal/base/includes/log.h +++ b/display_server/drivers/hal/base/includes/log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/noncopyable.h b/display_server/drivers/hal/base/includes/noncopyable.h index b73bbf5..bce0c5b 100644 --- a/display_server/drivers/hal/base/includes/noncopyable.h +++ b/display_server/drivers/hal/base/includes/noncopyable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/timestamp.h b/display_server/drivers/hal/base/includes/timestamp.h index 88b8da0..1c533f8 100644 --- a/display_server/drivers/hal/base/includes/timestamp.h +++ b/display_server/drivers/hal/base/includes/timestamp.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/includes/types.h b/display_server/drivers/hal/base/includes/types.h index d425c4f..6113bc6 100644 --- a/display_server/drivers/hal/base/includes/types.h +++ b/display_server/drivers/hal/base/includes/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/current_thread.cpp b/display_server/drivers/hal/base/src/current_thread.cpp index 4c2e36b..6105fc4 100644 --- a/display_server/drivers/hal/base/src/current_thread.cpp +++ b/display_server/drivers/hal/base/src/current_thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/BUILD.gn b/display_server/drivers/hal/base/src/event_loop/BUILD.gn index 94ff499..6193a12 100644 --- a/display_server/drivers/hal/base/src/event_loop/BUILD.gn +++ b/display_server/drivers/hal/base/src/event_loop/BUILD.gn @@ -1,5 +1,5 @@ # -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/event_channel.cpp b/display_server/drivers/hal/base/src/event_loop/event_channel.cpp index 54901a1..f8486fe 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_channel.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_channel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/event_loop.cpp b/display_server/drivers/hal/base/src/event_loop/event_loop.cpp index 97e7273..e9b66c9 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_loop.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_loop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp b/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp index d7078ae..e52dfb2 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_loop_thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/event_poller.cpp b/display_server/drivers/hal/base/src/event_loop/event_poller.cpp index d17ba62..5c055bc 100644 --- a/display_server/drivers/hal/base/src/event_loop/event_poller.cpp +++ b/display_server/drivers/hal/base/src/event_loop/event_poller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/timer.cpp b/display_server/drivers/hal/base/src/event_loop/timer.cpp index 3eec296..71d59af 100644 --- a/display_server/drivers/hal/base/src/event_loop/timer.cpp +++ b/display_server/drivers/hal/base/src/event_loop/timer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp b/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp index 7966dab..aaab9c8 100644 --- a/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp +++ b/display_server/drivers/hal/base/src/event_loop/timer_queue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/base/src/timestamp.cpp b/display_server/drivers/hal/base/src/timestamp.cpp index 9e48ca9..1104417 100644 --- a/display_server/drivers/hal/base/src/timestamp.cpp +++ b/display_server/drivers/hal/base/src/timestamp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/BUILD.gn b/display_server/drivers/hal/drm_backend/BUILD.gn index 203b33e..e5ba22f 100644 --- a/display_server/drivers/hal/drm_backend/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn index 48ea1fd..ce87d2d 100644 --- a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp index 592f0fc..68037ab 100644 --- a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h index 51386d3..1da7a03 100644 --- a/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h +++ b/display_server/drivers/hal/drm_backend/display_device/device_event_monitor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp index 025154f..0c8adf4 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h index 852fd15..a2c467e 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_atomic_committer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_common.h b/display_server/drivers/hal/drm_backend/display_device/drm_common.h index 0a64ec0..58b17ae 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_common.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp index 3137808..895a35b 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_connector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_connector.h b/display_server/drivers/hal/drm_backend/display_device/drm_connector.h index db242f3..233a080 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_connector.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_connector.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp index 2368336..b1099cd 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h index 7efbd46..3b8d859 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp index 4666672..327b6e6 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_device.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_device.h b/display_server/drivers/hal/drm_backend/display_device/drm_device.h index 0e2e2be..bb1365d 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_device.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_device.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_display.h b/display_server/drivers/hal/drm_backend/display_device/drm_display.h index 1a32010..40ac4ec 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_display.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_display.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp index 3552715..a051af7 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h index ab566e0..16c3ed3 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp index 85d65bc..56b538a 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h index 1efd184..6cee6d9 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_frame_buffer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp index e14b04a..b47d154 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_layer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_layer.h b/display_server/drivers/hal/drm_backend/display_device/drm_layer.h index 6e370fe..9a91cdc 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_layer.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_layer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp index 0362ac5..72bbc1a 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h index 8e20a44..39a2a21 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp index 485129f..0c64842 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_plane.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h index 35c3961..0e2eb20 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp b/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp index a50fc7b..541f65e 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/drm_property.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_property.h b/display_server/drivers/hal/drm_backend/display_device/drm_property.h index c940a41..1a351f0 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_property.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_property.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp index fd7f1e5..18adad6 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h index ee1de04..84e7344 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp b/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp index a839a5d..0545aca 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_session.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_session.h b/display_server/drivers/hal/drm_backend/display_device/hdi_session.h index 716c4a9..ef5bf7d 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_session.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_session.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h b/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h index 3adbc7d..7e388c0 100644 --- a/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h +++ b/display_server/drivers/hal/drm_backend/display_device/udev_object_helper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn index 5e7ca58..d6ddac1 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp index 1afc5fb..399faad 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h index 90c5273..b566893 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp index 9bb9f43..302b489 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h index 962436e..db129d5 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp index 564b37a..e2b6e76 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp index 9f17e51..8ed6577 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.h b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.h index be4302c..15dc875 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/display_gralloc_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp index 4151108..f219087 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h index af36a1a..1444a25 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp index 949de1d..6b81bbf 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h index 3db681e..2d470d4 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/gbm_allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp index f95c9ad..78ab398 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.h b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.h index a6f98b9..8c577ed 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/hi_drm_format.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.cpp index 7c785e0..dbc2f28 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.h b/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.h index d2a5317..e3a8b21 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/hi_gbm_format.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp index ee979b7..fa81b97 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h index f31bd1c..a0654f6 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h +++ b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/display_server/drivers/hal/test/BUILD.gn b/display_server/drivers/hal/test/BUILD.gn index b78bd5c..223e344 100644 --- a/display_server/drivers/hal/test/BUILD.gn +++ b/display_server/drivers/hal/test/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/drivers/hal/test/system_test/main.cpp b/display_server/drivers/hal/test/system_test/main.cpp index 785bc8d..5dd0cea 100644 --- a/display_server/drivers/hal/test/system_test/main.cpp +++ b/display_server/drivers/hal/test/system_test/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Technologies Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at -- Gitee From e5f127d42ebf0af5b276830d6cbfe4781bfacca8 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 14:35:28 +0800 Subject: [PATCH 02/14] feat(display_server): add surface test --- build/gn/BUILD.gn | 13 +- build/gn/configs/system_libs/BUILD.gn | 94 ++++-- .../drivers/hal/base/src/event_loop/BUILD.gn | 2 +- .../hdi_service/gralloc/client/BUILD.gn | 7 +- .../frameworks/surface/ft_build/BUILD.gn | 30 +- .../ft_build/mock/display_gralloc_client.cpp | 14 - .../surface/ft_build/mock/idisplay_gralloc.h | 156 ---------- .../frameworks/surface/src/buffer_queue.cpp | 6 +- .../frameworks/surface/test/ft_build/BUILD.gn | 60 ++++ .../native_window_buffer_test_oe.cpp | 278 ++++++++++++++++++ display_server/ft_configs/ds_config.gni | 45 ++- .../inner_api/common/graphic_common.h | 2 +- .../render_service_base/ft_build/BUILD.gn | 2 +- .../src/platform/fangtian/BUILD.gn | 2 +- display_server/utils/ft_build/BUILD.gn | 54 ++++ .../utils/scoped_bytrace/ft_build/BUILD.gn | 4 +- .../utils/socketpair/ft_build/BUILD.gn | 6 + 17 files changed, 537 insertions(+), 238 deletions(-) delete mode 100644 display_server/frameworks/surface/ft_build/mock/display_gralloc_client.cpp delete mode 100644 display_server/frameworks/surface/ft_build/mock/idisplay_gralloc.h create mode 100644 display_server/frameworks/surface/test/ft_build/BUILD.gn create mode 100644 display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp create mode 100644 display_server/utils/ft_build/BUILD.gn diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 1d19628..6e2fe72 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -group("ft_engine") { +group("ft_display_server") { deps = [ "//display_server/utils/socketpair/ft_build:socketpair", "//display_server/rosen/modules/composer/vsync/ft_build:libvsync", @@ -23,7 +23,11 @@ group("ft_engine") { "//display_server/rosen/modules/composer/ft_build:libcomposer", "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", "//display_server/rosen/modules/render_service/ft_build:librender_service", + ] +} +group("ft_window_manager") { + deps = [ "//window_manager/wmserver/ft_build:libwms", ] } @@ -32,6 +36,9 @@ group("ft_test") { testonly = true deps = [ - "//display_server/drivers/hal/test:drm_backend_test" + "//display_server/drivers/hal/test:drm_backend_test", + "//display_server/frameworks/surface/test/ft_build:test", + # "//display_server/rosen/samples/composer:hello_composer", + # "//display_server/rosen/modules/render_service_client/test:render_service_client_rs_demo" ] } diff --git a/build/gn/configs/system_libs/BUILD.gn b/build/gn/configs/system_libs/BUILD.gn index 1b5ab02..edd6cbd 100644 --- a/build/gn/configs/system_libs/BUILD.gn +++ b/build/gn/configs/system_libs/BUILD.gn @@ -12,28 +12,28 @@ # limitations under the License. config("c_utils_config") { - include_dirs = [ "${sys_inc}/c_utils" ] - libs = [ "utils", "sec_shared" ] + include_dirs = [ "${sys_inc}/c_utils" ] + libs = [ "utils", "sec_shared" ] } config("ipc_core_config") { - include_dirs = [ "${sys_inc}/ipc_core" ] - libs = [ "ipc_core" ] + include_dirs = [ "${sys_inc}/ipc_core" ] + libs = [ "ipc_core" ] } config("hilog_config") { - include_dirs = [ "${sys_inc}/hilog" ] - libs = [ "hilog" ] + include_dirs = [ "${sys_inc}/hilog" ] + libs = [ "hilog" ] } config("hitrace_meter_config") { - include_dirs = [ "${sys_inc}/hitrace_meter" ] - libs = [ "hitrace_meter" ] + include_dirs = [ "${sys_inc}/hitrace_meter" ] + libs = [ "hitrace_meter" ] } config("eventhandler_config") { - include_dirs = [ "${sys_inc}/eventhandler" ] - libs = [ "eventhandler" ] + include_dirs = [ "${sys_inc}/eventhandler" ] + libs = [ "eventhandler" ] } config("skia_config") { @@ -46,26 +46,82 @@ config("skia_config") { } config("samgr_config") { - include_dirs = [ "${sys_inc}/samgr" ] - libs = [ "samgr_proxy" ] + include_dirs = [ "${sys_inc}/samgr" ] + libs = [ "samgr_proxy" ] } config("image_config") { - include_dirs = [ "${sys_inc}/image" ] - libs = [ "image_native" ] + include_dirs = [ "${sys_inc}/image" ] + libs = [ "image_native" ] } config("mmi_config") { - include_dirs = [ "${sys_inc}/mmi" ] - libs = [ "mmi-client" ] + include_dirs = [ "${sys_inc}/mmi" ] + libs = [ "mmi-client" ] } config("syspara_config") { - include_dirs = [ "${sys_inc}/syspara" ] - libs = [ "beget_proxy", "begetutil" ] + include_dirs = [ "${sys_inc}/syspara" ] + libs = [ "beget_proxy", "begetutil" ] } config("safwk_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/safwk" ] libs = [ "system_ability_fwk" ] -} \ No newline at end of file +} + +group("ipc_core") { + public_configs = [ + ":c_utils_config", + ":ipc_core_config" + ] +} + +group("hilog") { + public_configs = [ + ":hilog_config", + ] +} + +group("hitrace_meter") { + public_configs = [ + ":c_utils_config", + ":hitrace_meter_config", + ] +} + +group("samgr") { + public_configs = [ + ":c_utils_config", + ":samgr_config", + ] +} + +group("ipc_core") { + public_configs = [ + ":c_utils_config", + ":ipc_core_config" + ] +} + +group("hilog") { + public_configs = [ + ":hilog_config", + ] +} + +group("hitrace_meter") { + public_configs = [ + ":c_utils_config", + ":hitrace_meter_config", + ] +} + +group("samgr") { + public_configs = [ + ":c_utils_config", + ":samgr_config", + ] +} diff --git a/display_server/drivers/hal/base/src/event_loop/BUILD.gn b/display_server/drivers/hal/base/src/event_loop/BUILD.gn index 6193a12..e58135b 100644 --- a/display_server/drivers/hal/base/src/event_loop/BUILD.gn +++ b/display_server/drivers/hal/base/src/event_loop/BUILD.gn @@ -23,7 +23,7 @@ ft_shared_library("hal_event_loop") { "timer_queue.cpp", ] configs = [ "//display_server/drivers/hal:hal_public_config" ] - deps = [ + public_deps = [ "//display_server/drivers/hal/base:hal_base", ] } diff --git a/display_server/drivers/hdi_service/gralloc/client/BUILD.gn b/display_server/drivers/hdi_service/gralloc/client/BUILD.gn index cb5a033..790d104 100755 --- a/display_server/drivers/hdi_service/gralloc/client/BUILD.gn +++ b/display_server/drivers/hdi_service/gralloc/client/BUILD.gn @@ -20,13 +20,8 @@ config("gralloc_client_public_config") { ] } -declare_args() { - drivers_peripheral_display_hdi_gralloc_client = - ":libhdi_display_gralloc_client" -} - group("hdi_gralloc_client") { - deps = [ drivers_peripheral_display_hdi_gralloc_client ] + public_deps = [ ":libhdi_display_gralloc_client" ] public_configs = [ ":gralloc_client_public_config" ] } diff --git a/display_server/frameworks/surface/ft_build/BUILD.gn b/display_server/frameworks/surface/ft_build/BUILD.gn index 354bb30..a1ef36c 100644 --- a/display_server/frameworks/surface/ft_build/BUILD.gn +++ b/display_server/frameworks/surface/ft_build/BUILD.gn @@ -24,22 +24,18 @@ config("surface_config") { "-Wno-error=deprecated-declarations", "-Wno-c++11-narrowing", ] +} +config("surface_public_config") { include_dirs = [ "../include", "$display_server_root/interfaces/inner_api/surface", "$display_server_root/interfaces/inner_api/common", "$display_server_root/utils/sandbox", "$display_server_root/utils/buffer_handle/export", - "mock", ] - defines = [] - if (enable_gpu) { - defines = [ "ACE_ENABLE_GPU" ] - } - defines += gpu_defines - + defines = gpu_defines } ft_shared_library("surface") { @@ -60,23 +56,21 @@ ft_shared_library("surface") { "../src/surface_delegate.cpp", "../src/surface_tunnel_handle.cpp", "../src/surface_utils.cpp", - "mock/display_gralloc_client.cpp", ] configs = [ ":surface_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:hitrace_meter_config", ] + public_configs = [ ":surface_public_config" ] - - deps = [ - "$display_server_root/utils/sync_fence/ft_build:sync_fence", - "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", - "$display_server_root/utils/sandbox/ft_build:sandbox_utils", - "$display_server_root/utils/scoped_bytrace/ft_build:scoped_bytrace", + deps = [ + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:hitrace_meter", + ] + public_deps = [ + "$display_server_root/utils/ft_build:libgraphic_utils", + "$display_server_root/drivers/hdi_service/gralloc/client:hdi_gralloc_client" ] } diff --git a/display_server/frameworks/surface/ft_build/mock/display_gralloc_client.cpp b/display_server/frameworks/surface/ft_build/mock/display_gralloc_client.cpp deleted file mode 100644 index 82236b1..0000000 --- a/display_server/frameworks/surface/ft_build/mock/display_gralloc_client.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include "idisplay_gralloc.h" - -namespace OHOS { -namespace HDI { -namespace Display { -namespace V1_0 { -IDisplayGralloc *IDisplayGralloc::Get(){ - return nullptr; -} -} -} -} -} diff --git a/display_server/frameworks/surface/ft_build/mock/idisplay_gralloc.h b/display_server/frameworks/surface/ft_build/mock/idisplay_gralloc.h deleted file mode 100644 index 7eb3965..0000000 --- a/display_server/frameworks/surface/ft_build/mock/idisplay_gralloc.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef HDI_IDISPLAY_GRALLOC_V1_0_H -#define HDI_IDISPLAY_GRALLOC_V1_0_H - -#include -#include "display_type.h" -#include "buffer_handle.h" - -namespace OHOS { -namespace HDI { -namespace Display { -namespace V1_0 { -using AllocatorDeathCallback = void (*)(void *); -class IDisplayGralloc { -public: - virtual ~IDisplayGralloc() = default; - - virtual int32_t RegAllocatorDeathCallback(AllocatorDeathCallback func, void* data) = 0; - - /** - * @brief Obtains all interfaces of IDisplayGralloc. - * - * @return Returns IDisplayGralloc* if the operation is successful; returns an null point otherwise. - * @since 1.0 - * @version 1.0 - */ - static IDisplayGralloc* Get(); - - /** - * @brief Allocates memory based on the parameters passed by the GUI. - * - * @param info Indicates the description of the memory to allocate. - * - * @param handle Indicates the pointer to the buffer of the memory to allocate. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t AllocMem(const AllocInfo &info, BufferHandle *&handle) const = 0; - - /** - * @brief Releases memory. - * - * @param handle Indicates the reference to the buffer of the memory to release. - * - * @since 1.0 - * @version 1.0 - */ - virtual void FreeMem(const BufferHandle &handle) const = 0; - - /** - * @brief Maps memory to memory without cache in the process's address space. - * - * @param handle Indicates the reference to the buffer of the memory to map. - * - * @return Returns the pointer to a valid address if the operation is successful; returns NULL otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual void *Mmap(const BufferHandle &handle) const = 0; - - /** - * @brief Maps memory to memory with cache in the process's address space. - * - * @param handle Indicates the reference to the buffer of the memory to map. - * - * @return Returns the pointer to a valid address if the operation is successful; returns NULL otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual void *MmapCache(const BufferHandle &buffer) const = 0; - - /** - * @brief Unmaps memory, that is, removes mappings from the process's address space. - * - * @param handle Indicates the reference to the buffer of the memory to unmap. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t Unmap(const BufferHandle &handle) const = 0; - - /** - * @brief Flushes data from the cache to memory and invalidates the data in the cache. - * - * @param handle Indicates the reference to the buffer of the cache to flush. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t FlushCache(const BufferHandle &handle) const = 0; - - /** - * @brief Flushes data from the cache mapped via {@link Mmap} to memory and invalidates the data in the cache. - * - * @param handle Indicates the reference to the buffer of the cache to flush. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t FlushMCache(const BufferHandle &buffer) const = 0; - - /** - * @brief Invalidates the cache to update it from memory. - * - * @param handle Indicates the reference to the buffer of the cache, which will be invalidated. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t InvalidateCache(const BufferHandle &handle) const = 0; - - /** - * @brief Checks whether the given VerifyAllocInfo array is allocatable. - * - * @param infos Indicates the VerifyAllocInfo array. - * @param supporteds Indicates whether the array is allocatable. - * - * @return Returns 0 if the operation is successful; returns an error code defined in {@link DispErrCode} - * otherwise. - * @since 1.0 - * @version 1.0 - */ - virtual int32_t IsSupportedAlloc(const std::vector &infos, - std::vector &supporteds) const = 0; -}; -} // namespace V1_0 -} // namespace Display -} // namespace HDI -} // namespace OHOS - -#endif // HDI_IDISPLAY_GRALLOC_V1_0_H diff --git a/display_server/frameworks/surface/src/buffer_queue.cpp b/display_server/frameworks/surface/src/buffer_queue.cpp index fb90a4b..c2af386 100644 --- a/display_server/frameworks/surface/src/buffer_queue.cpp +++ b/display_server/frameworks/surface/src/buffer_queue.cpp @@ -397,7 +397,7 @@ GSError BufferQueue::FlushBuffer(uint32_t sequence, const sptr void BufferQueue::DumpToFile(uint32_t sequence) { - if (access("/data/bq_dump", F_OK) == -1) { + if (access("/tmp/bq_enable_dump", F_OK) == -1) { return; } @@ -408,7 +408,7 @@ void BufferQueue::DumpToFile(uint32_t sequence) int64_t nowVal = (int64_t)now.tv_sec * secToUsec + (int64_t)now.tv_usec; std::stringstream ss; - ss << "/data/bq_" << GetRealPid() << "_" << name_ << "_" << nowVal << ".raw"; + ss << "/tmp/bq_dumps/bq_" << GetRealPid() << "_" << name_ << "_" << nowVal << ".raw"; sptr& buffer = bufferQueueCache_[sequence].buffer; std::ofstream rawDataFile(ss.str(), std::ofstream::binary); @@ -418,6 +418,8 @@ void BufferQueue::DumpToFile(uint32_t sequence) } rawDataFile.write(static_cast(buffer->GetVirAddr()), buffer->GetSize()); rawDataFile.close(); + + BLOGND("DumpToFile: %{public}s", ss.str().c_str()); } GSError BufferQueue::DoFlushBuffer(uint32_t sequence, const sptr &bedata, diff --git a/display_server/frameworks/surface/test/ft_build/BUILD.gn b/display_server/frameworks/surface/test/ft_build/BUILD.gn new file mode 100644 index 0000000..a44a041 --- /dev/null +++ b/display_server/frameworks/surface/test/ft_build/BUILD.gn @@ -0,0 +1,60 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +group("test") { + testonly = true + + deps = [ + ":native_window_buffer_test_oe", + ] +} + +ft_executable("native_window_buffer_test_oe") { + testonly = true + + sources = [ "../systemtest/native_window_buffer_test_oe.cpp" ] + + include_dirs = [ + "//foundation/graphic/graphic_2d/frameworks/surface/include", + "//base/security/access_token/interfaces/innerkits/nativetoken/include", + "//base/security/access_token/interfaces/innerkits/accesstoken/include", + "//base/security/access_token/interfaces/innerkits/token_setproc/include", + ] + + cflags = [ + "-Wall", + "-Werror", + "-g3", + "-Dprivate=public", + "-Dprotected=public", + ] + + deps = [ + "//display_server/frameworks/surface/ft_build:surface", + "//display_server/utils/sync_fence/ft_build:sync_fence", + + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:samgr", + ] + + configs = [ + # "//build/gn/configs/system_libs:hilog_config", + # "//build/gn/configs/system_libs:samgr_config", + # "//build/gn/configs/system_libs:syspara_config", + # "//build/gn/configs/system_libs:eventhandler_config", + # "//build/gn/configs/system_libs:hitrace_meter_config", + ] +} \ No newline at end of file diff --git a/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp b/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp new file mode 100644 index 0000000..b8a114c --- /dev/null +++ b/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "external_window.h" + +using namespace OHOS::HiviewDFX; + +namespace OHOS::Rosen { +class NativeWindowBufferTest : public IBufferConsumerListenerClazz { +public: + static void SetUpTestCase(); + void OnBufferAvailable() override; + int32_t SetData(NativeWindowBuffer *nativeWindowBuffer, NativeWindow *nativeWindow); + bool GetData(sptr &buffer); + pid_t ChildProcessMain(); + + void DoTest(); + + static inline sptr cSurface = nullptr; + static inline int32_t pipeFd[2] = {}; + static inline int32_t ipcSystemAbilityID = 34156; +}; + +void NativeWindowBufferTest::SetUpTestCase() {} + +void NativeWindowBufferTest::OnBufferAvailable() {} + +int32_t NativeWindowBufferTest::SetData(NativeWindowBuffer *nativeWindowBuffer, NativeWindow *nativeWindow) +{ + nativeWindowBuffer->sfbuffer->GetExtraData()->ExtraSet("123", 0x123); + nativeWindowBuffer->sfbuffer->GetExtraData()->ExtraSet("345", (int64_t)0x345); + nativeWindowBuffer->sfbuffer->GetExtraData()->ExtraSet("567", "567"); + + // alloc OHExtDataHandle + uint32_t reserveInts = 1; + size_t handleSize = sizeof(OHExtDataHandle) + (sizeof(int32_t) * reserveInts); + OHExtDataHandle *handle = static_cast(malloc(handleSize)); + if (handle == nullptr) { + return -1; + } + int32_t ret = memset_s(handle, handleSize, 0, handleSize); + if (ret != EOK) { + return -1; + } + handle->fd = -1; + handle->reserveInts = reserveInts; + for (uint32_t i = 0; i < reserveInts; i++) { + handle->reserve[i] = 1; + } + + ret = OH_NativeWindow_NativeWindowSetTunnelHandle(nativeWindow, handle); + // free OHExtDataHandle + if (handle->fd >= 0) { + close(handle->fd); + handle->fd = -1; + } + free(handle); + handle = nullptr; + return ret; +} + +bool NativeWindowBufferTest::GetData(sptr &buffer) +{ + int32_t int32; + int64_t int64; + std::string str; + buffer->GetExtraData()->ExtraGet("123", int32); + buffer->GetExtraData()->ExtraGet("345", int64); + buffer->GetExtraData()->ExtraGet("567", str); + if ((int32 != 0x123) || (int64 != 0x345) || (str != "567")) { + return false; + } + + sptr handleGet = nullptr; + handleGet = cSurface->GetTunnelHandle(); + if ((handleGet == nullptr) || (handleGet->GetHandle()->fd != -1) || + (handleGet->GetHandle()->reserveInts != 1) || (handleGet->GetHandle()->reserve[0] != 1)) { + return false; + } + return true; +} + +pid_t NativeWindowBufferTest::ChildProcessMain() +{ + pipe(pipeFd); + pid_t pid = fork(); + if (pid != 0) { + return pid; + } + + int64_t data; + read(pipeFd[0], &data, sizeof(data)); + + sptr robj = nullptr; + while (true) { + auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + robj = sam->GetSystemAbility(ipcSystemAbilityID); + if (robj != nullptr) { + break; + } + sleep(0); + } + + auto producer = iface_cast(robj); + sptr pSurface = Surface::CreateSurfaceAsProducer(producer); + + struct NativeWindow *nativeWindow = OH_NativeWindow_CreateNativeWindow(&pSurface); + struct NativeWindowBuffer *nativeWindowBuffer = nullptr; + + int code = SET_USAGE; + uint64_t usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, usage); + + code = SET_BUFFER_GEOMETRY; + int32_t height = 0x100; + int32_t width = 0x100; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, height, width); + + code = SET_FORMAT; + int32_t format = GRAPHIC_PIXEL_FMT_RGBA_8888; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, format); + + code = SET_STRIDE; + int32_t stride = 0x8; + OH_NativeWindow_NativeWindowHandleOpt(nativeWindow, code, stride); + + int32_t fenceFd = -1; + auto ret = OH_NativeWindow_NativeWindowRequestBuffer(nativeWindow, &nativeWindowBuffer, &fenceFd); + if (ret != OHOS::GSERROR_OK) { + data = ret; + write(pipeFd[1], &data, sizeof(data)); + exit(0); + return -1; + } + ret = SetData(nativeWindowBuffer, nativeWindow); + if (ret != OHOS::GSERROR_OK) { + data = ret; + write(pipeFd[1], &data, sizeof(data)); + exit(0); + return -1; + } + + struct OHNativeWindowRegion *region = new OHNativeWindowRegion(); + struct OHNativeWindowRegion::Rect *rect = new OHNativeWindowRegion::Rect(); + rect->w = 0x100; + rect->h = 0x100; + region->rects = rect; + ret = OH_NativeWindow_NativeWindowFlushBuffer(nativeWindow, nativeWindowBuffer, -1, *region); + if (ret != OHOS::GSERROR_OK) { + data = ret; + write(pipeFd[1], &data, sizeof(data)); + exit(0); + return -1; + } + data = ret; + write(pipeFd[1], &data, sizeof(data)); + usleep(1000); // sleep 1000 microseconds (equals 1 milliseconds) + read(pipeFd[0], &data, sizeof(data)); + close(pipeFd[0]); + close(pipeFd[1]); + exit(0); + return 0; +} + +/* +* Function: produce and consumer surface of nativewindow +* Type: Function +* Rank: Important(2) +* EnvConditions: N/A +* CaseDescription: 1. produce surface by nativewindow interface, fill buffer +* 2. consume surface and check buffer +* @tc.require: issueI5GMZN issueI5IWHW + */ +void NativeWindowBufferTest::DoTest() +{ + auto pid = ChildProcessMain(); + assert(pid > 0); + + // uint64_t tokenId; + // const char *perms[2]; + // perms[0] = "ohos.permission.DISTRIBUTED_DATASYNC"; + // perms[1] = "ohos.permission.CAMERA"; + // NativeTokenInfoParams infoInstance = { + // .dcapsNum = 0, + // .permsNum = 2, + // .aclsNum = 0, + // .dcaps = NULL, + // .perms = perms, + // .acls = NULL, + // .processName = "dcamera_client_demo", + // .aplStr = "system_basic", + // }; + // tokenId = GetAccessTokenId(&infoInstance); + // SetSelfTokenID(tokenId); + // int32_t rett = Security::AccessToken::AccessTokenKit::ReloadNativeTokenInfo(); + // ASSERT_EQ(rett, Security::AccessToken::RET_SUCCESS); + + std::cout << "[-] Create Consumer Surface." << std::endl; + HiviewDFX::HiLog::Error({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Create Consumer Surface"); + cSurface = Surface::CreateSurfaceAsConsumer("test"); + cSurface->RegisterConsumerListener(this); + auto producer = cSurface->GetProducer(); + std::cout << "[-] Create Consumer Surface done." << std::endl; + + std::cout << "[-] Add SA." << std::endl; + HiviewDFX::HiLog::Error({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Add SA."); + auto sam = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + sam->AddSystemAbility(ipcSystemAbilityID, producer->AsObject()); + std::cout << "[-] Add SA done." << std::endl; + + int64_t data = 0; + write(pipeFd[1], &data, sizeof(data)); + usleep(1000); // sleep 1000000 microseconds (equals 1 second) + read(pipeFd[0], &data, sizeof(data)); + assert(data == OHOS::GSERROR_OK); + + std::cout << "[-] Acquire Buffer." << std::endl; + HiviewDFX::HiLog::Info({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Acquire Buffer"); + OHOS::sptr buffer = nullptr; + int32_t fence = -1; + int64_t timestamp; + Rect damage; + auto ret = cSurface->AcquireBuffer(buffer, fence, timestamp, damage); + assert(ret == OHOS::GSERROR_OK); + assert(buffer != nullptr); + assert(GetData(buffer) == true); + std::cout << "[-] Acquire Buffer done." << std::endl; + + std::cout << "[-] Release Buffer." << std::endl; + HiviewDFX::HiLog::Info({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Release Buffer"); + ret = cSurface->ReleaseBuffer(buffer, -1); + assert(ret == OHOS::GSERROR_OK); + std::cout << "[-] Release Buffer done." << std::endl; + + write(pipeFd[1], &data, sizeof(data)); + close(pipeFd[0]); + close(pipeFd[1]); + + std::cout << "[-] Remove SA." << std::endl; + HiviewDFX::HiLog::Info({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Remove SA."); + sam->RemoveSystemAbility(ipcSystemAbilityID); + waitpid(pid, nullptr, 0); + std::cout << "[-] Remove SA done." << std::endl; +} +} + +int main() { + std::cout << "[-] Test Start." << std::endl; + OHOS::HiviewDFX::HiLog::Info({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Test Start."); + + auto tester = OHOS::Rosen::NativeWindowBufferTest(); + tester.DoTest(); + + std::cout << "[-] Test Done." << std::endl; + OHOS::HiviewDFX::HiLog::Info({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Test Done."); +} diff --git a/display_server/ft_configs/ds_config.gni b/display_server/ft_configs/ds_config.gni index 32b5fca..4a29f79 100644 --- a/display_server/ft_configs/ds_config.gni +++ b/display_server/ft_configs/ds_config.gni @@ -12,21 +12,40 @@ # limitations under the License. declare_args() { - feature_enable_gpu = false + graphic_standard_feature_ace_enable_gpu = false + graphic_standard_feature_rs_enable_eglimage = false + graphic_standard_feature_rs_enable_uni_render = false + graphic_standard_feature_enable_afbc = false } -if (feature_enable_gpu) { - enable_gpu = true - rs_enable_eglimage = true - gpu_defines = [ - "ACE_ENABLE_GL", - "RS_ENABLE_GL", - "RS_ENABLE_EGLIMAGE", - "RS_ENABLE_EGLQUERYSURFACE", - ] + +if (graphic_standard_feature_ace_enable_gpu) { + gpu_defines = [ + "ACE_ENABLE_GL", + "RS_ENABLE_GL", + ] + ds_enable_gpu = true +} else { + gpu_defines = [ "ACE_DISABLE_GL" ] + ds_enable_gpu = false +} + +if (graphic_standard_feature_rs_enable_eglimage) { + gpu_defines += [ + "RS_ENABLE_EGLIMAGE", + "RS_ENABLE_EGLQUERYSURFACE", + ] + rs_enable_eglimage = true } else { - enable_gpu = false - rs_enable_eglimage = false - gpu_defines = [] + gpu_defines += [ "RS_DISABLE_EGLIMAGE" ] + rs_enable_eglimage = false +} + +if (graphic_standard_feature_rs_enable_uni_render) { + gpu_defines += [ "RS_ENABLE_UNI_RENDER" ] +} + +if (graphic_standard_feature_enable_afbc) { + gpu_defines += [ "RS_ENABLE_AFBC" ] } display_server_root = "//display_server" diff --git a/display_server/interfaces/inner_api/common/graphic_common.h b/display_server/interfaces/inner_api/common/graphic_common.h index ad2b975..8ea9ff0 100644 --- a/display_server/interfaces/inner_api/common/graphic_common.h +++ b/display_server/interfaces/inner_api/common/graphic_common.h @@ -59,7 +59,7 @@ static const std::map GSErrorStrs = { static inline std::string LowErrorStrSpecial(GSError err) { if (err == LOWERROR_INVALID) { - char num[] = {err / 0x64 % 0xa, err / 0xa % 0xa, err % 0xa, 0}; // int to string (in 1000) + char num[] = {static_cast(err / 0x64 % 0xa), static_cast(err / 0xa % 0xa), static_cast(err % 0xa), 0}; // int to string (in 1000) return std::string("with low error <") + num + ">"; } else if (err == LOWERROR_FAILURE) { return "with low error "; diff --git a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn index db4109a..f7b2ce4 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn @@ -167,7 +167,7 @@ ft_source_set("render_service_base_src") { defines += [ "ENABLE_EXPORT_MACRO" ] } - if (enable_gpu) { + if (ds_enable_gpu) { sources += [ "../src/common/rs_shared_context.cpp" ] defines += [ "GR_TEST_UTILS=1", diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn index 83b9e41..2df9476 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn @@ -79,7 +79,7 @@ ft_source_set("rosen_fangtian_sources") { "$display_server_root/utils/log", "$display_server_root/interfaces/inner_api/composer", ] - if (enable_gpu) { + if (ds_enable_gpu) { defines += [ "GR_TEST_UTILS=1", ] diff --git a/display_server/utils/ft_build/BUILD.gn b/display_server/utils/ft_build/BUILD.gn new file mode 100644 index 0000000..2669984 --- /dev/null +++ b/display_server/utils/ft_build/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") +import("//display_server/ft_configs/ds_config.gni") + +utils_dir = "//display_server/utils" + +group("buffer_handle") { + public_deps = [ "${utils_dir}/buffer_handle/ft_build:buffer_handle" ] +} + +group("scoped_bytrace") { + public_deps = [ "${utils_dir}/scoped_bytrace/ft_build:scoped_bytrace" ] +} + +group("socketpair") { + public_deps = [ "${utils_dir}/socketpair/ft_build:socketpair" ] +} + +group("sync_fence") { + public_deps = [ "${utils_dir}/sync_fence/ft_build:sync_fence" ] +} + +group("sandbox_utils") { + public_deps = [ "${utils_dir}/sandbox/ft_build:sandbox_utils" ] +} + +config("libgraphic_utils_public_config") { + include_dirs = + [ "//foundation/graphic/graphic_2d/interfaces/inner_api/common" ] +} + +ft_shared_library("libgraphic_utils") { + public_configs = [ ":libgraphic_utils_public_config" ] + + public_deps = [ + ":buffer_handle", + ":scoped_bytrace", + ":socketpair", + ":sync_fence", + ":sandbox_utils", + ] +} diff --git a/display_server/utils/scoped_bytrace/ft_build/BUILD.gn b/display_server/utils/scoped_bytrace/ft_build/BUILD.gn index 66f7f5b..82cf4eb 100644 --- a/display_server/utils/scoped_bytrace/ft_build/BUILD.gn +++ b/display_server/utils/scoped_bytrace/ft_build/BUILD.gn @@ -35,6 +35,4 @@ ft_static_library("scoped_bytrace") { sources = [ "../src/scoped_bytrace.cpp" ] configs = [ ":scoped_bytrace_config" ] public_configs = [ ":scoped_bytrace_public_config" ] - subsystem_name = "graphic" - part_name = "graphic_standard" -} \ No newline at end of file +} diff --git a/display_server/utils/socketpair/ft_build/BUILD.gn b/display_server/utils/socketpair/ft_build/BUILD.gn index c0b7a0b..04ad0d0 100644 --- a/display_server/utils/socketpair/ft_build/BUILD.gn +++ b/display_server/utils/socketpair/ft_build/BUILD.gn @@ -20,6 +20,10 @@ config("socketpair_config") { "-Werror", "-g3", ] +} + +config("socketpair_public_config") { + visibility = [ ":socketpair" ] include_dirs = [ "../export", ] @@ -35,5 +39,7 @@ ft_shared_library("socketpair") { "//build/gn/configs/system_libs:ipc_core_config", ] + public_configs = [ ":socketpair_public_config" ] + deps = [ "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace" ] } -- Gitee From ff5e4c516a55f169262c9199d213511a59f66eb8 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 17:13:06 +0800 Subject: [PATCH 03/14] feat(display_server): add composer test --- build/gn/BUILD.gn | 10 +- build/gn/configs/system_libs/BUILD.gn | 114 ++++++++++++------ build/prebuild.sh | 8 +- .../hal/drm_backend/display_device/BUILD.gn | 6 +- display_server/drivers/hal/test/BUILD.gn | 27 +++-- .../hdi_service/gralloc/client/BUILD.gn | 12 +- .../rosen/modules/composer/ft_build/BUILD.gn | 22 ++-- .../modules/composer/vsync/ft_build/BUILD.gn | 12 +- .../composer/vsync/src/vsync_distributor.cpp | 5 + .../composer/vsync/src/vsync_sampler.cpp | 1 + .../modules/frame_analyzer/ft_build/BUILD.gn | 11 +- .../core/screen_manager/rs_screen.cpp | 4 +- .../modules/render_service/ft_build/BUILD.gn | 21 ++-- .../render_service_base/ft_build/BUILD.gn | 14 +-- .../ft_build/mock/BUILD.gn | 7 +- .../src/platform/fangtian/BUILD.gn | 14 +-- .../render_service_client/ft_build/BUILD.gn | 13 +- .../rosen/samples/composer/ft_build/BUILD.gn | 50 ++++++++ .../rosen/samples/composer/hello_composer.cpp | 69 ++++++----- .../rosen/samples/composer/hello_composer.h | 41 ++++--- .../rosen/samples/composer/layer_context.cpp | 1 + .../rosen/samples/composer/main.cpp | 4 +- .../utils/socketpair/ft_build/BUILD.gn | 14 +-- .../utils/sync_fence/ft_build/BUILD.gn | 15 ++- window_manager/dm/ft_build/BUILD.gn | 14 +-- window_manager/utils/ft_build/BUILD.gn | 16 +-- window_manager/wm/ft_build/BUILD.gn | 14 +-- 27 files changed, 312 insertions(+), 227 deletions(-) create mode 100644 display_server/rosen/samples/composer/ft_build/BUILD.gn diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 6e2fe72..3a2a20f 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -13,14 +13,8 @@ group("ft_display_server") { deps = [ - "//display_server/utils/socketpair/ft_build:socketpair", - "//display_server/rosen/modules/composer/vsync/ft_build:libvsync", - "//display_server/drivers/hal/drm_backend:drm_backend", - "//display_server/utils/sync_fence/ft_build:sync_fence", - "//display_server/frameworks/surface/ft_build:surface", - "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", - "//display_server/drivers/hdi_service/gralloc/client:hdi_gralloc_client", "//display_server/rosen/modules/composer/ft_build:libcomposer", + "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", "//display_server/rosen/modules/render_service/ft_build:librender_service", ] @@ -38,7 +32,7 @@ group("ft_test") { deps = [ "//display_server/drivers/hal/test:drm_backend_test", "//display_server/frameworks/surface/test/ft_build:test", - # "//display_server/rosen/samples/composer:hello_composer", + "//display_server/rosen/samples/composer/ft_build:hello_composer", # "//display_server/rosen/modules/render_service_client/test:render_service_client_rs_demo" ] } diff --git a/build/gn/configs/system_libs/BUILD.gn b/build/gn/configs/system_libs/BUILD.gn index edd6cbd..6572cf1 100644 --- a/build/gn/configs/system_libs/BUILD.gn +++ b/build/gn/configs/system_libs/BUILD.gn @@ -12,116 +12,152 @@ # limitations under the License. config("c_utils_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/c_utils" ] libs = [ "utils", "sec_shared" ] } config("ipc_core_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/ipc_core" ] libs = [ "ipc_core" ] } config("hilog_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/hilog" ] libs = [ "hilog" ] } config("hitrace_meter_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/hitrace_meter" ] libs = [ "hitrace_meter" ] } config("eventhandler_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/eventhandler" ] libs = [ "eventhandler" ] } config("skia_config") { - include_dirs = [ - "${sys_inc}/skia", - "${sys_inc}/skia/include", - "${sys_inc}/skia/include/core" - ] - libs = [ "ace_skia_fangtian" ] + visibility = [ ":*" ] + + include_dirs = [ + "${sys_inc}/skia", + "${sys_inc}/skia/include", + "${sys_inc}/skia/include/core" + ] + libs = [ "ace_skia_fangtian" ] } config("samgr_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/samgr" ] libs = [ "samgr_proxy" ] } config("image_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/image" ] libs = [ "image_native" ] } config("mmi_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/mmi" ] libs = [ "mmi-client" ] } config("syspara_config") { + visibility = [ ":*" ] + include_dirs = [ "${sys_inc}/syspara" ] libs = [ "beget_proxy", "begetutil" ] } config("safwk_config") { - visibility = [ ":*" ] + visibility = [ ":*" ] - include_dirs = [ "${sys_inc}/safwk" ] - libs = [ "system_ability_fwk" ] + include_dirs = [ "${sys_inc}/safwk" ] + libs = [ "system_ability_fwk" ] } -group("ipc_core") { - public_configs = [ - ":c_utils_config", - ":ipc_core_config" - ] +group("c_utils") { + public_configs = [ ":c_utils_config" ] } group("hilog") { - public_configs = [ - ":hilog_config", + public_configs = [ ":hilog_config" ] +} + +group("ipc_core") { + public_deps = [ ":c_utils" ] + public_configs = [ ":ipc_core_config" ] +} + +group("eventhandler") { + public_deps = [ + ":c_utils", + ":hilog", ] + public_configs = [ ":eventhandler_config" ] } group("hitrace_meter") { - public_configs = [ - ":c_utils_config", - ":hitrace_meter_config", - ] + public_deps = [ ":c_utils" ] + public_configs = [ ":hitrace_meter_config" ] } group("samgr") { - public_configs = [ - ":c_utils_config", - ":samgr_config", - ] + public_deps = [ ":c_utils" ] + public_configs = [ ":samgr_config" ] } -group("ipc_core") { - public_configs = [ - ":c_utils_config", - ":ipc_core_config" +group("image") { + public_deps = [ + ":hilog", + ":hitrace_meter", + ":c_utils", + ":ipc_core", ] + public_configs = [ ":image_config" ] } -group("hilog") { - public_configs = [ - ":hilog_config", +group("mmi") { + public_deps = [ + ":c_utils", + ":hilog", ] + public_configs = [ ":mmi_config" ] } -group("hitrace_meter") { - public_configs = [ - ":c_utils_config", - ":hitrace_meter_config", +group("syspara") { + public_deps = [ + ":c_utils", + ":hilog", ] + public_configs = [ ":syspara_config" ] } -group("samgr") { - public_configs = [ - ":c_utils_config", - ":samgr_config", +group("skia") { + public_configs = [ ":skia_config" ] +} + +group("safwk") { + public_deps = [ + ":c_utils", + ":ipc_core", + ":samgr" ] + public_configs = [ ":safwk_config" ] } diff --git a/build/prebuild.sh b/build/prebuild.sh index 0f1c7c1..3a81784 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -73,10 +73,16 @@ if [ ! -d ${PROJECT_DIR}/prebuilts/libs ]; then git clone https://gitee.com/yanansong/ft_engine_prebuild.git ${PROJECT_DIR}/prebuilts/libs fi -# copy prebuild library to /usr/lib64 ARCHNAME=`uname -m` cd ${PROJECT_DIR}/prebuilts/libs/library/${ARCHNAME} +# copy prebuild library to /usr/local/lib64 sudo cp -fr *.so /usr/local/lib64 +# copy prebuild binarys to /usr/local/bin +sudo cp -f hilog /usr/local/bin +sudo cp -f hilogd /usr/local/bin +sudo cp -f sa_main /usr/local/bin +sudo cp -f samgr /usr/local/bin + cd ${PROJECT_DIR} rm -fr ${PROJECT_DIR}/prebuilts/libs diff --git a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn index ce87d2d..f8cfef4 100644 --- a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn @@ -41,10 +41,7 @@ ft_shared_library("display_device") { "hdi_session.cpp", ] - configs = [ - "//build/gn/configs/system_libs:ipc_core_config", - "//display_server/drivers/hal:hal_public_config", - ] + configs = [ "//display_server/drivers/hal:hal_public_config" ] public_configs = [ ":display_device_public_config", "//display_server/drivers/hal/drm_backend:import_system_gbm_config" @@ -57,5 +54,6 @@ ft_shared_library("display_device") { deps = [ "//display_server/utils/sync_fence/ft_build:sync_fence", + "//build/gn/configs/system_libs:ipc_core", ] } diff --git a/display_server/drivers/hal/test/BUILD.gn b/display_server/drivers/hal/test/BUILD.gn index 223e344..c4dc771 100644 --- a/display_server/drivers/hal/test/BUILD.gn +++ b/display_server/drivers/hal/test/BUILD.gn @@ -14,20 +14,21 @@ import("//build/gn/fangtian.gni") ft_executable("drm_backend_test") { - testonly = true + testonly = true - sources = [ - "system_test/main.cpp" - ] + sources = [ + "system_test/main.cpp" + ] - deps = [ - "//display_server/drivers/hal/drm_backend:drm_backend", - "//display_server/drivers/hal/base:hal_base", - "//display_server/utils/sync_fence/ft_build:sync_fence", - ] + deps = [ + "//display_server/drivers/hal/drm_backend:drm_backend", + "//display_server/drivers/hal/base:hal_base", + "//display_server/utils/sync_fence/ft_build:sync_fence", - configs = [ - "//build/gn/configs/system_libs:ipc_core_config", - "//display_server/drivers/hal:hal_public_config" - ] + "//build/gn/configs/system_libs:ipc_core", + ] + + configs = [ + "//display_server/drivers/hal:hal_public_config" + ] } diff --git a/display_server/drivers/hdi_service/gralloc/client/BUILD.gn b/display_server/drivers/hdi_service/gralloc/client/BUILD.gn index 790d104..5268a4f 100755 --- a/display_server/drivers/hdi_service/gralloc/client/BUILD.gn +++ b/display_server/drivers/hdi_service/gralloc/client/BUILD.gn @@ -26,12 +26,7 @@ group("hdi_gralloc_client") { } ft_shared_library("libhdi_display_gralloc_client") { - configs = [ - ":gralloc_client_public_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:c_utils_config", - ] + configs = [ ":gralloc_client_public_config" ] sources = [ "allocator_adapter.cpp", @@ -44,6 +39,9 @@ ft_shared_library("libhdi_display_gralloc_client") { ] deps = [ - "//display_server/utils/buffer_handle/ft_build:buffer_handle" + "//display_server/utils/buffer_handle/ft_build:buffer_handle", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", ] } diff --git a/display_server/rosen/modules/composer/ft_build/BUILD.gn b/display_server/rosen/modules/composer/ft_build/BUILD.gn index 13804e5..93b234c 100644 --- a/display_server/rosen/modules/composer/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/ft_build/BUILD.gn @@ -54,24 +54,19 @@ ft_shared_library("libcomposer") { "$display_server_root/utils/log", ] - configs = [ - ":composer_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:c_utils_config", - ] + defines = gpu_defines - defines = [] - defines += gpu_defines + configs = [ ":composer_config" ] - public_configs = [ - ":composer_public_config", - ] + public_configs = [ ":composer_public_config" ] deps = [ "$display_server_root/frameworks/surface/ft_build:surface", "$display_server_root/rosen/modules/render_frame_trace/ft_build:render_frame_trace", - "$display_server_root/rosen/modules/render_service_base/ft_build:librender_service_base", + # "$display_server_root/rosen/modules/render_service_base/ft_build:librender_service_base", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", ] public_deps = [ @@ -79,7 +74,6 @@ ft_shared_library("libcomposer") { "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", "$display_server_root/utils/scoped_bytrace/ft_build:scoped_bytrace", "$display_server_root/utils/sync_fence/ft_build:sync_fence", - "$display_server_root/drivers/hal/drm_backend/display_device:display_device", - "$display_server_root/drivers/hal/drm_backend/display_gralloc:display_gralloc", + "$display_server_root/drivers/hal/drm_backend:drm_backend", ] } \ No newline at end of file diff --git a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn index c233ffe..7bc7089 100644 --- a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -50,13 +50,7 @@ ft_shared_library("libvsync") { "../src/vsync_sampler.cpp", ] - configs = [ - ":vsync_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:hilog_config", - ] + configs = [ ":vsync_config" ] public_configs = [ ":vsync_public_config", @@ -65,6 +59,10 @@ ft_shared_library("libvsync") { deps = [ "//display_server/utils/sandbox/ft_build:sandbox_utils", "//display_server/utils/socketpair/ft_build:socketpair", + + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:hilog", ] public_deps = [ diff --git a/display_server/rosen/modules/composer/vsync/src/vsync_distributor.cpp b/display_server/rosen/modules/composer/vsync/src/vsync_distributor.cpp index 74734c3..af87314 100644 --- a/display_server/rosen/modules/composer/vsync/src/vsync_distributor.cpp +++ b/display_server/rosen/modules/composer/vsync/src/vsync_distributor.cpp @@ -187,7 +187,10 @@ void VSyncDistributor::ThreadMain() continue; } } + ScopedBytrace func(name_ + "_SendVsync"); + VLOGI("VSyncDistributor::ThreadMain: Conns size: %{public}zu, timestamp: %{public}ld", conns.size(), timestamp); + for (uint32_t i = 0; i < conns.size(); i++) { int32_t ret = conns[i]->PostEvent(timestamp); VLOGD("Distributor name:%{public}s, connection name:%{public}s, ret:%{public}d", @@ -196,6 +199,7 @@ void VSyncDistributor::ThreadMain() RemoveConnection(conns[i]); } else if (ret == ERRNO_EAGAIN) { std::unique_lock locker(mutex_); + VLOGI("VSyncDistributor::ThreadMain: EAGAIN"); // Exclude SetVSyncRate if (conns[i]->rate_ < 0) { conns[i]->rate_ = 0; @@ -211,6 +215,7 @@ void VSyncDistributor::EnableVSync() vsyncEnabled_ = true; controller_->SetCallback(this); controller_->SetEnable(true); + VLOGI("Disable VSync."); } } diff --git a/display_server/rosen/modules/composer/vsync/src/vsync_sampler.cpp b/display_server/rosen/modules/composer/vsync/src/vsync_sampler.cpp index 3b222ed..815a857 100644 --- a/display_server/rosen/modules/composer/vsync/src/vsync_sampler.cpp +++ b/display_server/rosen/modules/composer/vsync/src/vsync_sampler.cpp @@ -81,6 +81,7 @@ void VSyncSampler::SetHardwareVSyncStatus(bool enabled) { std::lock_guard lock(mutex_); hardwareVSyncStatus_ = enabled; + VLOGI("VSyncSampler::SetHardwareVSyncStatus: enabled: %{public}d", enabled); } bool VSyncSampler::GetHardwareVSyncStatus() const diff --git a/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn index d85e407..19df417 100644 --- a/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn +++ b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn @@ -43,15 +43,16 @@ ft_shared_library("libframe_analyzer") { deps = [ "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:c_utils", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:syspara", ] configs = [ ":libframe_analyzer_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:syspara_config", ] public_configs = [ ":libframe_analyzer_public_config" ] diff --git a/display_server/rosen/modules/render_service/core/screen_manager/rs_screen.cpp b/display_server/rosen/modules/render_service/core/screen_manager/rs_screen.cpp index 6c2e173..6ade5f3 100644 --- a/display_server/rosen/modules/render_service/core/screen_manager/rs_screen.cpp +++ b/display_server/rosen/modules/render_service/core/screen_manager/rs_screen.cpp @@ -298,7 +298,7 @@ void RSScreen::ModeInfoDump(std::string& dumpString) void RSScreen::CapabilityTypeDump(InterfaceType capabilityType, std::string& dumpString) { dumpString += "type="; - switch (capability_.type) { + switch (static_cast(capability_.type)) { case DISP_INTF_HDMI: { dumpString += "DISP_INTF_HDMI, "; break; @@ -347,7 +347,7 @@ void RSScreen::PropDump(std::string& dumpString) void RSScreen::PowerStatusDump(std::string& dumpString) { dumpString += "powerstatus="; - switch (powerStatus_) { + switch (static_cast(powerStatus_)) { case POWER_STATUS_ON: { dumpString += "POWER_STATUS_ON"; break; diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index c90b0b7..d998fb4 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -69,24 +69,19 @@ ft_shared_library("librender_service") { "$display_server_root/utils/socketpair/export", ] - configs = [ - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:syspara_config", - "//build/gn/configs/system_libs:safwk_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:image_config", - ] - deps = [ "$display_server_root/frameworks/surface/ft_build:surface", "$display_server_root/rosen/modules/composer/ft_build:libcomposer", "$display_server_root/rosen/modules/render_frame_trace/ft_build:render_frame_trace", "$display_server_root/rosen/modules/render_service_base/ft_build:librender_service_base", + + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:syspara", + "//build/gn/configs/system_libs:safwk", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:samgr", + "//build/gn/configs/system_libs:image", ] libs = ["png"] diff --git a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn index f7b2ce4..409f970 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn @@ -174,14 +174,6 @@ ft_source_set("render_service_base_src") { ] } - configs = [ - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:skia_config", - ] - include_dirs = [ "$rosen_root/modules/render_service_base/src", "$rosen_root/modules/platform/image_native", @@ -196,6 +188,12 @@ ft_source_set("render_service_base_src") { "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", "$display_server_root/utils/sandbox/ft_build:sandbox_utils", "$display_server_root/utils/sync_fence/ft_build:sync_fence", + + "//build/gn/configs/system_libs:c_utils", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:skia", ] } diff --git a/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn index fdd9c15..9926414 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn @@ -15,10 +15,9 @@ import("//build/gn/fangtian.gni") import("//display_server/ft_configs/ds_config.gni") ft_source_set("mock_image_native") { - - configs = [ - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:skia_config", + deps = [ + "//build/gn/configs/system_libs:c_utils", + "//build/gn/configs/system_libs:skia", ] sources = [ diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn index 2df9476..658dbf3 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn @@ -25,13 +25,6 @@ config("platform_config") { ft_source_set("rosen_fangtian_sources") { configs = [ ":platform_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:samgr_config", ] cflags_cc = [ @@ -111,5 +104,12 @@ ft_source_set("rosen_fangtian_sources") { "$display_server_root/utils/sync_fence/ft_build:sync_fence", "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:samgr", ] } diff --git a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn index 8cc0381..f2df025 100644 --- a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn @@ -115,17 +115,14 @@ ft_source_set("render_service_client_src") { "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", "$display_server_root/utils/sync_fence/ft_build:sync_fence", "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:hitrace_meter", ] public_configs = [ ":render_service_client_config" ] - - configs = [ - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - ] } ft_shared_library("librender_service_client") { diff --git a/display_server/rosen/samples/composer/ft_build/BUILD.gn b/display_server/rosen/samples/composer/ft_build/BUILD.gn new file mode 100644 index 0000000..6241b62 --- /dev/null +++ b/display_server/rosen/samples/composer/ft_build/BUILD.gn @@ -0,0 +1,50 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +ft_executable("hello_composer") { + cflags = [ + "-Wall", + "-Werror", + "-g3", + ] + + sources = [ + "../hello_composer.cpp", + "../layer_context.cpp", + "../main.cpp", + ] + + include_dirs = [ + "//display_server/rosen/modules/composer/hdi_backend/include", + "//display_server/rosen/include/common", + "//display_server/rosen/modules/composer/vsync/include", + "//display_server/rosen/modules/render_service_base/src", + "//display_server/interfaces/inner_api/composer", + ] + + deps = [ + "//display_server/frameworks/surface/ft_build:surface", + "//display_server/rosen/modules/composer/ft_build:libcomposer", + "//display_server/utils/ft_build:sync_fence", + # "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + ] + + deps += [ + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:eventhandler", + # "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:ipc_core", + ] +} \ No newline at end of file diff --git a/display_server/rosen/samples/composer/hello_composer.cpp b/display_server/rosen/samples/composer/hello_composer.cpp index 43eb8fd..56b4d2a 100644 --- a/display_server/rosen/samples/composer/hello_composer.cpp +++ b/display_server/rosen/samples/composer/hello_composer.cpp @@ -52,6 +52,7 @@ void HelloComposer::Run(const std::vector &runArgs) return; } + // Step1: Register Hotplug callback and Wait callback done. backend_->RegScreenHotplug(HelloComposer::OnScreenPlug, this); while (1) { if (!outputMap_.empty()) { @@ -61,6 +62,7 @@ void HelloComposer::Run(const std::vector &runArgs) if (!initDeviceFinished_) { if (deviceConnected_) { + // Step2: Create Hdi Screen for all Output (Reg VSync callback) and init Layers CreateLayers(); } initDeviceFinished_ = true; @@ -72,6 +74,7 @@ void HelloComposer::Run(const std::vector &runArgs) ParseArgs(runArgs); sleep(1); + // Create main loop & Register virtual vsync callback std::shared_ptr runner = OHOS::AppExecFwk::EventRunner::Create(false); mainThreadHandler_ = std::make_shared(runner); g_receiver = new VSyncReceiver(vsyncConnection, mainThreadHandler_); @@ -105,6 +108,8 @@ void HelloComposer::OnScreenPlug(std::shared_ptr &output, bool connec void HelloComposer::OnPrepareCompleted( sptr &surface, const struct PrepareCompleteParam ¶m, void* data) { + LOGI("HelloComposer::OnPrepareCompleted"); + if (!param.needFlushFramebuffer) { return; } @@ -153,14 +158,14 @@ void HelloComposer::RequestSync() void HelloComposer::InitLayers(uint32_t screenId) { LOGI("Init layers, screenId is %{public}d", screenId); - uint32_t displayWidth = displayWidthsMap_[screenId]; - uint32_t displayHeight = displayHeightsMap_[screenId]; + int32_t displayWidth = displayWidthsMap_[screenId]; + int32_t displayHeight = displayHeightsMap_[screenId]; std::vector> &drawLayers = drawLayersMap_[screenId]; - uint32_t statusHeight = displayHeight / 10; // statusHeight is 1 / 10 displayHeight - uint32_t launcherHeight = displayHeight - statusHeight * 2; // index 1, cal launcher height 2 - uint32_t navigationY = displayHeight - statusHeight; + int32_t statusHeight = displayHeight / 10; // statusHeight is 1 / 10 displayHeight + int32_t launcherHeight = displayHeight - statusHeight * 2; // index 1, cal launcher height 2 + int32_t navigationY = displayHeight - statusHeight; LOGI("displayWidth[%{public}d], displayHeight[%{public}d], statusHeight[%{public}d], " "launcherHeight[%{public}d], navigationY[%{public}d]", displayWidth, displayHeight, statusHeight, launcherHeight, navigationY); @@ -183,10 +188,10 @@ void HelloComposer::InitLayers(uint32_t screenId) IRect { 0, 0, displayWidth, statusHeight }, 1, LayerType::LAYER_NAVIGATION)); - uint32_t layerWidth = displayWidth / 4; // layer width is 1/4 displayWidth - uint32_t layerHeight = displayHeight / 4; // layer height is 1/4 of displayHeight - uint32_t layerPositionX = displayWidth / 2 - layerWidth / 2; // x is (displayWidth - layerWidth) / 2 - uint32_t layerPositionY = displayHeight / 2 - layerHeight / 2; // y is (displayHeight - layerHeight) / 2 + int32_t layerWidth = displayWidth / 4; // layer width is 1/4 displayWidth + int32_t layerHeight = displayHeight / 4; // layer height is 1/4 of displayHeight + int32_t layerPositionX = displayWidth / 2 - layerWidth / 2; // x is (displayWidth - layerWidth) / 2 + int32_t layerPositionY = displayHeight / 2 - layerHeight / 2; // y is (displayHeight - layerHeight) / 2 LOGI("Layer position is: [x, y, w, h: [%{public}d, %{public}d, %{public}d, %{public}d]]", layerPositionX, layerPositionY, layerWidth, layerHeight); @@ -199,21 +204,24 @@ void HelloComposer::InitLayers(uint32_t screenId) void HelloComposer::Sync(int64_t, void *data) { + LOGI("VSync come."); + VSyncReceiver::FrameCallback fcb = { .userData_ = data, .callback_ = std::bind(&HelloComposer::Sync, this, ::std::placeholders::_1, ::std::placeholders::_2), }; - if (g_receiver != nullptr) { - g_receiver->RequestNextVSync(fcb); - } - if (!ready_) { LOGE("hdi screen is not ready"); return; } + // Do repaint Draw(); + + if (g_receiver != nullptr) { + g_receiver->RequestNextVSync(fcb); + } } void HelloComposer::SetRunArgs(const std::unique_ptr &drawLayer) const @@ -300,8 +308,8 @@ uint32_t HelloComposer::CreatePhysicalScreen() displayModeInfos[i].height, displayModeInfos[i].freshRate); if (displayModeInfos[i].id == static_cast(currentModeIndex)) { freq_ = 30; // 30 freq - displayWidthsMap_[screenId] = static_cast(displayModeInfos[i].width); - displayHeightsMap_[screenId] = static_cast(displayModeInfos[i].height); + displayWidthsMap_[screenId] = displayModeInfos[i].width; + displayHeightsMap_[screenId] = displayModeInfos[i].height; break; } } @@ -311,16 +319,16 @@ uint32_t HelloComposer::CreatePhysicalScreen() DispPowerStatus powerState; screen->GetScreenPowerStatus(powerState); - LOGI("get poweState:%{public}d", powerState); + LOGI("Get powerState:%{public}d", powerState); } DisplayCapability info; screen->GetScreenCapability(info); - LOGI("ScreenCapability: name(%{public}s), type(%{public}d), phyWidth(%{public}d), " - "phyHeight(%{public}d)", info.name, info.type, info.phyWidth, info.phyHeight); - LOGI("ScreenCapability: supportLayers(%{public}d), virtualDispCount(%{public}d), " - "supportWriteBack(%{public}d), propertyCount(%{public}d)", info.supportLayers, - info.virtualDispCount, info.supportWriteBack, info.propertyCount); + LOGI("ScreenCapability: name(%{public}s), type(%{public}d), phyWidth(%{public}d), phyHeight(%{public}d)", + info.name, info.type, info.phyWidth, info.phyHeight); + LOGI("ScreenCapability: supportLayers(%{public}d), virtualDispCount(%{public}d), supportWriteBack(%{public}d), " + "propertyCount(%{public}d)", + info.supportLayers, info.virtualDispCount, info.supportWriteBack, info.propertyCount); ready_ = true; @@ -426,13 +434,16 @@ void HelloComposer::RemoveOffScreenData(uint32_t offScreenId) namespace { void DrawFrameBufferData(void *image, uint32_t width, uint32_t height) { - static uint32_t value = 0x00; - value++; + static std::vector colors = {0xff0000ff, 0xffff00ff, 0xaa00ff00, 0xff00ffaa, 0xff0f0f00}; + static uint32_t index = 0; + if (index++ > 4) { + index = 0; + } uint32_t *pixel = static_cast(image); for (uint32_t x = 0; x < width; x++) { for (uint32_t y = 0; y < height; y++) { - *pixel++ = value; + *pixel++ = colors[index]; } } } @@ -441,15 +452,17 @@ void DrawFrameBufferData(void *image, uint32_t width, uint32_t height) void HelloComposer::DoPrepareCompleted(sptr surface, const struct PrepareCompleteParam ¶m) { uint32_t screenId = curOutput_->GetScreenId(); - uint32_t displayWidth = displayWidthsMap_[screenId]; - uint32_t displayHeight = displayHeightsMap_[screenId]; + int32_t displayWidth = displayWidthsMap_[screenId]; + int32_t displayHeight = displayHeightsMap_[screenId]; + // Request buffer from buffer queue BufferRequestConfig requestConfig = { .width = displayWidth, // need display width .height = displayHeight, // need display height .strideAlignment = 0x8, .format = GRAPHIC_PIXEL_FMT_BGRA_8888, - .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA, + // .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA, + .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA | BUFFER_USAGE_MEM_FB, .timeout = 0, }; @@ -474,6 +487,7 @@ void HelloComposer::DoPrepareCompleted(sptr surface, const struct Prepa } } + // Fill buffer with color auto addr = static_cast(fbBuffer->GetVirAddr()); if (hasClient) { DrawFrameBufferData(addr, static_cast(fbBuffer->GetWidth()), @@ -485,6 +499,7 @@ void HelloComposer::DoPrepareCompleted(sptr surface, const struct Prepa } } + // Flush buffer BufferFlushConfig flushConfig = { .damage = { .w = displayWidth, diff --git a/display_server/rosen/samples/composer/hello_composer.h b/display_server/rosen/samples/composer/hello_composer.h index 573d38d..755bf12 100644 --- a/display_server/rosen/samples/composer/hello_composer.h +++ b/display_server/rosen/samples/composer/hello_composer.h @@ -35,6 +35,25 @@ public: void Init(); void Run(const std::vector &runArgs); +private: + void InitLayers(uint32_t screenId); + void RequestSync(); + void CreateLayers(); + void CreateShowLayers(); + void Draw(); + void Sync(int64_t, void *data); + void DoPrepareCompleted(sptr surface, const struct PrepareCompleteParam ¶m); + void OnHotPlug(std::shared_ptr &output, bool connected); + void OnHotPlugEvent(std::shared_ptr &output, bool connected); + void ParseArgs(const std::vector &runArgs); + void SetRunArgs(const std::unique_ptr &drawLayer) const; + void RemoveOffScreenData(uint32_t offScreenId); + uint32_t CreatePhysicalScreen(); + + static void OnScreenPlug(std::shared_ptr &output, bool connected, void* data); + static void OnPrepareCompleted( + sptr &surface, const struct PrepareCompleteParam ¶m, void* data); + private: uint32_t freq_ = 30; uint32_t currScreenId_ = 0; @@ -54,29 +73,11 @@ private: std::shared_ptr mainThreadHandler_; /* map: key is screenId */ - std::unordered_map displayWidthsMap_; - std::unordered_map displayHeightsMap_; + std::unordered_map displayWidthsMap_; + std::unordered_map displayHeightsMap_; std::unordered_map> outputMap_; std::unordered_map> screensMap_; std::unordered_map>> drawLayersMap_; - - void InitLayers(uint32_t screenId); - void RequestSync(); - void CreateLayers(); - void CreateShowLayers(); - void Draw(); - void Sync(int64_t, void *data); - void DoPrepareCompleted(sptr surface, const struct PrepareCompleteParam ¶m); - void OnHotPlug(std::shared_ptr &output, bool connected); - void OnHotPlugEvent(std::shared_ptr &output, bool connected); - void ParseArgs(const std::vector &runArgs); - void SetRunArgs(const std::unique_ptr &drawLayer) const; - void RemoveOffScreenData(uint32_t offScreenId); - uint32_t CreatePhysicalScreen(); - - static void OnScreenPlug(std::shared_ptr &output, bool connected, void* data); - static void OnPrepareCompleted( - sptr &surface, const struct PrepareCompleteParam ¶m, void* data); }; } // namespace Rosen } // namespace OHOS diff --git a/display_server/rosen/samples/composer/layer_context.cpp b/display_server/rosen/samples/composer/layer_context.cpp index e887b15..9d14f97 100644 --- a/display_server/rosen/samples/composer/layer_context.cpp +++ b/display_server/rosen/samples/composer/layer_context.cpp @@ -167,6 +167,7 @@ SurfaceError LayerContext::FillHDILayer() prevBuffer_ = buffer; prevFence_ = acquireSyncFence; + ret = cSurface_->ReleaseBuffer(buffer, acquireFence); return ret; } diff --git a/display_server/rosen/samples/composer/main.cpp b/display_server/rosen/samples/composer/main.cpp index c83381d..3cdaef7 100644 --- a/display_server/rosen/samples/composer/main.cpp +++ b/display_server/rosen/samples/composer/main.cpp @@ -27,8 +27,8 @@ int32_t main(int32_t argc, const char *argv[]) runArgs[i] = argv[i]; } - OHOS::Rosen::HelloComposer m; - m.Run(runArgs); + OHOS::Rosen::HelloComposer hello_composer; + hello_composer.Run(runArgs); return 0; } \ No newline at end of file diff --git a/display_server/utils/socketpair/ft_build/BUILD.gn b/display_server/utils/socketpair/ft_build/BUILD.gn index 04ad0d0..f05a0aa 100644 --- a/display_server/utils/socketpair/ft_build/BUILD.gn +++ b/display_server/utils/socketpair/ft_build/BUILD.gn @@ -32,14 +32,14 @@ config("socketpair_public_config") { ft_shared_library("socketpair") { sources = [ "../src/local_socketpair.cpp" ] - configs = [ - ":socketpair_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:ipc_core_config", - ] + configs = [ ":socketpair_config" ] public_configs = [ ":socketpair_public_config" ] - deps = [ "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace" ] + deps = [ + "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", + ] } diff --git a/display_server/utils/sync_fence/ft_build/BUILD.gn b/display_server/utils/sync_fence/ft_build/BUILD.gn index 1cb670e..583ee73 100644 --- a/display_server/utils/sync_fence/ft_build/BUILD.gn +++ b/display_server/utils/sync_fence/ft_build/BUILD.gn @@ -45,16 +45,15 @@ ft_shared_library("sync_fence") { "../src/sync_fence_tracker.cpp", ] - configs = [ - ":sync_fence_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:ipc_core_config", - ] + configs = [ ":sync_fence_config" ] public_configs = [ ":sync_fence_public_config", ] + + deps = [ + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:ipc_core", + ] } diff --git a/window_manager/dm/ft_build/BUILD.gn b/window_manager/dm/ft_build/BUILD.gn index bc1ee33..911c521 100644 --- a/window_manager/dm/ft_build/BUILD.gn +++ b/window_manager/dm/ft_build/BUILD.gn @@ -47,13 +47,6 @@ ft_shared_library("libdm") { configs = [ ":libdm_private_config", "$window_manager_path/resources/config/build:coverage_flags", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:image_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:eventhandler_config", ] public_configs = [ ":libdm_public_config" ] @@ -61,5 +54,12 @@ ft_shared_library("libdm") { deps = [ "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", "$window_manager_path/utils/ft_build:libwmutil", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:image", + "//build/gn/configs/system_libs:samgr", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:event_handler", ] } diff --git a/window_manager/utils/ft_build/BUILD.gn b/window_manager/utils/ft_build/BUILD.gn index 189b479..a021930 100644 --- a/window_manager/utils/ft_build/BUILD.gn +++ b/window_manager/utils/ft_build/BUILD.gn @@ -58,14 +58,6 @@ ft_shared_library("libwmutil") { configs = [ ":libwmutil_private_config", "$window_manager_path/resources/config/build:coverage_flags", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:image_config", - "//build/gn/configs/system_libs:mmi_config", ] public_configs = [ ":libwmutil_public_config" ] @@ -73,5 +65,13 @@ ft_shared_library("libwmutil") { deps = [ "$display_server_path/frameworks/surface/ft_build:surface", "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:samgr", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:image", + "//build/gn/configs/system_libs:mmi", + "//build/gn/configs/system_libs:skia", ] } diff --git a/window_manager/wm/ft_build/BUILD.gn b/window_manager/wm/ft_build/BUILD.gn index a236077..ec47a13 100644 --- a/window_manager/wm/ft_build/BUILD.gn +++ b/window_manager/wm/ft_build/BUILD.gn @@ -58,14 +58,6 @@ ft_shared_library("libwm") { configs = [ ":libwm_private_config", "$window_manager_path/resources/config/build:coverage_flags", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:image_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:mmi_config", - "//build/gn/configs/system_libs:skia_config", ] public_configs = [ ":libwm_public_config" ] @@ -76,5 +68,11 @@ ft_shared_library("libwm") { "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", "$window_manager_path/dm/ft_build:libdm", "$window_manager_path/utils/ft_build:libwmutil", + + "//build/gn/configs/system_libs:image", + "//build/gn/configs/system_libs:samgr", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:mmi", + "//build/gn/configs/system_libs:skia", ] } -- Gitee From 0f9044e5f3a2fbc2c9bf00ba5009b761091ed745 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 17:33:03 +0800 Subject: [PATCH 04/14] refactor(display_server): adjust hello composer color --- .../rosen/samples/composer/hello_composer.cpp | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/display_server/rosen/samples/composer/hello_composer.cpp b/display_server/rosen/samples/composer/hello_composer.cpp index 56b4d2a..f99c41d 100644 --- a/display_server/rosen/samples/composer/hello_composer.cpp +++ b/display_server/rosen/samples/composer/hello_composer.cpp @@ -432,18 +432,48 @@ void HelloComposer::RemoveOffScreenData(uint32_t offScreenId) } namespace { +class Color { +public: + uint32_t GetNextColor() { + r = NextByteColor(&r_up, r, 10); + g = NextByteColor(&g_up, g, 10); + b = NextByteColor(&b_up, b, 10); + return (r << 24) | (g << 16) | (b << 8) | a; + } + +private: + uint8_t NextByteColor(bool *up, uint8_t cur, unsigned int step) + { + uint8_t next; + + next = cur + (*up ? 1 : -1) * (rand() % step); + if ((*up && next < cur) || (!*up && next > cur)) { + *up = !*up; + next = cur; + } + + return next; + } + +private: + uint8_t r = rand() % 0xff; + uint8_t g = rand() % 0xff; + uint8_t b = rand() % 0xff; + const uint8_t a = 0xff; + bool r_up = true; + bool g_up = true; + bool b_up = true; +}; + void DrawFrameBufferData(void *image, uint32_t width, uint32_t height) { - static std::vector colors = {0xff0000ff, 0xffff00ff, 0xaa00ff00, 0xff00ffaa, 0xff0f0f00}; - static uint32_t index = 0; - if (index++ > 4) { - index = 0; - } + static Color color; + auto current_color = color.GetNextColor(); uint32_t *pixel = static_cast(image); for (uint32_t x = 0; x < width; x++) { for (uint32_t y = 0; y < height; y++) { - *pixel++ = colors[index]; + *pixel++ = current_color; } } } -- Gitee From ec9c10a08ecaa3160b31aa954c464d45be492e44 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 19:07:31 +0800 Subject: [PATCH 05/14] refactor: move ds_config.gni --- build/configs/system_deps.toml | 1 - build/gn/BUILDCONFIG.gn | 3 +-- build/gn/toolchain/toolchain.gni | 2 ++ .../frameworks/surface/ft_build/BUILD.gn | 2 +- display_server/ft_build/BUILD.gn | 27 +++++++++++++++++++ .../{ft_configs => ft_build}/ds_config.gni | 2 +- .../rosen/modules/composer/ft_build/BUILD.gn | 2 +- .../modules/composer/vsync/ft_build/BUILD.gn | 2 +- .../modules/frame_analyzer/ft_build/BUILD.gn | 2 +- .../modules/render_service/ft_build/BUILD.gn | 2 +- .../render_service_base/ft_build/BUILD.gn | 2 +- .../ft_build/mock/BUILD.gn | 2 +- .../src/platform/fangtian/BUILD.gn | 2 +- .../render_service_client/ft_build/BUILD.gn | 2 +- display_server/utils/ft_build/BUILD.gn | 2 +- .../utils/sync_fence/ft_build/BUILD.gn | 2 +- 16 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 display_server/ft_build/BUILD.gn rename display_server/{ft_configs => ft_build}/ds_config.gni (96%) diff --git a/build/configs/system_deps.toml b/build/configs/system_deps.toml index d6d24ea..3bfe7ec 100755 --- a/build/configs/system_deps.toml +++ b/build/configs/system_deps.toml @@ -33,5 +33,4 @@ package_deps = [ # DRM Backend "libdrm-devel", "systemd-devel", - "mesa-libgbm-devel", ] diff --git a/build/gn/BUILDCONFIG.gn b/build/gn/BUILDCONFIG.gn index cb69f15..1eaa398 100644 --- a/build/gn/BUILDCONFIG.gn +++ b/build/gn/BUILDCONFIG.gn @@ -11,8 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License -print("[GN INFO] host_os :", host_os) -print("[GN INFO] host_cpu :", host_cpu) +print("[GN INFO] host_os=$host_os, host_cpu=$host_cpu") if (target_os == "") { target_os = host_os diff --git a/build/gn/toolchain/toolchain.gni b/build/gn/toolchain/toolchain.gni index e8a94ac..42b2b68 100755 --- a/build/gn/toolchain/toolchain.gni +++ b/build/gn/toolchain/toolchain.gni @@ -108,6 +108,8 @@ template("clang_toolchain") { ar = "llvm-ar" } + print("[GN INFO] cc = ${cc}, cxx = ${cxx}, ld = ${ld}, asm = ${asm}, ar = ${ar}") + # Bring these into our scope for string interpolation with default values. if (defined(invoker.link_libs_section_prefix)) { link_libs_section_prefix = invoker.link_libs_section_prefix diff --git a/display_server/frameworks/surface/ft_build/BUILD.gn b/display_server/frameworks/surface/ft_build/BUILD.gn index a1ef36c..e639b0b 100644 --- a/display_server/frameworks/surface/ft_build/BUILD.gn +++ b/display_server/frameworks/surface/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("surface_config") { visibility = [ ":*" ] diff --git a/display_server/ft_build/BUILD.gn b/display_server/ft_build/BUILD.gn new file mode 100644 index 0000000..eaa0425 --- /dev/null +++ b/display_server/ft_build/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") +import("ds_config.gni") + +group("libsurface") { + public_deps = [ "frameworks/surface:surface" ] +} + +group("libfence") { + public_deps = [ "frameworks/fence:libfence" ] +} + +group("libgl") { + public_deps = libgl +} diff --git a/display_server/ft_configs/ds_config.gni b/display_server/ft_build/ds_config.gni similarity index 96% rename from display_server/ft_configs/ds_config.gni rename to display_server/ft_build/ds_config.gni index 4a29f79..4ebe80e 100644 --- a/display_server/ft_configs/ds_config.gni +++ b/display_server/ft_build/ds_config.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022 Huawei Technologies Co., Ltd. +# Copyright (c) 2023 Huawei Technologies Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/display_server/rosen/modules/composer/ft_build/BUILD.gn b/display_server/rosen/modules/composer/ft_build/BUILD.gn index 93b234c..efafa11 100644 --- a/display_server/rosen/modules/composer/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("composer_config") { visibility = [ ":*" ] diff --git a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn index 7bc7089..01f2331 100644 --- a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("vsync_config") { visibility = [ ":*" ] diff --git a/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn index 19df417..716d503 100644 --- a/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn +++ b/display_server/rosen/modules/frame_analyzer/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("libframe_analyzer_config") { visibility = [ ":*" ] diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index d998fb4..26e895b 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") # On the openEuler platform, display_server and window_manager are in the same process # Use sa_main.bin instead of render_service.bin diff --git a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn index 409f970..f207dd8 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") rs_common_define = [ "ROSEN_OHOS" ] enable_export_macro = true diff --git a/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn index 9926414..ffed25d 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/mock/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") ft_source_set("mock_image_native") { deps = [ diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn index 658dbf3..6ac630f 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("platform_config") { include_dirs = [ diff --git a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn index f2df025..42b1c50 100644 --- a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("render_service_client_config") { include_dirs = [ diff --git a/display_server/utils/ft_build/BUILD.gn b/display_server/utils/ft_build/BUILD.gn index 2669984..7207480 100644 --- a/display_server/utils/ft_build/BUILD.gn +++ b/display_server/utils/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") utils_dir = "//display_server/utils" diff --git a/display_server/utils/sync_fence/ft_build/BUILD.gn b/display_server/utils/sync_fence/ft_build/BUILD.gn index 583ee73..c474ddc 100644 --- a/display_server/utils/sync_fence/ft_build/BUILD.gn +++ b/display_server/utils/sync_fence/ft_build/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") config("sync_fence_config") { visibility = [ ":sync_fence" ] -- Gitee From 0454ba3e9ee64e4ac761ccf181e5ecc2f9386845 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Mon, 26 Jun 2023 21:33:26 +0800 Subject: [PATCH 06/14] feat(display_server): enable RS and its demo test --- build/gn/BUILD.gn | 4 +- build/gn/configs/system_libs/BUILD.gn | 9 ++++ .../hal/drm_backend/display_device/BUILD.gn | 2 +- .../display_gralloc/allocator_controller.cpp | 10 ++-- .../display_gralloc/dumb_allocator.cpp | 6 ++- .../display_gralloc/shm_allocator.cpp | 8 +-- .../gralloc/client/mapper_adapter.cpp | 6 ++- .../rosen/modules/composer/ft_build/BUILD.gn | 7 ++- .../modules/composer/vsync/ft_build/BUILD.gn | 5 +- .../core/pipeline/rs_render_service.cpp | 13 +++-- .../core/pipeline/rs_render_service.h | 7 ++- .../modules/render_service/ft_build/BUILD.gn | 18 ++++++- .../render_service_base/ft_build/BUILD.gn | 14 ++--- .../include/common/rs_obj_geometry.h | 3 +- .../src/platform/fangtian/BUILD.gn | 15 +++--- .../backend/rs_surface_frame_raster.h | 2 +- .../fangtian/backend/rs_surface_raster.cpp | 9 ++-- .../render_service_client/ft_build/BUILD.gn | 8 +-- .../test/ft_build/BUILD.gn | 54 +++++++++++++++++++ .../test/render_service_client_rs_demo.cpp | 3 -- .../utils/buffer_handle/ft_build/BUILD.gn | 1 + 21 files changed, 151 insertions(+), 53 deletions(-) create mode 100644 display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 3a2a20f..74d623a 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -16,7 +16,7 @@ group("ft_display_server") { "//display_server/rosen/modules/composer/ft_build:libcomposer", "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", - "//display_server/rosen/modules/render_service/ft_build:librender_service", + "//display_server/rosen/modules/render_service/ft_build:render_service", ] } @@ -33,6 +33,6 @@ group("ft_test") { "//display_server/drivers/hal/test:drm_backend_test", "//display_server/frameworks/surface/test/ft_build:test", "//display_server/rosen/samples/composer/ft_build:hello_composer", - # "//display_server/rosen/modules/render_service_client/test:render_service_client_rs_demo" + "//display_server/rosen/modules/render_service_client/test/ft_build:render_service_client_rs_demo" ] } diff --git a/build/gn/configs/system_libs/BUILD.gn b/build/gn/configs/system_libs/BUILD.gn index 6572cf1..b485224 100644 --- a/build/gn/configs/system_libs/BUILD.gn +++ b/build/gn/configs/system_libs/BUILD.gn @@ -92,6 +92,11 @@ config("safwk_config") { libs = [ "system_ability_fwk" ] } +config("libz_config") { + visibility = [ ":*" ] + libs = [ "shared_libz" ] +} + group("c_utils") { public_configs = [ ":c_utils_config" ] } @@ -161,3 +166,7 @@ group("safwk") { ] public_configs = [ ":safwk_config" ] } + +group("libz") { + public_configs = [ ":libz_config" ] +} diff --git a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn index f8cfef4..44acd00 100644 --- a/display_server/drivers/hal/drm_backend/display_device/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_device/BUILD.gn @@ -50,10 +50,10 @@ ft_shared_library("display_device") { public_deps = [ "//display_server/drivers/hal/drm_backend:display_drm_dep", "//display_server/drivers/hal/base:hal_base", + "//display_server/utils/sync_fence/ft_build:sync_fence", ] deps = [ - "//display_server/utils/sync_fence/ft_build:sync_fence", "//build/gn/configs/system_libs:ipc_core", ] } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp index 302b489..3e8d1e1 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/allocator_controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Technologies Co., Ltd. + * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -58,9 +58,12 @@ std::shared_ptr AllocatorController::GetAllocator(uint64_t usage) // * DRM: Dumb Buffer for CPU Rendering (when usage include `CPU_WRITE`) // * GBM: Smart Buffer for GPU Rendering (other case) if (usage & HBM_USE_MEM_DMA) { - if (usage & HBM_USE_CPU_WRITE) { + if ((usage & HBM_USE_CPU_WRITE) && (usage & HBM_USE_MEM_FB)) { LOG_DEBUG("[Gralloc::AllocatorController::GetAllocator] Choose Dumb Allocator."); return dumbAllocator_; + } else if (usage & HBM_USE_CPU_WRITE) { + LOG_ERROR("[Gralloc::AllocatorController::GetAllocator] DRM Backend not support CPU_WRITE flag without FB flag."); + return nullptr; } else { #ifdef DRM_BACKEND_USE_GBM LOG_DEBUG("[Gralloc::AllocatorController::GetAllocator] Choose GBM Allocator."); @@ -73,7 +76,8 @@ std::shared_ptr AllocatorController::GetAllocator(uint64_t usage) } // If user need CPU buffer for CPU Rendering, we will provide shared memory. - if (!(usage & HBM_USE_MEM_DMA) && (usage & HBM_USE_CPU_WRITE)) { + if (!(usage & HBM_USE_MEM_FB) && (usage & HBM_USE_CPU_WRITE)) { + LOG_DEBUG("[Gralloc::AllocatorController::GetAllocator] Choose Shm Allocator."); return shmAllocator_; } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp index f219087..75226d8 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/dumb_allocator.cpp @@ -38,6 +38,8 @@ namespace DISPLAY { int32_t DumbAllocator::Init() { + LOG_DEBUG("[Gralloc::DumbAllocator::Init] Initing..."); + // Get DRM fd from HDI Session int drmFd = GrallocUtils::GetDrmFdFromSession(); if (IsInvalidFd(drmFd)) { @@ -54,6 +56,8 @@ int32_t DumbAllocator::Init() // } // drmFd_ = newFd; + LOG_DEBUG("[Gralloc::DumbAllocator::Init] Init done."); + return DISPLAY_SUCCESS; } @@ -182,7 +186,7 @@ void *DumbAllocator::Mmap(BufferHandle &buffer) } /* Prepare buffer for mmap */ - LOG_DEBUG("[Gralloc::DumbAllocator::Mmap] prepare buffer for mmap"); + LOG_DEBUG("[Gralloc::DumbAllocator::Mmap] prepare buffer for mmap. handle = %{public}u", handle); struct drm_mode_map_dumb map {}; map.handle = handle; if (drmIoctl(drmFd_, DRM_IOCTL_MODE_MAP_DUMB, &map) != 0) { diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp index fa81b97..f370f1b 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp +++ b/display_server/drivers/hal/drm_backend/display_gralloc/shm_allocator.cpp @@ -28,7 +28,7 @@ namespace oewm { namespace HDI { namespace DISPLAY { -#define RANDNAME_PATTERN "/oewm-shm-XXXXXX" +#define RANDNAME_PATTERN "/ft-shm-XXXXXX" int32_t ShmAllocator::AllocMem(const AllocInfo &info, BufferHandle **bufferPtr) { @@ -152,14 +152,14 @@ int32_t ShmAllocator::FlushCache(BufferHandle &buffer) { // TODO: FlushCache is not supported yet. UNUSED(buffer); - return DISPLAY_FAILURE; + return DISPLAY_SUCCESS; } int32_t ShmAllocator::InvalidateCache(BufferHandle &buffer) { // TODO: InvalidateCache is not supported yet. UNUSED(buffer); - return DISPLAY_FAILURE; + return DISPLAY_SUCCESS; } void ShmAllocator::Randname(char *buf) @@ -177,7 +177,7 @@ int ShmAllocator::ExclShmOpen(char *name) { int retries = 100; do { - Randname(name + strlen(RANDNAME_PATTERN) - 6); + Randname(name + (strlen(RANDNAME_PATTERN) - 6)); --retries; // CLOEXEC is guaranteed to be set by shm_open diff --git a/display_server/drivers/hdi_service/gralloc/client/mapper_adapter.cpp b/display_server/drivers/hdi_service/gralloc/client/mapper_adapter.cpp index 960bc51..7753e50 100644 --- a/display_server/drivers/hdi_service/gralloc/client/mapper_adapter.cpp +++ b/display_server/drivers/hdi_service/gralloc/client/mapper_adapter.cpp @@ -44,9 +44,11 @@ bool MapperAdapter::IsReady() const int32_t MapperAdapter::MapBuffer(const BufferHandle& handle, void*& outData) const { - int32_t ret = 0; outData = mapperFuncs_->Mmap(const_cast(&handle)); - return ret; + if (outData == nullptr) { + return DISPLAY_FAILURE; + } + return DISPLAY_SUCCESS; } int32_t MapperAdapter::UnmapBuffer(const BufferHandle& handle) const diff --git a/display_server/rosen/modules/composer/ft_build/BUILD.gn b/display_server/rosen/modules/composer/ft_build/BUILD.gn index efafa11..bd8ab07 100644 --- a/display_server/rosen/modules/composer/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/ft_build/BUILD.gn @@ -61,19 +61,18 @@ ft_shared_library("libcomposer") { public_configs = [ ":composer_public_config" ] deps = [ - "$display_server_root/frameworks/surface/ft_build:surface", - "$display_server_root/rosen/modules/render_frame_trace/ft_build:render_frame_trace", - # "$display_server_root/rosen/modules/render_service_base/ft_build:librender_service_base", - "//build/gn/configs/system_libs:hilog", "//build/gn/configs/system_libs:ipc_core", ] public_deps = [ "../vsync/ft_build:libvsync", + "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", "$display_server_root/utils/scoped_bytrace/ft_build:scoped_bytrace", "$display_server_root/utils/sync_fence/ft_build:sync_fence", "$display_server_root/drivers/hal/drm_backend:drm_backend", + "$display_server_root/frameworks/surface/ft_build:surface", + "$display_server_root/rosen/modules/render_frame_trace/ft_build:render_frame_trace", ] } \ No newline at end of file diff --git a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn index 01f2331..79787c4 100644 --- a/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn +++ b/display_server/rosen/modules/composer/vsync/ft_build/BUILD.gn @@ -57,15 +57,14 @@ ft_shared_library("libvsync") { ] deps = [ - "//display_server/utils/sandbox/ft_build:sandbox_utils", - "//display_server/utils/socketpair/ft_build:socketpair", - "//build/gn/configs/system_libs:eventhandler", "//build/gn/configs/system_libs:ipc_core", "//build/gn/configs/system_libs:hilog", ] public_deps = [ + "//display_server/utils/sandbox/ft_build:sandbox_utils", + "//display_server/utils/socketpair/ft_build:socketpair", "//display_server/utils/scoped_bytrace/ft_build:scoped_bytrace", ] } diff --git a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp index e858f53..18fefdd 100644 --- a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp +++ b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp @@ -76,10 +76,17 @@ bool RSRenderService::Init() RSQosThread::ThreadStart(); // Wait samgr ready for up to 5 second to ensure adding service to samgr. - int status = WaitParameter("bootevent.samgr.ready", "true", 5); - if (status != 0) { - RS_LOGE("RSRenderService wait SAMGR error, return value [%d].", status); + // int status = WaitParameter("bootevent.samgr.ready", "true", 5); + // if (status != 0) { + // RS_LOGE("RSRenderService wait SAMGR error, return value [%d].", status); + // } + + auto samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + RS_LOGE("RSRenderService GetSystemAbilityManager fail."); + return false; } + samgr->AddSystemAbility(RENDER_SERVICE, this); return true; } diff --git a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h index 00c298c..bce828d 100644 --- a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h +++ b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h @@ -33,9 +33,14 @@ class RSSyncTask; class RSRenderServiceConnection; class RSRenderService : public SystemAbility, public RSRenderServiceStub { - DECLARE_DELAYED_SINGLETON(RSRenderService); DECLARE_SYSTEM_ABILITY(RSRenderService); public: + RSRenderService(); + ~RSRenderService() noexcept; + + RSRenderService(const RSRenderService&) = delete; + RSRenderService& operator=(const RSRenderService&) = delete; + bool Init(); void Run(); diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index 26e895b..decc40e 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -74,17 +74,31 @@ ft_shared_library("librender_service") { "$display_server_root/rosen/modules/composer/ft_build:libcomposer", "$display_server_root/rosen/modules/render_frame_trace/ft_build:render_frame_trace", "$display_server_root/rosen/modules/render_service_base/ft_build:librender_service_base", + ] + public_deps = [ + "//build/gn/configs/system_libs:samgr", "//build/gn/configs/system_libs:hitrace_meter", "//build/gn/configs/system_libs:skia", "//build/gn/configs/system_libs:syspara", "//build/gn/configs/system_libs:safwk", "//build/gn/configs/system_libs:eventhandler", - "//build/gn/configs/system_libs:samgr", "//build/gn/configs/system_libs:image", ] libs = ["png"] cflags = [ "-Wno-c++11-narrowing" ] -} \ No newline at end of file +} + +ft_executable("render_service") { + sources = [ "../core/main.cpp" ] + + include_dirs = [ "../core" ] + + deps = [ + ":librender_service", + "//display_server/rosen/modules/composer/ft_build:libcomposer", + "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + ] +} diff --git a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn index f207dd8..8c298f0 100644 --- a/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/ft_build/BUILD.gn @@ -17,7 +17,7 @@ import("//display_server/ft_build/ds_config.gni") rs_common_define = [ "ROSEN_OHOS" ] enable_export_macro = true -config("export_config") { +config("render_service_base_public_config") { cflags_cc = [ "-std=c++17" ] include_dirs = [ "../include" ] @@ -156,7 +156,7 @@ ft_source_set("render_service_base_src") { ] public_configs = [ - ":export_config", + ":render_service_base_public_config", ] deps = [ "../src/platform/fangtian:rosen_fangtian_sources", @@ -185,10 +185,6 @@ ft_source_set("render_service_base_src") { ] deps += [ - "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", - "$display_server_root/utils/sandbox/ft_build:sandbox_utils", - "$display_server_root/utils/sync_fence/ft_build:sync_fence", - "//build/gn/configs/system_libs:c_utils", "//build/gn/configs/system_libs:ipc_core", "//build/gn/configs/system_libs:hitrace_meter", @@ -196,10 +192,14 @@ ft_source_set("render_service_base_src") { "//build/gn/configs/system_libs:skia", ] + public_deps = [ + "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + "$display_server_root/utils/sync_fence/ft_build:sync_fence", + ] } ft_shared_library("librender_service_base") { - deps = [ + public_deps = [ ":render_service_base_src", "../src/platform/fangtian:rosen_fangtian_sources", ] diff --git a/display_server/rosen/modules/render_service_base/include/common/rs_obj_geometry.h b/display_server/rosen/modules/render_service_base/include/common/rs_obj_geometry.h index 79ae428..83691a8 100644 --- a/display_server/rosen/modules/render_service_base/include/common/rs_obj_geometry.h +++ b/display_server/rosen/modules/render_service_base/include/common/rs_obj_geometry.h @@ -44,7 +44,8 @@ public: class RSObjGeometry { public: RSObjGeometry() - : x_(-INFINITY), y_(-INFINITY), z_(0), width_(-INFINITY), height_(-INFINITY), trans_(nullptr) + // : x_(-INFINITY), y_(-INFINITY), z_(0), width_(-INFINITY), height_(-INFINITY), trans_(nullptr) + : x_(0), y_(0), z_(0), width_(0), height_(0), trans_(nullptr) {} virtual ~RSObjGeometry() {} diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn index 6ac630f..1ea79bd 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/BUILD.gn @@ -97,14 +97,7 @@ ft_source_set("rosen_fangtian_sources") { libs = [ "crypto", "EGL", "GLESv2" ] } - deps = [ - "$display_server_root/frameworks/surface/ft_build:surface", - "$rosen_root/modules/composer/vsync/ft_build:libvsync", - "$display_server_root/utils/sync_fence/ft_build:sync_fence", - "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", - "$display_server_root/utils/sandbox/ft_build:sandbox_utils", - "//build/gn/configs/system_libs:hilog", "//build/gn/configs/system_libs:ipc_core", "//build/gn/configs/system_libs:hitrace_meter", @@ -112,4 +105,12 @@ ft_source_set("rosen_fangtian_sources") { "//build/gn/configs/system_libs:skia", "//build/gn/configs/system_libs:samgr", ] + + public_deps = [ + "$display_server_root/utils/buffer_handle/ft_build:buffer_handle", + "$display_server_root/frameworks/surface/ft_build:surface", + "$rosen_root/modules/composer/vsync/ft_build:libvsync", + "$display_server_root/utils/sync_fence/ft_build:sync_fence", + "$display_server_root/utils/sandbox/ft_build:sandbox_utils", + ] } diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_frame_raster.h b/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_frame_raster.h index 2d44d10..b0af0b5 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_frame_raster.h +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_frame_raster.h @@ -50,7 +50,7 @@ private: .height = 0x100, .strideAlignment = 0x8, .format = PIXEL_FMT_RGBA_8888, - .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA, + .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA | BUFFER_USAGE_MEM_FB, .timeout = 0, }; BufferFlushConfig flushConfig_ = { diff --git a/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_raster.cpp b/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_raster.cpp index fb9ffbb..223f3dc 100644 --- a/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_raster.cpp +++ b/display_server/rosen/modules/render_service_base/src/platform/fangtian/backend/rs_surface_raster.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Technologies Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,8 +23,10 @@ namespace OHOS { namespace Rosen { -RSSurfaceOhosRaster::RSSurfaceOhosRaster(const sptr& producer) : RSSurfaceOhos(producer) {} - +RSSurfaceOhosRaster::RSSurfaceOhosRaster(const sptr& producer) : RSSurfaceOhos(producer) +{ + bufferUsage_ = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE; +} void RSSurfaceOhosRaster::SetSurfaceBufferUsage(uint64_t usage) { @@ -53,7 +55,6 @@ std::unique_ptr RSSurfaceOhosRaster::RequestFrame(int32_t width, return nullptr; } - sptr tempFence = new SyncFence(frame->releaseFence_); int res = tempFence->Wait(3000); if (res < 0) { diff --git a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn index 42b1c50..b3d4a3c 100644 --- a/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_client/ft_build/BUILD.gn @@ -14,13 +14,14 @@ import("//build/gn/fangtian.gni") import("//display_server/ft_build/ds_config.gni") -config("render_service_client_config") { +config("render_service_client_public_config") { include_dirs = [ "$rosen_root/modules", "$rosen_root/modules/render_service_client/core", "$rosen_root/modules/render_service_base/include", "$rosen_root/modules/render_service_base/src/platform/fangtian/include", "$rosen_root/modules/platform/image_native", + "$rosen_root/modules/2d_graphics/src", "$display_server_root/interfaces/inner_api/common", "$display_server_root/interfaces/inner_api/surface", "$display_server_root/interfaces/inner_api/composer", @@ -33,7 +34,6 @@ ft_source_set("render_service_client_src") { defines += gpu_defines defines += [ "MODULE_RSC" ] include_dirs = [ - "$rosen_root/modules/2d_graphics/src", "$rosen_root/modules/render_frame_trace/include", "$rosen_root/modules/render_service_base/src", "$display_server_root/utils/log", @@ -107,7 +107,7 @@ ft_source_set("render_service_client_src") { "-fvisibility-inlines-hidden", ] - deps = [ + public_deps = [ "$rosen_root/modules/composer/vsync/ft_build:libvsync", "$rosen_root/modules/frame_analyzer/ft_build:libframe_analyzer", "$rosen_root/modules/render_frame_trace/ft_build:render_frame_trace", @@ -122,7 +122,7 @@ ft_source_set("render_service_client_src") { "//build/gn/configs/system_libs:hitrace_meter", ] - public_configs = [ ":render_service_client_config" ] + public_configs = [ ":render_service_client_public_config" ] } ft_shared_library("librender_service_client") { diff --git a/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn new file mode 100644 index 0000000..a7a0e9f --- /dev/null +++ b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn @@ -0,0 +1,54 @@ +# Copyright (c) 2023 Huawei Technologies Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/gn/fangtian.gni") + +ft_executable("render_service_client_rs_demo") { + sources = [ "../render_service_client_rs_demo.cpp" ] + + include_dirs = [ + "//display_server/rosen/modules/render_service_base/src", + "//display_server/rosen/include", + "//display_server/drivers/interfaces", + ] + + deps = [ + # "//display_server/rosen/modules/2d_graphics:2d_graphics", + "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", + + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:libz", # TODO: include files + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:image", + ] +} + +# ft_executable("render_service_client_gravity_demo") { +# sources = [ "render_service_client_gravity_demo.cpp" ] + +# include_dirs = [ "//window_manager/interfaces/innerkits" ] + +# deps = [ +# "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", +# # "//display_server/rosen/modules/2d_graphics:2d_graphics", +# "//display_server/rosen/modules/render_service_base:librender_service_base", +# "//display_server/rosen/modules/render_service_client:librender_service_client", +# "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk", +# "//window_manager/wm:libwm", +# "//window_manager/wmserver:libwms", +# "//third_party/zlib:libz", +# ] + +# public_deps = [ "//third_party/flutter/build/fangtian/skia:ace_skia_fangtian" ] +# } diff --git a/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp b/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp index 0f4f746..5083360 100644 --- a/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp +++ b/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp @@ -31,9 +31,6 @@ #include "ui/rs_display_node.h" #include "ui/rs_surface_node.h" #include "render_context/render_context.h" -// temporary debug -#include "foundation/graphic/graphic_2d/rosen/modules/render_service_base/src/platform/ohos/rs_surface_frame_ohos.h" -#include "foundation/graphic/graphic_2d/rosen/modules/render_service_base/src/platform/ohos/rs_surface_ohos.h" using namespace OHOS; using namespace OHOS::Rosen; diff --git a/display_server/utils/buffer_handle/ft_build/BUILD.gn b/display_server/utils/buffer_handle/ft_build/BUILD.gn index 1a72a02..ea69a94 100644 --- a/display_server/utils/buffer_handle/ft_build/BUILD.gn +++ b/display_server/utils/buffer_handle/ft_build/BUILD.gn @@ -18,6 +18,7 @@ config("buffer_handle_public") { "../export", ] } + ft_static_library("buffer_handle") { include_dirs = [ "${sys_inc}/c_utils", -- Gitee From 49b4a6ccfec7763c7c0372809f99b5c30179a2cb Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 11:14:26 +0800 Subject: [PATCH 07/14] fix: repair compile error : two noncopyable.h --- .../hal/base/includes/event_loop/event_channel.h | 2 +- .../drivers/hal/base/includes/event_loop/timer.h | 2 +- .../{noncopyable.h => noncopyable_hal.h} | 0 .../hal/drm_backend/display_device/drm_common.h | 2 +- .../hal/drm_backend/display_device/drm_crtc.h | 2 +- .../hal/drm_backend/display_device/drm_encoder.h | 2 +- .../drm_backend/display_device/drm_mode_info.h | 2 +- .../hal/drm_backend/display_device/drm_plane.h | 2 +- .../hal/drm_backend/display_device/hdi_layer.h | 2 +- .../animation/window_animation/ft_build/BUILD.gn | 16 ++++++++-------- window_manager/dm/ft_build/BUILD.gn | 4 +--- window_manager/dmserver/ft_build/BUILD.gn | 13 +++++-------- window_manager/utils/ft_build/BUILD.gn | 2 -- window_manager/wmserver/ft_build/BUILD.gn | 16 ++++++---------- 14 files changed, 28 insertions(+), 39 deletions(-) rename display_server/drivers/hal/base/includes/{noncopyable.h => noncopyable_hal.h} (100%) diff --git a/display_server/drivers/hal/base/includes/event_loop/event_channel.h b/display_server/drivers/hal/base/includes/event_loop/event_channel.h index 47a4886..363d143 100644 --- a/display_server/drivers/hal/base/includes/event_loop/event_channel.h +++ b/display_server/drivers/hal/base/includes/event_loop/event_channel.h @@ -21,7 +21,7 @@ #include #include -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "timestamp.h" namespace oewm { diff --git a/display_server/drivers/hal/base/includes/event_loop/timer.h b/display_server/drivers/hal/base/includes/event_loop/timer.h index 551e2cb..564c7c7 100644 --- a/display_server/drivers/hal/base/includes/event_loop/timer.h +++ b/display_server/drivers/hal/base/includes/event_loop/timer.h @@ -17,7 +17,7 @@ #include -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "timestamp.h" namespace oewm { diff --git a/display_server/drivers/hal/base/includes/noncopyable.h b/display_server/drivers/hal/base/includes/noncopyable_hal.h similarity index 100% rename from display_server/drivers/hal/base/includes/noncopyable.h rename to display_server/drivers/hal/base/includes/noncopyable_hal.h diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_common.h b/display_server/drivers/hal/drm_backend/display_device/drm_common.h index 58b17ae..3638d60 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_common.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_common.h @@ -20,7 +20,7 @@ #include #include -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "types.h" namespace oewm { diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h index 3b8d859..82c7634 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_crtc.h @@ -15,7 +15,7 @@ #pragma once -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "drm_common.h" #include "drm_property.h" #include "hdi_display.h" diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h index 16c3ed3..2671b84 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_encoder.h @@ -15,7 +15,7 @@ #pragma once -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "drm_common.h" #include "drm_crtc.h" diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h index 39a2a21..055aadb 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_mode_info.h @@ -15,7 +15,7 @@ #pragma once -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "display_type.h" #include "drm_common.h" diff --git a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h index 0e2eb20..49a2581 100644 --- a/display_server/drivers/hal/drm_backend/display_device/drm_plane.h +++ b/display_server/drivers/hal/drm_backend/display_device/drm_plane.h @@ -15,7 +15,7 @@ #pragma once -#include "noncopyable.h" +#include "noncopyable_hal.h" #include "drm_common.h" #include "drm_property.h" diff --git a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h index 84e7344..291c922 100644 --- a/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h +++ b/display_server/drivers/hal/drm_backend/display_device/hdi_layer.h @@ -21,7 +21,7 @@ #include "unique_fd.h" #include "buffer_handle.h" #include "display_type.h" -#include "noncopyable.h" +#include "noncopyable_hal.h" namespace oewm { namespace HDI { diff --git a/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn b/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn index a349e50..dbc75ce 100644 --- a/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn +++ b/display_server/rosen/modules/animation/window_animation/ft_build/BUILD.gn @@ -12,9 +12,9 @@ # limitations under the License. import("//build/gn/fangtian.gni") -import("//display_server/ft_configs/ds_config.gni") +import("//display_server/ft_build/ds_config.gni") -config("window_animation_config") { +config("window_animation_public_config") { cflags = [ "-Wno-c++11-narrowing" ] include_dirs = [ @@ -33,16 +33,16 @@ ft_shared_library("window_animation") { "../src/rs_window_animation_target.cpp", ] - public_configs = [ ":window_animation_config" ] + public_configs = [ ":window_animation_public_config" ] cflags_cc = [ "-std=c++17" ] public_deps = [ "$display_server_root/rosen/modules/render_service_client/ft_build:librender_service_client" ] - configs = [ - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:skia_config", + deps = [ + "//build/gn/configs/system_libs:c_utils", + "//build/gn/configs/system_libs:hilog", + "//build/gn/configs/system_libs:ipc_core", + "//build/gn/configs/system_libs:skia", ] } diff --git a/window_manager/dm/ft_build/BUILD.gn b/window_manager/dm/ft_build/BUILD.gn index 911c521..61b7db9 100644 --- a/window_manager/dm/ft_build/BUILD.gn +++ b/window_manager/dm/ft_build/BUILD.gn @@ -55,11 +55,9 @@ ft_shared_library("libdm") { "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", "$window_manager_path/utils/ft_build:libwmutil", - "//build/gn/configs/system_libs:hilog", - "//build/gn/configs/system_libs:ipc_core", "//build/gn/configs/system_libs:image", "//build/gn/configs/system_libs:samgr", "//build/gn/configs/system_libs:skia", - "//build/gn/configs/system_libs:event_handler", + "//build/gn/configs/system_libs:eventhandler", ] } diff --git a/window_manager/dmserver/ft_build/BUILD.gn b/window_manager/dmserver/ft_build/BUILD.gn index 1e630e8..83cff8f 100644 --- a/window_manager/dmserver/ft_build/BUILD.gn +++ b/window_manager/dmserver/ft_build/BUILD.gn @@ -52,14 +52,6 @@ ft_shared_library("libdms") { configs = [ ":libdms_private_config", "$window_manager_path/resources/config/build:coverage_flags", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:safwk_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:skia_config", ] public_configs = [ ":libdms_public_config" ] @@ -71,5 +63,10 @@ ft_shared_library("libdms") { "$display_server_path/rosen/modules/render_service_base/ft_build:librender_service_base", "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", "$window_manager_path/utils/ft_build:libwmutil", + + "//build/gn/configs/system_libs:hitrace_meter", + "//build/gn/configs/system_libs:safwk", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:skia", ] } diff --git a/window_manager/utils/ft_build/BUILD.gn b/window_manager/utils/ft_build/BUILD.gn index a021930..8ec7b3e 100644 --- a/window_manager/utils/ft_build/BUILD.gn +++ b/window_manager/utils/ft_build/BUILD.gn @@ -66,8 +66,6 @@ ft_shared_library("libwmutil") { "$display_server_path/frameworks/surface/ft_build:surface", "$display_server_path/rosen/modules/render_service_client/ft_build:librender_service_client", - "//build/gn/configs/system_libs:hilog", - "//build/gn/configs/system_libs:ipc_core", "//build/gn/configs/system_libs:samgr", "//build/gn/configs/system_libs:eventhandler", "//build/gn/configs/system_libs:image", diff --git a/window_manager/wmserver/ft_build/BUILD.gn b/window_manager/wmserver/ft_build/BUILD.gn index 0cd85a1..3b851da 100644 --- a/window_manager/wmserver/ft_build/BUILD.gn +++ b/window_manager/wmserver/ft_build/BUILD.gn @@ -78,16 +78,6 @@ ft_shared_library("libwms") { configs = [ ":libwms_config", "$window_manager_path/resources/config/build:coverage_flags", - "//build/gn/configs/system_libs:hilog_config", - "//build/gn/configs/system_libs:hitrace_meter_config", - "//build/gn/configs/system_libs:c_utils_config", - "//build/gn/configs/system_libs:ipc_core_config", - "//build/gn/configs/system_libs:samgr_config", - "//build/gn/configs/system_libs:safwk_config", - "//build/gn/configs/system_libs:eventhandler_config", - "//build/gn/configs/system_libs:skia_config", - "//build/gn/configs/system_libs:image_config", - "//build/gn/configs/system_libs:mmi_config", ] libs = [ "xml2" ] @@ -99,5 +89,11 @@ ft_shared_library("libwms") { "$window_manager_path/dmserver/ft_build:libdms", "$window_manager_path/utils/ft_build:libwmutil", "$window_manager_path/wm/ft_build:libwm", + + "//build/gn/configs/system_libs:safwk", + "//build/gn/configs/system_libs:eventhandler", + "//build/gn/configs/system_libs:skia", + "//build/gn/configs/system_libs:image", + "//build/gn/configs/system_libs:mmi", ] } -- Gitee From fcf65def1caee51731936f77a1ddc145f7c80596 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 11:38:41 +0800 Subject: [PATCH 08/14] refactor: disable rs_main --- build/gn/BUILD.gn | 3 +-- .../hal/drm_backend/display_gralloc/BUILD.gn | 4 +--- .../frameworks/surface/test/ft_build/BUILD.gn | 15 --------------- display_server/ft_build/ds_config.gni | 1 + .../core/pipeline/rs_render_service.cpp | 10 ++++++---- .../modules/render_service/ft_build/BUILD.gn | 13 +++++++++++++ .../test/ft_build/BUILD.gn | 19 ------------------- 7 files changed, 22 insertions(+), 43 deletions(-) diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 74d623a..61fb063 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -13,10 +13,9 @@ group("ft_display_server") { deps = [ - "//display_server/rosen/modules/composer/ft_build:libcomposer", "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + "//display_server/rosen/modules/render_service/ft_build:render_service_group", "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", - "//display_server/rosen/modules/render_service/ft_build:render_service", ] } diff --git a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn index d6ddac1..c962b32 100644 --- a/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn +++ b/display_server/drivers/hal/drm_backend/display_gralloc/BUILD.gn @@ -46,9 +46,7 @@ ft_shared_library("display_gralloc") { public_deps = [ "//display_server/drivers/hal/drm_backend:display_drm_dep", - "//display_server/drivers/hal/base:hal_base" - ] - deps = [ + "//display_server/drivers/hal/base:hal_base", "//display_server/drivers/hal/drm_backend/display_device:display_device", ] } diff --git a/display_server/frameworks/surface/test/ft_build/BUILD.gn b/display_server/frameworks/surface/test/ft_build/BUILD.gn index a44a041..e33a59d 100644 --- a/display_server/frameworks/surface/test/ft_build/BUILD.gn +++ b/display_server/frameworks/surface/test/ft_build/BUILD.gn @@ -26,13 +26,6 @@ ft_executable("native_window_buffer_test_oe") { sources = [ "../systemtest/native_window_buffer_test_oe.cpp" ] - include_dirs = [ - "//foundation/graphic/graphic_2d/frameworks/surface/include", - "//base/security/access_token/interfaces/innerkits/nativetoken/include", - "//base/security/access_token/interfaces/innerkits/accesstoken/include", - "//base/security/access_token/interfaces/innerkits/token_setproc/include", - ] - cflags = [ "-Wall", "-Werror", @@ -49,12 +42,4 @@ ft_executable("native_window_buffer_test_oe") { "//build/gn/configs/system_libs:hilog", "//build/gn/configs/system_libs:samgr", ] - - configs = [ - # "//build/gn/configs/system_libs:hilog_config", - # "//build/gn/configs/system_libs:samgr_config", - # "//build/gn/configs/system_libs:syspara_config", - # "//build/gn/configs/system_libs:eventhandler_config", - # "//build/gn/configs/system_libs:hitrace_meter_config", - ] } \ No newline at end of file diff --git a/display_server/ft_build/ds_config.gni b/display_server/ft_build/ds_config.gni index 4ebe80e..60dc3dc 100644 --- a/display_server/ft_build/ds_config.gni +++ b/display_server/ft_build/ds_config.gni @@ -16,6 +16,7 @@ declare_args() { graphic_standard_feature_rs_enable_eglimage = false graphic_standard_feature_rs_enable_uni_render = false graphic_standard_feature_enable_afbc = false + rs_main_executable = false } if (graphic_standard_feature_ace_enable_gpu) { diff --git a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp index 18fefdd..bbebaea 100644 --- a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp +++ b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.cpp @@ -76,17 +76,19 @@ bool RSRenderService::Init() RSQosThread::ThreadStart(); // Wait samgr ready for up to 5 second to ensure adding service to samgr. - // int status = WaitParameter("bootevent.samgr.ready", "true", 5); - // if (status != 0) { - // RS_LOGE("RSRenderService wait SAMGR error, return value [%d].", status); - // } + int status = WaitParameter("bootevent.samgr.ready", "true", 5); + if (status != 0) { + RS_LOGE("RSRenderService wait SAMGR error, return value [%d].", status); + } +#ifdef RS_MAIN_EXECUTABLE auto samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); if (samgr == nullptr) { RS_LOGE("RSRenderService GetSystemAbilityManager fail."); return false; } samgr->AddSystemAbility(RENDER_SERVICE, this); +#endif // RS_MAIN_EXECUTABLE return true; } diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index decc40e..68a7f83 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -17,6 +17,15 @@ import("//display_server/ft_build/ds_config.gni") # On the openEuler platform, display_server and window_manager are in the same process # Use sa_main.bin instead of render_service.bin +group("render_service_group") { + deps = [ ":librender_service" ] + + if (rs_main_executable) { + print("[GN INFO] Build render_service.") + deps += [ ":render_service" ] + } +} + ft_shared_library("librender_service") { defines = [] defines += gpu_defines @@ -24,6 +33,10 @@ ft_shared_library("librender_service") { if (use_musl) { defines += [ "FRAME_AWARE_TRACE" ] } + if (rs_main_executable) { + defines += [ "RS_MAIN_EXECUTABLE" ] + } + sources = [ "../core/pipeline/rs_base_render_engine.cpp", "../core/pipeline/rs_base_render_util.cpp", diff --git a/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn index a7a0e9f..7c8c665 100644 --- a/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn @@ -33,22 +33,3 @@ ft_executable("render_service_client_rs_demo") { "//build/gn/configs/system_libs:image", ] } - -# ft_executable("render_service_client_gravity_demo") { -# sources = [ "render_service_client_gravity_demo.cpp" ] - -# include_dirs = [ "//window_manager/interfaces/innerkits" ] - -# deps = [ -# "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", -# # "//display_server/rosen/modules/2d_graphics:2d_graphics", -# "//display_server/rosen/modules/render_service_base:librender_service_base", -# "//display_server/rosen/modules/render_service_client:librender_service_client", -# "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk", -# "//window_manager/wm:libwm", -# "//window_manager/wmserver:libwms", -# "//third_party/zlib:libz", -# ] - -# public_deps = [ "//third_party/flutter/build/fangtian/skia:ace_skia_fangtian" ] -# } -- Gitee From 5238c77e159e786c19f85a485aacaab442475548 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 12:55:30 +0800 Subject: [PATCH 09/14] fix(build): add sys deps: libicu --- build/configs/system_deps.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/configs/system_deps.toml b/build/configs/system_deps.toml index 3bfe7ec..24969f0 100755 --- a/build/configs/system_deps.toml +++ b/build/configs/system_deps.toml @@ -30,6 +30,7 @@ package_deps = [ "ninja-build", "libxml2-devel", "libpng-devel", + "libicu", # DRM Backend "libdrm-devel", "systemd-devel", -- Gitee From e09620cf3df289867df1723e817ca772d5852644 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 13:02:42 +0800 Subject: [PATCH 10/14] build: stop build render_service --- .../modules/render_service/ft_build/BUILD.gn | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index 68a7f83..9b5bb94 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -104,14 +104,16 @@ ft_shared_library("librender_service") { cflags = [ "-Wno-c++11-narrowing" ] } -ft_executable("render_service") { - sources = [ "../core/main.cpp" ] +if (rs_main_executable) { + ft_executable("render_service") { + sources = [ "../core/main.cpp" ] - include_dirs = [ "../core" ] + include_dirs = [ "../core" ] - deps = [ - ":librender_service", - "//display_server/rosen/modules/composer/ft_build:libcomposer", - "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", - ] + deps = [ + ":librender_service", + "//display_server/rosen/modules/composer/ft_build:libcomposer", + "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", + ] + } } -- Gitee From 33628cf2001cdcb8477106334058379333979838 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 14:11:03 +0800 Subject: [PATCH 11/14] build: prebuild dont copy samgr at aarch64 --- build/prebuild.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/prebuild.sh b/build/prebuild.sh index 3a81784..2fd9ab1 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -80,8 +80,10 @@ sudo cp -fr *.so /usr/local/lib64 # copy prebuild binarys to /usr/local/bin sudo cp -f hilog /usr/local/bin sudo cp -f hilogd /usr/local/bin -sudo cp -f sa_main /usr/local/bin -sudo cp -f samgr /usr/local/bin +if [ ARCHNAME = "x86_64" ]; then + sudo cp -f sa_main /usr/local/bin + sudo cp -f samgr /usr/local/bin +fi cd ${PROJECT_DIR} rm -fr ${PROJECT_DIR}/prebuilts/libs -- Gitee From 680355e98895432c9c43c26502cdab8a89def140 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 14:40:09 +0800 Subject: [PATCH 12/14] build: move arm.gni to gn dir --- build/gn/configs/compiler/BUILD.gn | 2 +- build/gn/configs/fangtian/abi.gni | 2 +- build/{configs => gn/configs/fangtian}/arm.gni | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename build/{configs => gn/configs/fangtian}/arm.gni (100%) diff --git a/build/gn/configs/compiler/BUILD.gn b/build/gn/configs/compiler/BUILD.gn index 2de69e5..c56e8f9 100755 --- a/build/gn/configs/compiler/BUILD.gn +++ b/build/gn/configs/compiler/BUILD.gn @@ -6,7 +6,7 @@ import("//build/gn/configs/compiler/compiler.gni") import("//build/gn/toolchain/toolchain.gni") if (current_cpu == "arm" || current_cpu == "arm64") { - import("//build/configs/arm.gni") + import("//build/gn/configs/fangtian/arm.gni") } declare_args() { diff --git a/build/gn/configs/fangtian/abi.gni b/build/gn/configs/fangtian/abi.gni index aa729f3..c6b5696 100755 --- a/build/gn/configs/fangtian/abi.gni +++ b/build/gn/configs/fangtian/abi.gni @@ -30,7 +30,7 @@ assert(!devtools_instrumentation_dumping || use_order_profiling, if (current_cpu == "x86") { ft_app_abi = "x86" } else if (current_cpu == "arm") { - import("//build/config/arm.gni") + import("//build/gn/configs/fangtian/arm.gni") if (arm_version < 7) { ft_app_abi = "armeabi" } else { diff --git a/build/configs/arm.gni b/build/gn/configs/fangtian/arm.gni similarity index 100% rename from build/configs/arm.gni rename to build/gn/configs/fangtian/arm.gni -- Gitee From 5c34841717a352aa9c16b016713e5e7aec0b08dd Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 16:01:36 +0800 Subject: [PATCH 13/14] chore: adjust rs main build and rs test --- .../core/pipeline/rs_render_service.h | 5 ++++ .../modules/render_service/ft_build/BUILD.gn | 23 +++++++++++-------- .../test/render_service_client_rs_demo.cpp | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h index bce828d..9b2f3bc 100644 --- a/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h +++ b/display_server/rosen/modules/render_service/core/pipeline/rs_render_service.h @@ -33,13 +33,18 @@ class RSSyncTask; class RSRenderServiceConnection; class RSRenderService : public SystemAbility, public RSRenderServiceStub { +#ifndef RS_MAIN_EXECUTABLE + DECLARE_DELAYED_SINGLETON(RSRenderService); +#endif // RS_MAIN_EXECUTABLE DECLARE_SYSTEM_ABILITY(RSRenderService); public: +#ifdef RS_MAIN_EXECUTABLE RSRenderService(); ~RSRenderService() noexcept; RSRenderService(const RSRenderService&) = delete; RSRenderService& operator=(const RSRenderService&) = delete; +#endif // RS_MAIN_EXECUTABLE bool Init(); void Run(); diff --git a/display_server/rosen/modules/render_service/ft_build/BUILD.gn b/display_server/rosen/modules/render_service/ft_build/BUILD.gn index 9b5bb94..9b26976 100644 --- a/display_server/rosen/modules/render_service/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service/ft_build/BUILD.gn @@ -17,25 +17,28 @@ import("//display_server/ft_build/ds_config.gni") # On the openEuler platform, display_server and window_manager are in the same process # Use sa_main.bin instead of render_service.bin +config("render_service_config") { + if (rs_main_executable) { + defines += [ "RS_MAIN_EXECUTABLE" ] + } +} + group("render_service_group") { deps = [ ":librender_service" ] if (rs_main_executable) { - print("[GN INFO] Build render_service.") + print("[GN INFO] Enable RS exec building.") deps += [ ":render_service" ] } } ft_shared_library("librender_service") { - defines = [] - defines += gpu_defines - + defines = gpu_defines if (use_musl) { defines += [ "FRAME_AWARE_TRACE" ] } - if (rs_main_executable) { - defines += [ "RS_MAIN_EXECUTABLE" ] - } + + cflags = [ "-Wno-c++11-narrowing" ] sources = [ "../core/pipeline/rs_base_render_engine.cpp", @@ -99,9 +102,9 @@ ft_shared_library("librender_service") { "//build/gn/configs/system_libs:image", ] - libs = ["png"] + public_configs = [ ":render_service_config" ] - cflags = [ "-Wno-c++11-narrowing" ] + libs = ["png"] } if (rs_main_executable) { @@ -115,5 +118,7 @@ if (rs_main_executable) { "//display_server/rosen/modules/composer/ft_build:libcomposer", "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", ] + + configs = [ ":render_service_config" ] } } diff --git a/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp b/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp index 5083360..77aceae 100644 --- a/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp +++ b/display_server/rosen/modules/render_service_client/test/render_service_client_rs_demo.cpp @@ -334,6 +334,7 @@ public: RSDisplayNodeConfig config; RSDisplayNode::SharedPtr displayNode = RSDisplayNode::Create(config); + displayNode->SetBounds(0, 0, screenWidth_, screenheight_); displayNode->AddChild(surfaceNode1, -1); displayNode->AddChild(surfaceNode2, -1); -- Gitee From 13ee8e92a5cf55d7b387f2381e21298a49edf0e5 Mon Sep 17 00:00:00 2001 From: fseeeye Date: Tue, 27 Jun 2023 16:14:20 +0800 Subject: [PATCH 14/14] chore: do sth crappy --- .../native_window_buffer_test_oe.cpp | 19 ------------------- .../test/ft_build/BUILD.gn | 4 +--- .../rosen/samples/composer/ft_build/BUILD.gn | 2 -- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp b/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp index b8a114c..a580edd 100644 --- a/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp +++ b/display_server/frameworks/surface/test/systemtest/native_window_buffer_test_oe.cpp @@ -198,25 +198,6 @@ void NativeWindowBufferTest::DoTest() auto pid = ChildProcessMain(); assert(pid > 0); - // uint64_t tokenId; - // const char *perms[2]; - // perms[0] = "ohos.permission.DISTRIBUTED_DATASYNC"; - // perms[1] = "ohos.permission.CAMERA"; - // NativeTokenInfoParams infoInstance = { - // .dcapsNum = 0, - // .permsNum = 2, - // .aclsNum = 0, - // .dcaps = NULL, - // .perms = perms, - // .acls = NULL, - // .processName = "dcamera_client_demo", - // .aplStr = "system_basic", - // }; - // tokenId = GetAccessTokenId(&infoInstance); - // SetSelfTokenID(tokenId); - // int32_t rett = Security::AccessToken::AccessTokenKit::ReloadNativeTokenInfo(); - // ASSERT_EQ(rett, Security::AccessToken::RET_SUCCESS); - std::cout << "[-] Create Consumer Surface." << std::endl; HiviewDFX::HiLog::Error({ LOG_CORE, 0xC01400, "SurfaceTest" }, "Create Consumer Surface"); cSurface = Surface::CreateSurfaceAsConsumer("test"); diff --git a/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn index 7c8c665..f364f5e 100644 --- a/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn +++ b/display_server/rosen/modules/render_service_client/test/ft_build/BUILD.gn @@ -23,12 +23,10 @@ ft_executable("render_service_client_rs_demo") { ] deps = [ - # "//display_server/rosen/modules/2d_graphics:2d_graphics", - "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", "//display_server/rosen/modules/render_service_client/ft_build:librender_service_client", "//build/gn/configs/system_libs:hilog", - "//build/gn/configs/system_libs:libz", # TODO: include files + "//build/gn/configs/system_libs:libz", "//build/gn/configs/system_libs:skia", "//build/gn/configs/system_libs:image", ] diff --git a/display_server/rosen/samples/composer/ft_build/BUILD.gn b/display_server/rosen/samples/composer/ft_build/BUILD.gn index 6241b62..0a4fdee 100644 --- a/display_server/rosen/samples/composer/ft_build/BUILD.gn +++ b/display_server/rosen/samples/composer/ft_build/BUILD.gn @@ -38,13 +38,11 @@ ft_executable("hello_composer") { "//display_server/frameworks/surface/ft_build:surface", "//display_server/rosen/modules/composer/ft_build:libcomposer", "//display_server/utils/ft_build:sync_fence", - # "//display_server/rosen/modules/render_service_base/ft_build:librender_service_base", ] deps += [ "//build/gn/configs/system_libs:hilog", "//build/gn/configs/system_libs:eventhandler", - # "//build/gn/configs/system_libs:skia", "//build/gn/configs/system_libs:ipc_core", ] } \ No newline at end of file -- Gitee