diff --git a/README.md b/README.md index ce597b51e4f9b7b4cf6c4899d10a8f2ab92d7082..443a3aeb1632a26d69fbc7fb3ebc8e8b2b05e0ab 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Phytium-OpenHarmony-D2000-X100 ## 介绍 -该项目介绍,如何在飞腾信息科技有限公司的 Phytium D2000 + X100 DEV硬件平台上运行 OpenHarmony 标准系统[OpenHamony 4.0 release](https://gitee.com/openharmony/docs/blob/master/zh-cn/release-notes/OpenHarmony-v4.0-release.md)。 +该项目介绍,如何在飞腾信息科技有限公司的 Phytium D2000 + X100 DEV硬件平台上运行 OpenHarmony 标准系统[OpenHamony 4.1 release](https://gitee.com/openharmony/docs/blob/master/zh-cn/release-notes/OpenHarmony-v4.1-release.md)。 支持X100提供的视频解码硬件加速,以及图形显示硬件加速。 支持Linux kernel 5.10。 @@ -34,7 +34,7 @@ export PROJ_ROOT=$WORK_SPACE/OpenHarmony mkdir $WORK_SPACE mkdir $PROJ_ROOT cd $PROJ_ROOT -repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.0-Release --no-repo-verify +repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v4.1-Release --no-repo-verify repo sync -c repo forall -c 'git lfs pull' ``` @@ -60,16 +60,26 @@ cd $PHY_DEV git clone git@gitee.com:phytium_embedded/phytium-openharmony-d2000-device.git ``` ## 2.2 整合phytiym device源码 -1. 将获取到的device源码分别放入OpenHarmony的device对应的目录 -``` -cp $PHY_DEV/device_board_phytium $PROJ_ROOT/device/board/phytium -r -cp $PHY_DEV/device_soc_phytium $PROJ_ROOT/device/soc/phytium -r -cp $PHY_DEV/vendor_phytium $PROJ_ROOT/vendor/phytium -r -``` -2. 执行$PHY_DEV/auto_patch.sh,将device_board_phytium/d2000/patch/中的patch打入到OpenHarmony对应仓库中。 -``` -$PHY_DEV/auto_patch.sh $PROJ_ROOT +执行phytium_env.sh脚本,将phytium device代码,以及针对openharmony修改的patch集成到OpenHarmony中。 +``` +./phytium_env.sh $PROJ_ROOT 0 +THE OHOS_PATH_ROOT: /home/xxx/workspace/OpenHarmony +THE DEVICE: d2000(0) + #### sync phytium env start! #### + #### sync device_soc_phytium #### + #### sync device_soc_phytium end #### + #### sync device_board_phytium #### + #### sync device_board_phytium end #### + #### sync vendor_phytium #### + #### sync vendor_phytium end #### +... +... + #### sync phytium end! #### + ``` +> 这里我们需要传入两个参数: +> 第一个是鸿蒙的根目录。 +> 第二个是指设备ID,0对应d2000;1对应e2000;2对应phytiumpi-firefly ## 2.3 适配fstab文件 确认存储介质的类型,对应修改fstab文件。具体参考文档[Openharmony多种存储介质配置说明](https://gitee.com/phytium_embedded/phytium-embedded-docs/blob/master/mobile_terminal/Openharmony%E5%A4%9A%E7%A7%8D%E5%AD%98%E5%82%A8%E4%BB%8B%E8%B4%A8%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E.pdf)。 @@ -91,16 +101,7 @@ $PROJ_ROOT/out/d2000/packages/phone/images/vendor.img $PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img ``` ## 3.2 编译 Linux kernel -D2000内核源码暂未开源,需要签署了NDA才能获取,请邮件联系phytium嵌入式软件部(linan1284@phytium.com.cn)获取kernel源码,邮件中请标明所属公司,个人基本信息及联系方式,以及与您对接的飞腾同事。 -单独编译OpenHarmony内核方法: -``` -$export PATH=$PROJ_ROOT/prebuilts/clang/ohos/linux-x86_64/llvm/bin:$PROJ_ROOT/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/:$PATH -$export MAKE_OPTIONS="ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- CC=clang HOSTCC=clang LLVM=1 LLVM_IAS=1" -$cd $KERNEL_DIR #kernel源码根目录 -$make ${MAKE_OPTIONS} pd2008_standard_defconfig -$make ${MAKE_OPTIONS} menuconfig -$make ${MAKE_OPTIONS} -j32 -``` +D2000源码暂未开源,请邮件联系phytium嵌入式软件部(linan1284@phytium.com.cn)获取kernel源码,并参考kernel源码中的README,编译出相关文件。 >**!!!注意:** vpu是作为Linux Kernel的modules的方式进行编译的,内核代码修改更新时,需要同步更新vpu相关的ko文件。 linux kernel源码编译后,vpu的ko文件生成的位置: diff --git a/auto_patch.sh b/auto_patch.sh deleted file mode 100755 index 0d3d09c92831d25d059e76f32e3fe3d36dc233ad..0000000000000000000000000000000000000000 --- a/auto_patch.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -if [ $# -eq 0 ] ; then - echo -e "\033[31m USAGE: auto_patch.sh OHOS_PATH_ROOT \033[0m" - echo -e "\033[31m example: ./auto_patch.sh /home/phytium/OpenHarmony \033[0m" - exit 1; -fi - -OHOS_PATH_ROOT=$1 -if [ ! -d $OHOS_PATH_ROOT ];then - echo -e "\033[31mMake sure the OHOS_PATH_ROOT exist! \033[0m" - exit 1; -fi - -DEVICE=d2000 - -clean=0 -if [ $# -eq 2 ];then - if [ $2="clean" ];then - clean=1 - fi -fi - -PATCH_PATH=$OHOS_PATH_ROOT/device/board/phytium/$DEVICE/patch -if [ ! -d $PATCH_PATH ];then - echo -e "\033[31mMake sure you have copied phytium device code to OHOS_PATH_ROOT! \033[0m" - exit 1; -fi - -echo -e "" -echo -e "######################################################################" -echo -e "#### \033[32m Auto apply phytium_oh patchs start !\033[0m" -echo -e "#### \033[32m OHOS_PATH_ROOT: $OHOS_PATH_ROOT \033[0m" -echo -e "#### \033[32m PATCH_PATH : $PATCH_PATH \033[0m" -echo -e "#### \033[32m DEVICE : $DEVICE \033[0m" -echo -e "######################################################################" - -CURRENTPWD=$(pwd) - -####get_git_path(patch_name) get git path from patch name to git apply -function get_git_path(){ - local path=$1 - path=${path#*=} - path=${path%=*} - path=${path//-/\/} - echo $path -} - -for file in `ls $PATCH_PATH` -do - git_path=$(get_git_path $file)/ - if [ ! -d $OHOS_PATH_ROOT/$git_path ];then - echo -e "\033[31m$git_path not exit \033[0m" - continue - fi - - cd $OHOS_PATH_ROOT/$git_path - if [ $clean -eq 0 ];then - echo -e "\n\033[32m#### git apply $file #### \033[0m" - git apply $PATCH_PATH/$file - echo -e "\033[32m#### git apply $file end#### \033[0m" - else - echo -e "\n\033[32m#### git reset $git_path #### \033[0m" - git checkout ./* - echo -e "\033[32m#### git reset $git_path end #### \033[0m" - fi -# git status -done - -cd $CURRENTPWD - -echo -e "\n#### \033[32mAuto apply phytium_oh patchs end !\033[0m" diff --git a/device_board_phytium/d2000/kernel/BUILD.gn b/device_board_phytium/common/build_kernel/BUILD.gn similarity index 42% rename from device_board_phytium/d2000/kernel/BUILD.gn rename to device_board_phytium/common/build_kernel/BUILD.gn index fc0a1aa5c1c8dc54d8a78bb49fd2f85545a55911..b546c3eb145113279f0582b0de8121f8f22f9eda 100755 --- a/device_board_phytium/d2000/kernel/BUILD.gn +++ b/device_board_phytium/common/build_kernel/BUILD.gn @@ -1,4 +1,7 @@ -# Copyright (c) 2022 Phytium Technology Co., Ltd. All rights reserved. +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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 @@ -13,26 +16,51 @@ import("//build/config/clang/clang.gni") import("//build/ohos.gni") -kernel_build_script_dir = "//kernel/linux/linux-5.10" -kernel_source_dir = "//kernel/linux/linux-5.10" +import("//build/ohos/kernel/kernel.gni") + +# it needs adaptation for more device target +target_cpu = "arm64" +kernel_image = "" +if (target_cpu == "arm") { + kernel_image = "uImage" +} else if (target_cpu == "arm64") { + kernel_image = "Image" +} + +kernel_build_script_dir = "//device/board/phytium/common/build_kernel" +kernel_source_dir = "//kernel/linux/$linux_kernel_version" + +# //out/ohos-arm64-release +print("root_build_dir = $root_build_dir") + +action("check_build") { + script = "check_build.sh" + sources = [ kernel_source_dir ] + outputs = [ "$root_build_dir/kernel.timestamp" ] + args = [ + rebase_path(kernel_source_dir, root_build_dir), + rebase_path("$root_build_dir/packages/phone/images/$kernel_image"), + rebase_path("$root_build_dir/kernel.timestamp"), + ] +} -action("kernel") { +action("build_kernel") { script = "build_kernel.sh" sources = [ kernel_source_dir ] + deps = [ ":check_build" ] product_path = "vendor/$product_company/$product_name" - outputs = [ "$root_build_dir/../kernel/src_tmp/linux-5.10/boot_linux" ] + build_type = "standard" + outputs = [ "$root_build_dir/packages/phone/images/$kernel_image" ] args = [ rebase_path(kernel_build_script_dir, root_build_dir), + rebase_path("$root_out_dir/KERNEL_OBJ"), rebase_path("$root_build_dir/packages/phone/images"), - rebase_path("//device/board/phytium/$device_name"), + build_type, + target_cpu, product_path, - rebase_path("$root_build_dir/../.."), - device_company, device_name, - product_company, + linux_kernel_version, + rebase_path("$root_out_dir/../.."), ] - if (enable_ramdisk) { - args += [ "enable_ramdisk" ] - } } diff --git a/device_board_phytium/common/build_kernel/build_kernel.sh b/device_board_phytium/common/build_kernel/build_kernel.sh new file mode 100755 index 0000000000000000000000000000000000000000..71b36d8f63e0c4fe1c5f0db6a88a388c11665190 --- /dev/null +++ b/device_board_phytium/common/build_kernel/build_kernel.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +set -e + +#$1 - kernel build script work dir +#$2 - kernel build script stage dir +#$3 - GN target output dir +export OHOS_ROOT_PATH=${9} +export DEVICE_NAME=${7} +export KERNEL_SOURCE_PATH=${OHOS_ROOT_PATH}/device/board/phytium/${DEVICE_NAME}/kernel_source +export KERNEL_PATCH=${KERNEL_SOURCE_PATH}/phytium_patch/phytium.patch +export KERNEL_CONFIG=${KERNEL_SOURCE_PATH}/phytium_standard_defconfig + +echo build_kernel +if [ -f "${KERNEL_PATCH}" -a -f "${KERNEL_CONFIG}" ]; then + pushd ${1} + ./kernel_module_build.sh ${2} ${4} ${5} ${6} ${7} ${8} + mkdir -p ${3} + rm -rf ${3}/../../../kernel.timestamp + if [ -d ${3}/kernel ];then + echo "${3}/kernel existed!" + cd ${3}/kernel + rm -rf * + cd - + else + mkdir -p ${3}/kernel + fi + + cp ${2}/kernel/src_tmp/${8}/arch/arm64/boot/Image ${3}/kernel/Image + + mkdir -p ${3}/kernel/dtb + cp ${2}/kernel/src_tmp/${8}/arch/arm64/boot/dts/phytium/*.dtb ${3}/kernel/dtb + + mkdir -p ${3}/kernel/EFI + cp ${OHOS_ROOT_PATH}/device/board/phytium/${7}/loader/EFI/* ${3}/kernel/EFI -rf + cp ${OHOS_ROOT_PATH}/device/board/phytium/common/tools/generate_image/* ${3} -rf + popd + +else + echo "No kernel patch found, skip building Kernel" +fi + diff --git a/device_board_phytium/common/build_kernel/check_build.sh b/device_board_phytium/common/build_kernel/check_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..dc12906ffeab470795c797e3aedf901ff25fb858 --- /dev/null +++ b/device_board_phytium/common/build_kernel/check_build.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +set -e + +function readfile () +{ + for file in $1/* + do + if [ -d "$file" ];then + readfile $file $2 $3 + elif [ "$file" -nt "$2" ]; then + echo $file is update + touch $3; + return + fi + done +} + +echo $1 for check kernel dir +echo $2 for output image +echo $3 for timestamp +if [ -e "$2" ]; then + readfile $1 $2 $3 + if [ "$3" -nt "$2" ]; then + echo "need update $2" + rm -rf $2; + fi +fi + diff --git a/device_board_phytium/d2000/kernel/build_kernel.sh b/device_board_phytium/common/build_kernel/kernel.gni similarity index 65% rename from device_board_phytium/d2000/kernel/build_kernel.sh rename to device_board_phytium/common/build_kernel/kernel.gni index 7c0b16e978c8690729fe0b1661ae89be302e9d1c..5eaed71dc047a5227f1869b052fb9e3e5ac7df2b 100755 --- a/device_board_phytium/d2000/kernel/build_kernel.sh +++ b/device_board_phytium/common/build_kernel/kernel.gni @@ -1,6 +1,7 @@ -#!/bin/bash - -# Copyright (c) 2022 Phytium Technology Co., Ltd. All rights reserved. +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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 @@ -12,20 +13,6 @@ # 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. - -set -e - - - -pushd ${1} -ROOT_DIR=${5} -export PRODUCT_PATH=${4} -export DEVICE_COMPANY=${6} -export DEVICE_NAME=${7} -export PRODUCT_COMPANY=${8} - - -mkdir -p ${2} - -cp ${3}/loader/boot_linux.img ${2}/boot_linux.img -popd +declare_args() { + linux_kernel_version = "linux-5.10" +} diff --git a/device_board_phytium/common/build_kernel/kernel.mk b/device_board_phytium/common/build_kernel/kernel.mk new file mode 100755 index 0000000000000000000000000000000000000000..59e3ef85335b1e6a9b81586c6c0c55fda2981c16 --- /dev/null +++ b/device_board_phytium/common/build_kernel/kernel.mk @@ -0,0 +1,69 @@ +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +PRODUCT_NAME=$(TARGET_PRODUCT) +OHOS_BUILD_HOME := $(realpath $(shell pwd)/../../../../../) +KERNEL_SRC_TMP_PATH := $(OUT_DIR)/kernel/${KERNEL_VERSION} +KERNEL_OBJ_TMP_PATH := $(OUT_DIR)/kernel/OBJ/${KERNEL_VERSION} +ifeq ($(BUILD_TYPE), standard) + KERNEL_SRC_TMP_PATH := $(OUT_DIR)/kernel/src_tmp/${KERNEL_VERSION} +endif + +KERNEL_SRC_PATH := $(OHOS_BUILD_HOME)/kernel/linux/${KERNEL_VERSION} +KERNEL_PATCH_PATH := $(OHOS_BUILD_HOME)/kernel/linux/patches/${KERNEL_VERSION} +PHYTIUM_PATCH_PATH := $(OHOS_BUILD_HOME)/device/board/phytium/$(DEVICE_NAME)/kernel_source + +PREBUILTS_GCC_DIR := $(OHOS_BUILD_HOME)/prebuilts/gcc +CLANG_HOST_TOOLCHAIN := $(OHOS_BUILD_HOME)/prebuilts/clang/ohos/linux-x86_64/llvm/bin +KERNEL_HOSTCC := $(CLANG_HOST_TOOLCHAIN)/clang +KERNEL_PREBUILT_MAKE := make +CLANG_CC := $(CLANG_HOST_TOOLCHAIN)/clang + +ifeq ($(KERNEL_ARCH), arm) + KERNEL_TARGET_TOOLCHAIN := $(PREBUILTS_GCC_DIR)/linux-x86/arm/gcc-linaro-7.5.0-arm-linux-gnueabi/bin + KERNEL_TARGET_TOOLCHAIN_PREFIX := $(KERNEL_TARGET_TOOLCHAIN)/arm-linux-gnueabi- +else ifeq ($(KERNEL_ARCH), arm64) + KERNEL_TARGET_TOOLCHAIN := $(PREBUILTS_GCC_DIR)/linux-x86/aarch64/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin + KERNEL_TARGET_TOOLCHAIN_PREFIX := $(KERNEL_TARGET_TOOLCHAIN)/aarch64-linux-gnu- +endif + + +KERNEL_CROSS_COMPILE := +KERNEL_CROSS_COMPILE += CC="$(CLANG_CC)" +KERNEL_CROSS_COMPILE += CROSS_COMPILE="$(KERNEL_TARGET_TOOLCHAIN_PREFIX)" + +KERNEL_MAKE := \ + PATH="$(CLANG_HOST_TOOLCHAIN):$$PATH" \ + $(KERNEL_PREBUILT_MAKE) + +DEVICE_PATCH_DIR := $(OHOS_BUILD_HOME)/kernel/linux/patches/${KERNEL_VERSION}/$(DEVICE_NAME)_patch +DEVICE_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME).patch +HDF_PATCH_FILE := $(DEVICE_PATCH_DIR)/hdf.patch +SMALL_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME)_$(BUILD_TYPE).patch +KERNEL_IMAGE_FILE := $(KERNEL_SRC_TMP_PATH)/arch/$(KERNEL_ARCH)/boot/$(KERNEL_IMAGE) +DEFCONFIG_FILE := phytium_standard_defconfig + +$(KERNEL_IMAGE_FILE): + echo "build kernel... " + $(hide) rm -rf $(KERNEL_SRC_TMP_PATH);mkdir -p $(KERNEL_SRC_TMP_PATH);cp -arfL $(KERNEL_SRC_PATH)/* $(KERNEL_SRC_TMP_PATH) + $(hide) $(OHOS_BUILD_HOME)/device/board/phytium/common/build_kernel/patch_phytium.sh $(PHYTIUM_PATCH_PATH) $(KERNEL_SRC_TMP_PATH) + $(hide) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME) + $(hide) cp $(PHYTIUM_PATCH_PATH)/${DEFCONFIG_FILE} $(KERNEL_SRC_TMP_PATH)/arch/$(KERNEL_ARCH)/configs/ + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) LLVM=1 LLVM_IAS=1 $(KERNEL_CROSS_COMPILE) distclean + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) LLVM=1 LLVM_IAS=1 $(KERNEL_CROSS_COMPILE) $(DEFCONFIG_FILE) + $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) LLVM=1 LLVM_IAS=1 $(KERNEL_CROSS_COMPILE) -j6 +.PHONY: build-kernel +build-kernel: $(KERNEL_IMAGE_FILE) diff --git a/device_board_phytium/common/build_kernel/kernel_module_build.sh b/device_board_phytium/common/build_kernel/kernel_module_build.sh new file mode 100755 index 0000000000000000000000000000000000000000..cf7dcd14336919e37b97280f8199408cf9147c83 --- /dev/null +++ b/device_board_phytium/common/build_kernel/kernel_module_build.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +set -e + +export OUT_DIR=$1 +export BUILD_TYPE=$2 +export KERNEL_ARCH=$3 +export PRODUCT_PATH=vendor/phytium/$7 +export DEVICE_NAME=$5 +export KERNEL_VERSION=$6 +LINUX_KERNEL_OUT=${OUT_DIR}/kernel/src_tmp/${KERNEL_VERSION} + +# it needs adaptation for more device target +kernel_image="" +if [ "$KERNEL_ARCH" == "arm" ];then + kernel_image="uImage" +elif [ "$KERNEL_ARCH" == "arm64" ];then + kernel_image="Image" +fi + +export KERNEL_IMAGE=${kernel_image} +LINUX_KERNEL_IMAGE_FILE=${LINUX_KERNEL_OUT}/arch/${KERNEL_ARCH}/boot/${kernel_image} + +make -f kernel.mk + +if [ -f "${LINUX_KERNEL_IMAGE_FILE}" ];then + echo "Image: ${LINUX_KERNEL_IMAGE_FILE} build success" +else + echo "Image: ${LINUX_KERNEL_IMAGE_FILE} build failed!!!" + exit 1 +fi + +exit 0 diff --git a/device_board_phytium/common/build_kernel/make_initramfs.sh b/device_board_phytium/common/build_kernel/make_initramfs.sh new file mode 100755 index 0000000000000000000000000000000000000000..0b11092160deb3d603439d0aa29af3786ac21cdc --- /dev/null +++ b/device_board_phytium/common/build_kernel/make_initramfs.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +set -e + +ROOT_DIR=${1} +OUT_RAMDISK_DIR=${ROOT_DIR}/out/e2000/packages/phone/ramdisk +OUT_KERNEL_IMAGE_RAMFS_DIR=${2} + +function make_initramfs () +{ + cp ${OUT_RAMDISK_DIR} ${OUT_KERNEL_IMAGE_RAMFS_DIR}/ -rf + cp ${ROOT_DIR}/device/board/phytium/e2000/cfg/fstab.e2000 ${OUT_KERNEL_IMAGE_RAMFS_DIR}/ramdisk/etc/fstab.required + cd ${OUT_KERNEL_IMAGE_RAMFS_DIR}/ramdisk + find . | cpio -o -Hnewc > ../initramfs.img +} + + +make_initramfs diff --git a/device_board_phytium/common/build_kernel/patch_phytium.sh b/device_board_phytium/common/build_kernel/patch_phytium.sh new file mode 100755 index 0000000000000000000000000000000000000000..b186969849c9592817356b506611a33074c18b6c --- /dev/null +++ b/device_board_phytium/common/build_kernel/patch_phytium.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# This file contains confidential and proprietary information of +# OSWare Technology 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. + +set -e + +OHOS_SOURCE_ROOT=$1 +KERNEL_BUILD_ROOT=$2 + +PHYTIUM_PATCH=${OHOS_SOURCE_ROOT}/phytium_patch/phytium.patch +VPU_PATCH=${OHOS_SOURCE_ROOT}/phytium_patch/vpu.patch +GPU_PATCH=${OHOS_SOURCE_ROOT}/phytium_patch/gpu.patch + +function patch_phytium() +{ + cd $KERNEL_BUILD_ROOT + patch -p1 < ${PHYTIUM_PATCH} + + if [ -f "${VPU_PATCH}" ]; then + patch -p1 < ${VPU_PATCH} + else + echo "vpu patch doesn't exist!" + fi + + if [ ${TARGET_PRODUCT} = "d2000" ]; then + if [ -f "${GPU_PATCH}" ]; then + patch -p1 < ${GPU_PATCH} + else + echo "gpu patch doesn't exist!" + fi + fi + + cd - +} + +function main() +{ + patch_phytium +} + +main diff --git a/device_board_phytium/d2000/tools/generate_image/generate_image.sh b/device_board_phytium/common/tools/generate_image/generate_image.sh similarity index 65% rename from device_board_phytium/d2000/tools/generate_image/generate_image.sh rename to device_board_phytium/common/tools/generate_image/generate_image.sh index 6c031388f1913b8aa200793b881f10e33ead1bd2..a043255360ef950c20b4bb1daf637ac935f6727e 100644 --- a/device_board_phytium/d2000/tools/generate_image/generate_image.sh +++ b/device_board_phytium/common/tools/generate_image/generate_image.sh @@ -1,4 +1,16 @@ #!/bin/sh +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# 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. ############################################################################################################################# #manual: # this script is used to generate image of phytium android and openharmony product. @@ -38,13 +50,31 @@ normal="\e[0m" #partion sizes are defined in part.cfg, Unit size is MByte CONFIG=part.cfg -IMAGE_NAME=$(awk '/^image_name/{print $3}' "$CONFIG") +UBOOT_NAME=no_uboot +IMAGE_NAME_END="uboot" +BOOT_IMG="boot_uboot.img" +BOOT_PART_FORMAT="ext4" +if [ -n $1 ]&&[ ! -z $1 ]; then + if [ $1 == "efi" ]; then + BOOT_IMG="boot_efi.img" + IMAGE_NAME_END="efi" + BOOT_PART_FORMAT="fat32" + else + if [ -f $1 ]; then + UBOOT_NAME=$1 + UBOOT_NAME_BASENAME=$(basename $UBOOT_NAME) + IMAGE_NAME_END="uboot_"${UBOOT_NAME_BASENAME%.*} + fi + fi +fi + +IMAGE_NAME_EX=$(awk '/^image_name_ex/{print $3}' "$CONFIG") +IMAGE_NAME="${IMAGE_NAME_EX}_${IMAGE_NAME_END}.img" LABLE_RESERVE_SIZE=$(awk '/^label_reserve_size/{print $3}' "$CONFIG") BOOT_PARTION_SIZE=$(awk '/^boot_partition_size/{print $3}' "$CONFIG") SYSTEM_PARTION_SIZE=$(awk '/^system_partition_size/{print $3}' "$CONFIG") VENDOR_PARTION_SIZE=$(awk '/^vendor_partition_size/{print $3}' "$CONFIG") USERDATA_PARTION_SIZE=$(awk '/^userdata_partition_size/{print $3}' "$CONFIG") - START_BOOT_ADDR=$LABLE_RESERVE_SIZE let END_BOOT_ADDR=$LABLE_RESERVE_SIZE+$BOOT_PARTION_SIZE START_SYSTEM_ADDR=$END_BOOT_ADDR @@ -55,16 +85,22 @@ START_USERDATA_ADDR=$END_VENDOR_ADDR let END_USERDATA_ADDR=$START_USERDATA_ADDR+$USERDATA_PARTION_SIZE let TOTAL_IMAGE_SIZE=$LABLE_RESERVE_SIZE+$BOOT_PARTION_SIZE+$SYSTEM_PARTION_SIZE+$VENDOR_PARTION_SIZE+$USERDATA_PARTION_SIZE ############################################################################################################################### +echo -e "${green}start generate $IMAGE_NAME ${normal}" + +if [ ! -f ${BOOT_IMG} ]; then + ./make_boot.sh . ${IMAGE_NAME_END} +fi sudo -v echo -e "${green}start creating empty image, please wait......${normal}" sudo dd if=/dev/zero of=$IMAGE_NAME bs=1MB count=$TOTAL_IMAGE_SIZE echo -e "${green}parting image ......${normal}" -sudo parted $IMAGE_NAME --script -- mklabel msdos -sudo parted $IMAGE_NAME --script -- mkpart primary ext4 ${START_BOOT_ADDR}M ${END_BOOT_ADDR}M-1 -sudo parted $IMAGE_NAME --script -- mkpart primary ext4 ${START_SYSTEM_ADDR}M ${END_SYSTEM_ADDR}M-1 -sudo parted $IMAGE_NAME --script -- mkpart primary ext4 ${START_VENDOR_ADDR}M ${END_VENDOR_ADDR}M-1 -sudo parted $IMAGE_NAME --script -- mkpart primary ext4 ${START_USERDATA_ADDR}M ${END_USERDATA_ADDR}M-1 + +sudo parted $IMAGE_NAME --script -- mklabel gpt +sudo parted $IMAGE_NAME --script -- mkpart boot ${BOOT_PART_FORMAT} ${START_BOOT_ADDR}M ${END_BOOT_ADDR}M-1 +sudo parted $IMAGE_NAME --script -- mkpart system ext4 ${START_SYSTEM_ADDR}M ${END_SYSTEM_ADDR}M-1 +sudo parted $IMAGE_NAME --script -- mkpart vendor ext4 ${START_VENDOR_ADDR}M ${END_VENDOR_ADDR}M-1 +sudo parted $IMAGE_NAME --script -- mkpart userdata ext4 ${START_USERDATA_ADDR}M ${END_USERDATA_ADDR}M-1 loopdevice=`sudo losetup -f --show ${IMAGE_NAME}` device=`sudo kpartx -va $loopdevice | sed -E 's/.*(loop[1-9]?[0-9])p.*/\1/g' | head -1` @@ -73,21 +109,23 @@ partBoot="${device}p1" partSystem="${device}p2" partVendor="${device}p3" partUserdata="${device}p4" -echo -e "${green}start to generate boot partition......${normal}" -sudo mkfs.ext4 -L boot $partBoot -sudo mkdir -p /media/image_to_boot -sudo mount $partBoot /media/image_to_boot -sudo cp Image ramdisk.img *.dtb part.cfg /media/image_to_boot -sudo umount /media/image_to_boot -sudo rm /media/image_to_boot -rf -echo -e "${green}start dd system and vendor image......${normal}" +echo -e "${green}start dd boot/system/vendor images......${normal}" +sudo dd if=${BOOT_IMG} of=$partBoot bs=1M sudo dd if=system.img of=$partSystem bs=1M sudo dd if=vendor.img of=$partVendor bs=1M echo -e "${green}start to generate userdata partition......${normal}" sudo mkfs.ext4 -L userdata $partUserdata +if [ -f $UBOOT_NAME ];then +echo -e "${green}start to burn uboot img......${normal}" +sudo dd if=$loopdevice of=table.bin bs=1 skip=446 count=66 +sudo dd if=$UBOOT_NAME of=$loopdevice +sudo dd if=table.bin of=$loopdevice bs=1 seek=446 count=66 +rm table.bin -f +fi + sync sleep 5 diff --git a/device_board_phytium/d2000/tools/generate_image/part.cfg b/device_board_phytium/common/tools/generate_image/part.cfg similarity index 55% rename from device_board_phytium/d2000/tools/generate_image/part.cfg rename to device_board_phytium/common/tools/generate_image/part.cfg index 2aba5c846866a2cef406469964df7b255336f6df..afdf593040a09b6db6e817250ea8123e8e47aef7 100644 --- a/device_board_phytium/d2000/tools/generate_image/part.cfg +++ b/device_board_phytium/common/tools/generate_image/part.cfg @@ -1,7 +1,7 @@ [partition] -image_name = d2000.img -label_reserve_size = 4 +image_name_ex = d2000 +label_reserve_size = 64 boot_partition_size = 256 system_partition_size = 2048 vendor_partition_size = 512 -userdata_partition_size = 5120 +userdata_partition_size = 1024 diff --git a/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-2GB-gefa51bb5.bin b/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-2GB-gefa51bb5.bin new file mode 100644 index 0000000000000000000000000000000000000000..4fee1ebefe8c02c62a4cb9054281a4fc626cae5a Binary files /dev/null and b/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-2GB-gefa51bb5.bin differ diff --git a/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-4GB-gefa51bb5.bin b/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-4GB-gefa51bb5.bin new file mode 100644 index 0000000000000000000000000000000000000000..03e5970d1338ce16f51aed5d67f180d95bf6e260 Binary files /dev/null and b/device_board_phytium/common/tools/generate_image/uboot/phytiumpi/fip-all-hw2.1-harmony-4GB-gefa51bb5.bin differ diff --git a/device_board_phytium/d2000/BUILD.gn b/device_board_phytium/d2000/BUILD.gn index 885eacc488b310d13b654f34514b94a0b06b66a4..34f664744741ea85a219606672ffa0740c40816b 100755 --- a/device_board_phytium/d2000/BUILD.gn +++ b/device_board_phytium/d2000/BUILD.gn @@ -18,7 +18,7 @@ group("d2000_group") { deps = [ "cfg:init_configs", "distributedhardware:distributedhardware", - "kernel:kernel", + "../common/build_kernel:build_kernel", "//device/soc/phytium/d2000/hardware:hardware_group", "//device/soc/phytium/d2000/hardware/display:display_buffer_model", "//device/soc/phytium/d2000/hardware/display:display_composer_model", diff --git a/device_board_phytium/d2000/audio_alsa/common.h b/device_board_phytium/d2000/audio_alsa/common.h new file mode 100755 index 0000000000000000000000000000000000000000..4a99f17a4f5daa046c61abf889d6d7965b19f441 --- /dev/null +++ b/device_board_phytium/d2000/audio_alsa/common.h @@ -0,0 +1,58 @@ +/* + * 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 + * + * 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 ALSA_SND_COMMON_H +#define ALSA_SND_COMMON_H + +/* Playback Path */ +#define SND_NUMID_PLAYBACK_PATH 1 +#define SND_ELEM_PLAYBACK_PATH "Playback Path" +#define SND_OUT_CARD_OFF "0" /* close play path */ +#define SND_OUT_CARD_RCV "1" /* speaker */ +#define SND_OUT_CARD_SPK "2" /* speaker */ +#define SND_OUT_CARD_HP "3" /* headphone */ +#define SND_OUT_CARD_HP_NO_MIC "4" /* headphone */ +#define SND_OUT_CARD_BT "5" /* bluetooth (Don't set!!!) */ +#define SND_OUT_CARD_SPK_HP "6" /* speaker and headphone */ +#define SND_OUT_CARD_RING_SPK "7" /* speaker */ +#define SND_OUT_CARD_RING_HP "8" /* headphone */ +#define SND_OUT_CARD_RING_HP_NO_MIC "9" /* headphone */ +#define SND_OUT_CARD_RING_SPK_HP "10" /* speaker and headphone */ + +/* Capture MIC Path */ +#define SND_NUMID_CAPUTRE_MIC_PATH 2 +#define SND_ELEM_CAPUTRE_MIC_PATH "Capture MIC Path" +#define SND_IN_CARD_MIC_OFF "0" /* close capture path */ +#define SND_IN_CARD_MAIN_MIC "1" /* main mic */ +#define SND_IN_CARD_HANDS_FREE_MIC "2" /* hands free mic */ +#define SND_IN_CARD_BT_SCO_MIC "3" /* bluetooth sco mic (Don't set!!!) */ + +/* DACL Playback Volume */ +#define SND_NUMID_DACL_PLAYBACK_VOL 3 +#define SND_ELEM_DACL_PLAYBACK_VOL "DACL Playback Volume" + +/* DACR Playback Volume */ +#define SND_NUMID_DACR_PLAYBACK_VOL 4 +#define SND_ELEM_DACR_PLAYBACK_VOL "DACR Playback Volume" + +/* DACL Capture Volume */ +#define SND_NUMID_DACL_CAPTURE_VOL 5 +#define SND_ELEM_DACL_CAPTURE_VOL "DACL Capture Volume" + +/* DACR Capture Volume */ +#define SND_NUMID_DACR_CAPTURE_VOL 6 +#define SND_ELEM_DACR_CAPTURE_VOL "DACR Capture Volume" + +#endif /* ALSA_SND_COMMON_H */ diff --git a/device_board_phytium/d2000/audio_alsa/vendor_capture.c b/device_board_phytium/d2000/audio_alsa/vendor_capture.c new file mode 100755 index 0000000000000000000000000000000000000000..24e63f45e11643cd07459d9f1c0271c7b805304b --- /dev/null +++ b/device_board_phytium/d2000/audio_alsa/vendor_capture.c @@ -0,0 +1,227 @@ +/* + * 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 + * + * 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 "alsa_snd_capture.h" +#include "common.h" + +#define HDF_LOG_TAG HDF_AUDIO_HAL_CAPTURE + +typedef struct _CAPTURE_DATA_ { + struct AlsaMixerCtlElement ctrlLeftVolume; + struct AlsaMixerCtlElement ctrlRightVolume; + long tempVolume; +}CaptureData; + +static int32_t CaptureInitImpl(struct AlsaCapture* captureIns) +{ + if (captureIns->priData != NULL) { + return HDF_SUCCESS; + } + CHECK_NULL_PTR_RETURN_DEFAULT(captureIns); + + CaptureData *priData = (CaptureData *)OsalMemCalloc(sizeof(CaptureData)); + if (priData == NULL) { + AUDIO_FUNC_LOGE("Failed to allocate memory!"); + return HDF_FAILURE; + } + + SndElementItemInit(&priData->ctrlLeftVolume); + SndElementItemInit(&priData->ctrlRightVolume); + priData->ctrlLeftVolume.numid = SND_NUMID_DACL_CAPTURE_VOL; + priData->ctrlLeftVolume.name = SND_ELEM_DACL_CAPTURE_VOL; + priData->ctrlRightVolume.numid = SND_NUMID_DACR_CAPTURE_VOL; + priData->ctrlRightVolume.name = SND_ELEM_DACR_CAPTURE_VOL; + CaptureSetPriData(captureIns, (CapturePriData)priData); + + return HDF_SUCCESS; +} + +static int32_t CaptureSelectSceneImpl(struct AlsaCapture *captureIns, enum AudioPortPin descPins, + const struct PathDeviceInfo *deviceInfo) +{ + captureIns->descPins = descPins; + return HDF_SUCCESS; +} + +static int32_t CaptureGetVolThresholdImpl(struct AlsaCapture *captureIns, long *volMin, long *volMax) +{ + int32_t ret; + long _volMin = 0; + long _volMax = 0; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)captureIns; + CaptureData *priData = CaptureGetPriData(captureIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = SndElementReadRange(cardIns, &priData->ctrlLeftVolume, &_volMin, &_volMax); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("SndElementReadRange fail!"); + return HDF_FAILURE; + } + *volMin = _volMin; + *volMax = _volMax; + + return HDF_SUCCESS; +} + +static int32_t CaptureGetVolumeImpl(struct AlsaCapture *captureIns, long *volume) +{ + int32_t ret; + long volLeft = 0; + long volRight = 0; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)captureIns; + CaptureData *priData = CaptureGetPriData(captureIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = SndElementReadInt(cardIns, &priData->ctrlLeftVolume, &volLeft); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Read left volume fail!"); + return HDF_FAILURE; + } + ret = SndElementReadInt(cardIns, &priData->ctrlRightVolume, &volRight); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Read right volume fail!"); + return HDF_FAILURE; + } + *volume = (volLeft + volRight) >> 1; + + return HDF_SUCCESS; +} + +static int32_t CaptureSetVolumeImpl(struct AlsaCapture *captureIns, long volume) +{ + int32_t ret; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)captureIns; + CaptureData *priData = CaptureGetPriData(captureIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + ret = SndElementWriteInt(cardIns, &priData->ctrlLeftVolume, volume); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Write left volume fail!"); + return HDF_FAILURE; + } + ret = SndElementWriteInt(cardIns, &priData->ctrlRightVolume, volume); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Write right volume fail!"); + return HDF_FAILURE; + } + + return HDF_SUCCESS; +} + +static int32_t CaptureSetMuteImpl(struct AlsaCapture *captureIns, bool muteFlag) +{ + int32_t ret; + long vol, setVol; + CaptureData *priData = CaptureGetPriData(captureIns); + CHECK_NULL_PTR_RETURN_DEFAULT(captureIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + ret = captureIns->GetVolume(captureIns, &vol); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("GetVolume failed!"); + return HDF_FAILURE; + } + + if (muteFlag) { + priData->tempVolume = vol; + setVol = 0; + } else { + setVol = priData->tempVolume; + } + captureIns->SetVolume(captureIns, setVol); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("SetVolume failed!"); + return HDF_FAILURE; + } + captureIns->muteState = muteFlag; + return HDF_SUCCESS; +} + +static int32_t CaptureStartImpl(struct AlsaCapture *captureIns) +{ + struct AlsaMixerCtlElement mixerItem; + CHECK_NULL_PTR_RETURN_DEFAULT(captureIns); + + SndElementItemInit(&mixerItem); + mixerItem.numid = SND_NUMID_CAPUTRE_MIC_PATH; + mixerItem.name = SND_ELEM_CAPUTRE_MIC_PATH; + mixerItem.value = SND_IN_CARD_MAIN_MIC; + SndElementWrite(&captureIns->soundCard, &mixerItem); + + return HDF_SUCCESS; +} + +static int32_t CaptureStopImpl(struct AlsaCapture *captureIns) +{ + struct AlsaMixerCtlElement mixerItem; + CHECK_NULL_PTR_RETURN_DEFAULT(captureIns); + + SndElementItemInit(&mixerItem); + mixerItem.numid = SND_NUMID_CAPUTRE_MIC_PATH; + mixerItem.name = SND_ELEM_CAPUTRE_MIC_PATH; + mixerItem.value = SND_IN_CARD_MIC_OFF; + SndElementWrite(&captureIns->soundCard, &mixerItem); + snd_pcm_drop(captureIns->soundCard.pcmHandle); + return HDF_SUCCESS; +} + +static int32_t CaptureGetGainThresholdImpl(struct AlsaCapture *captureIns, float *gainMin, float *gainMax) +{ + AUDIO_FUNC_LOGE("8541e not support gain operation"); + return HDF_SUCCESS; +} + +static int32_t CaptureGetGainImpl(struct AlsaCapture *captureIns, float *volume) +{ + AUDIO_FUNC_LOGE("8541e not support gain operation"); + return HDF_SUCCESS; +} + +static int32_t CaptureSetGainImpl(struct AlsaCapture *captureIns, float volume) +{ + AUDIO_FUNC_LOGE("8541e not support gain operation"); + return HDF_SUCCESS; +} + +static bool CaptureGetMuteImpl(struct AlsaCapture *captureIns) +{ + return captureIns->muteState; +} + +int32_t CaptureOverrideFunc(struct AlsaCapture *captureIns) +{ + if (captureIns == NULL) { + return HDF_FAILURE; + } + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)captureIns; + + if (cardIns->cardType == SND_CARD_PRIMARY) { + captureIns->Init = CaptureInitImpl; + captureIns->SelectScene = CaptureSelectSceneImpl; + captureIns->Start = CaptureStartImpl; + captureIns->Stop = CaptureStopImpl; + captureIns->GetVolThreshold = CaptureGetVolThresholdImpl; + captureIns->GetVolume = CaptureGetVolumeImpl; + captureIns->SetVolume = CaptureSetVolumeImpl; + captureIns->GetGainThreshold = CaptureGetGainThresholdImpl; + captureIns->GetGain = CaptureGetGainImpl; + captureIns->SetGain = CaptureSetGainImpl; + captureIns->GetMute = CaptureGetMuteImpl; + captureIns->SetMute = CaptureSetMuteImpl; + } + + return HDF_SUCCESS; +} \ No newline at end of file diff --git a/device_board_phytium/d2000/audio_alsa/vendor_render.c b/device_board_phytium/d2000/audio_alsa/vendor_render.c new file mode 100755 index 0000000000000000000000000000000000000000..b275d30eb09da79c426f9d53e12d101c36a4d797 --- /dev/null +++ b/device_board_phytium/d2000/audio_alsa/vendor_render.c @@ -0,0 +1,261 @@ +/* + * 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 + * + * 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 "alsa_snd_render.h" +#include "common.h" + +#define HDF_LOG_TAG HDF_AUDIO_HAL_RENDER + +typedef struct _RENDER_DATA_ { + struct AlsaMixerCtlElement ctrlLeftVolume; + struct AlsaMixerCtlElement ctrlRightVolume; + long tempVolume; +}RenderData; + +static int32_t RenderInitImpl(struct AlsaRender *renderIns) +{ + if (renderIns->priData != NULL) { + return HDF_SUCCESS; + } + CHECK_NULL_PTR_RETURN_DEFAULT(renderIns); + + RenderData *priData = (RenderData *)OsalMemCalloc(sizeof(RenderData)); + if (priData == NULL) { + AUDIO_FUNC_LOGE("Failed to allocate memory!"); + return HDF_FAILURE; + } + + SndElementItemInit(&priData->ctrlLeftVolume); + SndElementItemInit(&priData->ctrlRightVolume); + priData->ctrlLeftVolume.numid = SND_NUMID_DACL_PLAYBACK_VOL; + priData->ctrlLeftVolume.name = SND_ELEM_DACL_PLAYBACK_VOL; + priData->ctrlRightVolume.numid = SND_NUMID_DACR_PLAYBACK_VOL; + priData->ctrlRightVolume.name = SND_ELEM_DACR_PLAYBACK_VOL; + RenderSetPriData(renderIns, (RenderPriData)priData); + + return HDF_SUCCESS; +} + +static int32_t RenderSelectSceneImpl(struct AlsaRender *renderIns, enum AudioPortPin descPins, + const struct PathDeviceInfo *deviceInfo) +{ + renderIns->descPins = descPins; + return HDF_SUCCESS; +} + +static int32_t RenderGetVolThresholdImpl(struct AlsaRender *renderIns, long *volMin, long *volMax) +{ + int32_t ret; + long _volMin = 0; + long _volMax = 0; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + RenderData *priData = RenderGetPriData(renderIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = SndElementReadRange(cardIns, &priData->ctrlLeftVolume, &_volMin, &_volMax); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("SndElementReadRange fail!"); + return HDF_FAILURE; + } + *volMin = _volMin; + *volMax = _volMax; + + return HDF_SUCCESS; +} + +static int32_t RenderGetVolumeImpl(struct AlsaRender *renderIns, long *volume) +{ + int32_t ret; + long volLeft = 0; + long volRight = 0; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + RenderData *priData = RenderGetPriData(renderIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = SndElementReadInt(cardIns, &priData->ctrlLeftVolume, &volLeft); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Read left volume fail!"); + return HDF_FAILURE; + } + ret = SndElementReadInt(cardIns, &priData->ctrlRightVolume, &volRight); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Read right volume fail!"); + return HDF_FAILURE; + } + *volume = (volLeft + volRight) >> 1; + + return HDF_SUCCESS; +} + +static int32_t RenderSetVolumeImpl(struct AlsaRender *renderIns, long volume) +{ + int32_t ret; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + RenderData *priData = RenderGetPriData(renderIns); + CHECK_NULL_PTR_RETURN_DEFAULT(cardIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = SndElementWriteInt(cardIns, &priData->ctrlLeftVolume, volume); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Write left volume fail!"); + return HDF_FAILURE; + } + ret = SndElementWriteInt(cardIns, &priData->ctrlRightVolume, volume); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("Write right volume fail!"); + return HDF_FAILURE; + } + + return HDF_SUCCESS; +} + +static bool RenderGetMuteImpl(struct AlsaRender *renderIns) +{ + return renderIns->muteState; +} + +static int32_t RenderSetMuteImpl(struct AlsaRender *renderIns, bool muteFlag) +{ + int32_t ret; + long vol, setVol; + RenderData *priData = RenderGetPriData(renderIns); + CHECK_NULL_PTR_RETURN_DEFAULT(renderIns); + CHECK_NULL_PTR_RETURN_DEFAULT(priData); + + ret = renderIns->GetVolume(renderIns, &vol); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("GetVolume failed!"); + return HDF_FAILURE; + } + + if (muteFlag) { + priData->tempVolume = vol; + setVol = 0; + } else { + setVol = priData->tempVolume; + } + + renderIns->SetVolume(renderIns, setVol); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("SetVolume failed!"); + return HDF_FAILURE; + } + renderIns->muteState = muteFlag; + + return HDF_SUCCESS; +} + +static int32_t RenderStartImpl(struct AlsaRender *renderIns) +{ + int32_t ret; + struct AlsaMixerCtlElement elem; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + + SndElementItemInit(&elem); + elem.numid = SND_NUMID_PLAYBACK_PATH; + elem.name = SND_ELEM_PLAYBACK_PATH; + switch (renderIns->descPins) { + case PIN_OUT_SPEAKER: + elem.value = SND_OUT_CARD_SPK_HP; + break; + case PIN_OUT_HEADSET: + elem.value = SND_OUT_CARD_HP; + break; + default: + elem.value = SND_OUT_CARD_SPK_HP; + } + + ret = SndElementWrite(cardIns, &elem); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("write render fail!"); + return HDF_FAILURE; + } + + return HDF_SUCCESS; +} + +static int32_t RenderStopImpl(struct AlsaRender *renderIns) +{ + int32_t ret; + struct AlsaMixerCtlElement elem; + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + + SndElementItemInit(&elem); + elem.numid = SND_NUMID_PLAYBACK_PATH; + elem.name = SND_ELEM_PLAYBACK_PATH; + elem.value = SND_OUT_CARD_OFF; + ret = SndElementWrite(cardIns, &elem); + if (ret != HDF_SUCCESS) { + AUDIO_FUNC_LOGE("write render fail!"); + return HDF_FAILURE; + } + + snd_pcm_drain(renderIns->soundCard.pcmHandle); + return HDF_SUCCESS; +} + +static int32_t RenderGetGainThresholdImpl(struct AlsaRender *renderIns, float *gainMin, float *gainMax) +{ + AUDIO_FUNC_LOGI("Not support gain operation"); + return HDF_SUCCESS; +} + +static int32_t RenderGetGainImpl(struct AlsaRender *renderIns, float *volume) +{ + AUDIO_FUNC_LOGI("Not support gain operation"); + return HDF_SUCCESS; +} + +static int32_t RenderSetGainImpl(struct AlsaRender *renderIns, float volume) +{ + AUDIO_FUNC_LOGI("Not support gain operation"); + return HDF_SUCCESS; +} + +static int32_t RenderGetChannelModeImpl(struct AlsaRender *renderIns, enum AudioChannelMode *mode) +{ + return HDF_SUCCESS; +} + +static int32_t RenderSetChannelModeImpl(struct AlsaRender *renderIns, enum AudioChannelMode mode) +{ + return HDF_SUCCESS; +} + +int32_t RenderOverrideFunc(struct AlsaRender *renderIns) +{ + struct AlsaSoundCard *cardIns = (struct AlsaSoundCard *)renderIns; + + if (cardIns->cardType == SND_CARD_PRIMARY) { + renderIns->Init = RenderInitImpl; + renderIns->SelectScene = RenderSelectSceneImpl; + renderIns->Start = RenderStartImpl; + renderIns->Stop = RenderStopImpl; + renderIns->GetVolThreshold = RenderGetVolThresholdImpl; + renderIns->GetVolume = RenderGetVolumeImpl; + renderIns->SetVolume = RenderSetVolumeImpl; + renderIns->GetGainThreshold = RenderGetGainThresholdImpl; + renderIns->GetGain = RenderGetGainImpl; + renderIns->SetGain = RenderSetGainImpl; + renderIns->GetMute = RenderGetMuteImpl; + renderIns->SetMute = RenderSetMuteImpl; + renderIns->GetChannelMode = RenderGetChannelModeImpl; + renderIns->SetChannelMode = RenderSetChannelModeImpl; + } + + return HDF_SUCCESS; +} diff --git a/device_board_phytium/d2000/cfg/BUILD.gn b/device_board_phytium/d2000/cfg/BUILD.gn index 6640e7cdf379a8caf1cc9520b8b71ed8d0e848da..5e73b3012a2a653c24641d9803d791080492b7e8 100755 --- a/device_board_phytium/d2000/cfg/BUILD.gn +++ b/device_board_phytium/d2000/cfg/BUILD.gn @@ -15,21 +15,21 @@ import("//build/ohos.gni") ohos_prebuilt_etc("init.d2000.cfg") { source = "init.d2000.cfg" - part_name = "phytium_products" + part_name = "device_d2000" install_images = [ chipset_base_dir ] install_enable = true } ohos_prebuilt_etc("init.d2000.usb.cfg") { source = "init.d2000.usb.cfg" - part_name = "phytium_products" + part_name = "device_d2000" install_images = [ chipset_base_dir ] install_enable = true } ohos_prebuilt_etc("fstab.d2000") { source = "fstab.d2000" - part_name = "phytium_products" + part_name = "device_d2000" install_images = [ vendor_base_dir ] install_enable = true } @@ -37,7 +37,7 @@ ohos_prebuilt_etc("fstab.d2000") { if (enable_ramdisk) { ohos_prebuilt_etc("fstab.required") { source = "fstab.required" - part_name = "phytium_products" + part_name = "device_d2000" install_enable = true install_images = [ "ramdisk", @@ -46,7 +46,7 @@ if (enable_ramdisk) { } else { ohos_prebuilt_etc("fstab.required") { source = "fstab.required" - part_name = "phytium_products" + part_name = "device_d2000" install_images = [ "system" ] install_enable = true } diff --git a/device_board_phytium/d2000/distributedhardware/BUILD.gn b/device_board_phytium/d2000/distributedhardware/BUILD.gn index 46562279d421ee94feaf3bf8da6704bfe7a4eec7..e5d29e536aeb6489b4ba10e7b8ca6e532c1c4a81 100644 --- a/device_board_phytium/d2000/distributedhardware/BUILD.gn +++ b/device_board_phytium/d2000/distributedhardware/BUILD.gn @@ -17,7 +17,7 @@ ohos_prebuilt_etc("distributed_hardware_components_cfg.json") { install_enable = true module_install_dir = "etc/distributedhardware/" install_images = [ chipset_base_dir ] - part_name = "phytium_products" + part_name = "device_d2000" } ohos_prebuilt_etc("dinput_business_event_whitelist.cfg") { @@ -25,7 +25,7 @@ ohos_prebuilt_etc("dinput_business_event_whitelist.cfg") { install_enable = true module_install_dir = "etc/distributedhardware/" install_images = [ chipset_base_dir ] - part_name = "phytium_products" + part_name = "device_d2000" } group("distributedhardware") { diff --git a/device_board_phytium/d2000/kernel_source/phytium_patch/.gitkeep b/device_board_phytium/d2000/kernel_source/phytium_patch/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/device_board_phytium/d2000/ohos.build b/device_board_phytium/d2000/ohos.build index 0105953eddfb4b5b134a3d6e3911ddb3a4d54cdf..ae67d16f6f7f9884aa2043e2acc876b1649c5436 100755 --- a/device_board_phytium/d2000/ohos.build +++ b/device_board_phytium/d2000/ohos.build @@ -1,7 +1,7 @@ { "subsystem": "phytium_products", "parts": { - "phytium_products": { + "device_d2000": { "module_list": [ "//device/board/phytium/${device_name}:d2000_group" ] diff --git a/device_board_phytium/d2000/patch/0000=arkcompiler-runtime_core=fix_build.patch b/device_board_phytium/d2000/patch/0000=arkcompiler-runtime_core=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..3321d7f4bee3ca57603eab55d4b15a0e31ceac92 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=arkcompiler-runtime_core=fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/static_core/runtime/interpreter/arch/aarch64/macros.h b/static_core/runtime/interpreter/arch/aarch64/macros.h +index 5a7fa62d..c4e4607c 100644 +--- a/static_core/runtime/interpreter/arch/aarch64/macros.h ++++ b/static_core/runtime/interpreter/arch/aarch64/macros.h +@@ -29,7 +29,7 @@ + void const *_label; \ + asm("ldr %[label], [%[dispatch_table], %w[opcode], uxtw #3]" \ + : [label] "=r"(_label) \ +- : [dispatch_table] "r"(DISPATCH_TABLE), [opcode] "r"((uint32_t)(OPCODE)); \ ++ : [dispatch_table] "r"(DISPATCH_TABLE), [opcode] "r"((uint32_t)(OPCODE))); \ + goto *_label; \ + } while (0) + diff --git a/device_board_phytium/d2000/patch/0000=base-global-i18n=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-global-i18n=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..97242abb7229cc9f6a6a6016c91d7338286fde8b --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-global-i18n=fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/frameworks/intl/src/holiday_manager.cpp b/frameworks/intl/src/holiday_manager.cpp +index a5a8697..eb17d98 100644 +--- a/frameworks/intl/src/holiday_manager.cpp ++++ b/frameworks/intl/src/holiday_manager.cpp +@@ -54,7 +54,7 @@ HolidayManager::HolidayManager(const char* path) + char strDate[10]; + size_t resCode = strftime(strDate, sizeof(strDate), "%Y%m%d", &tmObj); + if (resCode == 0) { +- HiLog::Error(LABEL, "Failed: strftime error:%{public}d .", resCode); ++ //HiLog::Error(LABEL, "Failed: strftime error:%{public}d .", resCode); + return; + } + std::string startDate(strDate); diff --git a/device_board_phytium/d2000/patch/0000=base-hiviewdfx-hiview=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-hiviewdfx-hiview=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a76924bb592cc0830b794734b41ddde737f1326 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-hiviewdfx-hiview=fix_build.patch @@ -0,0 +1,39 @@ +diff --git a/adapter/service/idl/src/hiview_service_ability_proxy.cpp b/adapter/service/idl/src/hiview_service_ability_proxy.cpp +index 34f4070a..fd443dab 100644 +--- a/adapter/service/idl/src/hiview_service_ability_proxy.cpp ++++ b/adapter/service/idl/src/hiview_service_ability_proxy.cpp +@@ -65,7 +65,7 @@ int32_t HiviewServiceAbilityProxy::List(const std::string& logType, std::vector< + HIVIEW_LOGE("ReadBulkData failed"); + return HiviewNapiErrCode::ERR_DEFAULT; + } +- HIVIEW_LOGW("file list num:%{public}d", fileInfos.size()); ++ //HIVIEW_LOGW("file list num:%{public}d", fileInfos.size()); + return ERR_OK; + } + +diff --git a/adapter/service/idl/src/hiview_service_ability_stub.cpp b/adapter/service/idl/src/hiview_service_ability_stub.cpp +index 1052b131..d97e814f 100644 +--- a/adapter/service/idl/src/hiview_service_ability_stub.cpp ++++ b/adapter/service/idl/src/hiview_service_ability_stub.cpp +@@ -201,7 +201,7 @@ int32_t HiviewServiceAbilityStub::HandleListRequest(MessageParcel& data, Message + if (ret != ERR_OK) { + return ret; + } +- HIVIEW_LOGW("file list num:%{public}d", fileInfos.size()); ++ //HIVIEW_LOGW("file list num:%{public}d", fileInfos.size()); + sptr ashmem = AshMemoryUtils::GetAshmem(ASH_MEM_NAME, ASH_MEM_SIZE); + if (ashmem == nullptr) { + HIVIEW_LOGE("ge ashmem failed."); +diff --git a/base/event_store/utility/reader/sys_event_doc_reader.cpp b/base/event_store/utility/reader/sys_event_doc_reader.cpp +index 5e5bd5c9..6f101c4e 100644 +--- a/base/event_store/utility/reader/sys_event_doc_reader.cpp ++++ b/base/event_store/utility/reader/sys_event_doc_reader.cpp +@@ -157,7 +157,7 @@ int SysEventDocReader::ReadPages(const DocQuery& query, EntryQueue& entries, int + pageIndex, docPath_.c_str()); + break; + } +- HIVIEW_LOGD("read the next page index=%{public}zu, file=%{public}s", pageIndex, docPath_.c_str()); ++ //HIVIEW_LOGD("read the next page index=%{public}zu, file=%{public}s", pageIndex, docPath_.c_str()); + continue; + } + TryToAddEntry(content, contentSize, query, entries, num); diff --git a/device_board_phytium/d2000/patch/0000=base-location=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-location=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..5d0b390019a21f1ad4e9c4ac2bced1af9e8445be --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-location=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/services/location_gnss/gnss/source/gnss_ability_skeleton.cpp b/services/location_gnss/gnss/source/gnss_ability_skeleton.cpp +index c73869a..46ce45c 100644 +--- a/services/location_gnss/gnss/source/gnss_ability_skeleton.cpp ++++ b/services/location_gnss/gnss/source/gnss_ability_skeleton.cpp +@@ -261,8 +261,8 @@ int GnssAbilityStub::OnRemoteRequest(uint32_t code, + AppIdentity identity; + identity.SetPid(callingPid); + identity.SetUid(callingUid); +- LBSLOGI(GNSS, "%{public}s cmd = %{public}u, flags= %{public}d, identity = %{public}s, timestamp = %{public}lld", +- __func__, code, option.GetFlags(), identity.ToString().c_str(), CommonUtils::GetCurrentTimeStamp()); ++ //LBSLOGI(GNSS, "%{public}s cmd = %{public}u, flags= %{public}d, identity = %{public}s, timestamp = %{public}lld", ++ // __func__, code, option.GetFlags(), identity.ToString().c_str(), CommonUtils::GetCurrentTimeStamp()); + + if (data.ReadInterfaceToken() != GetDescriptor()) { + LBSLOGE(GNSS, "invalid token."); diff --git a/device_board_phytium/d2000/patch/0000=base-notification-distributed_notification_service=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-notification-distributed_notification_service=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..dc4311035f110135b2baa6329593975d23ce2eb3 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-notification-distributed_notification_service=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/services/ans/src/reminder_data_manager.cpp b/services/ans/src/reminder_data_manager.cpp +index e9951d4d..5cc90275 100644 +--- a/services/ans/src/reminder_data_manager.cpp ++++ b/services/ans/src/reminder_data_manager.cpp +@@ -948,8 +948,8 @@ void ReminderDataManager::ShowActiveReminderExtendLocked(sptr & + } + uint64_t tempTriggerTime = (*it)->GetTriggerTimeInMilli(); + if (tempTriggerTime < triggerTime) { +- ANSR_LOGE("this reminder triggerTime is less than target triggerTime. " +- "now trigger time is %{public}llu.", tempTriggerTime); ++ //ANSR_LOGE("this reminder triggerTime is less than target triggerTime. " ++ // "now trigger time is %{public}llu.", tempTriggerTime); + continue; + } + if (tempTriggerTime - triggerTime > ReminderRequest::SAME_TIME_DISTINGUISH_MILLISECONDS) { diff --git a/device_board_phytium/d2000/patch/0000=base-startup-appspawn=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-startup-appspawn=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c11d66fdfc16f6db53474c77ff2e0c09f5ff27f --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-startup-appspawn=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/adapter/appspawn_nweb.cpp b/adapter/appspawn_nweb.cpp +index e68813a..4ff24af 100644 +--- a/adapter/appspawn_nweb.cpp ++++ b/adapter/appspawn_nweb.cpp +@@ -46,8 +46,8 @@ struct RenderProcessNode { + + namespace { + constexpr int32_t RENDER_PROCESS_MAX_NUM = 16; +- constexpr int32_t RETRY_MAX_TIMES = 60; +- constexpr int32_t WAIT_NWEB_LIB_MARGIN = 5; ++ //constexpr int32_t RETRY_MAX_TIMES = 60; ++ //constexpr int32_t WAIT_NWEB_LIB_MARGIN = 5; + std::map g_renderProcessMap; + std::mutex g_mutex; + void *g_nwebRenderHandle = nullptr; diff --git a/device_board_phytium/d2000/patch/0000=base-time-time_service=fix_build.patch b/device_board_phytium/d2000/patch/0000=base-time-time_service=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..d199c4ce33aa7591f79944d3b977a85d89b48fb8 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=base-time-time_service=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/services/time/src/ntp_update_time.cpp b/services/time/src/ntp_update_time.cpp +index b286af1..32d0802 100644 +--- a/services/time/src/ntp_update_time.cpp ++++ b/services/time/src/ntp_update_time.cpp +@@ -259,8 +259,8 @@ bool NtpUpdateTime::IsValidNITZTime() + } + auto bootTimeNano = steady_clock::now().time_since_epoch().count(); + auto bootTimeMilli = bootTimeNano / NANO_TO_MILLISECOND; +- TIME_HILOGI(TIME_MODULE_SERVICE, "nitz update time: %{public}" PRIu64 " currentTime: %{public}" PRId64 "", +- nitzUpdateTimeMilli_, bootTimeMilli); ++ //TIME_HILOGI(TIME_MODULE_SERVICE, "nitz update time: %{public}" PRIu64 " currentTime: %{public}" PRId64 "", ++ // nitzUpdateTimeMilli_, bootTimeMilli); + return (bootTimeMilli - static_cast(nitzUpdateTimeMilli_)) < DAY_TO_MILLISECOND; + } + diff --git a/device_board_phytium/d2000/patch/0000=developtools-profiler=fix_build.patch b/device_board_phytium/d2000/patch/0000=developtools-profiler=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..04e7a94d4a8d9f8d7d3345c8aff183fdd062714b --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=developtools-profiler=fix_build.patch @@ -0,0 +1,18 @@ +diff --git a/device/plugins/native_daemon/src/call_stack.cpp b/device/plugins/native_daemon/src/call_stack.cpp +index 5868dd10..e352f712 100644 +--- a/device/plugins/native_daemon/src/call_stack.cpp ++++ b/device/plugins/native_daemon/src/call_stack.cpp +@@ -521,7 +521,12 @@ bool CallStack::DoUnwind2(const VirtualThread &thread, std::vector &c + regs->SetRegsData(tempRegs); + #else + std::shared_ptr regs = std::make_shared(); +- regs->SetRegsData(static_cast(regs_), regsNum_); ++ //regs->SetRegsData(static_cast(regs_), regsNum_); ++ std::vector tempRegs; ++ for (size_t i = 0; i < regsNum_; ++i) { ++ tempRegs.push_back((uintptr_t)regs_[i]); ++ } ++ regs->SetRegsData(tempRegs); + #endif + + unwinder->SetRegs(regs); diff --git a/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_framework=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_framework=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..4153f11d7a7bca2e32ce1abe98e21f0a0ccfb9bb --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_framework=fix_build.patch @@ -0,0 +1,166 @@ +diff --git a/client/src/mirror_player.cpp b/client/src/mirror_player.cpp +index 379ffd5..d94bef0 100644 +--- a/client/src/mirror_player.cpp ++++ b/client/src/mirror_player.cpp +@@ -59,7 +59,7 @@ int32_t MirrorPlayer::SetSurface(const std::string &surfaceId) + + sptr surface = SurfaceUtils::GetInstance()->GetSurface(surfaceUniqueId); + if (!surface) { +- CLOGE("surface is null, surface uniqueId %llu", surfaceUniqueId); ++ //CLOGE("surface is null, surface uniqueId %llu", surfaceUniqueId); + return CAST_ENGINE_ERROR; + } + sptr producer = surface->GetProducer(); +diff --git a/client/src/stream_player.cpp b/client/src/stream_player.cpp +index c2d4a47..83ba09e 100644 +--- a/client/src/stream_player.cpp ++++ b/client/src/stream_player.cpp +@@ -61,7 +61,7 @@ int32_t StreamPlayer::SetSurface(const std::string &surfaceId) + + sptr surface = SurfaceUtils::GetInstance()->GetSurface(surfaceUniqueId); + if (!surface) { +- CLOGE("surface is null, surface uniqueId %llu", surfaceUniqueId); ++ //CLOGE("surface is null, surface uniqueId %llu", surfaceUniqueId); + return CAST_ENGINE_ERROR; + } + sptr producer = surface->GetProducer(); +diff --git a/service/src/cast_service_listener_impl_proxy.cpp b/service/src/cast_service_listener_impl_proxy.cpp +index 1c94af3..6b52de4 100644 +--- a/service/src/cast_service_listener_impl_proxy.cpp ++++ b/service/src/cast_service_listener_impl_proxy.cpp +@@ -50,7 +50,7 @@ bool FillCastRemoteDevices(MessageParcel &data, const std::vector(size))) { +- CLOGE("Failed to write the device size:%u", size); ++ //CLOGE("Failed to write the device size:%u", size); + return false; + } + for (auto &device : devices) { +diff --git a/service/src/device_manager/src/discovery_manager.cpp b/service/src/device_manager/src/discovery_manager.cpp +index 384dd66..cb7417e 100644 +--- a/service/src/device_manager/src/discovery_manager.cpp ++++ b/service/src/device_manager/src/discovery_manager.cpp +@@ -318,7 +318,7 @@ void DiscoveryManager::OnDeviceInfoFound(uint16_t subscribeId, const DmDeviceInf + } + } + remoteDeviceMap[newDevice] = scanCount; +- CLOGD("OnDeviceInfoFound out remoteDeviceMap.size: %{public}u", remoteDeviceMap.size()); ++ //CLOGD("OnDeviceInfoFound out remoteDeviceMap.size: %{public}u", remoteDeviceMap.size()); + } + + void DiscoveryManager::NotifyDeviceIsFound(const CastInnerRemoteDevice &newDevice) +diff --git a/service/src/session/src/channel/src/softbus/softbus_connection.cpp b/service/src/session/src/channel/src/softbus/softbus_connection.cpp +index a20dd62..6e744eb 100644 +--- a/service/src/session/src/channel/src/softbus/softbus_connection.cpp ++++ b/service/src/session/src/channel/src/softbus/softbus_connection.cpp +@@ -216,7 +216,7 @@ std::pair> SoftBusConnection::GetConnec + */ + int SoftBusConnection::OnSendFileProcess(int sessionId, uint64_t bytesUpload, uint64_t bytesTotal) + { +- CLOGD("OnSendFileProcess invoked bytesUpload: %llu, bytesTotal: %llu", bytesUpload, bytesTotal); ++ //CLOGD("OnSendFileProcess invoked bytesUpload: %llu, bytesTotal: %llu", bytesUpload, bytesTotal); + auto ret = GetConnection(sessionId); + if (!ret.first) { + CLOGE("OnSendFileProcess, Get Connection Failed, sessionId = %d.", sessionId); +@@ -285,8 +285,8 @@ int SoftBusConnection::OnReceiveFileStarted(int sessionId, const char *files, in + int SoftBusConnection::OnReceiveFileProcess(int sessionId, const char *firstFile, uint64_t bytesUpload, + uint64_t bytesTotal) + { +- CLOGD("OnReceiveFileProcess invoked, firstFile is: %s, bytesUpload: %llu, bytesTotal: %llu", firstFile, bytesUpload, +- bytesTotal); ++ //CLOGD("OnReceiveFileProcess invoked, firstFile is: %s, bytesUpload: %llu, bytesTotal: %llu", firstFile, bytesUpload, ++ // bytesTotal); + return RET_OK; + } + +@@ -542,4 +542,4 @@ void SoftBusConnection::SetPassiveCloseFlag(bool isPassiveClose) + } + } // namespace CastEngineService + } // namespace CastEngine +-} // namespace OHOS +\ No newline at end of file ++} // namespace OHOS +diff --git a/service/src/session/src/stream/src/local/src/cast_local_file_channel_client.cpp b/service/src/session/src/stream/src/local/src/cast_local_file_channel_client.cpp +index 65e6e85..539aa1e 100644 +--- a/service/src/session/src/stream/src/local/src/cast_local_file_channel_client.cpp ++++ b/service/src/session/src/stream/src/local/src/cast_local_file_channel_client.cpp +@@ -143,7 +143,7 @@ void CastLocalFileChannelClient::AddDataListener(std::shared_ptr + } + std::lock_guard lock(listenerLock_); + dataListeners_.push_back(dataListener); +- CLOGD("listener count %{public}u", dataListeners_.size()); ++ //CLOGD("listener count %{public}u", dataListeners_.size()); + } + + void CastLocalFileChannelClient::RemoveDataListener(std::shared_ptr dataListener) +@@ -154,7 +154,7 @@ void CastLocalFileChannelClient::RemoveDataListener(std::shared_ptr lock(listenerLock_); + dataListeners_.remove(dataListener); +- CLOGD("listener count %{public}u", dataListeners_.size()); ++ //CLOGD("listener count %{public}u", dataListeners_.size()); + } + + bool CastLocalFileChannelClient::ProcessServerResponse(const uint8_t *buffer, unsigned int length, +diff --git a/service/src/session/src/stream/src/local/src/cast_local_file_channel_server.cpp b/service/src/session/src/stream/src/local/src/cast_local_file_channel_server.cpp +index 05384b4..82534dd 100644 +--- a/service/src/session/src/stream/src/local/src/cast_local_file_channel_server.cpp ++++ b/service/src/session/src/stream/src/local/src/cast_local_file_channel_server.cpp +@@ -202,7 +202,7 @@ struct CastLocalFileChannelServer::LocalFileInfo CastLocalFileChannelServer::Fin + int64_t CastLocalFileChannelServer::GetFileLengthByFd(int fd) + { + // This lseek may cause performance issues. Record the consumption time and print. +- auto t1 = std::chrono::steady_clock::now(); ++ //auto t1 = std::chrono::steady_clock::now(); + + off64_t fileLen = lseek64(fd, 0, SEEK_END); + if (fileLen < 0) { +@@ -210,11 +210,11 @@ int64_t CastLocalFileChannelServer::GetFileLengthByFd(int fd) + return -1; + } + +- auto t2 = std::chrono::steady_clock::now(); +- auto cost = std::chrono::duration_cast(t2 - t1); ++ //auto t2 = std::chrono::steady_clock::now(); ++ //auto cost = std::chrono::duration_cast(t2 - t1); + + int64_t ret = static_cast(fileLen); +- CLOGI("file length %lld, time cost %{public}llu ms", fileLen, static_cast(cost.count())); ++ //CLOGI("file length %lld, time cost %{public}llu ms", fileLen, static_cast(cost.count())); + + return ret; + } +@@ -326,16 +326,16 @@ void CastLocalFileChannelServer::ResponseFileDataRequest(const std::string &uri, + + void CastLocalFileChannelServer::ResponseFileRequest(const std::string &uri, int64_t start, int64_t end) + { +- CLOGD("file: %s start: %{public}lld end: %{public}lld", uri.c_str(), start, end); ++ //CLOGD("file: %s start: %{public}lld end: %{public}lld", uri.c_str(), start, end); + + if (uri.empty()) { +- CLOGE("Invalid request, %{public}lld - %{public}lld", start, end); ++ //CLOGE("Invalid request, %{public}lld - %{public}lld", start, end); + return; + } + + int64_t fileLen = FindFileLengthByUri(uri); + if (fileLen <= 0) { +- CLOGE("Invalid file: %s, len %{public}lld", uri.c_str(), fileLen); ++ //CLOGE("Invalid file: %s, len %{public}lld", uri.c_str(), fileLen); + return; + } + +diff --git a/service/src/session/src/stream/src/local/src/local_data_source.cpp b/service/src/session/src/stream/src/local/src/local_data_source.cpp +index 2d425be..50a6dfc 100644 +--- a/service/src/session/src/stream/src/local/src/local_data_source.cpp ++++ b/service/src/session/src/stream/src/local/src/local_data_source.cpp +@@ -121,7 +121,7 @@ int32_t LocalDataSource::ReadAt(uint32_t length, const std::shared_ptr= fileLength_) { + CLOGE("ReadAt EOF, pos:%{public}" PRId64 " fileLength_:%{public}" PRId64, pos, fileLength_); + return Media::SOURCE_ERROR_EOF; diff --git a/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_plus_stream=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_plus_stream=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..589d32985f8d9f6795c2df3d9e2a35f424fed775 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-CastEngine-castengine_cast_plus_stream=fix_build.patch @@ -0,0 +1,107 @@ +diff --git a/src/channel/src/softbus/softbus_connection.cpp b/src/channel/src/softbus/softbus_connection.cpp +index 568a3b9..859b183 100644 +--- a/src/channel/src/softbus/softbus_connection.cpp ++++ b/src/channel/src/softbus/softbus_connection.cpp +@@ -216,7 +216,7 @@ std::pair> SoftBusConnection::GetConnec + */ + int SoftBusConnection::OnSendFileProcess(int sessionId, uint64_t bytesUpload, uint64_t bytesTotal) + { +- CLOGD("OnSendFileProcess invoked bytesUpload: %llu, bytesTotal: %llu", bytesUpload, bytesTotal); ++ //CLOGD("OnSendFileProcess invoked bytesUpload: %llu, bytesTotal: %llu", bytesUpload, bytesTotal); + auto ret = GetConnection(sessionId); + if (!ret.first) { + CLOGE("OnSendFileProcess, Get Connection Failed, sessionId = %d.", sessionId); +@@ -285,8 +285,8 @@ int SoftBusConnection::OnReceiveFileStarted(int sessionId, const char *files, in + int SoftBusConnection::OnReceiveFileProcess(int sessionId, const char *firstFile, uint64_t bytesUpload, + uint64_t bytesTotal) + { +- CLOGD("OnReceiveFileProcess invoked, firstFile is: %s, bytesUpload: %llu, bytesTotal: %llu", firstFile, bytesUpload, +- bytesTotal); ++ //CLOGD("OnReceiveFileProcess invoked, firstFile is: %s, bytesUpload: %llu, bytesTotal: %llu", firstFile, bytesUpload, ++ // bytesTotal); + return RET_OK; + } + +diff --git a/src/stream/src/local/src/cast_local_file_channel_client.cpp b/src/stream/src/local/src/cast_local_file_channel_client.cpp +index 3432c48..c0912be 100644 +--- a/src/stream/src/local/src/cast_local_file_channel_client.cpp ++++ b/src/stream/src/local/src/cast_local_file_channel_client.cpp +@@ -143,7 +143,7 @@ void CastLocalFileChannelClient::AddDataListener(std::shared_ptr + } + std::lock_guard lock(listenerLock_); + dataListeners_.push_back(dataListener); +- CLOGD("listener count %{public}u", dataListeners_.size()); ++ //CLOGD("listener count %{public}u", dataListeners_.size()); + } + + void CastLocalFileChannelClient::RemoveDataListener(std::shared_ptr dataListener) +@@ -154,7 +154,7 @@ void CastLocalFileChannelClient::RemoveDataListener(std::shared_ptr lock(listenerLock_); + dataListeners_.remove(dataListener); +- CLOGD("listener count %{public}u", dataListeners_.size()); ++ //CLOGD("listener count %{public}u", dataListeners_.size()); + } + + bool CastLocalFileChannelClient::ProcessServerResponse(const uint8_t *buffer, unsigned int length, +diff --git a/src/stream/src/local/src/cast_local_file_channel_server.cpp b/src/stream/src/local/src/cast_local_file_channel_server.cpp +index e9b530a..71e9cba 100644 +--- a/src/stream/src/local/src/cast_local_file_channel_server.cpp ++++ b/src/stream/src/local/src/cast_local_file_channel_server.cpp +@@ -202,7 +202,7 @@ struct CastLocalFileChannelServer::LocalFileInfo CastLocalFileChannelServer::Fin + int64_t CastLocalFileChannelServer::GetFileLengthByFd(int fd) + { + // This lseek may cause performance issues. Record the consumption time and print. +- auto t1 = std::chrono::steady_clock::now(); ++ //auto t1 = std::chrono::steady_clock::now(); + + off64_t fileLen = lseek64(fd, 0, SEEK_END); + if (fileLen < 0) { +@@ -210,11 +210,11 @@ int64_t CastLocalFileChannelServer::GetFileLengthByFd(int fd) + return -1; + } + +- auto t2 = std::chrono::steady_clock::now(); +- auto cost = std::chrono::duration_cast(t2 - t1); ++ //auto t2 = std::chrono::steady_clock::now(); ++ //auto cost = std::chrono::duration_cast(t2 - t1); + + int64_t ret = static_cast(fileLen); +- CLOGI("file length %lld, time cost %{public}llu ms", fileLen, static_cast(cost.count())); ++ //CLOGI("file length %lld, time cost %{public}llu ms", fileLen, static_cast(cost.count())); + + return ret; + } +@@ -326,16 +326,16 @@ void CastLocalFileChannelServer::ResponseFileDataRequest(const std::string &uri, + + void CastLocalFileChannelServer::ResponseFileRequest(const std::string &uri, int64_t start, int64_t end) + { +- CLOGD("file: %s start: %{public}lld end: %{public}lld", uri.c_str(), start, end); ++ //CLOGD("file: %s start: %{public}lld end: %{public}lld", uri.c_str(), start, end); + + if (uri.empty()) { +- CLOGE("Invalid request, %{public}lld - %{public}lld", start, end); ++ //CLOGE("Invalid request, %{public}lld - %{public}lld", start, end); + return; + } + + int64_t fileLen = FindFileLengthByUri(uri); + if (fileLen <= 0) { +- CLOGE("Invalid file: %s, len %{public}lld", uri.c_str(), fileLen); ++ //CLOGE("Invalid file: %s, len %{public}lld", uri.c_str(), fileLen); + return; + } + +diff --git a/src/stream/src/local/src/local_data_source.cpp b/src/stream/src/local/src/local_data_source.cpp +index c87cdab..56d01da 100644 +--- a/src/stream/src/local/src/local_data_source.cpp ++++ b/src/stream/src/local/src/local_data_source.cpp +@@ -121,7 +121,7 @@ int32_t LocalDataSource::ReadAt(uint32_t length, const std::shared_ptr= fileLength_) { + CLOGE("ReadAt EOF, pos:%{public}" PRId64 " fileLength_:%{public}" PRId64, pos, fileLength_); + return Media::SOURCE_ERROR_EOF; diff --git a/device_board_phytium/d2000/patch/0000=foundation-ability-ability_runtime=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-ability-ability_runtime=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..73c6b83f790e1b5162f8199a97875d31be17830d --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-ability-ability_runtime=fix_build.patch @@ -0,0 +1,22 @@ +diff --git a/services/abilitymgr/src/ecological_rule/ability_ecological_rule_mgr_service.cpp b/services/abilitymgr/src/ecological_rule/ability_ecological_rule_mgr_service.cpp +index 529ae4010..eda1bbc72 100644 +--- a/services/abilitymgr/src/ecological_rule/ability_ecological_rule_mgr_service.cpp ++++ b/services/abilitymgr/src/ecological_rule/ability_ecological_rule_mgr_service.cpp +@@ -116,7 +116,7 @@ int32_t AbilityEcologicalRuleMgrServiceClient::EvaluateResolveInfos(const AAFwk: + } + int32_t res = ecologicalRuleMgrServiceProxy_->EvaluateResolveInfos(want, callerInfo, type, abilityInfos); + int64_t cost = GetCurrentTimeMicro() - start; +- HILOG_DEBUG("[ERMS-DFX] EvaluateResolveInfos interface cost %{public}lld mirco seconds.", cost); ++ //HILOG_DEBUG("[ERMS-DFX] EvaluateResolveInfos interface cost %{public}lld mirco seconds.", cost); + return res; + } + +@@ -141,7 +141,7 @@ int32_t AbilityEcologicalRuleMgrServiceClient::QueryStartExperience(const OHOS:: + rule.isAllow, rule.sceneCode.c_str(), (*(rule.replaceWant)).ToString().c_str()); + } + int64_t cost = GetCurrentTimeMicro() - start; +- HILOG_DEBUG("[ERMS-DFX] QueryStartExperience interface cost %{public}lld mirco seconds.", cost); ++ //HILOG_DEBUG("[ERMS-DFX] QueryStartExperience interface cost %{public}lld mirco seconds.", cost); + return res; + } + diff --git a/device_board_phytium/d2000/patch/0000=foundation-ability-form_fwk=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-ability-form_fwk=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..d10904f51276f0fef42dfccb1fc85959bd773f62 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-ability-form_fwk=fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/frameworks/js/napi/form_observer/js_form_observer.cpp b/frameworks/js/napi/form_observer/js_form_observer.cpp +index 973792f7..38685539 100644 +--- a/frameworks/js/napi/form_observer/js_form_observer.cpp ++++ b/frameworks/js/napi/form_observer/js_form_observer.cpp +@@ -90,7 +90,7 @@ private: + HILOG_DEBUG("argc is %{public}zu, param range is [%{public}zu, %{public}zu]", + argc, minParamNum, maxParamNum); + if (argc > maxParamNum || argc < minParamNum) { +- HILOG_ERROR("invalid param number %{public}d.", argc); ++ //HILOG_ERROR("invalid param number %{public}d.", argc); + std::string errMsg = "[" + std::to_string(minParamNum) + ", " + std::to_string(maxParamNum) + "]"; + NapiFormUtil::ThrowParamNumError(env, std::to_string(argc), errMsg); + return false; diff --git a/device_board_phytium/d2000/patch/0000=foundation-arkui-ace_engine=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-arkui-ace_engine=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..a12c19d89195e1dc2ff471f6b074319627416740 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-arkui-ace_engine=fix_build.patch @@ -0,0 +1,26 @@ +diff --git a/adapter/ohos/osal/js_accessibility_manager.cpp b/adapter/ohos/osal/js_accessibility_manager.cpp +index abb522ae13..1c04ff701e 100644 +--- a/adapter/ohos/osal/js_accessibility_manager.cpp ++++ b/adapter/ohos/osal/js_accessibility_manager.cpp +@@ -2051,8 +2051,8 @@ bool JsAccessibilityManager::SendAccessibilitySyncEvent( + if (!isEnabled) { + return false; + } +- TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY, "send accessibility event:%{public}d aid:%{public}lld", +- eventInfo.GetEventType(), static_cast(eventInfo.GetAccessibilityId())); ++ //TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY, "send accessibility event:%{public}d aid:%{public}lld", ++ // eventInfo.GetEventType(), static_cast(eventInfo.GetAccessibilityId())); + return client->SendEvent(eventInfo); + } + +@@ -2086,8 +2086,8 @@ bool JsAccessibilityManager::TransferAccessibilityAsyncEvent( + AccessibilityEventInfo eventInfoNew = eventInfo; + eventInfoNew.SetSource(uiExtensionOffset + eventInfo.GetViewId()); + #endif +- TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY, "send accessibility event:%{public}d aid:%{public}lld", +- eventInfoNew.GetEventType(), static_cast(eventInfoNew.GetAccessibilityId())); ++ //TAG_LOGD(AceLogTag::ACE_ACCESSIBILITY, "send accessibility event:%{public}d aid:%{public}lld", ++ // eventInfoNew.GetEventType(), static_cast(eventInfoNew.GetAccessibilityId())); + return client->SendEvent(eventInfoNew); + } + diff --git a/device_board_phytium/d2000/patch/0000=foundation-bundlemanager-bundle_framework=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-bundlemanager-bundle_framework=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..11e8cc57c46aba4743d9a5b6c34a3c27d60a9e3d --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-bundlemanager-bundle_framework=fix_build.patch @@ -0,0 +1,32 @@ +diff --git a/services/bundlemgr/src/free_install/bms_ecological_rule_mgr_service_client.cpp b/services/bundlemgr/src/free_install/bms_ecological_rule_mgr_service_client.cpp +index e0e95fe3f..e2ed9f5e6 100644 +--- a/services/bundlemgr/src/free_install/bms_ecological_rule_mgr_service_client.cpp ++++ b/services/bundlemgr/src/free_install/bms_ecological_rule_mgr_service_client.cpp +@@ -116,11 +116,11 @@ int32_t BmsEcologicalRuleMgrServiceClient::QueryFreeInstallExperience(const OHOS + int32_t res = bmsEcologicalRuleMgrServiceProxy_->QueryFreeInstallExperience(want, callerInfo, rule); + if (rule.replaceWant != nullptr) { + rule.replaceWant->SetParam(ERMS_ORIGINAL_TARGET, want.ToString()); +- APP_LOGD("QueryFreeInstallExperience isAllow = %{public}d, replaceWant = %{public}s", rule.isAllow, +- (*(rule.replaceWant)).ToString().c_str()); ++ //APP_LOGD("QueryFreeInstallExperience isAllow = %{public}d, replaceWant = %{public}s", rule.isAllow, ++ // (*(rule.replaceWant)).ToString().c_str()); + } + int64_t cost = GetCurrentTimeMicro() - start; +- APP_LOGD("[ERMS-DFX] QueryFreeInstallExperience interface cost %{public}lld mirco seconds.", cost); ++ //APP_LOGD("[ERMS-DFX] QueryFreeInstallExperience interface cost %{public}lld mirco seconds.", cost); + return res; + } + +diff --git a/services/bundlemgr/src/installd/installd_operator.cpp b/services/bundlemgr/src/installd/installd_operator.cpp +index 8ad37561a..079f6a2b7 100644 +--- a/services/bundlemgr/src/installd/installd_operator.cpp ++++ b/services/bundlemgr/src/installd/installd_operator.cpp +@@ -810,7 +810,7 @@ int64_t InstalldOperator::GetDiskUsageFromQuota(const int32_t uid) + APP_LOGE("Failed to get quotactl, errno: %{public}d", errno); + return 0; + } +- APP_LOGD("get disk usage from quota, uid: %{public}d, usage: %{public}llu", uid, dq.dqb_curspace); ++ //APP_LOGD("get disk usage from quota, uid: %{public}d, usage: %{public}llu", uid, dq.dqb_curspace); + return dq.dqb_curspace; + } + diff --git a/device_board_phytium/d2000/patch/0000=foundation-communication-bluetooth_service=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-communication-bluetooth_service=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a7c6de72d1ecbdf7406c3bc16219f8f2ba0b341 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-communication-bluetooth_service=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/services/bluetooth/service/src/hfp_ag/hfp_ag_system_event_processer.cpp b/services/bluetooth/service/src/hfp_ag/hfp_ag_system_event_processer.cpp +index 24c59b4..ed4d72e 100644 +--- a/services/bluetooth/service/src/hfp_ag/hfp_ag_system_event_processer.cpp ++++ b/services/bluetooth/service/src/hfp_ag/hfp_ag_system_event_processer.cpp +@@ -167,8 +167,8 @@ void HfpAgSystemEventProcesser::ProcessDialOutCallEvent(const std::string &numbe + return; + } + +- LOG_INFO("[HFP AG]%{public}s():: dialNumber length[%{public}d], dialType[%{public}d]", __FUNCTION__, +- dialNumber.length(), dialType); ++ //LOG_INFO("[HFP AG]%{public}s():: dialNumber length[%{public}d], dialType[%{public}d]", __FUNCTION__, ++ // dialNumber.length(), dialType); + + if (dialNumber.length() == 0) { + profile_.SendResultCode(HFP_AG_RESULT_ERROR); diff --git a/device_board_phytium/d2000/patch/0000=foundation-communication-netmanager_base=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-communication-netmanager_base=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..a35e32f3d3854c839aefa87f4a019590322d9d76 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-communication-netmanager_base=fix_build.patch @@ -0,0 +1,48 @@ +diff --git a/frameworks/native/netstatsclient/src/proxy/net_stats_service_proxy.cpp b/frameworks/native/netstatsclient/src/proxy/net_stats_service_proxy.cpp +index 7360449c..dad49455 100644 +--- a/frameworks/native/netstatsclient/src/proxy/net_stats_service_proxy.cpp ++++ b/frameworks/native/netstatsclient/src/proxy/net_stats_service_proxy.cpp +@@ -412,7 +412,7 @@ int32_t NetStatsServiceProxy::GetCookieRxBytes(uint64_t &stats, uint64_t cookie) + return NETMANAGER_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL; + } + if (!data.WriteUint64(cookie)) { +- NETMGR_LOG_E("proxy cookie%{public}llu", cookie); ++ //NETMGR_LOG_E("proxy cookie%{public}llu", cookie); + return NETMANAGER_ERR_WRITE_DATA_FAIL; + } + +@@ -438,7 +438,7 @@ int32_t NetStatsServiceProxy::GetCookieTxBytes(uint64_t &stats, uint64_t cookie) + return NETMANAGER_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL; + } + if (!data.WriteUint64(cookie)) { +- NETMGR_LOG_E("proxy cookie%{public}llu", cookie); ++ //NETMGR_LOG_E("proxy cookie%{public}llu", cookie); + return NETMANAGER_ERR_WRITE_DATA_FAIL; + } + +diff --git a/services/netmanagernative/src/netsys/dnsresolv/dns_quality_diag.cpp b/services/netmanagernative/src/netsys/dnsresolv/dns_quality_diag.cpp +index 96fcb85b..7034e38f 100644 +--- a/services/netmanagernative/src/netsys/dnsresolv/dns_quality_diag.cpp ++++ b/services/netmanagernative/src/netsys/dnsresolv/dns_quality_diag.cpp +@@ -235,7 +235,7 @@ int32_t DnsQualityDiag::send_dns_report() + if (report_.size() > 0) { + std::list reportSend(report_); + report_.clear(); +- NETNATIVE_LOG_D("send_dns_report (%{public}u)", reportSend.size()); ++ //NETNATIVE_LOG_D("send_dns_report (%{public}u)", reportSend.size()); + for (auto cb: resultListeners_) { + NETNATIVE_LOGI("send_dns_report cb)"); + cb->OnDnsResultReport(reportSend.size(), reportSend); +diff --git a/services/netsyscontroller/src/netsys_controller_service_impl.cpp b/services/netsyscontroller/src/netsys_controller_service_impl.cpp +index 8ebbdcda..dba6b51a 100644 +--- a/services/netsyscontroller/src/netsys_controller_service_impl.cpp ++++ b/services/netsyscontroller/src/netsys_controller_service_impl.cpp +@@ -739,7 +739,7 @@ int32_t NetsysControllerServiceImpl::UnregisterDnsHealthCallback(const sptrlen, msg->data, msg->len); + if (result != EOK) { +- NETSTACK_LOGE("memcpy err, res: %{public}d, msg: %{public}s, len: %{public}u", result, +- reinterpret_cast(msg->data), msg->len); ++ //NETSTACK_LOGE("memcpy err, res: %{public}d, msg: %{public}s, len: %{public}u", result, ++ // reinterpret_cast(msg->data), msg->len); + return NapiUtils::GetUndefined(env); + } + return MakeJsLocalSocketMessageParam(env, msgBuffer, msg); diff --git a/device_board_phytium/d2000/patch/0000=foundation-communication-wifi=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-communication-wifi=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..f956af139b709c166d6a4b3b8dd82e7f879b3e83 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-communication-wifi=fix_build.patch @@ -0,0 +1,37 @@ +diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_stub.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_stub.cpp +index f1ac7829..cf3762b4 100644 +--- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_stub.cpp ++++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_stub.cpp +@@ -190,7 +190,7 @@ void WifiDeviceStub::RemoveDeviceCbDeathRecipient(const wptr &rem + static_cast(deathRecipient_), static_cast(iter->second)); + remoteObject->RemoveDeathRecipient(iter->second); + remoteDeathMap.erase(iter); +- WIFI_LOGI("remove death recipient success! remoteDeathMap.size: %{public}d.", remoteDeathMap.size()); ++ //WIFI_LOGI("remove death recipient success! remoteDeathMap.size: %{public}d.", remoteDeathMap.size()); + } + } + +@@ -818,8 +818,8 @@ void WifiDeviceStub::OnRegisterCallBack(uint32_t code, MessageParcel &data, Mess + if (iter == remoteDeathMap.end()) { + std::lock_guard lock(mutex_); + remoteDeathMap.insert(std::make_pair(remote, deathRecipient_)); +- WIFI_LOGI("OnRegisterCallBack, AddDeathRecipient, remote: %{public}p, remoteDeathMap.size: %{public}d", +- static_cast(remote), remoteDeathMap.size()); ++ //WIFI_LOGI("OnRegisterCallBack, AddDeathRecipient, remote: %{public}p, remoteDeathMap.size: %{public}d", ++ // static_cast(remote), remoteDeathMap.size()); + if ((remote->IsProxyObject()) && (!remote->AddDeathRecipient(deathRecipient_))) { + WIFI_LOGI("AddDeathRecipient!"); + } +diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/config/wifi_settings.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/config/wifi_settings.cpp +index c80a93a6..1c5b51a3 100644 +--- a/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/config/wifi_settings.cpp ++++ b/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/config/wifi_settings.cpp +@@ -451,7 +451,7 @@ int WifiSettings::GetScanInfoList(std::vector &results) + results.push_back(*iter); + ++iter; + } +- LOGI("WifiSettings::GetScanInfoList size = %{public}u", results.size()); ++ //LOGI("WifiSettings::GetScanInfoList size = %{public}u", results.size()); + return 0; + } + diff --git a/device_board_phytium/d2000/patch/0000=foundation-distributeddatamgr-datamgr_service=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-distributeddatamgr-datamgr_service=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..cf858137df74cc854abb7d504ca0b5d1f6e67bb9 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-distributeddatamgr-datamgr_service=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp +index 593ee190..cc0c0170 100644 +--- a/services/distributeddataservice/service/data_share/data_share_service_stub.cpp ++++ b/services/distributeddataservice/service/data_share/data_share_service_stub.cpp +@@ -333,8 +333,8 @@ int DataShareServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Me + auto finish = std::chrono::steady_clock::now(); + auto duration = std::chrono::duration_cast(finish - start); + if (duration >= TIME_THRESHOLD) { +- ZLOGW("over time, code:%{public}u callingPid:%{public}d, cost:%{public}" PRIi64 "ms", +- code, callingPid, duration.count()); ++ //ZLOGW("over time, code:%{public}u callingPid:%{public}d, cost:%{public}" PRIi64 "ms", ++ // code, callingPid, duration.count()); + } + } + return res; diff --git a/device_board_phytium/d2000/patch/0000=foundation-filemanagement-dfs_service=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-filemanagement-dfs_service=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..db2a65a0bafe1fefefa9d871d49b08b70de7fd17 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-filemanagement-dfs_service=fix_build.patch @@ -0,0 +1,26 @@ +diff --git a/services/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_handler.cpp b/services/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_handler.cpp +index 9fae30cd..c007dbf4 100644 +--- a/services/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_handler.cpp ++++ b/services/cloudsyncservice/src/data_sync/gallery_data_sync/file_data_handler.cpp +@@ -3782,8 +3782,8 @@ void FileDataHandler::UpdateThmVec() + vector fileIds = vector(size); + BatchGetFileIdFromCloudId(tmp, fileIds); + ret = BatchUpdate(sql, PC::PHOTO_CLOUD_ID, tmp, count); +- LOGI("update size is %{public}zu, success count is %{public}lld, fail count is %{public}zu", +- size, count, tmp.size()); ++ //LOGI("update size is %{public}zu, success count is %{public}lld, fail count is %{public}zu", ++ // size, count, tmp.size()); + if (ret != E_OK) { + LOGW("update thm fail"); + std::lock_guard lock(thmMutex_); +@@ -3822,8 +3822,8 @@ void FileDataHandler::UpdateLcdVec() + lcdVec_.erase(lcdVec_.begin(), lcdVec_.begin() + size); + } + ret = BatchUpdate(sql, PC::PHOTO_CLOUD_ID, tmp, count); +- LOGI("update size is %{public}zu, success count is %{public}lld, fail count is %{public}zu", +- size, count, tmp.size()); ++ //LOGI("update size is %{public}zu, success count is %{public}lld, fail count is %{public}zu", ++ // size, count, tmp.size()); + if (ret != E_OK) { + LOGW("update thm fail"); + std::lock_guard lock(lcdMutex_); diff --git a/device_board_phytium/d2000/patch/0000=foundation-graphic-graphic_2d=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-graphic-graphic_2d=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..284f8269368a36de106229980786b6e4d3afe7d5 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-graphic-graphic_2d=fix_build.patch @@ -0,0 +1,76 @@ +diff --git a/rosen/modules/2d_graphics/src/drawing/recording/draw_cmd_list.cpp b/rosen/modules/2d_graphics/src/drawing/recording/draw_cmd_list.cpp +index bf7772e5a..6225e4f36 100644 +--- a/rosen/modules/2d_graphics/src/drawing/recording/draw_cmd_list.cpp ++++ b/rosen/modules/2d_graphics/src/drawing/recording/draw_cmd_list.cpp +@@ -192,7 +192,7 @@ std::string DrawCmdList::GetOpsWithDesc() const + desc += typeOpDes[item->GetType()]; + desc += "\n"; + } +- LOGI("DrawCmdList::GetOpsWithDesc %{public}s, opitem sz: %{public}u", desc.c_str(), drawOpItems_.size()); ++ //LOGI("DrawCmdList::GetOpsWithDesc %{public}s, opitem sz: %{public}u", desc.c_str(), drawOpItems_.size()); + return desc; + } + +diff --git a/rosen/modules/render_service/core/pipeline/rs_hardware_thread.cpp b/rosen/modules/render_service/core/pipeline/rs_hardware_thread.cpp +index dc99a5e2f..2447c0415 100644 +--- a/rosen/modules/render_service/core/pipeline/rs_hardware_thread.cpp ++++ b/rosen/modules/render_service/core/pipeline/rs_hardware_thread.cpp +@@ -299,7 +299,7 @@ void RSHardwareThread::ExecuteSwitchRefreshRate(uint32_t refreshRate) + static_cast(id), refreshRate); + int32_t status = hgmCore.SetScreenRefreshRate(id, 0, refreshRate); + if (status < EXEC_SUCCESS) { +- RS_LOGD("RSHardwareThread: failed to set refreshRate %{public}d, screenId %{public}llu", refreshRate, id); ++ //RS_LOGD("RSHardwareThread: failed to set refreshRate %{public}d, screenId %{public}llu", refreshRate, id); + } + } + } +diff --git a/rosen/modules/render_service_base/src/platform/ohos/rs_jank_stats.cpp b/rosen/modules/render_service_base/src/platform/ohos/rs_jank_stats.cpp +index 9236a63bf..9e1d2082d 100644 +--- a/rosen/modules/render_service_base/src/platform/ohos/rs_jank_stats.cpp ++++ b/rosen/modules/render_service_base/src/platform/ohos/rs_jank_stats.cpp +@@ -137,7 +137,7 @@ void RSJankStats::SetRSJankStats() + return; + } + if (missedVsync >= VSYNC_JANK_LOG_THRESHOLED) { +- ROSEN_LOGI("RSJankStats::SetJankStats jank frames %{public}lld", missedVsync); ++ //ROSEN_LOGI("RSJankStats::SetJankStats jank frames %{public}lld", missedVsync); + } + size_t type = JANK_FRAME_INVALID; + if (missedVsync < 6) { // JANK_FRAME_6_FREQ : (0,6) +diff --git a/rosen/modules/render_service_client/core/pipeline/rs_render_thread_visitor.cpp b/rosen/modules/render_service_client/core/pipeline/rs_render_thread_visitor.cpp +index 7d23d2a98..3d7ce281a 100644 +--- a/rosen/modules/render_service_client/core/pipeline/rs_render_thread_visitor.cpp ++++ b/rosen/modules/render_service_client/core/pipeline/rs_render_thread_visitor.cpp +@@ -795,8 +795,8 @@ void RSRenderThreadVisitor::ProcessSurfaceViewInRT(RSSurfaceRenderNode& node) + const auto& property = node.GetRenderProperties(); + sptr surface = SurfaceUtils::GetInstance()->GetSurface(node.GetSurfaceId()); + if (surface == nullptr) { +- RS_LOGE("RSRenderThreadVisitor::ProcessSurfaceViewInRT nodeId is %llu cannot find surface by surfaceId %llu", +- node.GetId(), node.GetSurfaceId()); ++ //RS_LOGE("RSRenderThreadVisitor::ProcessSurfaceViewInRT nodeId is %llu cannot find surface by surfaceId %llu", ++ // node.GetId(), node.GetSurfaceId()); + return; + } + sptr surfaceBuffer; +diff --git a/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp b/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp +index 7866a964e..5724028c0 100644 +--- a/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp ++++ b/rosen/modules/render_service_client/core/ui/rs_surface_node.cpp +@@ -486,14 +486,14 @@ bool RSSurfaceNode::CreateNodeAndSurface(const RSSurfaceRenderNodeConfig& config + #ifndef ROSEN_CROSS_PLATFORM + sptr surface = SurfaceUtils::GetInstance()->GetSurface(surfaceId); + if (surface == nullptr) { +- ROSEN_LOGE("RSSurfaceNode::CreateNodeAndSurface nodeId is %llu cannot find surface by surfaceId %llu", +- GetId(), surfaceId); ++ //ROSEN_LOGE("RSSurfaceNode::CreateNodeAndSurface nodeId is %llu cannot find surface by surfaceId %llu", ++ // GetId(), surfaceId); + return false; + } + surface_ = std::static_pointer_cast( + RSIRenderClient::CreateRenderServiceClient())->CreateRSSurface(surface); + if (surface_ == nullptr) { +- ROSEN_LOGE("RSSurfaceNode::CreateNodeAndSurface nodeId is %llu creat RSSurface fail", GetId()); ++ //ROSEN_LOGE("RSSurfaceNode::CreateNodeAndSurface nodeId is %llu creat RSSurface fail", GetId()); + return false; + } + #endif diff --git a/device_board_phytium/d2000/patch/0000=foundation-multimedia-camera_framework=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-multimedia-camera_framework=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..fc80c8520bfc2ba10a9d1d78ca2c72f5e28b4b7a --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-multimedia-camera_framework=fix_build.patch @@ -0,0 +1,15 @@ +diff --git a/frameworks/js/camera_napi/src/output/photo_output_napi.cpp b/frameworks/js/camera_napi/src/output/photo_output_napi.cpp +index 25caa3c7..53f77de7 100644 +--- a/frameworks/js/camera_napi/src/output/photo_output_napi.cpp ++++ b/frameworks/js/camera_napi/src/output/photo_output_napi.cpp +@@ -98,8 +98,8 @@ void PhotoListener::ExecuteDeferredPhoto(sptr surfaceBuffer) cons + int32_t deferredProcessingType; + surfaceBuffer->GetExtraData()->ExtraGet(OHOS::Camera::imageId, imageId); + surfaceBuffer->GetExtraData()->ExtraGet(OHOS::Camera::deferredProcessingType, deferredProcessingType); +- MEDIA_ERR_LOG("PhotoListener ExecuteDeferredPhoto imageId:%{public}lld, deferredProcessingType:%{public}d", +- imageId, deferredProcessingType); ++ //MEDIA_ERR_LOG("PhotoListener ExecuteDeferredPhoto imageId:%{public}lld, deferredProcessingType:%{public}d", ++ // imageId, deferredProcessingType); + + // create pixelMap to encode + int32_t thumbnailWidth; diff --git a/device_board_phytium/d2000/patch/0000=foundation-multimedia-media_library=fix_build.patch b/device_board_phytium/d2000/patch/0000=foundation-multimedia-media_library=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..9b90915cf8c3a983f8285ba9ebc710b24c2808ba --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=foundation-multimedia-media_library=fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/frameworks/js/src/media_asset_change_request_napi.cpp b/frameworks/js/src/media_asset_change_request_napi.cpp +index 346fa663..9aae3b0a 100644 +--- a/frameworks/js/src/media_asset_change_request_napi.cpp ++++ b/frameworks/js/src/media_asset_change_request_napi.cpp +@@ -884,7 +884,7 @@ static int SavePhotoProxyImage(const string &fileUri, sptr().GetDefaultDisplayId(); + defaultDisplayId = (defaultDisplayId == DISPLAY_ID_INVALID)? 0 : defaultDisplayId; + property_->SetDisplayId(defaultDisplayId); +- WLOGFI("Reset displayId to %{public}llu", defaultDisplayId); ++ //WLOGFI("Reset displayId to %{public}llu", defaultDisplayId); + } + } + +diff --git a/wm/src/window_session_impl.cpp b/wm/src/window_session_impl.cpp +index fd7fe3bed..08ad6a435 100644 +--- a/wm/src/window_session_impl.cpp ++++ b/wm/src/window_session_impl.cpp +@@ -307,7 +307,7 @@ void WindowSessionImpl::SetDefaultDisplayIdIfNeed() + SingletonContainer::Get().GetDefaultDisplayId(); + defaultDisplayId = (defaultDisplayId == DISPLAY_ID_INVALID)? 0 : defaultDisplayId; + property_->SetDisplayId(defaultDisplayId); +- WLOGFI("Reset displayId to %{public}llu", defaultDisplayId); ++ //WLOGFI("Reset displayId to %{public}llu", defaultDisplayId); + } + } + diff --git a/device_board_phytium/d2000/patch/0000=third_party-pulseaudio=fix_build.patch b/device_board_phytium/d2000/patch/0000=third_party-pulseaudio=fix_build.patch new file mode 100644 index 0000000000000000000000000000000000000000..7fa4cf6f32fb428d7891f84dcf55a8a2bc714273 --- /dev/null +++ b/device_board_phytium/d2000/patch/0000=third_party-pulseaudio=fix_build.patch @@ -0,0 +1,13 @@ +diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c +index b1b71aa1e..b3b7122b6 100644 +--- a/src/pulsecore/sink.c ++++ b/src/pulsecore/sink.c +@@ -2828,7 +2828,7 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse + delay_bytes = 0; + if (i->thread_info.move_start_time > 0) { + usec = pa_rtclock_now() - i->thread_info.move_start_time; +- pa_log_debug("Move took %llu usec", usec); ++ //pa_log_debug("Move took %llu usec", usec); + delay_bytes = pa_usec_to_bytes(usec, &s->sample_spec); + } + diff --git a/device_board_phytium/d2000/patch/0001=base-theme-screenlock_mgr=add_retrytimes.patch b/device_board_phytium/d2000/patch/0001=base-theme-screenlock_mgr=add_retrytimes.patch index 6c50740682f5633e1fe0c46e68ab38b64e6dd41b..9821077563752f5c2c90ad63fcab2a1094ad683b 100644 --- a/device_board_phytium/d2000/patch/0001=base-theme-screenlock_mgr=add_retrytimes.patch +++ b/device_board_phytium/d2000/patch/0001=base-theme-screenlock_mgr=add_retrytimes.patch @@ -1,20 +1,20 @@ diff --git a/services/src/screenlock_system_ability.cpp b/services/src/screenlock_system_ability.cpp -index f30d329..e474eb4 100644 +index 307f447..ab00f8a 100644 --- a/services/src/screenlock_system_ability.cpp +++ b/services/src/screenlock_system_ability.cpp -@@ -240,7 +240,8 @@ void ScreenLockSystemAbility::OnSystemReady() +@@ -222,7 +222,8 @@ void ScreenLockSystemAbility::OnSystemReady() { SCLOCK_HILOGI("ScreenLockSystemAbility OnSystemReady started."); bool isExitFlag = false; -- int tryTime = 20; -+ //int tryTime = 20; +- int tryTime = 50; ++ //int tryTime = 50; + int tryTime = 60; int minTryTime = 0; while (!isExitFlag && (tryTime > minTryTime)) { - if (systemEventListener_ != nullptr) { -@@ -696,4 +697,4 @@ bool ScreenLockSystemAbility::CheckPermission(const std::string &permissionName) - - #endif + if (systemEventListener_ != nullptr && systemReady_) { +@@ -613,4 +614,4 @@ bool ScreenLockSystemAbility::CheckPermission(const std::string &permissionName) + return true; + } } // namespace ScreenLock -} // namespace OHOS \ No newline at end of file diff --git a/device_board_phytium/d2000/patch/0002=build=add_phytium_whitelist.patch b/device_board_phytium/d2000/patch/0002=build=add_phytium_whitelist.patch index 074f9da43dd4338347df17cbc828d5aba88932a2..3460cf11a24c2249584ef2541245db2f9b1f1bb7 100644 --- a/device_board_phytium/d2000/patch/0002=build=add_phytium_whitelist.patch +++ b/device_board_phytium/d2000/patch/0002=build=add_phytium_whitelist.patch @@ -1,18 +1,16 @@ diff --git a/compile_standard_whitelist.json b/compile_standard_whitelist.json -index db4d288..7c902f1 100644 +index ce4ca863..9286614a 100644 --- a/compile_standard_whitelist.json +++ b/compile_standard_whitelist.json -@@ -8,7 +8,8 @@ - "third_party/pixman/bundle.json", - "third_party/wayland_standard/bundle.json", - "third_party/wpa_supplicant/wpa_supplicant-2.9_standard/bundle.json", -- "vendor/hihope/rk3568/ohos.build" -+ "vendor/hihope/rk3568/ohos.build", -+ "device/board/phytium/d2000/ohos.build" +@@ -6,6 +6,7 @@ + "device/qemu/arm_virt/linux/ohos.build", + "third_party/flutter/glfw/bundle.json", + "vendor/hihope/rk3568/ohos.build", ++ "device/board/phytium/d2000/ohos.build", + "vendor/hihope/ipcamera/ohos.build" ], "subsystem_components": [], - "gn_part_or_subsystem_error": [ -@@ -26,6 +27,12 @@ +@@ -28,6 +29,12 @@ "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vdi_impl", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vendor", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_composer_vdi_impl", @@ -25,7 +23,7 @@ index db4d288..7c902f1 100644 "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy:librockchip_vpu", "//device/soc/rockchip/rk3568/hardware/omx_il/component/common:libRkOMX_Resourcemanager", "//device/soc/rockchip/rk3568/hardware/omx_il/component/video/dec:libomxvpu_dec", -@@ -127,6 +134,12 @@ +@@ -120,6 +127,12 @@ "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vdi_impl", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vendor", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_composer_vdi_impl", @@ -38,7 +36,7 @@ index db4d288..7c902f1 100644 "//device/soc/rockchip/rk3568/hardware/mpp/mpp/hdi_mpp:hdi_mpp", "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy:librockchip_vpu", "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy:rockchip_vpu_src", -@@ -445,6 +458,12 @@ +@@ -410,6 +423,12 @@ "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vendor", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_composer_vdi_impl", "//device/soc/rockchip/rk3568/hardware/display:libhigbm_vendor", @@ -51,7 +49,7 @@ index db4d288..7c902f1 100644 "//device/soc/rockchip/rk3568/hardware/mpp/mpp/hdi_mpp:hdi_mpp", "//device/soc/rockchip/rk3568/hardware/mpp/mpp/legacy:rockchip_vpu_src", "//device/soc/rockchip/rk3568/hardware/omx_il/component/common:RkOMX_Basecomponent", -@@ -502,6 +521,12 @@ +@@ -458,6 +477,12 @@ "//device/soc/rockchip/rk3568/hardware/display:display_composer_vendor", "//device/soc/rockchip/rk3568/hardware/display:libdisplay_buffer_vendor", "//device/soc/rockchip/rk3568/hardware/display:libhigbm_vendor", @@ -61,6 +59,6 @@ index db4d288..7c902f1 100644 + "//device/soc/phytium/d2000/hardware/display:libdisplay_buffer_vendor", + "//device/soc/phytium/d2000/hardware/display:libdisplay_composer_vdi_impl", + "//device/soc/phytium/d2000/hardware/display:libhigbm_vendor", - "//drivers/peripheral/audio/effect/model:effect_model_service_1.0", "//drivers/peripheral/codec/test/demo/adapter:codec_hdi_adapter_decode", "//drivers/peripheral/codec/test/demo/adapter:codec_hdi_adapter_encode", + "//drivers/peripheral/codec/test/demo/v2.0:codec_hdi_omx_decode", diff --git a/device_board_phytium/d2000/patch/0003=developtools-integration_verification=add_alsa_in_chipsetsdk_whitelist.patch b/device_board_phytium/d2000/patch/0003=developtools-integration_verification=add_alsa_in_chipsetsdk_whitelist.patch index a1b308027057a785e8b6d9fe0570437e8260fabd..8591d7a248b6c953ec2358a122e9fdf0c1530738 100644 --- a/device_board_phytium/d2000/patch/0003=developtools-integration_verification=add_alsa_in_chipsetsdk_whitelist.patch +++ b/device_board_phytium/d2000/patch/0003=developtools-integration_verification=add_alsa_in_chipsetsdk_whitelist.patch @@ -1,25 +1,12 @@ -From edee0410f2bdf9541f2ee81ec154dcb38d466e9b Mon Sep 17 00:00:00 2001 -From: zhangjianwei -Date: Thu, 16 Nov 2023 18:08:51 +0800 -Subject: [PATCH] chipsetsdk whitelist - -Change-Id: Ie72800b1b20bec54df5c19ff092a64515c301c21 ---- - tools/deps_guard/rules/ChipsetSDK/whitelist.json | 1 + - 1 file changed, 1 insertion(+) - diff --git a/tools/deps_guard/rules/ChipsetSDK/whitelist.json b/tools/deps_guard/rules/ChipsetSDK/whitelist.json -index 0a44cb1..fa66344 100755 +index c08829f..454fb94 100755 --- a/tools/deps_guard/rules/ChipsetSDK/whitelist.json +++ b/tools/deps_guard/rules/ChipsetSDK/whitelist.json -@@ -45,6 +45,7 @@ +@@ -33,6 +33,7 @@ "libsamgr_proxy.z.so", "libhril_innerkits.z.so", "libpower_proxy_1.0.z.so", + "libasound.so", "libbuffer_producer_sequenceable_1.0.z.so", - "libbuffer_handle_sequenceable_1.0.z.so", --- -2.25.1 - + diff --git a/device_board_phytium/d2000/patch/0004=drivers-peripheral=support_alsa.patch b/device_board_phytium/d2000/patch/0004=drivers-peripheral=support_alsa.patch index 0d38519349da9246e3edfb8ca9521d8a2abfd018..d6bfcc29d7bcd75be159fe99210ceabf3be0c05b 100644 --- a/device_board_phytium/d2000/patch/0004=drivers-peripheral=support_alsa.patch +++ b/device_board_phytium/d2000/patch/0004=drivers-peripheral=support_alsa.patch @@ -1,18 +1,8 @@ -From 220e674b72f3eaca4caebd9b2e657a3800d80329 Mon Sep 17 00:00:00 2001 -From: zhangjianwei -Date: Thu, 16 Nov 2023 20:37:48 +0800 -Subject: [PATCH] add alsa utils - -Change-Id: I59c906ae3823ede37748a78f7c13c7da58906250 ---- - audio/bundle.json | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - diff --git a/audio/bundle.json b/audio/bundle.json -index 195a11e90..369650b8e 100755 +index 73a470eb5..57953452a 100755 --- a/audio/bundle.json +++ b/audio/bundle.json -@@ -43,7 +43,8 @@ +@@ -46,7 +46,8 @@ "build": { "sub_component": [ "//drivers/peripheral/audio:hdi_audio", @@ -22,6 +12,3 @@ index 195a11e90..369650b8e 100755 ], "test": [ "//drivers/peripheral/audio/test:audio_test_entry", --- -2.25.1 - diff --git a/device_board_phytium/d2000/patch/0005=foundation-graphic-graphic_2d=disable-display-mouse-before-animation-completed.patch b/device_board_phytium/d2000/patch/0005=foundation-graphic-graphic_2d=disable-display-mouse-before-animation-completed.patch new file mode 100644 index 0000000000000000000000000000000000000000..9947bd66fdaa8aad646b680eab8eed02d5771b72 --- /dev/null +++ b/device_board_phytium/d2000/patch/0005=foundation-graphic-graphic_2d=disable-display-mouse-before-animation-completed.patch @@ -0,0 +1,13 @@ +diff --git a/frameworks/bootanimation/include/boot_animationconfig.h b/frameworks/bootanimation/include/boot_animationconfig.h +index c97b93394..20ccb7fba 100644 +--- a/frameworks/bootanimation/include/boot_animationconfig.h ++++ b/frameworks/bootanimation/include/boot_animationconfig.h +@@ -36,7 +36,7 @@ public: + bool IsBootVideoEnabled(); + private: + BootCustomConfig custConfig_; +- bool bootVideoEnabled_ = true; ++ bool bootVideoEnabled_ = false; + }; + } // namespace OHOS + diff --git a/device_board_phytium/d2000/patch/0006=base-startup-init=fix_get_fstab_fail_from_cmdline.patch b/device_board_phytium/d2000/patch/0006=base-startup-init=fix_get_fstab_fail_from_cmdline.patch new file mode 100644 index 0000000000000000000000000000000000000000..b51eddca166dbb37d348ac5078ea5b48c9257557 --- /dev/null +++ b/device_board_phytium/d2000/patch/0006=base-startup-init=fix_get_fstab_fail_from_cmdline.patch @@ -0,0 +1,34 @@ +diff --git a/interfaces/innerkits/fs_manager/fstab_mount.c b/interfaces/innerkits/fs_manager/fstab_mount.c +index 65dc09a7..9878c5c3 100755 +--- a/interfaces/innerkits/fs_manager/fstab_mount.c ++++ b/interfaces/innerkits/fs_manager/fstab_mount.c +@@ -480,9 +480,12 @@ int MountAllWithFstabFile(const char *fstabFile, bool required) + BEGET_CHECK(!isFile, return -1); + + Fstab *fstab = NULL; +- if ((fstab = ReadFstabFromFile(fstabFile, false)) == NULL) { +- BEGET_LOGE("[fs_manager][error] Read fstab file \" %s \" failed\n", fstabFile); +- return -1; ++ fstab = LoadFstabFromCommandLine(); ++ if (fstab == NULL) { ++ if ((fstab = ReadFstabFromFile(fstabFile, false)) == NULL) { ++ BEGET_LOGE("[fs_manager][error] Read fstab file \" %s \" failed\n", fstabFile); ++ return -1; ++ } + } + + int rc = MountAllWithFstab(fstab, required); +@@ -497,8 +500,11 @@ int UmountAllWithFstabFile(const char *fstabFile) + BEGET_CHECK(!isFile, return -1); + + Fstab *fstab = NULL; +- fstab = ReadFstabFromFile(fstabFile, false); +- BEGET_ERROR_CHECK(fstab != NULL, return -1, "Read fstab file \" %s \" failed.", fstabFile); ++ fstab = LoadFstabFromCommandLine(); ++ if (fstab == NULL) { ++ fstab = ReadFstabFromFile(fstabFile, false); ++ BEGET_ERROR_CHECK(fstab != NULL, return -1, "Read fstab file \" %s \" failed.", fstabFile); ++ } + + FstabItem *item = NULL; + int rc = -1; diff --git a/device_board_phytium/d2000/patch/0007=drivers-peripheral=omx_calling_modification.patch b/device_board_phytium/d2000/patch/0007=drivers-peripheral=omx_calling_modification.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f1fe741f7f417db0d0e206602f8be8b5b5cc41d --- /dev/null +++ b/device_board_phytium/d2000/patch/0007=drivers-peripheral=omx_calling_modification.patch @@ -0,0 +1,358 @@ +From 87d8c69c7ecf0ddcd3880b0aaddafcb1010fa290 Mon Sep 17 00:00:00 2001 +From: libowen +Date: Tue, 20 Feb 2024 17:22:34 +0800 +Subject: [PATCH] phytium omx decoder component calling modification. + +Change-Id: I39af90ad1f67368f24de2924324bbecf826c55f9 +--- + codec/test/BUILD.gn | 10 +- + .../demo/v2.0/include/codec_packet_reader.h | 2 + + codec/test/demo/v2.0/src/codec_hdi_decode.cpp | 29 +++- + .../demo/v2.0/src/codec_packet_reader.cpp | 155 +++++++++++++++++- + 4 files changed, 183 insertions(+), 13 deletions(-) + +diff --git a/codec/test/BUILD.gn b/codec/test/BUILD.gn +index 2483c37d3..b77df658a 100644 +--- a/codec/test/BUILD.gn ++++ b/codec/test/BUILD.gn +@@ -16,12 +16,12 @@ import("../codec.gni") + group("hdf_test_media_codec") { + testonly = true + deps = [ +- "benchmarktest:hdf_codec_idl_benchmark_test", ++# "benchmarktest:hdf_codec_idl_benchmark_test", + "demo:hdf_demo_codec", +- "fuzztest/hdi_fuzzer:hdf_codec_idl_fuzz_test", +- "fuzztest/image_fuzzer:hdf_jpeg_fuzz_test", +- "fuzztest/omx_fuzzer:hdf_fuzztest_media_codec", +- "unittest:hdf_unittest_codec", ++# "fuzztest/hdi_fuzzer:hdf_codec_idl_fuzz_test", ++# "fuzztest/image_fuzzer:hdf_jpeg_fuzz_test", ++# "fuzztest/omx_fuzzer:hdf_fuzztest_media_codec", ++# "unittest:hdf_unittest_codec", + ] + + if (drivers_peripheral_codec_feature_support_hdi_v1) { +diff --git a/codec/test/demo/v2.0/include/codec_packet_reader.h b/codec/test/demo/v2.0/include/codec_packet_reader.h +index bb6a99045..21897b56f 100644 +--- a/codec/test/demo/v2.0/include/codec_packet_reader.h ++++ b/codec/test/demo/v2.0/include/codec_packet_reader.h +@@ -28,6 +28,8 @@ public: + virtual bool ReadOnePacket(std::ifstream &ioIn, char *buf, uint32_t &filledCount) = 0; + + static Ptr GetPacketReader(const CodecMime &mime); ++ ++ CodecMime codecMime_; + }; + + class CodecH264Reader : public CodecPacketReader { +diff --git a/codec/test/demo/v2.0/src/codec_hdi_decode.cpp b/codec/test/demo/v2.0/src/codec_hdi_decode.cpp +index 8f2ecfa3b..eba219519 100644 +--- a/codec/test/demo/v2.0/src/codec_hdi_decode.cpp ++++ b/codec/test/demo/v2.0/src/codec_hdi_decode.cpp +@@ -179,7 +179,7 @@ int32_t CodecHdiDecode::ConfigPortDefine() + param.format.video.nFrameHeight = height_; + param.format.video.nStride = stride_; + param.format.video.nSliceHeight = height_; +- param.format.video.eColorFormat = omxColorFormat_; ++ //param.format.video.eColorFormat = omxColorFormat_; + err = + client_->SetParameter(client_, OMX_IndexParamPortDefinition, reinterpret_cast(¶m), sizeof(param)); + if (err != HDF_SUCCESS) { +@@ -397,18 +397,20 @@ int32_t CodecHdiDecode::UseBufferOnPort(PortIndex portIndex) + "buffer count [%{public}d], portEnable[%{public}d], err [%{public}d]", + portIndex, bufferSize, bufferCount, portEnable, err); + +- { ++ /*{ + OMX_PARAM_BUFFERSUPPLIERTYPE param; + InitParam(param); + param.nPortIndex = static_cast(portIndex); + err = client_->GetParameter(client_, OMX_IndexParamCompBufferSupplier, reinterpret_cast(¶m), + sizeof(param)); + HDF_LOGI("param.eBufferSupplier[%{public}d] err [%{public}d]", param.eBufferSupplier, err); +- } ++ }*/ + if (useBufferHandle_ && portIndex == PortIndex::PORT_INDEX_OUTPUT) { + err = UseBufferHandle(bufferCount, bufferSize); ++ HDF_LOGE("xxx %{public}s %{public}d", __func__, __LINE__); + } else { + err = UseBufferOnPort(portIndex, bufferCount, bufferSize); ++ HDF_LOGE("xxx %{public}s %{public}d", __func__, __LINE__); + } + + if (err != HDF_SUCCESS) { +@@ -630,6 +632,7 @@ void CodecHdiDecode::Run() + if (eosFlag) { + bufferInfo->omxBuffer->flag = OMX_BUFFERFLAG_EOS; + } ++ bufferInfo->omxBuffer->flag |= OMX_BUFFERFLAG_ENDOFFRAME; + err = client_->EmptyThisBuffer(client_, bufferInfo->omxBuffer.get()); + if (err != HDF_SUCCESS) { + HDF_LOGE("%{public}s EmptyThisBuffer error", __func__); +@@ -645,6 +648,21 @@ void CodecHdiDecode::Run() + HDF_LOGI("decoder costtime %{public}f, count=%{public}d", diff.count(), count_); + // command to IDLE + (void)client_->SendCommand(client_, OMX_CommandStateSet, OMX_StateIdle, NULL, 0); ++ // wait Idle ++ OMX_STATETYPE status = OMX_StateIdle; ++ int32_t tryCount = MAX_WAIT_COUNT; ++ do { ++ int32_t err = client_->GetState(client_, &status); ++ if (err != HDF_SUCCESS) { ++ HDF_LOGE("%s GetState error [%{public}x]", __func__, err); ++ break; ++ } ++ if (status != OMX_StateIdle) { ++ HDF_LOGI("Wait for OMX_StateLoaded status"); ++ this->WaitForStatusChanged(); ++ } ++ tryCount--; ++ } while ((status != OMX_StateLoaded) && (tryCount > 0)); + return; + } + int32_t CodecHdiDecode::OnEvent(struct CodecCallbackType *self, OMX_EVENTTYPE event, struct EventInfo *info) +@@ -684,6 +702,7 @@ int32_t CodecHdiDecode::OnEmptyBufferDone(const struct OmxCodecBuffer &buffer) + + int32_t CodecHdiDecode::OnFillBufferDone(const struct OmxCodecBuffer &buffer) + { ++ HDF_LOGI("OnFillBufferDone Enter!!!"); + if (exit_) { + return HDF_SUCCESS; + } +@@ -695,6 +714,7 @@ int32_t CodecHdiDecode::OnFillBufferDone(const struct OmxCodecBuffer &buffer) + count_++; + // read buffer + auto bufferInfo = iter->second; ++ HDF_LOGI("Returned Buffer length: filledLen = %{public}d !!!", buffer.filledLen); + if (bufferInfo->avSharedPtr != nullptr) { + void *addr = const_cast(bufferInfo->avSharedPtr->ReadFromAshmem(buffer.filledLen, buffer.offset)); + ioOut_.write(static_cast(addr), buffer.filledLen); +@@ -711,12 +731,14 @@ int32_t CodecHdiDecode::OnFillBufferDone(const struct OmxCodecBuffer &buffer) + HDF_LOGI("OnFillBufferDone the END coming"); + return HDF_SUCCESS; + } ++ HDF_LOGI("OnFillBufferDone: Before FillThisBuffer."); + // call fillthisbuffer again + auto err = client_->FillThisBuffer(client_, bufferInfo->omxBuffer.get()); + if (err != HDF_SUCCESS) { + HDF_LOGE("%{public}s FillThisBuffer error", __func__); + return HDF_SUCCESS; + } ++ HDF_LOGI("OnFillBufferDone Leave !!!"); + return HDF_SUCCESS; + } + +@@ -724,6 +746,7 @@ int main(int argc, char *argv[]) + { + CommandOpt opt; + CommandParse parse; ++ HDF_LOGE("xxx %{public}s %{public}d", __func__, __LINE__); + if (!parse.Parse(argc, argv, opt)) { + return HDF_FAILURE; + } +diff --git a/codec/test/demo/v2.0/src/codec_packet_reader.cpp b/codec/test/demo/v2.0/src/codec_packet_reader.cpp +index 56b0c93cc..75b7c11f8 100644 +--- a/codec/test/demo/v2.0/src/codec_packet_reader.cpp ++++ b/codec/test/demo/v2.0/src/codec_packet_reader.cpp +@@ -25,6 +25,59 @@ constexpr char START_CODE = 0x1; + constexpr char VOP_START = 0xB6; + } // namespace + ++typedef enum ++{ ++ H264_NAL_UNKNOWN = 0, ++ H264_NAL_SLICE = 1, ++ H264_NAL_SLICE_DPA = 2, ++ H264_NAL_SLICE_DPB = 3, ++ H264_NAL_SLICE_DPC = 4, ++ H264_NAL_SLICE_IDR = 5, ++ H264_NAL_SEI = 6, ++ H264_NAL_SPS = 7, ++ H264_NAL_PPS = 8, ++ H264_NAL_AU_DELIMITER = 9, ++ H264_NAL_SEQ_END = 10, ++ H264_NAL_STREAM_END = 11, ++ H264_NAL_FILLER_DATA = 12, ++ H264_NAL_SPS_EXT = 13, ++ H264_NAL_PREFIX_UNIT = 14, ++ H264_NAL_SUBSET_SPS = 15, ++ H264_NAL_DEPTH_SPS = 16, ++ H264_NAL_SLICE_AUX = 19, ++ H264_NAL_SLICE_EXT = 20, ++ H264_NAL_SLICE_DEPTH = 21 ++} H264NalUnitType; ++ ++typedef enum ++{ ++ H265_NAL_SLICE_TRAIL_N = 0, ++ H265_NAL_SLICE_TRAIL_R = 1, ++ H265_NAL_SLICE_TSA_N = 2, ++ H265_NAL_SLICE_TSA_R = 3, ++ H265_NAL_SLICE_STSA_N = 4, ++ H265_NAL_SLICE_STSA_R = 5, ++ H265_NAL_SLICE_RADL_N = 6, ++ H265_NAL_SLICE_RADL_R = 7, ++ H265_NAL_SLICE_RASL_N = 8, ++ H265_NAL_SLICE_RASL_R = 9, ++ H265_NAL_SLICE_BLA_W_LP = 16, ++ H265_NAL_SLICE_BLA_W_RADL = 17, ++ H265_NAL_SLICE_BLA_N_LP = 18, ++ H265_NAL_SLICE_IDR_W_RADL = 19, ++ H265_NAL_SLICE_IDR_N_LP = 20, ++ H265_NAL_SLICE_CRA_NUT = 21, ++ H265_NAL_VPS = 32, ++ H265_NAL_SPS = 33, ++ H265_NAL_PPS = 34, ++ H265_NAL_AUD = 35, ++ H265_NAL_EOS = 36, ++ H265_NAL_EOB = 37, ++ H265_NAL_FD = 38, ++ H265_NAL_PREFIX_SEI = 39, ++ H265_NAL_SUFFIX_SEI = 40 ++} H265NalUnitType; ++ + CodecPacketReader::Ptr CodecPacketReader::GetPacketReader(const CodecMime &mime) + { + CodecPacketReader::Ptr reader = nullptr; +@@ -42,14 +95,85 @@ CodecPacketReader::Ptr CodecPacketReader::GetPacketReader(const CodecMime &mime) + default: + break; + } ++ if(reader){ ++ reader->codecMime_ = mime; ++ } + return reader; + } + + CodecH264Reader::CodecH264Reader() : CodecPacketReader() + {} + ++bool FrameCompletedCheck(char *buf, bool *Started, uint32_t *cur_nal_type, uint32_t *next_nal_type, std::ifstream &ioIn, const CodecPacketReader* const reader) ++{ ++ bool Completed = false; ++ if(reader->codecMime_ == CodecMime::AVC){ ++ if(!(*Started)){ ++ //check current nalu type ++ /* +---------------+ ++ * |0|1|2|3|4|5|6|7| ++ * +-+-+-+-+-+-+-+-+ ++ * |F|NRI| Type | ++ * +---------------+ ++ */ ++ *next_nal_type = (buf[0] & 0x1f); ++ *Started = (*cur_nal_type == H264_NAL_SLICE || *cur_nal_type == H264_NAL_SLICE_DPA || *cur_nal_type == H264_NAL_SLICE_IDR); ++ Completed = !(*Started); ++ } else { ++ //check next nalu type ++ *next_nal_type = (buf[0] & 0x1f); ++ Completed = *Started && ((*next_nal_type >= H264_NAL_SEI && *next_nal_type <= H264_NAL_AU_DELIMITER) || ++ (*next_nal_type >= 14 && *next_nal_type <= 18)); ++ } ++ if(!Completed){ ++ // first_mb_in_slice == 0 in slice header also considered start of the next frame ++ char SliceHDR[1]; ++ ioIn.read(SliceHDR, 1); ++ Completed |= *Started && (*next_nal_type == H264_NAL_SLICE || ++ *next_nal_type == H264_NAL_SLICE_DPA || *next_nal_type == H264_NAL_SLICE_IDR) && (SliceHDR[0] & 0x80); ++ ioIn.seekg(-1, std::ios_base::cur); ++ } ++ }else if(reader->codecMime_ == CodecMime::HEVC){ ++ if(!(*Started)){ ++ //check current nalu type ++ /* +---------------+---------------+ ++ * |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7| ++ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ++ * |F| Type | LayerId | TID | ++ * +-------------+-----------------+ ++ * */ ++ *next_nal_type = (buf[0] >> 1) & 0x3f; ++ *Started = ((*cur_nal_type >= H265_NAL_SLICE_TRAIL_N && *cur_nal_type <= H265_NAL_SLICE_RASL_R) || ++ (*cur_nal_type >= H265_NAL_SLICE_BLA_W_LP && *cur_nal_type <= 23)); ++ Completed = !(*Started); ++ } else { ++ //check next nalu type ++ *next_nal_type = (buf[0] >> 1) & 0x3f; ++ Completed = *Started && ((*next_nal_type >= H265_NAL_VPS && *next_nal_type <= H265_NAL_AUD) || ++ *next_nal_type == H265_NAL_PREFIX_SEI || (*next_nal_type >= 41 && *next_nal_type <= 44) || ++ (*next_nal_type >= 48 && *next_nal_type <= 55)); ++ } ++ if(!Completed){ ++ // Any VCL Nal unit with first_slice_segment_in_pic_flag == 1 considered start of the next frame ++ char SliceHDR[2]; ++ ioIn.read(SliceHDR, 2); ++ Completed |= *Started && (((*next_nal_type >= H265_NAL_SLICE_TRAIL_N && *next_nal_type <= H265_NAL_SLICE_RASL_R) || ++ (*next_nal_type >= H265_NAL_SLICE_BLA_W_LP && *next_nal_type <= 23)) && (SliceHDR[1] & 0x80)); ++ ioIn.seekg(-2, std::ios_base::cur); ++ } ++ } ++ HDF_LOGI("Completed = %{public}s, cur_nal_type = %{public}d, next_nal_type = %{public}d !!!", Completed?"true":"false", *cur_nal_type, *next_nal_type); ++ *cur_nal_type = *next_nal_type; ++ return Completed; ++} ++ + bool CodecH264Reader::ReadOnePacket(std::ifstream &ioIn, char *buf, uint32_t &filledCount) + { ++ bool Started = false; //picture started flag ++ bool Completed = false; //picture completed flag ++ uint32_t cur_nal_type; ++ uint32_t next_nal_type; ++ + // read start code first + ioIn.read(buf, START_CODE_SIZE_FRAME); + if (ioIn.eof()) { +@@ -59,19 +183,40 @@ bool CodecH264Reader::ReadOnePacket(std::ifstream &ioIn, char *buf, uint32_t &fi + char *temp = buf; + temp += START_CODE_SIZE_FRAME; + bool ret = true; ++ ++ //parse first nalu type before loop ++ ioIn.read(temp, 1); ++ (codecMime_ == CodecMime::AVC) ? (cur_nal_type = (temp[0] & 0x1f)) : (cur_nal_type = (temp[0] >> 1) & 0x3f); ++ temp++; + while (!ioIn.eof()) { + ioIn.read(temp, 1); + if (*temp == START_CODE) { + // check start code + if ((temp[START_CODE_OFFSET_ONE] == 0) && (temp[START_CODE_OFFSET_SEC] == 0) && + (temp[START_CODE_OFFSET_THIRD] == 0)) { +- ioIn.seekg(-START_CODE_SIZE_FRAME, std::ios_base::cur); +- temp -= (START_CODE_SIZE_FRAME - 1); ++ //Read next nalu header ++ ioIn.read(++temp, 1); ++ Completed = FrameCompletedCheck(temp, &Started, &cur_nal_type, &next_nal_type, ioIn, this); ++ if(!Completed){ ++ HDF_LOGI("Frame is not completed, Read more nalu !!!"); ++ temp++; ++ continue; ++ } ++ ioIn.seekg(-(START_CODE_SIZE_FRAME + 1), std::ios_base::cur); ++ temp -= START_CODE_SIZE_FRAME; + ret = false; + break; + } else if ((temp[START_CODE_OFFSET_ONE] == 0) && (temp[START_CODE_OFFSET_SEC] == 0)) { +- ioIn.seekg(-START_CODE_SIZE_SLICE, std::ios_base::cur); +- temp -= (START_CODE_SIZE_SLICE - 1); ++ //Read next nalu header ++ ioIn.read(++temp, 1); ++ Completed = FrameCompletedCheck(temp, &Started, &cur_nal_type, &next_nal_type, ioIn, this); ++ if(!Completed){ ++ HDF_LOGI("Frame is not completed, Read more nalu !!!"); ++ temp++; ++ continue; ++ } ++ ioIn.seekg(-(START_CODE_SIZE_SLICE + 1), std::ios_base::cur); ++ temp -= START_CODE_SIZE_SLICE; + ret = false; + break; + } +@@ -134,4 +279,4 @@ bool CodecVp9Reader::ReadOnePacket(std::ifstream &ioIn, char *buf, uint32_t &fil + return true; + } + return false; +-} +\ No newline at end of file ++} +-- +2.25.1 + diff --git a/device_board_phytium/d2000/patch/0008=foundation-multimedia-player_framework=add-yuvconvert-in-PlayBin.patch b/device_board_phytium/d2000/patch/0008=foundation-multimedia-player_framework=add-yuvconvert-in-PlayBin.patch new file mode 100644 index 0000000000000000000000000000000000000000..faf7c165ec5c3bb4af1ed6615a09633c0a25b726 --- /dev/null +++ b/device_board_phytium/d2000/patch/0008=foundation-multimedia-player_framework=add-yuvconvert-in-PlayBin.patch @@ -0,0 +1,63 @@ +From e71a6b5be4e63aa504235987d9ea2ce135b6ec3e Mon Sep 17 00:00:00 2001 +From: libowen +Date: Fri, 23 Feb 2024 18:12:27 +0800 +Subject: [PATCH] Add yuvconvert in PlayBin. + +Change-Id: I21246b4e63d8249c5ea3ca0aeac35f09b9dc5514 +--- + .../playbin_adapter/playbin_ctrler_base.cpp | 25 ++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp +index a92c8a22..ebf6f611 100644 +--- a/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp ++++ b/services/engine/gstreamer/common/playbin_adapter/playbin_ctrler_base.cpp +@@ -727,6 +727,7 @@ void PlayBinCtrlerBase::SetupAudioDiedEventCb() + void PlayBinCtrlerBase::SetupCustomElement() + { + // There may be a risk of data competition, but the sinkProvider is unlikely to be reconfigured. ++ MEDIA_LOGD("SetupCustomElement Enter!!!"); + if (sinkProvider_ != nullptr) { + audioSink_ = sinkProvider_->CreateAudioSink(); + if (audioSink_ != nullptr) { +@@ -737,7 +738,28 @@ void PlayBinCtrlerBase::SetupCustomElement() + } + videoSink_ = sinkProvider_->CreateVideoSink(); + if (videoSink_ != nullptr) { +- g_object_set(playbin_, "video-sink", videoSink_, nullptr); ++ MEDIA_LOGD("videoSink_ creat successfully!!!"); ++ GstElement *convert = gst_element_factory_make ("yuvconvert", "convert"); ++ if( !convert ){ ++ MEDIA_LOGE("yuvconvert elements creat failed!!!"); ++ convert = gst_element_factory_make ("videoconvert","convert"); ++ } ++ ++ GstElement *convert_bin = gst_bin_new("convert_bin"); ++ if( convert_bin != nullptr){ ++ gst_bin_add_many(GST_BIN(convert_bin), convert, videoSink_, nullptr); ++ gst_element_link_many(convert, videoSink_, nullptr); ++ GstPad *pad = gst_element_get_static_pad(convert, "sink"); ++ GstPad *ghost_pad = gst_ghost_pad_new ("sink", pad); ++ gst_pad_set_active (ghost_pad, TRUE); ++ gst_element_add_pad (convert_bin, ghost_pad); ++ gst_object_unref (pad); ++ g_object_set(playbin_, "video-sink", convert_bin, nullptr); ++ MEDIA_LOGD("convert_bin has been created !!!"); ++ }else{ ++ MEDIA_LOGE("convert_bin creat failed!!!"); ++ g_object_set(playbin_, "video-sink", videoSink_, nullptr); ++ } + } else if (audioSink_ != nullptr) { + g_object_set(playbin_, "video-sink", audioSink_, nullptr); + } +@@ -755,6 +777,7 @@ void PlayBinCtrlerBase::SetupCustomElement() + MEDIA_LOGD("can not create scaletempo, the audio playback speed can not be adjusted"); + } + } ++ MEDIA_LOGD("SetupCustomElement Exit!!!"); + } + + void PlayBinCtrlerBase::SetupSourceSetupSignal() +-- +2.25.1 + diff --git a/device_board_phytium/d2000/patch/0009=third_party-gstreamer=add-registration-of-h263-h265-vc1-vp9parse-plugins.patch b/device_board_phytium/d2000/patch/0009=third_party-gstreamer=add-registration-of-h263-h265-vc1-vp9parse-plugins.patch new file mode 100644 index 0000000000000000000000000000000000000000..2d8507bf2c0ccda0a5e94efccd0c8aca9cc3957e --- /dev/null +++ b/device_board_phytium/d2000/patch/0009=third_party-gstreamer=add-registration-of-h263-h265-vc1-vp9parse-plugins.patch @@ -0,0 +1,76 @@ +From cc57eae69fd1ea3069b072775d33bde80d4fe3ec Mon Sep 17 00:00:00 2001 +From: libowen +Date: Mon, 1 Apr 2024 16:52:33 +0800 +Subject: [PATCH] Add registration of h263/h265/vc1/vp9parse plugins in + videoparsers. + +Change-Id: Icfb6a764f83901c1633085b75b2ee3f6217b5379 +--- + gstplugins_bad/BUILD.gn | 6 ++++++ + gstplugins_bad/gst/videoparsers/gstvideoparserselements.h | 4 ++++ + gstplugins_bad/gst/videoparsers/plugin.c | 4 ++++ + 3 files changed, 14 insertions(+) + +diff --git a/gstplugins_bad/BUILD.gn b/gstplugins_bad/BUILD.gn +index 005733f0..5f6975f4 100644 +--- a/gstplugins_bad/BUILD.gn ++++ b/gstplugins_bad/BUILD.gn +@@ -264,6 +264,7 @@ ohos_source_set("codecparsers_source") { + sources = [ + "gst-libs/gst/codecparsers/dboolhuff.c", + "gst-libs/gst/codecparsers/gsth264parser.c", ++ "gst-libs/gst/codecparsers/gsth265parser.c", + "gst-libs/gst/codecparsers/gstjpeg2000sampling.c", + "gst-libs/gst/codecparsers/gstjpegparser.c", + "gst-libs/gst/codecparsers/gstmpeg4parser.c", +@@ -298,8 +299,13 @@ ohos_source_set("parse_source") { + visibility = [ ":*" ] + + sources = [ ++ "gst/videoparsers/h263parse.c", ++ "gst/videoparsers/gsth263parse.c", + "gst/videoparsers/gsth264parse.c", ++ "gst/videoparsers/gsth265parse.c", + "gst/videoparsers/gstmpeg4videoparse.c", ++ "gst/videoparsers/gstvc1parse.c", ++ "gst/videoparsers/gstvp9parse.c", + "gst/videoparsers/gstvideoparserselement.c", + "gst/videoparsers/gstvideoparseutils.c", + "gst/videoparsers/plugin.c", +diff --git a/gstplugins_bad/gst/videoparsers/gstvideoparserselements.h b/gstplugins_bad/gst/videoparsers/gstvideoparserselements.h +index 36dd6764..a05c013d 100644 +--- a/gstplugins_bad/gst/videoparsers/gstvideoparserselements.h ++++ b/gstplugins_bad/gst/videoparsers/gstvideoparserselements.h +@@ -49,8 +49,12 @@ GST_ELEMENT_REGISTER_DECLARE (pngparse); + GST_ELEMENT_REGISTER_DECLARE (vc1parse); + GST_ELEMENT_REGISTER_DECLARE (vp9parse); + #else ++GST_ELEMENT_REGISTER_DECLARE (h263parse); + GST_ELEMENT_REGISTER_DECLARE (h264parse); ++GST_ELEMENT_REGISTER_DECLARE (h265parse); + GST_ELEMENT_REGISTER_DECLARE (mpeg4videoparse); ++GST_ELEMENT_REGISTER_DECLARE (vc1parse); ++GST_ELEMENT_REGISTER_DECLARE (vp9parse); + #endif + + #endif /* __GST_VIDEOPARSERS_ELEMENTS_H__ */ +diff --git a/gstplugins_bad/gst/videoparsers/plugin.c b/gstplugins_bad/gst/videoparsers/plugin.c +index 7319ebb7..7b4c3e62 100644 +--- a/gstplugins_bad/gst/videoparsers/plugin.c ++++ b/gstplugins_bad/gst/videoparsers/plugin.c +@@ -60,8 +60,12 @@ plugin_init (GstPlugin * plugin) + */ + ret |= GST_ELEMENT_REGISTER (av1parse, plugin); + #else ++ ret |= GST_ELEMENT_REGISTER (h263parse, plugin); + ret |= GST_ELEMENT_REGISTER (h264parse, plugin); + ret |= GST_ELEMENT_REGISTER (mpeg4videoparse, plugin); ++ ret |= GST_ELEMENT_REGISTER (h265parse, plugin); ++ ret |= GST_ELEMENT_REGISTER (vc1parse, plugin); ++ ret |= GST_ELEMENT_REGISTER (vp9parse, plugin); + #endif + return ret; + } +-- +2.25.1 + diff --git a/device_board_phytium/d2000/tools/generate_image/make_boot.sh b/device_board_phytium/d2000/tools/generate_image/make_boot.sh new file mode 100755 index 0000000000000000000000000000000000000000..0b3ff82f955303f59aeccae494cd1e1778697177 --- /dev/null +++ b/device_board_phytium/d2000/tools/generate_image/make_boot.sh @@ -0,0 +1,145 @@ +#!/bin/sh + +# Copyright (c) 2023 Phytium Technology Co., Ltd. All rights reserved. +# 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. + +set -e + +#set color defination in echo info +green="\e[32;1m" +red="\e[31;1m" +normal="\e[0m" + +OUT_PATH=${1} +FORMATE=uboot +if [ $# -eq 2 ] && [ "efi" = $2 ]; then + FORMATE=efi +fi +IMG_NAME=${OUT_PATH}/boot_${FORMATE}.img +BOOT_PATH=${OUT_PATH}/boot/ + +IMAGE_SIZE=64 # 64M +IMAGE_BLOCKS=4096 +FILE_CHECK="fail" + +echo -e "${green}>>>>> making ${FORMATE} boot image...${normal}" +echo -e "${green}src path:${BOOT_PATH}, dis image name:${IMG_NAME}, size:${IMAGE_SIZE}M, block size:${IMAGE_BLOCKS}${normal}" + +if [ -e ${OUT_PATH}/ramdisk.img ]; then + cp ${OUT_PATH}/ramdisk.img ${BOOT_PATH} +fi + +function make_uboot_boot_image() +{ + src=$1 + dis=$2 + size=$3 + block_size=$4 + block_num=$((${size} * 1024 * 1024 / ${block_size})) + + if [ "`uname -m`" == "aarch64" ]; then + echo y | sudo mke2fs -b ${block_size} -d ${src} -i 8192 -t ext2 ${dis} ${block_num} + else + genext2fs -B ${block_size} -b ${block_num} -d ${src} -i 8192 -U ${dis} + fi + + return $? +} + +function make_efi_boot_image() +{ + src=$1 + dis=$2 + size=$3"M" + + VOLUME_LABEL=boot + # հ VFAT ļ + truncate -s ${size} ${dis} + + # VFAT ļϵͳ + mkfs.vfat -n $VOLUME_LABEL -F 32 ${dis} + + # VFAT ļصʱĿ¼ + if [ -d "vfat_mount_point" ];then + if mountpoint -q vfat_mount_point; then + sudo umount vfat_mount_point + fi + rm vfat_mount_point/* -rf + else + mkdir -p vfat_mount_point + fi + + sudo mount -o loop ${dis} vfat_mount_point + #sudo mount ${dis} vfat_mount_point + + # ļ VFAT ص + sudo cp ${src}/* vfat_mount_point/ -r + + # ж VFAT ļ + sudo umount vfat_mount_point + rm vfat_mount_point -rf + + return $? +} + +function check_boot_files() +{ + src=$1 + formate=$2 + check_Image="Image " + check_ramdisk="ramdisk.img " + check_dtb="" + check_efi="" + if [ "efi" = ${formate} ]; then + check_efi="EFI " + else + check_dtb="dtb " + fi + + for FILE in `ls ${src}` + do + if [[ $FILE = "Image" ]]; then + check_Image="" + elif [[ $FILE = "ramdisk.img" ]]; then + check_ramdisk="" + elif [[ $FILE =~ ".dtb" ]]; then + check_dtb="" + elif [[ $FILE = "EFI" ]]; then + check_efi="" + fi + done + + if [ -z $check_Image ]&&[ -z $check_ramdisk ]&&[ -z $check_dtb ]&&[ -z $check_efi ]; then + FILE_CHECK="sucess" + else + echo -e "${red}check files in ${BOOT_PATH} failed,${check_Image}${check_ramdisk}${check_dtb}${check_efi}is needed.${normal}" + echo "ls ${src}:["`ls ${src}`"]" + fi +} + +check_boot_files ${BOOT_PATH} ${FORMATE} +if [ ${FILE_CHECK} == "fail" ]; then + echo -e "${red}<<<<< make ${FORMATE} boot image failed.${normal}" +else + if [ "efi" = ${FORMATE} ];then + make_efi_boot_image ${BOOT_PATH} ${IMG_NAME} ${IMAGE_SIZE} + else + make_uboot_boot_image ${BOOT_PATH} ${IMG_NAME} ${IMAGE_SIZE} ${IMAGE_BLOCKS} + fi + ret=$? + if [ $? == 0 ]; then + echo -e "${green}<<<<< make ${FORMATE} boot image success.${normal}" + else + echo -e "${red}<<<<< make ${FORMATE} boot image failed, error code:$ret.${normal}" + fi +fi diff --git a/device_soc_phytium/d2000/hardware/display/.BUILD.gn.swp b/device_soc_phytium/d2000/hardware/display/.BUILD.gn.swp new file mode 100644 index 0000000000000000000000000000000000000000..acd320984f59bfc63b32859cd98634e3d0dfa15b Binary files /dev/null and b/device_soc_phytium/d2000/hardware/display/.BUILD.gn.swp differ diff --git a/device_soc_phytium/d2000/hardware/display/BUILD.gn b/device_soc_phytium/d2000/hardware/display/BUILD.gn index 519f6c42b6b3a6e25ca99dc0b9feafc5e3acf0ff..838ee50badba6edf351c70673a6fe41dfa3d66bc 100755 --- a/device_soc_phytium/d2000/hardware/display/BUILD.gn +++ b/device_soc_phytium/d2000/hardware/display/BUILD.gn @@ -60,9 +60,9 @@ ohos_shared_library("libdisplay_buffer_vdi_impl") { install_enable = true install_images = [ chipset_base_dir ] - innerapi_tags = [ "chipsetsdk" ] subsystem_name = "hdf" - part_name = "phytium_products" + innerapi_tags = [ "passthrough" ] + part_name = "device_d2000" } ohos_shared_library("libdisplay_buffer_vendor") { @@ -99,9 +99,9 @@ ohos_shared_library("libdisplay_buffer_vendor") { install_enable = true install_images = [ chipset_base_dir ] - innerapi_tags = [ "chipsetsdk" ] + innerapi_tags = [ "passthrough" ] subsystem_name = "hdf" - part_name = "phytium_products" + part_name = "device_d2000" } ohos_static_library("libhigbm_vendor") { @@ -157,7 +157,7 @@ ohos_shared_library("libdisplay_composer_vdi_impl") { external_deps = [ "c_utils:utils", "drivers_interface_display:display_composer_idl_headers", - "graphic_chipsetsdk:buffer_handle", + "graphic_surface:buffer_handle", "hilog:libhilog", "ipc:ipc_single", @@ -166,7 +166,7 @@ ohos_shared_library("libdisplay_composer_vdi_impl") { install_enable = true install_images = [ chipset_base_dir ] subsystem_name = "hdf" - part_name = "phytium_products" + part_name = "device_d2000" } ohos_shared_library("display_composer_vendor") { @@ -231,7 +231,7 @@ ohos_shared_library("display_composer_vendor") { install_enable = true install_images = [ chipset_base_dir ] subsystem_name = "hdf" - part_name = "phytium_products" + part_name = "device_d2000" } ohos_shared_library("display_gfx") { @@ -260,5 +260,5 @@ ohos_shared_library("display_gfx") { install_enable = true install_images = [ chipset_base_dir ] subsystem_name = "hdf" - part_name = "phytium_products" + part_name = "device_d2000" } diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_common.h b/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_common.h index 42cf95bd2f3398f37b9eb3ba9d01853ab188b5e2..2a5104db9e04bf754e0ef1c4d54c67e960eb3ef9 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_common.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_common.h @@ -25,6 +25,7 @@ namespace HDI { namespace DISPLAY { constexpr int32_t INVALID_MODE_ID = -1; constexpr uint32_t DRM_INVALID_ID = 0xFFFFFFFF; +constexpr uint32_t PIPE_INVALID_ID = 0xFFFFFFFF; template using IdMapPtr = std::unordered_map>; template using SortMapPtr = std::map>; class DrmEncoder; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_interface.h b/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_interface.h index 10cc2cf49ab5fe90669951db7b198f01dfd3adae..eb4023317cad77998c589f0d38f4a684041fc099 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_interface.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/core/hdi_device_interface.h @@ -33,6 +33,7 @@ public: virtual std::map HandleHotplug() = 0; virtual bool HandleHotplug(uint32_t dispId, bool &plugIn) = 0; virtual std::map> getAllDisplays() = 0; + virtual const IdMapPtr& GetConnectors() const = 0; virtual ~HdiDeviceInterface() {} }; } // namespace OHOS diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.cpp b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.cpp index ed26302044ed97745e3c640551899cb5d01c9150..6aff3cdb03d88730f0a59322467f9d542a32c1a0 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.cpp @@ -129,6 +129,11 @@ int32_t DrmConnector::SetBrightness(uint32_t level) return DISPLAY_SUCCESS; } +void DrmConnector::SetCrtcPipe(uint32_t pipe) +{ + mCrtcPipe = pipe; +} + void DrmConnector::GetDisplayCap(DisplayCapability &cap) { cap.phyHeight = mPhyHeight; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.h b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.h index 8b1a910cb0fae407ff2a7b2fba9c114892515e43..64f031c3481c8563ce88a345709554d97efc90c2 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_connector.h @@ -119,6 +119,11 @@ public: bool plugIn, drmModeConnectorPtr c, int *crtc_id); int32_t GetBrightness(uint32_t& level) const; int32_t SetBrightness(uint32_t level); + void SetCrtcPipe(uint32_t pipe); + uint32_t GetCrtcPipe() const + { + return mCrtcPipe; + } private: static void ConvertTypeToName(uint32_t type, std::string &name); @@ -144,6 +149,7 @@ private: uint32_t mPropCrtcId = DRM_INVALID_ID; uint32_t mPropBrightnessId = DRM_INVALID_ID; uint32_t mBrightnessLevel = 0; + uint32_t mCrtcPipe = PIPE_INVALID_ID; std::unordered_map mModes; int32_t mPreferenceId = INVALID_MODE_ID; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.cpp b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.cpp index 6f31ba843876e955f951c5ae485a6e411e5abee0..b35e67cce53384aae000876921b52f0b7e617f36 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.cpp @@ -486,6 +486,9 @@ std::map> DrmDevice::DiscoveryDisplay() } DISPLAY_LOGD(); auto crtc = crtcIter->second; + if (crtc) { + connector->SetCrtcPipe(crtc->GetPipe()); + } // create the display std::shared_ptr display = std::make_shared(connector, crtc, mInstance); DISPLAY_LOGD(); diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.h b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.h index 0e2f9b2c653978266182914655cf84d87e75d9e7..4de1601ff4652babcc5d1cdcbbdfa42919be1a56 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_device.h @@ -62,6 +62,10 @@ public: std::map HandleHotplug() override; bool HandleHotplug(uint32_t dispId, bool &plugIn) override; std::map> getAllDisplays() override; + const IdMapPtr& GetConnectors() const override + { + return mConnectors; + } private: static FdPtr mDrmFd; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.cpp b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.cpp index a5ffaccb9ee11031a457c1226d9532301af8211d..af8d66588418e3d8d7290bba626e07c59026f8c8 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.cpp @@ -69,22 +69,50 @@ bool DrmVsyncWorker::WaitSignalAndCheckRuning() return mRunning; } +uint32_t DrmVsyncWorker::GetVBlankPipe() +{ + auto drmDeviceInstance = DrmDevice::Create(); + uint32_t crtcPipe = PIPE_INVALID_ID; + if (drmDeviceInstance == nullptr) { + DISPLAY_LOGE("Failed to create DrmDevice instance"); + return 0; + } + + const auto& connectors = drmDeviceInstance->GetConnectors(); + for (const auto& connectorPair : connectors) { + auto connector = connectorPair.second; + uint32_t id = connector->GetId(); + bool isConnected = connector->IsConnected(); + if(isConnected) + { + /* TODO: Currently, vblank is based on the signal displayed on the first detected connection, that is, it only supports mirroring. + * The logic needs to be modified in the future to adjust for different refresh rates to provide the most accurate vblank signal + */ + crtcPipe = connector->GetCrtcPipe(); + DISPLAY_LOGD("Connector ID: %{public}u, Connected: %{public}d, CRTC " + "Pipe: %{public}u", + id, isConnected, crtcPipe); + break; + } + } + return crtcPipe; +} uint64_t DrmVsyncWorker::WaitNextVBlank(unsigned int &sq) { constexpr uint64_t SEC_TO_NSEC = 1000 * 1000 * 1000; constexpr uint64_t USEC_TO_NSEC = 1000; + uint32_t index = GetVBlankPipe(); + uint32_t high_crtc = (index << DRM_VBLANK_HIGH_CRTC_SHIFT); drmVBlank vblank = { .request = drmVBlankReq { - .type = DRM_VBLANK_RELATIVE, + .type = (drmVBlankSeqType)( DRM_VBLANK_RELATIVE | (high_crtc & DRM_VBLANK_HIGH_CRTC_MASK)), .sequence = 1, .signal = 0, } }; int ret = drmWaitVBlank(mDrmFd, &vblank); - if(ret < 0) - return ret; DISPLAY_CHK_RETURN((ret < 0), 0, DISPLAY_LOGE("wait vblank failed ret : %{public}d errno %{public}d", ret, errno)); sq = vblank.reply.sequence; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.h b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.h index f945d1f40bea7c1237ce8a460db1e6d74d90d26c..09baf6d555fd0ee834489391f66079d6712590de 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_vsync_worker.h @@ -36,6 +36,7 @@ public: uint64_t WaitNextVBlank(unsigned int &sq); bool WaitSignalAndCheckRuning(); void ReqesterVBlankCb(const std::shared_ptr &cb); + uint32_t GetVBlankPipe(); private: int mDrmFd = 0; diff --git a/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.cpp b/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.cpp index bc04606870d94ff425f708793ab671f4b19155d7..4e015602130ddc376b7b12c29a196fbb8b3d10db 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.cpp @@ -80,6 +80,36 @@ int32_t DisplayBufferVdiImpl::IsSupportedAlloc(const std::vector& value) +{ + DISPLAY_LOGE("%s is not supported", __func__); + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::GetMetadata(const BufferHandle& handle, uint32_t key, std::vector& value) +{ + DISPLAY_LOGE("%s is not supported", __func__); + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::ListMetadataKeys(const BufferHandle& handle, std::vector& keys) +{ + DISPLAY_LOGE("%s is not supported", __func__); + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::EraseMetadataKey(const BufferHandle& handle, uint32_t key) +{ + DISPLAY_LOGE("%s is not supported", __func__); + return DISPLAY_NOT_SUPPORT; +} + extern "C" IDisplayBufferVdi* CreateDisplayBufferVdi() { return new DisplayBufferVdiImpl(); diff --git a/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.h b/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.h index 9cb70a4b6a7bc3ed17a8c64e8002d928346ab14c..8e22852da93c91887e3bbeb640bdff848cc99c4f 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.h +++ b/device_soc_phytium/d2000/hardware/display/src/display_gralloc/display_buffer_vdi_impl.h @@ -38,6 +38,11 @@ public: virtual int32_t InvalidateCache(const BufferHandle& handle) const override; virtual int32_t IsSupportedAlloc(const std::vector& infos, std::vector& supporteds) const override; + virtual int32_t RegisterBuffer(const BufferHandle& handle) override; + virtual int32_t SetMetadata(const BufferHandle& handle, uint32_t key, const std::vector& value) override; + virtual int32_t GetMetadata(const BufferHandle& handle, uint32_t key, std::vector& value) override; + virtual int32_t ListMetadataKeys(const BufferHandle& handle, std::vector& keys) override; + virtual int32_t EraseMetadataKey(const BufferHandle& handle, uint32_t key) override; }; } // namespace DISPLAY } // namespace HDI diff --git a/device_soc_phytium/d2000/hardware/gpu/BUILD.gn b/device_soc_phytium/d2000/hardware/gpu/BUILD.gn index 4832bb1c34da8d4bc15d18c5eb823577b07265e2..fa086aa08a5859748d16f91fb16d9ee6f840be53 100755 --- a/device_soc_phytium/d2000/hardware/gpu/BUILD.gn +++ b/device_soc_phytium/d2000/hardware/gpu/BUILD.gn @@ -76,7 +76,7 @@ ohos_prebuilt_shared_library("lib_pvr_dri") { install_images = [ chipset_base_dir ] relative_install_dir = "chipsetsdk" subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } mesa3d_all_lib_deps += [ ":lib_pvr_dri" ] @@ -85,14 +85,14 @@ ohos_prebuilt_etc("phytiumvr.ini") { install_enable = true install_images = [ chipset_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } mesa3d_all_lib_deps += [ ":phytiumvr.ini" ] ohos_prebuilt_etc("d2000.para.dac") { source = "d2000.para.dac" subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" module_install_dir = "etc/param" } mesa3d_all_lib_deps += [ ":d2000.para.dac"] @@ -100,7 +100,8 @@ mesa3d_all_lib_deps += [ ":d2000.para.dac"] if (enable_ramdisk) { ohos_prebuilt_etc("rgx.fw.30.3.816.20") { source = "$mesa3d_pvr_libs_dir/lib/firmware/rgx.fw.30.3.816.20" - part_name = "phytium_products" + subsystem_name = "phytium_products" + part_name = "device_d2000" install_enable = true install_images = [ "ramdisk", @@ -113,7 +114,8 @@ if (enable_ramdisk) { ohos_prebuilt_etc("rgx.sh.30.3.816.20") { source = "$mesa3d_pvr_libs_dir/lib/firmware/rgx.sh.30.3.816.20" - part_name = "phytium_products" + subsystem_name = "phytium_products" + part_name = "device_d2000" install_enable = true install_images = [ "ramdisk", @@ -135,7 +137,7 @@ foreach(item, mesa3d_all_lib_items) { install_images = [ chipset_base_dir ] relative_install_dir = "chipsetsdk" subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } mesa3d_all_lib_deps += [ ":$prebuild_name" ] } @@ -150,7 +152,7 @@ foreach(item, mesa3d_all_relay_lib_items) { install_images = [ chipset_base_dir ] relative_install_dir = "chipsetsdk" subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } mesa3d_all_lib_deps += [ ":$prebuild_name" ] } diff --git a/device_soc_phytium/d2000/hardware/vpu/BUILD.gn b/device_soc_phytium/d2000/hardware/vpu/BUILD.gn index 852b498f2a950bd4ce9ccd43ce93f2868216d9f3..410dc33ee17609ca22000dd5cc639147070a1de4 100644 --- a/device_soc_phytium/d2000/hardware/vpu/BUILD.gn +++ b/device_soc_phytium/d2000/hardware/vpu/BUILD.gn @@ -28,7 +28,7 @@ ohos_prebuilt_shared_library("libgstomx") { relative_install_dir = "media/plugins" install_images = [ system_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":libgstomx" ] @@ -38,17 +38,27 @@ ohos_prebuilt_shared_library("libomx_vxd") { # relative_install_dir = "media/plugins" install_images = [ system_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":libomx_vxd" ] +ohos_prebuilt_shared_library("libgstyuvconvert") { + source = "$vpu_libs_dir/libgstyuvconvert.z.so" + install_enable = true + relative_install_dir = "media/plugins" + install_images = [ system_base_dir ] + subsystem_name = "phytium_products" + part_name = "device_d2000" +} +vpu_all_lib_deps += [ ":libgstyuvconvert" ] + ohos_prebuilt_shared_library("img_mem") { source = "$vpu_libs_dir/img_mem.ko" install_enable = true relative_install_dir = "media/plugins" install_images = [ system_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":img_mem" ] @@ -58,7 +68,7 @@ ohos_prebuilt_shared_library("vxd") { relative_install_dir = "media/plugins" install_images = [ system_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":vxd" ] @@ -68,7 +78,7 @@ ohos_prebuilt_shared_library("gstomx.conf") { relative_install_dir = "media/plugins" install_images = [ system_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":gstomx.conf" ] @@ -80,7 +90,7 @@ ohos_prebuilt_shared_library("pvdec_full_bin.fw") { module_install_dir = "lib/firmware" install_images = [ "system" ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } vpu_all_lib_deps += [ ":pvdec_full_bin.fw" ] diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstyuvconvert.z.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstyuvconvert.z.so new file mode 100755 index 0000000000000000000000000000000000000000..1d724c3f426dfd2f0a0f80266f3469cc5c886033 Binary files /dev/null and b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstyuvconvert.z.so differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstomx.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstomx.so index c5f35459b3b27414d512c11808aab1b99a95f446..2984c46ed582cdf3819776a590a794668022c194 100644 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstomx.so and b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstomx.so differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstyuvconvert.z.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstyuvconvert.z.so new file mode 100755 index 0000000000000000000000000000000000000000..1d724c3f426dfd2f0a0f80266f3469cc5c886033 Binary files /dev/null and b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstyuvconvert.z.so differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libomx_vxd.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libomx_vxd.so index 32acc65130ca1008e040e72fa7d3c64be4619b2d..c261f27590c1812922c02486d2417b0f490f40da 100644 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libomx_vxd.so and b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libomx_vxd.so differ diff --git a/phytium_env.sh b/phytium_env.sh new file mode 100755 index 0000000000000000000000000000000000000000..61216dc61feb300a3d5b772b4253fca27686178a --- /dev/null +++ b/phytium_env.sh @@ -0,0 +1,158 @@ +#!/bin/bash + +function print_help(){ + echo -e "\033[31m Help Info\033[0m" + echo -e "\033[31m USAGE: phytium_env.sh OHOS_PATH_ROOT DEVICE_ID\033[0m" + echo -e "\033[31m OHOS_PATH_ROOT: absolute path of openharmony root path\033[0m" + echo -e "\033[31m DEVICE_ID : 0 for d2000 | 1 for e2000 | 2 for phytiumpi-firefly \033[0m" + echo -e "\033[31m example: ./phytium_env.sh /home/phytium/OpenHarmony 1 \033[0m" +} + +#check input parameters +if [ $# -lt 2 ];then + print_help + exit 1; +fi + +OHOS_PATH_ROOT=$1 +if [ ! -d $OHOS_PATH_ROOT ];then + echo -e "\033[31mMake sure the OHOS_PATH_ROOT($OHOS_PATH_ROOT) exist! \033[0m" + print_help + exit 1; +fi + +DEVICE_ID=$2 +case $DEVICE_ID in +0) + DEVICE=d2000 +;; +1) + DEVICE=e2000 +;; +2) + DEVICE=phytiumpi-firefly +;; +*) + echo -e "\033[31mMake sure the DEVICE_ID is correct! \033[0m" + print_help + exit 1; +esac + +CLEAN=0 +if [ $# -eq 3 ];then + CLEAN=$3 +fi + +echo -e "\033[32mTHE OHOS_PATH_ROOT: $OHOS_PATH_ROOT \033[0m" +echo -e "\033[32mTHE DEVICE: $DEVICE($DEVICE_ID) \033[0m" +echo -e "\033[32m #### sync phytium env start! #### \033[0m" + +CURRENTPWD=$(pwd) + +#sync device code +function rm_path(){ + if [ -d $1 ];then + rm $1 -r + echo -e "\033[32m #### remove path $1 #### \033[0m" + fi +} + +rm_path $OHOS_PATH_ROOT/device/soc/phytium +rm_path $OHOS_PATH_ROOT/device/board/phytium +rm_path $OHOS_PATH_ROOT/vendor/phytium + +if [ $CLEAN -eq 0 ];then +{ +#sync device_soc_phytium +echo -e "\033[32m #### sync device_soc_phytium #### \033[0m" +mkdir -p $OHOS_PATH_ROOT/device/soc/phytium/ +cp device_soc_phytium/* $OHOS_PATH_ROOT/device/soc/phytium -R +echo -e "\033[32m #### sync device_soc_phytium end #### \033[0m" + +#sync device_board_phytium +echo -e "\033[32m #### sync device_board_phytium #### \033[0m" +mkdir -p $OHOS_PATH_ROOT/device/board/phytium +cp device_board_phytium/* $OHOS_PATH_ROOT/device/board/phytium/ -R +chmod 777 $OHOS_PATH_ROOT/device/board/phytium/$DEVICE/kernel/* +echo -e "\033[32m #### sync device_board_phytium end #### \033[0m" + +#sync vendor_phytium +echo -e "\033[32m #### sync vendor_phytium #### \033[0m" +mkdir -p $OHOS_PATH_ROOT/vendor/phytium +cp vendor_phytium/* $OHOS_PATH_ROOT/vendor/phytium/ -R +echo -e "\033[32m #### sync vendor_phytium end #### \033[0m" +} +fi + +#applay patch for openharmony + +####get_git_path(patch_name) get git path from patch name to git apply +function get_git_path(){ + local path=$1 + path=${path#*=} + path=${path%=*} + path=${path//-/\/} + echo $path +} + +####apply_git_patch(patch_path) apply git patch in patch_path +function apply_git_patch(){ + for file in `ls $1` + do + if [[ ! $file =~ ".patch" ]] && [[ ! $file =~ ".diff" ]]; then + continue + fi + + git_path=$(get_git_path $file)/ + if [ ! -d $OHOS_PATH_ROOT/$git_path ];then + echo -e "\033[31m$git_path not exit \033[0m" + continue + fi + + cd $OHOS_PATH_ROOT/$git_path + if [ $CLEAN -eq 0 ];then + echo -e "\n\033[32m#### git apply $file #### \033[0m" + git apply $1/$file + echo -e "\033[32m#### git apply $file end#### \033[0m" + else + echo -e "\n\033[32m#### git reset $git_path #### \033[0m" + git checkout ./* + echo -e "\033[32m#### git reset $git_path end #### \033[0m" + fi + #git status + done +} + +PATCH_PATH=$CURRENTPWD/device_board_phytium/common/patch +if [ $DEVICE == d2000 ]; then + PATCH_PATH=$CURRENTPWD/device_board_phytium/d2000/patch +fi + +#PATCH_PATH=$OHOS_PATH_ROOT/device/board/phytium/common/patch +#if [ ! -d $PATCH_PATH ];then +# echo -e "\033[31mMake sure you have copied phytium device code to OHOS_PATH_ROOT! \033[0m" +# exit 1; +#fi + +echo -e "" +echo -e "######################################################################" +echo -e "#### \033[32m Auto apply phytium_oh patchs start !\033[0m" +echo -e "#### \033[32m OHOS_PATH_ROOT: $OHOS_PATH_ROOT \033[0m" +echo -e "#### \033[32m PATCH_PATH : $PATCH_PATH \033[0m" +echo -e "#### \033[32m DEVICE : $DEVICE \033[0m" +echo -e "######################################################################" + +CURRENTPWD=$(pwd) + +apply_git_patch $PATCH_PATH +device_patch_path=$PATCH_PATH/$DEVICE +if [ -d $device_patch_path ];then + apply_git_patch $device_patch_path +fi + +cd $CURRENTPWD + +echo -e "\033[32m #### applay patch end ####\n \033[0m" + + +echo -e "\033[32m #### sync phytium end! #### \033[0m" diff --git a/vendor_phytium/d2000/config.json b/vendor_phytium/d2000/config.json index 6a7f98eb95ece31bfab3da5a0c8ccd7da4ed4a0d..525cf8a1e84afe1a882f86788b5b8f67aa75933c 100755 --- a/vendor_phytium/d2000/config.json +++ b/vendor_phytium/d2000/config.json @@ -43,12 +43,7 @@ }, { "subsystem": "phytium_products", - "components": [ - { - "component": "phytium_products", - "features": [] - } - ] + "components": [] }, { "subsystem": "arkui", @@ -63,10 +58,10 @@ ] }, { - "subsystem": "wpa_supplicant-2.9", + "subsystem": "wpa_supplicant", "components": [ { - "component": "wpa_supplicant-2.9", + "component": "wpa_supplicant", "features": [ "wpa_supplicant_driver_nl80211 = true" ] diff --git a/vendor_phytium/d2000/hdf_config/uhdf/device_info.hcs b/vendor_phytium/d2000/hdf_config/uhdf/device_info.hcs index 71e4dc7d6026319fed94d10e37230bdf3705228e..12cc999d3da2ff2ca2a85dea634a3c40d7a0b87e 100644 --- a/vendor_phytium/d2000/hdf_config/uhdf/device_info.hcs +++ b/vendor_phytium/d2000/hdf_config/uhdf/device_info.hcs @@ -374,24 +374,6 @@ deviceMatchAttr = "media_codec_capabilities"; } } - codec_device :: device { - device0 :: deviceNode { - policy = 2; - priority = 100; - moduleName = "libcodec_server.z.so"; - serviceName = "codec_hdi_service"; - deviceMatchAttr = "codec_hdi1.0_capabilities"; - } - } - codec_image_device :: device { - device0 :: deviceNode { - policy = 2; - priority = 100; - moduleName = "libcodec_jpeg_driver.z.so"; - serviceName = "codec_image_jpeg_service"; - deviceMatchAttr = "image_codec_capabilities"; - } - } } distributed_camera_host :: host { diff --git a/vendor_phytium/d2000/hdf_config/uhdf/hdf.hcs b/vendor_phytium/d2000/hdf_config/uhdf/hdf.hcs index bf8dc250cb2744b277f7ffeac187299008b04d44..d4a8650e8b95ace6cb6bcaf74b78949e0b65d335 100755 --- a/vendor_phytium/d2000/hdf_config/uhdf/hdf.hcs +++ b/vendor_phytium/d2000/hdf_config/uhdf/hdf.hcs @@ -1,4 +1,5 @@ #include "device_info.hcs" +#include "media_codec/media_codec_capabilities.hcs" root { module = "default"; diff --git a/vendor_phytium/d2000/hdf_config/uhdf/media_codec/codec_component_capabilities.hcs b/vendor_phytium/d2000/hdf_config/uhdf/media_codec/codec_component_capabilities.hcs new file mode 100755 index 0000000000000000000000000000000000000000..a3fc65e80d9e9ea511b29ee7bf97b94aaec15852 --- /dev/null +++ b/vendor_phytium/d2000/hdf_config/uhdf/media_codec/codec_component_capabilities.hcs @@ -0,0 +1,238 @@ +root { + module = "master"; + codec_config { + match_attr = "codec_component_capabilities"; + use_openmax = true; + // capsMask: 0x01, Adaptive playback; 0x02, Secure playback; 0x04, Tunnel playback. + // allocateMask: 0x01, Input buffer allocated within the Codec module; + // allocateMask: 0x02, Input buffer allocated by an external user; + // allocateMask: 0x04, Output buffer allocated within the Codec module; + // allocateMask: 0x08, Output buffer allocated by an external user. + + VideoHwEncoders { + } + VideoHwDecoders { + /* node name explanation -- HDF_video_hw_dec_avc_phy: + ** + ** HDF____________video__________________hw____________________dec____________avc_______phy + ** | | | | | | + ** HDF or OMX video or audio hardware or software encoder or decoder mime vendor + */ + HDF_video_hw_dec_avc_phy { + role = 1; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.AVC"; + supportProfiles = [1, 32768, 2, 32768, 8, 32768]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [320, 240, 617, 617, 720, 480, 559, 559, 1280, 720, 276, 276, 1920, 1080, 164, 164, 3840, 2160, 30, 30]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mpeg2_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MPEG2"; + supportProfiles = [0, 3, 1, 3]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 8; + supportPixelFmts = [21]; + measuredFrameRate = []; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_vp8_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.VP8"; + supportProfiles = []; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [320, 180, 500, 500, 640, 360, 387, 387, 1280, 720, 112, 112, 1920, 1080, 77, 77]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_h263_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.H263"; + supportProfiles = [1, 1, 1, 2, 1, 4, 1, 16, 8, 1, 8, 2, 8, 4, 8, 16]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [176, 144, 600, 600, 352, 288, 600, 600]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mpeg4_phy { + role = 3; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MPEG4"; + supportProfiles = [1, 1, 1, 2, 1, 4, 1, 8, 1, 16]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [176, 144, 600, 600]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mjpeg_phy { + role = 0; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MJPEG"; + supportProfiles = []; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = []; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_hevc_phy { + role = 2; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.HEVC"; + supportProfiles = [1, 1, 1, 4, 1, 16, 1, 64, 1, 256, 1, 1024, 1, 4096, 1, 16384, 1, 65536, 2, 65536]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 160000000; + minWidth = 64; + minHeight = 64; + maxWidth = 8192; + maxHeight = 8192; + widthAlignment = 2; + heightAlignment = 2; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [352, 288, 700, 700, 720, 480, 700, 700, 640, 360, 980, 980, 1280, 720, 600, 600, 1920, 1080, 130, 130, 3840, 2160, 130, 130]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + } + VideoSwEncoders { + } + VideoSwDecoders { + } + AudioHwEncoders { + } + AudioHwDecoders { + } + AudioSwEncoders { + } + AudioSwDecoders { + } + } +} diff --git a/vendor_phytium/d2000/hdf_config/uhdf/media_codec/media_codec_capabilities.hcs b/vendor_phytium/d2000/hdf_config/uhdf/media_codec/media_codec_capabilities.hcs new file mode 100755 index 0000000000000000000000000000000000000000..c2a7fcb26f0dde9cef0e1d79bf326a7eb5c59c69 --- /dev/null +++ b/vendor_phytium/d2000/hdf_config/uhdf/media_codec/media_codec_capabilities.hcs @@ -0,0 +1,238 @@ +root { + module = "master"; + codec_config { + match_attr = "media_codec_capabilities"; + use_openmax = true; + // capsMask: 0x01, Adaptive playback; 0x02, Secure playback; 0x04, Tunnel playback. + // allocateMask: 0x01, Input buffer allocated within the Codec module; + // allocateMask: 0x02, Input buffer allocated by an external user; + // allocateMask: 0x04, Output buffer allocated within the Codec module; + // allocateMask: 0x08, Output buffer allocated by an external user. + + VideoHwEncoders { + } + VideoHwDecoders { + /* node name explanation -- HDF_video_hw_dec_avc_phy: + ** + ** HDF____________video__________________hw____________________dec____________avc_______phy + ** | | | | | | + ** HDF or OMX video or audio hardware or software encoder or decoder mime vendor + */ + HDF_video_hw_dec_avc_phy { + role = 1; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.AVC"; + supportProfiles = [1, 32768, 2, 32768, 8, 32768]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [320, 240, 617, 617, 720, 480, 559, 559, 1280, 720, 276, 276, 1920, 1080, 164, 164, 3840, 2160, 30, 30]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mpeg2_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MPEG2"; + supportProfiles = [0, 3, 1, 3]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 8; + supportPixelFmts = [21]; + measuredFrameRate = []; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_vp8_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.VP8"; + supportProfiles = []; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [320, 180, 500, 500, 640, 360, 387, 387, 1280, 720, 112, 112, 1920, 1080, 77, 77]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_h263_phy { + role = 0xFFFFFFFF; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.H263"; + supportProfiles = [1, 1, 1, 2, 1, 4, 1, 16, 8, 1, 8, 2, 8, 4, 8, 16]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [176, 144, 600, 600, 352, 288, 600, 600]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mpeg4_phy { + role = 3; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MPEG4"; + supportProfiles = [1, 1, 1, 2, 1, 4, 1, 8, 1, 16]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [176, 144, 600, 600]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_mjpeg_phy { + role = 0; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.MJPEG"; + supportProfiles = []; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 10000000; + minWidth = 64; + minHeight = 64; + maxWidth = 4096; + maxHeight = 4096; + widthAlignment = 8; + heightAlignment = 8; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = []; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + HDF_video_hw_dec_hevc_phy { + role = 2; + type = 0; + name = "OMX.IMG.MSVDX.Decoder.HEVC"; + supportProfiles = [1, 1, 1, 4, 1, 16, 1, 64, 1, 256, 1, 1024, 1, 4096, 1, 16384, 1, 65536, 2, 65536]; + maxInst = 6; + isSoftwareCodec = false; + processModeMask = []; + capsMask = [0x01]; + minBitRate = 1; + maxBitRate = 160000000; + minWidth = 64; + minHeight = 64; + maxWidth = 8192; + maxHeight = 8192; + widthAlignment = 2; + heightAlignment = 2; + minBlockCount = 0xFFFFFFFF; + maxBlockCount = 0xFFFFFFFF; + minBlocksPerSecond = 1; + maxBlocksPerSecond = 244800; + blockSizeWidth = 16; + blockSizeHeight = 16; + supportPixelFmts = [21]; + measuredFrameRate = [352, 288, 700, 700, 720, 480, 700, 700, 640, 360, 980, 980, 1280, 720, 600, 600, 1920, 1080, 130, 130, 3840, 2160, 130, 130]; + bitRateMode = []; + minFrameRate = 0; + maxFrameRate = 0; + } + } + VideoSwEncoders { + } + VideoSwDecoders { + } + AudioHwEncoders { + } + AudioHwDecoders { + } + AudioSwEncoders { + } + AudioSwDecoders { + } + } +}