diff --git a/build/builder.py b/build/builder.py index 8863d29e81f935d7dd250f22a24d210ef32c9b98..c97e83cddb85ab6ef886e60e4eb965b8dbe8f6d8 100755 --- a/build/builder.py +++ b/build/builder.py @@ -87,7 +87,9 @@ class FtBuilder: choices=['DEBUG', 'INFO', 'WARNING', 'ERROR', 'FATAL', 'CRITICAL'], default='NOTSET', help='Set log level of builder.') - + build_parser.add_argument('-i', '--install', + action='store_true', + help='Install all library to /usr/lib64.') # Subcommand: format format_parser = subparsers.add_parser('format', help='Format C/C++ & GN files') format_parser.add_argument('--code-path', diff --git a/build/builder/commands/build.py b/build/builder/commands/build.py index 42804ea11793962de005f3d1b22569c3699a9de3..e8240f31ca464e74d2e362caaaf5ebac7540ec92 100755 --- a/build/builder/commands/build.py +++ b/build/builder/commands/build.py @@ -53,7 +53,11 @@ class Builder: # return exec_sys_command(['ln', '-sf', os.path.join(self.build_output_dir, 'compile_commands.json'), self.project_dir])[0] exec_sys_command(['rm', '-f', os.path.join(self.project_dir, 'compile_commands.json')]) return exec_sys_command(['cp', os.path.join(self.build_output_dir, 'compile_commands.json'), self.project_dir])[0] - + if self.args.install is True: + librarys = os.listdir(os.path.join(self.build_output_dir, 'common/common/')) + for lib in librarys: + if '.so' in lib: + exec_sys_command(['cp', '-rf', os.path.join(self.build_output_dir, 'common/common/', lib), "/usr/lib64/"])[0] return True def launch_gn(self) -> bool: diff --git a/build/prebuild.sh b/build/prebuild.sh index 320c9c069224d45030d6b9bea08d5e48dd111743..c428474fd37c7227cbe61b3bed8d802d4b638299 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -70,20 +70,13 @@ python3 ${PROJECT_DIR}/build/builder.py check --install-packages $* # install prebuild library if [ ! -d ${PROJECT_DIR}/prebuilts/libs ]; then -git clone https://gitee.com/yanansong/ft_engine_prebuild.git ${PROJECT_DIR}/prebuilts/libs +git clone https://gitee.com/yanansong/ft_engine_prebuild.git -b rpms ${PROJECT_DIR}/prebuilts/libs fi 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 -if [ ARCHNAME = "x86_64" ]; then - sudo cp -f sa_main /usr/local/bin - sudo cp -f samgr /usr/local/bin -fi + +cd ${PROJECT_DIR}/prebuilts/libs/rpms/${ARCHNAME} +sudo ./installRPM cd ${PROJECT_DIR} rm -fr ${PROJECT_DIR}/prebuilts/libs @@ -107,6 +100,7 @@ cd ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper/ if [ ! -d ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper/build ]; then mkdir build fi + cd build cmake .. make -j6 @@ -122,6 +116,10 @@ cd ${PROJECT_DIR}/prebuilts/rpm/binary ./install.sh cd ${PROJECT_DIR} +# copy FT sa file to /usr/local/share/ft/ +sudo mkdir -p /usr/local/share/ft +sudo cp -fr ${PROJECT_DIR}/etc/ft.xml /usr/local/share/ft/ + # copy config files to /usr/local/share/ft/window_manager sudo mkdir -p /usr/local/share/ft/window_manager sudo cp ${PROJECT_DIR}/window_manager/resources/config/other/display_manager_config.xml /usr/local/share/ft/window_manager diff --git a/display_server/rosen/modules/2d_graphics/src/render_context/render_context.cpp b/display_server/rosen/modules/2d_graphics/src/render_context/render_context.cpp index ae7570b2b91097d6d1544c7d4c1d83454aed87e4..84bb6e5496d0463d1ac9db666522dd8547df6a8a 100644 --- a/display_server/rosen/modules/2d_graphics/src/render_context/render_context.cpp +++ b/display_server/rosen/modules/2d_graphics/src/render_context/render_context.cpp @@ -165,7 +165,7 @@ void RenderContext::InitializeEglContext() unsigned int ret; EGLint count; EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT, EGL_NONE }; + EGL_ALPHA_SIZE, 8, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; ret = eglChooseConfig(eglDisplay_, config_attribs, &config_, 1, &count); if (!(ret && static_cast(count) >= 1)) { 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 bbebaea82b74d8c69b3c0d2693176b17b8e6d790..1521699bae6a9935b01d1e163e7c29c266f6373a 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 @@ -75,20 +75,13 @@ bool RSRenderService::Init() RSQosThread::GetInstance()->appVSyncDistributor_ = appVSyncDistributor_; RSQosThread::ThreadStart(); +#ifndef __FANGTIAN__ // 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); } - -#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 +#endif return true; } diff --git a/etc/ft.xml b/etc/ft.xml new file mode 100644 index 0000000000000000000000000000000000000000..c332ff936dd5b042c8d1e8d125b4bba5f12415cb --- /dev/null +++ b/etc/ft.xml @@ -0,0 +1,30 @@ + + + + + FT + + /usr/lib64/librender_service.so + + + + 10 + /usr/lib64/librender_service.so + true + false + 1 + + + diff --git a/runFT.sh b/runFT.sh new file mode 100755 index 0000000000000000000000000000000000000000..cef666908f0d334eaad9f1ec748dd8b812b9ce37 --- /dev/null +++ b/runFT.sh @@ -0,0 +1,16 @@ +# 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. + +sudo systemctl restart samgr +sudo systemctl restart hilogd +sa_main /usr/local/share/ft/ft.xml