diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 9e448c2340ac6474c455ffd22bbe48f7536672bf..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,205 +0,0 @@ -# Phytium-OpenHarmony-D2000-X100 -## Intro -This project introduces how to run OpenHarmony standard system [OpenHarmony 4.0 Release](https://gitee.com/openharmony/docs/blob/master/zh-cn/release-notes/OpenHarmony-v4.0-release.md) on Phytium D2000 + X100 DEV hardware platform from Phytium Technology Co., Ltd. -It supports video decoding hardware acceleration and graphics display hardware acceleration provided by the X100. -It supports Linux kernel 5.10. - -# How to set up the development environment -## 1.1 Hardware environment -A X86 host with the ubuntu20.04 OS installed is needed. The minimum memory requirement is 16 GB. -## 1.2 Download repo script file -1. Register the [gitee](https://gitee.com/signup?redirect_to_url=%2Fdashboard) account. - -2. Register the gitee SSH public key, please refer to[Gitee help info](https://gitee.com/help/articles/4191). - -3. Install [git client](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and then configure the git user information. -``` -git config --global user.name "your-name" -git config --global user.email "your-email-address" -git config --global credential.helper store -``` -4. Install repo tools by running the commands below. -``` -curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo -chmod a+x /usr/local/bin/repo -pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests -``` ->Tips: -If you do not have the permission to access /usr/local/bin/, you can download the repo to another directory and configure it into environment variables .** - -## 1.3 Get OpenHarmony standard system source code -Download OpenHarmony standard system source code by repo + ssh. -``` -export WORK_SPACE=/home/xxx/workspace #replace to your own workspace path -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 sync -c -repo forall -c 'git lfs pull' -``` -## 1.4 Get the compilation toolchain -Get the compilation toolchain by using the installation package. -``` -sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby openjdk-11-jdk libtinfo5 npm -``` -## 1.5 Execute prebuilts script -Go to the root path of OpenHarmony source code, and execute prebuilts script to install the compiler and binary tools . -``` -cd &PROJ_ROOT -bash build/prebuilts_download.sh -``` - -# Download and integrate phytium device source code -## 2.1 Download phytium device source code -Create a local path and download phytium device source code to it . -``` -export PHY_DEV=$WORK_SPACE/phytium_device -mkdir $PHY_DEV -cd $PHY_DEV -git clone git@gitee.com:phytium_embedded/phytium-openharmony-d2000-device.git -``` -## 2.2 Integrate phytium device code -1. Copy the phytium device source code to the corresponding device directory of the OpenHarmony source code. -``` -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. Execute $PHY_DEV/auto_patch.sh to apply all the patches in device_board_phytium/d2000/patch/ to the corresponding repositories in OpenHarmony source code . -``` -$PHY_DEV/auto_patch.sh $PROJ_ROOT -``` -## 2.3 check fstab files -check what storage type used, change fstab files. Please refer to [Openhamony storage configuration manual](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). - - -# Build -## 3.1 Build OpenHarmony source code -``` -cd $PROJ_ROOT -./build.sh --product-name d2000 --ccache --target-cpu arm64 -``` - Prompt message will be printed after building successfully: -``` -post_process -=====build d2000 successful. -``` -Out put files -``` -$PROJ_ROOT/out/d2000/packages/phone/images/system.img -$PROJ_ROOT/out/d2000/packages/phone/images/vendor.img -$PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img -``` -## 3.2 Build linux kernel -Please connect Phytium Technology Co. LTD by emails provided at the end of this file to get linux kernel source code, and build it by yourself referring to the README in linux kernel source code. ->**!!! Notice:** -As vpu is compiled as a module of linux kernel modules, when you update linux kernel, you should update the ko files of vpu at the same time. When linux kernel project is built, the ko files of vpu will be generated to the path below : -**linux_kernel/drivers/media/platform/phytium-vpu/vxd/vxd.ko -linux_kernel/drivers/media/platform/phytium-vpu/mem_man/img_mem.ko** -These two ko files should be copied to the path **/system/lib64/media/plugins/** of system partition on development board, when you burn the image. - -# Burn Images -## 4.1 Hard disk partition -Prepare a hard disk of SATA,clean all the partitions on it.Under a linux environment, use the fdisk command to create four partitions on the disk. The order of partitions should be boot/system/vendor/userdata. The size of each partition can be set according to the actual situation, for example:500M/3G/500M/10G. -p1 500MB for BOOT/EFI -p2 3GB for system -p3 500MB for vendor -p4 10G for data ->You can search for the detailed use of the fdisk command by Baidu and Google, or refer to the contents of disk partition in [Phytium embedded linux user guid](https://gitee.com/phytium_embedded/phytium-sdk/blob/master/%E9%A3%9E%E8%85%BE%E5%B5%8C%E5%85%A5%E5%BC%8FLinux%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.pdf). -## 4.2 Burn system/vendor/userdata partitions -Use mkfs tool to format these three partitions as ext4. -``` -sudo mkfs.ext4 sdx2 -sudo mkfs.ext4 sdx3 -sudo mkfs.ext4 sdx4 -``` ->**!!! Notice:** -Use command df to verify the "x" in sdx, it might be a\b\c before you format the disk partitions. - -Use command dd to burn the images, which is produced in chapter[3.1 Build OpenHarmony source code](#31-build-openharmony-source-code), to the corresponding disk partition. -``` -sudo dd if=system.img of=/dev/sdx2 bs=1M -sudo dd if=vendor.img of=/dev/sdx3 bs=1M -``` ->**!!! Notice:** If the system booting is blocked, try to format data partition(**sudo mkfs.ext4 sdx4**) - -## 4.3. Burn boot partition -According to the different boot mode, the burning method of boot partition will be different.There are two kinds of boot mode:boot by Uboot and boot by UEFI. -### 4.3.1 Boot by Uboot -1. Format boot partition as ext4 -``` -sudo mkfs.ext4 sdx1 -``` -2. Mount boot partition -``` -mkdir ~/disk -sudo mount /dev/sdx1 ~/disk -``` -3. Copy the linux kernel images, device tree files, which are got in chapter [3.2 Build linux kernel](#32-build-linux-kernel), and ramdisk image which is got in chapter [3.1 Build OpenHarmony source code](#31-build-openharmony-source-code), to boot partition. -``` -sudo cp linux_kernel/arch/arm64/boot/Image ~/disk/ -sudo cp linux_kernel/arch/arm64/boot/dts/phytium/d2000-devboard-dsk.dtb ~/disk/ -sudo cp $PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img ~/disk/ -sync -``` ->If you have the linux kernel source code, you can get all files to burn in linux kernel output files. Get more details from README in linux kernel source code. -4. Unmount boot partition -``` -sudo umount ~/disk -``` -### 4.3.2 Boot by UEFI -1) Format boot partition as EFI -``` -sudo mkfs.vfat sdx1 -``` -2) Mount boot partition -``` -mkdir ~/disk -sudo mount /dev/sdx1 ~/disk -``` -3) Copy the linux kernel images, EFI files, which are got in chapter [3.2 Build linux kernel](#32-build-linux-kernel), and ramdisk image which is got in chapter [3.1 Build OpenHarmony source code](#31-build-openharmony-source-code), to boot partition. -``` -sudo cp linux_kernel/arch/arm64/boot/Image ~/disk/ -sudo cp $PHY_DEV/device_board_phytium/d2000/loader/EFI/ ~/disk/ -r -sudo cp $PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img ~/disk/ -sync -``` ->If you have the linux kernel source code, you can get all files to burn in linux kernel output files. Get more details from README in linux kernel source code. - -You can modify ~/disk/EFI/BOOT/grub.cfg to change boot parameters, Generally, use the default startup parameters. - -4) Unmount boot partition -``` -sudo umount ~/disk -``` -## 4.4 Image packaging tool -In contrast to the aforementioned burning process, we also provide an image packaging tool that allows you to package several partitions of img files into a single image, and then burn the packaged image to disk at once through the dd or winddows burning tool, without partitioning the disk. -Tool location: -``` -device_board_phytium/d2000/tools/generate_image/generate_image.sh -``` -For details on how to use and configure the tool, please refer to the instructions at the beginning of the script file. -# Boot device - -Connect the burnt SATA hard disk and debug serial port cable to the d2000 EVB board.The baud rate of the serial port debugging tool of the host computer is set to 115200, and then power on the d2000 EVB board. -## 5.1 Boot by Uboot -Press Enter in the serial port debugging tool window, after power on, and you will get into Uboot environment, set Uboot environment parameters and send uboot start command. -``` -setenv bootargs console=ttyAMA1,115200 earlycon=p1011,0x28001000 root=/dev/ram0 elevator=deadline rootwait rw loglevel=6 hardware=d2000 rootfstype=ext4 initrd=0x93000000,90M -setenv bootcmd "ext4load scsi 0:1 0x90100000 d2000-devboard-dsk.dtb;ext4load scsi 0:1 0x90200000 Image;ext4load scsi 0:1 0x93000000 ramdisk.img;booti 0x90200000 - 0x90100000" -saveenv -boot -``` -## 5.2 Boot by UEFI -Boot parameters have already been write in the boot partition, so it will directly start system after being powered on. - -# Maintainer email -Phytium Technology Co., Ltd -zhangjianwei@phytium.com.cn -tangkaiwen@phytium.com.cn -xiayan1086@phytium.com.cn -libowen1180@phytium.com.cn -chenzigui1762@phytium.com.cn diff --git a/README.md b/README.md index ce597b51e4f9b7b4cf6c4899d10a8f2ab92d7082..035f7a75f4a72d70cb5af6d7fcb87e0a1f90e399 100644 --- a/README.md +++ b/README.md @@ -1,210 +1,300 @@ # 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)。 -支持X100提供的视频解码硬件加速,以及图形显示硬件加速。 + +该项目介绍,如何在飞腾信息科技有限公司的 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。 # 搭建开发环境 + ## 1.1 硬件环境 -准备一台装有ubuntu20.04系统X86主机,内存最低配置要求16G。 + +准备一台装有ubuntu20.04系统X86主机,内存最低配置要求16G。 + ## 1.2 下载repo脚本文件 -1. 注册码云[gitee](https://gitee.com/signup?redirect_to_url=%2Fdashboard)账号。 +1. 注册码云[gitee](https://gitee.com/signup?redirect_to_url=%2Fdashboard)账号。 2. 注册码云SSH公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191)。 - 3. 安装[git客户端](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)和[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。 + ``` git config --global user.name "your-name" git config --global user.email "your-email-address" git config --global credential.helper store ``` + 4. 安装码云repo工具,可以执行如下命令。 + ``` curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo chmod a+x /usr/local/bin/repo pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests ``` ->注:如果没有访问/usr/local/bin/目录的权限,可将repo下载至其他目录,并将其配置到环境变量。 + +> 注:如果没有访问/usr/local/bin/目录的权限,可将repo下载至其他目录,并将其配置到环境变量。 + ## 1.3 获取OpenHarmony标准系统源码 + 通过repo + ssh 下载源码。 + ``` export WORK_SPACE=/home/xxx/workspace #替换成自己定义的workspace路径 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' ``` + ## 1.4 获取编译工具链 + 使用安装包方式获取编译工具链。 + ``` sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby openjdk-11-jdk libtinfo5 npm ``` + ## 1.5 执行prebuilts + 进入OpenHarmony源码根目录,执行脚本,安装编译器及二进制工具。 + ``` cd $PROJ_ROOT bash build/prebuilts_download.sh ``` # 飞腾设备代码下载与整合 + ## 2.1 下载phytium device源码 + 创建一个本地目录,然后将phytium device源码下载到该目录。 + ``` export PHY_DEV=$WORK_SPACE/phytium_device mkdir $PHY_DEV 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对应仓库中。 + +执行phytium_env.sh脚本,将phytium device代码,以及针对openharmony修改的patch集成到OpenHarmony中。 + ``` -$PHY_DEV/auto_patch.sh $PROJ_ROOT +./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)。 + +确认存储介质的类型,对应修改fstab文件。具体参考文档[Openharmony多种存储介质配置说明](https://gitee.com/phytium_embedded/phytium-openharmony-device/wikis/%E9%95%9C%E5%83%8F%E7%94%9F%E6%88%90%E4%B8%8E%E7%83%A7%E5%BD%95/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)。 # 代码编译 -## 3.1 编译OpenHarmony源码 + +## 3.1 编译OpenHarmony源码 + ``` cd $PROJ_ROOT ./build.sh --product-name d2000 --ccache --target-cpu arm64 ``` + 编译成功提示: + ``` post_process =====build d2000 successful. ``` + 编译生成的文件 + ``` $PROJ_ROOT/out/d2000/packages/phone/images/system.img $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 -``` ->**!!!注意:** -vpu是作为Linux Kernel的modules的方式进行编译的,内核代码修改更新时,需要同步更新vpu相关的ko文件。 -linux kernel源码编译后,vpu的ko文件生成的位置: -linux_kernel/drivers/media/platform/phytium-vpu/vxd/vxd.ko -linux_kernel/drivers/media/platform/phytium-vpu/mem_man/img_mem.ko -镜像烧写时,将这两个ko文件拷贝到开发板的system分区: -/system/lib64/media/plugins/ + +D2000源码暂未开源,请邮件联系phytium嵌入式软件部(linan1284@phytium.com.cn)获取kernel源码,并参考kernel源码中的README,编译出相关文件。 + +> **!!!注意:** +> vpu是作为Linux Kernel的modules的方式进行编译的,内核代码修改更新时,需要同步更新vpu相关的ko文件。 +> linux kernel源码编译后,vpu的ko文件生成的位置: +> linux_kernel/drivers/media/platform/phytium-vpu/vxd/vxd.ko +> linux_kernel/drivers/media/platform/phytium-vpu/mem_man/img_mem.ko +> 镜像烧写时,将这两个ko文件拷贝到开发板的system分区: +> /system/lib64/media/plugins/ # 镜像烧写 + ## 4.1 硬盘分区 -准备一块SATA硬盘,删除原有分区后,在linux下,使用fdsik命令分区,创建4个分区,依次为boot,system,vendor,userdata,根据实际情况设定,比如可以设定为500M,3G,500M,10G。 -p1 500MB for BOOT/EFI -p2 3GB for system -p3 500MB for vendor -p4 10G for data ->fdisk命令详细使用方法可自行百度谷歌,或者参考[飞腾嵌入式 LINUX 用户 -手册](https://gitee.com/phytium_embedded/phytium-sdk/blob/master/%E9%A3%9E%E8%85%BE%E5%B5%8C%E5%85%A5%E5%BC%8FLinux%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.pdf)中的磁盘分区部分内容。 + +准备一块SATA硬盘,删除原有分区后,在linux下,使用fdsik命令分区,创建4个分区,依次为boot,system,vendor,userdata,根据实际情况设定,比如可以设定为500M,3G,500M,10G。p1 500MB for BOOT/EFIp2 3GB for systemp3 500MB for vendorp4 10G for data + +> fdisk命令详细使用方法可自行百度谷歌,或者参考[飞腾嵌入式 LINUX 用户 +> 手册](https://gitee.com/phytium_embedded/phytium-sdk/blob/master/%E9%A3%9E%E8%85%BE%E5%B5%8C%E5%85%A5%E5%BC%8FLinux%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C.pdf)中的磁盘分区部分内容。 + ## 4.2 烧录system/vendor/userdata分区 + 将这三个分区并格式化为ext4,sdX中的X烧写之前先用df命令确认一下是多少,可能是b,c...等,这里一定要注意不要烧错。 + ``` sudo mkfs.ext4 sdx2 sudo mkfs.ext4 sdx3 sudo mkfs.ext4 sdx4 ``` ->**!!!注意:** 在格式化之前,用df确认需要烧写的分区,也就是sdx中的x,可能是a、b、c。 + +> **!!!注意:** 在格式化之前,用df确认需要烧写的分区,也就是sdx中的x,可能是a、b、c。 使用dd命令将[3.1 编译OpenHarmony源码](#31-编译openharmony源码)章节编译生成的镜像文件烧写到对应分区中。 + ``` sudo dd if=system.img of=/dev/sdx2 bs=1M sudo dd if=vendor.img of=/dev/sdx3 bs=1M ``` -## 4.3. 烧录boot分区 + +## 4.3. 烧录boot分区 + boot分区的烧录,启动方式不一样,烧录方法不一样,区分为Uboot启动和UEFI启动两种。 + ### 4.3.1 Uboot启动 + 1. 将boot分区格式化为ext4 + ``` sudo mkfs.ext4 sdx1 ``` + 2. 挂载boot分区 + ``` mkdir ~/disk sudo mount /dev/sdx1 ~/disk ``` -3. 将[3.2 编译 Linux kernel](#32-编译-linux-kernel)章节中生成的Kernel镜像,设备树文件,以及[3.3 编译OpenHarmony源码](#31-编译openharmony源码)章节中生成的ramdisk拷贝到boot分区。 + +3. 将[3.2 编译 Linux kernel](#32-编译-linux-kernel)章节中生成的Kernel镜像,设备树文件,以及[3.3 编译OpenHarmony源码](#31-编译openharmony源码)章节中生成的ramdisk拷贝到boot分区。 + ``` sudo cp linux_kernel/arch/arm64/boot/Image ~/disk/ sudo cp linux_kernel/arch/arm64/boot/dts/phytium/d2000-devboard-dsk.dtb ~/disk/ sudo cp $PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img ~/disk/ sync ``` ->如果使用kernel源码编译的文件,参考kernel源码中提供的README。 + +> 如果使用kernel源码编译的文件,参考kernel源码中提供的README。 + 4. 卸载boot分区 + ``` sudo umount ~/disk ``` + ### 4.3.2 UEFI启动 + 1) 将boot分区格式化为EFI + ``` sudo mkfs.vfat sdx1 ``` + 2) 挂载boot分区 + ``` mkdir ~/disk sudo mount /dev/sdx1 ~/disk ``` + 3) 将[3.2 编译 Linux kernel](#32-编译-linux-kernel)章节中生成的Kernel镜像,EFI文件,以及[3.1 编译OpenHarmony源码](#31-编译openharmony源码)章节中生成的ramdisk拷贝到EFI分区。 + ``` sudo cp linux_kernel/arch/arm64/boot/Image ~/disk/ sudo cp $PHY_DEV/device_board_phytium/d2000/loader/EFI/ ~/disk/ -r sudo cp $PROJ_ROOT/out/d2000/packages/phone/images/ramdisk.img ~/disk/ sync ``` ->如果使用kernel源码编译的文件,参考kernel源码中提供的README。 + +> 如果使用kernel源码编译的文件,参考kernel源码中提供的README。 如果需要修改启动参数,修改~/disk/EFI/BOOT/grub.cfg文件,一般使用默认启动参数的即可。 4) 卸载boot分区 + ``` sudo umount ~/disk ``` + ## 4.4 镜像打包工具 -区别于前面提到的烧写流程,我们还提供了一个镜像打包工具,可以将几个分区的img文件打包成一个镜像,通过dd或者winddows下的烧写工具将打包后的镜像一次性烧写到磁盘,不需要对磁盘分区。 + +区别于前面提到的烧写流程,我们还提供了一个镜像打包工具,可以将几个分区的img文件打包成一个镜像,通过dd或者winddows下的烧写工具将打包后的镜像一次性烧写到磁盘,不需要对磁盘分区。 工具所在位置: + +device_board_phytium/common/tools/generate_image/generate_image.sh ``` -device_board_phytium/d2000/tools/generate_image/generate_image.sh + +使用和配置方法详情,请参考[wiki文档](https://gitee.com/phytium_embedded/phytium-openharmony-device/wikis/%E9%95%9C%E5%83%8F%E7%94%9F%E6%88%90%E4%B8%8E%E7%83%A7%E5%BD%95/%E9%95%9C%E5%83%8F%E7%94%9F%E6%88%90%E8%84%9A%E6%9C%AC)。 + +参考命令: +cd out/d2000/packages/phone/images/ + +#uboot启动 +./generate_image.sh + +#UEFI启动 +./generate_image.sh efi ``` -使用和配置方法详情,请参考脚本文件开头的使用说明。 +打包时会有如下打印信息: +``` +start generate phytium_oh_xxx.img +start creating empty image, please wait...... +... +... +losetup loopdevice...... +generate phytium_oh_xxx.img successfully!!!!!! +``` + # 设备启动 -将烧写好的SATA硬盘和调试串口线,连接到d2000 DEV板上。上位机的串口调试工具波特率设置为115200,上电开机。 -## 5.1 Uboot启动 +将烧写好的SATA硬盘和调试串口线,连接到d2000 DEV板上。上位机的串口调试工具波特率设置为115200,上电开机。 + +## 5.1 Uboot启动 + 在开机阶段,按回车,设置uboot环境变量 + ``` setenv bootargs console=ttyAMA1,115200 earlycon=p1011,0x28001000 root=/dev/ram0 elevator=deadline rootwait rw loglevel=6 hardware=d2000 rootfstype=ext4 initrd=0x93000000,90M setenv bootcmd "ext4load scsi 0:1 0x90100000 d2000-devboard-dsk.dtb;ext4load scsi 0:1 0x90200000 Image;ext4load scsi 0:1 0x93000000 ramdisk.img;booti 0x90200000 - 0x90100000" saveenv boot ``` + ## 5.2 UEFI启动 + 启动参数已经在烧写EFI分区时已写好,上电后,会直接进入系统。 -# 维护者邮箱 -飞腾信息技术有限公司 -zhangjianwei@phytium.com.cn -tangkaiwen@phytium.com.cn -xiayan1086@phytium.com.cn -libowen1180@phytium.com.cn + +# 维护者邮箱 + +飞腾信息技术有限公司 +zhangjianwei@phytium.com.cn +tangkaiwen@phytium.com.cn +xiayan1086@phytium.com.cn +libowen1180@phytium.com.cn chenzigui1762@phytium.com.cn 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/README_zh.md b/device_board_phytium/README.md similarity index 100% rename from device_board_phytium/README_zh.md rename to device_board_phytium/README.md 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..c831f8a4e807e9e7abc9e84eb544f4e4b1d18488 --- /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}/boot ];then + echo "${3}/boot existed!" + cd ${3}/boot + rm -rf * + cd - + else + mkdir -p ${3}/boot + fi + + cp ${2}/kernel/src_tmp/${8}/arch/arm64/boot/Image ${3}/boot/ + + mkdir -p ${3}/boot/dtb + cp ${2}/kernel/src_tmp/${8}/arch/arm64/boot/dts/phytium/*.dtb ${3}/boot/dtb + + mkdir -p ${3}/boot/EFI + cp ${OHOS_ROOT_PATH}/device/board/phytium/${7}/loader/EFI/* ${3}/boot/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..e1a444c550b17e73b5c36c5696dad844fcaf5456 --- /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 [ ${DEVICE_NAME} = "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 53% 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..0d718cbe079c581dc7b1c8cd8910e98956f5fd36 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,55 @@ 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" +PART_MODE="msdos" + +while [ -n "$1" ] +do + case $1 in + efi) + BOOT_IMG="boot_efi.img" + IMAGE_NAME_END="efi" + BOOT_PART_FORMAT="fat32" + ;; + uboot) + BOOT_IMG="boot_uboot.img" + IMAGE_NAME_END="uboot" + BOOT_PART_FORMAT="ext4" + ;; + msdos) + PART_MODE="msdos" + ;; + gpt) + PART_MODE="gpt" + ;; + *) + if [ -f $1 ]; then + UBOOT_NAME=$1 + fi + ;; + esac + shift +done + +#### only uboot mode support to burn uboot image +if [ -f $UBOOT_NAME ]&&[ $IMAGE_NAME_END == "uboot" ]; then + UBOOT_NAME_BASENAME=$(basename $UBOOT_NAME) + IMAGE_NAME_END="uboot_"${UBOOT_NAME_BASENAME%.*} +else + UBOOT_NAME="no_uboot" +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 +109,30 @@ 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 with ${PART_MODE} mode !!!${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}" +echo -e "${green}1.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 +echo -e "${green}2.parting image with ${PART_MODE} mode......${normal}" + +if [ ${PART_MODE} == "gpt" ]; then + 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 +else + sudo parted $IMAGE_NAME --script -- mklabel msdos + sudo parted $IMAGE_NAME --script -- mkpart primary ${BOOT_PART_FORMAT} ${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 +fi 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 +141,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}3.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}" +echo -e "${green}4.start to generate userdata partition......${normal}" sudo mkfs.ext4 -L userdata $partUserdata +if [ -f $UBOOT_NAME ];then +echo -e "${green}5.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/common/tools/generate_image/make_boot.sh b/device_board_phytium/common/tools/generate_image/make_boot.sh new file mode 100755 index 0000000000000000000000000000000000000000..0b3ff82f955303f59aeccae494cd1e1778697177 --- /dev/null +++ b/device_board_phytium/common/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_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/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=modify-the-uid-of-bootanimation.patch b/device_board_phytium/d2000/patch/0005=foundation-graphic-graphic_2d=modify-the-uid-of-bootanimation.patch new file mode 100644 index 0000000000000000000000000000000000000000..7100b098dff72fefa8937707932f58eaeceb2619 --- /dev/null +++ b/device_board_phytium/d2000/patch/0005=foundation-graphic-graphic_2d=modify-the-uid-of-bootanimation.patch @@ -0,0 +1,13 @@ +diff --git a/graphic.cfg b/graphic.cfg +index 8b19d0226..9d8f11f64 100644 +--- a/graphic.cfg ++++ b/graphic.cfg +@@ -42,7 +42,7 @@ + ], + "importance" : -20, + "once" : 1, +- "uid" : "graphics", ++ "uid" : "root", + "gid" : ["graphics"], + "secon" : "u:r:bootanimation:s0" + } 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/patch/0010=drivers-interface-display-composer-v1_0=add-dp-con-type.patch b/device_board_phytium/d2000/patch/0010=drivers-interface-display-composer-v1_0=add-dp-con-type.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d357135b80f73df2f7d6f1c34842da12f04f789 --- /dev/null +++ b/device_board_phytium/d2000/patch/0010=drivers-interface-display-composer-v1_0=add-dp-con-type.patch @@ -0,0 +1,12 @@ +diff --git a/display/composer/v1_0/DisplayComposerType.idl b/display/composer/v1_0/DisplayComposerType.idl +index fce5368..77244e4 100644 +--- a/display/composer/v1_0/DisplayComposerType.idl ++++ b/display/composer/v1_0/DisplayComposerType.idl +@@ -305,6 +305,7 @@ enum InterfaceType { + DISP_INTF_VGA, /**< VGA interface */ + DISP_INTF_MIPI, /**< MIPI interface */ + DISP_INTF_PANEL, /**< PANEL interface */ ++ DISP_INTF_DP, /**< DP interface */ + DISP_INTF_BUTT, + }; + diff --git a/device_board_phytium/d2000/patch/0010=foundation-graphic-graphic_2d=add-dp-con-type.patch b/device_board_phytium/d2000/patch/0010=foundation-graphic-graphic_2d=add-dp-con-type.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f12f2a4ce215bfbbff414aae45d3d03d885694d --- /dev/null +++ b/device_board_phytium/d2000/patch/0010=foundation-graphic-graphic_2d=add-dp-con-type.patch @@ -0,0 +1,39 @@ +diff --git a/rosen/modules/composer/hdi_backend/include/hdi_display_type.h b/rosen/modules/composer/hdi_backend/include/hdi_display_type.h +index 8fc523255..bcbb0fcdf 100644 +--- a/rosen/modules/composer/hdi_backend/include/hdi_display_type.h ++++ b/rosen/modules/composer/hdi_backend/include/hdi_display_type.h +@@ -49,6 +49,7 @@ typedef enum { + GRAPHIC_DISP_INTF_VGA, /**< VGA interface */ + GRAPHIC_DISP_INTF_MIPI, /**< MIPI interface */ + GRAPHIC_DISP_INTF_PANEL, /**< PANEL interface */ ++ GRAPHIC_DISP_INTF_DP, /**< DP interface */ + GRAPHIC_DISP_INTF_BUTT, + } GraphicInterfaceType; + +diff --git a/rosen/modules/render_service/core/screen_manager/rs_screen.cpp b/rosen/modules/render_service/core/screen_manager/rs_screen.cpp +index fa2d2919b..4fbf3e0ec 100644 +--- a/rosen/modules/render_service/core/screen_manager/rs_screen.cpp ++++ b/rosen/modules/render_service/core/screen_manager/rs_screen.cpp +@@ -451,6 +451,10 @@ void RSScreen::CapabilityTypeDump(GraphicInterfaceType capabilityType, std::stri + dumpString += "DISP_INTF_BT656, "; + break; + } ++ case GRAPHIC_DISP_INTF_DP: { ++ dumpString += "DISP_INTF_DP, "; ++ break; ++ } + default: + dumpString += "INVILID_DISP_INTF, "; + break; +diff --git a/rosen/modules/render_service_base/include/screen_manager/screen_types.h b/rosen/modules/render_service_base/include/screen_manager/screen_types.h +index 7559c937d..a0f94d911 100644 +--- a/rosen/modules/render_service_base/include/screen_manager/screen_types.h ++++ b/rosen/modules/render_service_base/include/screen_manager/screen_types.h +@@ -91,6 +91,7 @@ typedef enum : uint32_t { + DISP_INTF_MIPI, + DISP_INTF_PANEL, + DISP_INTF_BUTT, ++ DISP_INTF_DP, + DISP_INVALID, + } ScreenInterfaceType; + diff --git a/device_board_phytium/d2000/patch/0011=base-hiviewdfx-hidumper=cancel-dump-privilege-check.patch b/device_board_phytium/d2000/patch/0011=base-hiviewdfx-hidumper=cancel-dump-privilege-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..02379aa5994f27cdfed92ad5150ce43611dd4394 --- /dev/null +++ b/device_board_phytium/d2000/patch/0011=base-hiviewdfx-hidumper=cancel-dump-privilege-check.patch @@ -0,0 +1,20 @@ +diff --git a/services/native/src/dump_manager_service.cpp b/services/native/src/dump_manager_service.cpp +index f7692c8..7c45220 100644 +--- a/services/native/src/dump_manager_service.cpp ++++ b/services/native/src/dump_manager_service.cpp +@@ -165,12 +165,15 @@ int32_t DumpManagerService::Request(std::vector &args, int outfd + // Authenticate dump permissions + bool DumpManagerService::HasDumpPermission() const + { ++ /* the default hidumper service does not provide DUMP privileges */ ++ #ifdef ENABLE_DUMP_PERMISSION_CHECK + uint32_t callingTokenID = IPCSkeleton::GetCallingTokenID(); + int res = Security::AccessToken::AccessTokenKit::VerifyAccessToken(callingTokenID, "ohos.permission.DUMP"); + if (res != Security::AccessToken::PermissionState::PERMISSION_GRANTED) { + DUMPER_HILOGI(MODULE_SERVICE, "No dump permission, please check!"); + return false; + } ++ #endif + return true; + } + diff --git a/device_board_phytium/d2000/patch/0013=build=make_boot_image.patch b/device_board_phytium/d2000/patch/0013=build=make_boot_image.patch new file mode 100755 index 0000000000000000000000000000000000000000..f51937e452ed32c6a0b2d1bc84a45177c0914b2e --- /dev/null +++ b/device_board_phytium/d2000/patch/0013=build=make_boot_image.patch @@ -0,0 +1,14 @@ +diff --git a/ohos/images/mkimage/mkimages.py b/ohos/images/mkimage/mkimages.py +index 9f14878..caf7c9c 100755 +--- a/ohos/images/mkimage/mkimages.py ++++ b/ohos/images/mkimage/mkimages.py +@@ -134,6 +134,9 @@ def mk_images(args): + mk_system_img(mkfs_tools, mk_configs, device, src_dir, is_sparse) + elif image_name == "ramdisk.img": + mk_ramdisk_img(mkfs_tools, mk_configs, device, src_dir, is_sparse) ++ ret = os.system('sh ./packages/phone/images/make_boot.sh ./packages/phone/images/') ++ if ret: ++ print("execute make_boot.sh fail, ret: %s" % str(ret)) + elif image_name == "updater_ramdisk.img": + if config.get('component_type', '') == 'system_component': + return diff --git a/device_soc_phytium/README.md b/device_soc_phytium/README.md index 33b9fd8f23c2d495d1badfe0edcb7fb0e6a57911..681d7298cb200d7ce60e37c805e0cf866e1f4997 100644 --- a/device_soc_phytium/README.md +++ b/device_soc_phytium/README.md @@ -5,7 +5,7 @@ D2000芯片简介参考[官网信息](https://phytium.com.cn/article/721)。 ### 1.2 仓库简介 -媒体、南向接口实现、框架及对接层库目录。 +媒体及wifi南向接口实现、框架及对接层库目录。 ### 1.3 约束 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/composer/display_composer_vdi_impl.cpp b/device_soc_phytium/d2000/hardware/display/src/display_device/composer/display_composer_vdi_impl.cpp index b9d34e37f010ee801c321fe75c3020f3b45c7713..0a0eeec3fb1fda54c5d59b8af27a0510449fd184 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/composer/display_composer_vdi_impl.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/composer/display_composer_vdi_impl.cpp @@ -108,19 +108,15 @@ int32_t DisplayComposerVdiImpl::SetDisplayPowerStatus(uint32_t devId, DispPowerS int32_t DisplayComposerVdiImpl::GetDisplayBacklight(uint32_t devId, uint32_t& level) { DISPLAY_LOGD(); - CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE); - int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::GetDisplayBacklight, &level); - DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec)); - return HDF_SUCCESS; + DISPLAY_LOGD("%{public}s is not supported", __func__); + return HDF_ERR_NOT_SUPPORT; } int32_t DisplayComposerVdiImpl::SetDisplayBacklight(uint32_t devId, uint32_t level) { DISPLAY_LOGD(); - CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE); - int32_t ec = composerModel_->CallDisplayFunction(devId, &HdiDisplay::SetDisplayBacklight, level); - DISPLAY_CHK_RETURN(ec != DISPLAY_SUCCESS, HDF_FAILURE, DISPLAY_LOGE("failed, ec=%{public}d", ec)); - return HDF_SUCCESS; + DISPLAY_LOGD("%{public}s is not supported", __func__); + return HDF_ERR_NOT_SUPPORT; } int32_t DisplayComposerVdiImpl::GetDisplayProperty(uint32_t devId, uint32_t id, uint64_t& value) @@ -381,8 +377,6 @@ int32_t DisplayComposerVdiImpl::SetLayerMaskInfo(uint32_t devId, uint32_t layerI int32_t DisplayComposerVdiImpl::SetLayerColor(uint32_t devId, uint32_t layerId, const LayerColor& layerColor) { CHECK_NULLPOINTER_RETURN_VALUE(composerModel_, HDF_FAILURE); - DISPLAY_LOGE("%{public}s layerColor: r=%{public}d, g=%{public}d, b=%{public}d, a=%{public}d", - __func__, layerColor.r, layerColor.g, layerColor.b, layerColor.a); DISPLAY_LOGD("%{public}s is not supported", __func__); return HDF_ERR_NOT_SUPPORT; } 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..75203aeb414bc9403d193590514ff9193304e9e6 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 @@ -50,6 +50,7 @@ DrmConnector::DrmConnector(drmModeConnector c, const FdPtr &fd) DISPLAY_LOGD("add possible encoder id %{public}d", c.encoders[i]); } + DISPLAY_LOGI("connector_type value is: %{public}d", c.connector_type); ConvertToHdiType(c.connector_type, mType); ConvertTypeToName(mType, mName); InitModes(c); @@ -129,17 +130,17 @@ 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; cap.phyWidth = mPhyWidth; cap.type = mType; - memcpy_s(const_cast(cap.name.c_str()), cap.name.size(), mName.c_str(), mName.size()); - if (mName.size() >= sizeof(cap.name)) { - cap.name[sizeof(cap.name) - 1] = 0; - } else { - cap.name[mName.size()] = 0; - } + cap.name = mName; cap.supportLayers = mSupportLayers; cap.virtualDispCount = mVirtualDispCount; cap.supportWriteBack = mSupportWriteBack; @@ -159,6 +160,9 @@ void DrmConnector::ConvertTypeToName(uint32_t type, std::string &name) case DISP_INTF_MIPI: name = "MIPI"; break; + case DISP_INTF_DP: + name = "DP"; + break; default: name = "Unknown"; break; @@ -178,6 +182,9 @@ void DrmConnector::ConvertToHdiType(uint32_t type, InterfaceType &hdiType) case DRM_MODE_CONNECTOR_HDMIB: hdiType = DISP_INTF_HDMI; break; + case DRM_MODE_CONNECTOR_DisplayPort: + hdiType = DISP_INTF_DP; + break; default: hdiType = DISP_INTF_BUTT; break; 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_plane.cpp b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_plane.cpp index cd8f134202ff3c986d332b48e4596381b4cbb9e6..8599e2896722868414fcfef8c77b13f897a1f797 100644 --- a/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_plane.cpp +++ b/device_soc_phytium/d2000/hardware/display/src/display_device/drm/drm_plane.cpp @@ -55,7 +55,7 @@ int DrmPlane::GetCrtcProp(DrmDevice &drmDevice) mPropCrtc_hId = prop.propId; crtc_h = prop.value; - DISPLAY_LOGE("plane %{public}d crtc_x %{public}d crtc_y %{public}d crtc_w %{public}d crtc_h %{public}d", + DISPLAY_LOGI("plane %{public}d crtc_x %{public}d crtc_y %{public}d crtc_w %{public}d crtc_h %{public}d", GetId(), crtc_x, crtc_y, crtc_w, crtc_h); return 0; @@ -87,7 +87,7 @@ int DrmPlane::GetSrcProp(DrmDevice &drmDevice) mPropSrc_hId = prop.propId; src_h = prop.value; - DISPLAY_LOGE("plane %{public}d src_x %{public}d src_y %{public}d src_w %{public}d src_h %{public}d", + DISPLAY_LOGI("plane %{public}d src_x %{public}d src_y %{public}d src_w %{public}d src_h %{public}d", GetId(), src_x, src_y, src_w, src_h); return 0; 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..9553c7856047cb64983ef22caa741215470b6222 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,26 +69,64 @@ 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; + constexpr uint64_t FRAME_INTERVAL_60HZ_NS = 16666667; + + uint32_t index = GetVBlankPipe(); + uint32_t high_crtc = (index << DRM_VBLANK_HIGH_CRTC_SHIFT); drmVBlank vblank = { - .request = - drmVBlankReq { - .type = DRM_VBLANK_RELATIVE, - .sequence = 1, - .signal = 0, - } + .request = { + .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; - return static_cast(vblank.reply.tval_sec * SEC_TO_NSEC + vblank.reply.tval_usec * USEC_TO_NSEC); + if (ret < 0) { + DISPLAY_LOGD("wait vblank failed ret : %{public}d, using software to simulate frame rate 60Hz", ret); + struct timespec req = {0, FRAME_INTERVAL_60HZ_NS}; + struct timespec rem = {0, 0}; + nanosleep(&req, &rem); + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + sq = 1; + return static_cast(now.tv_sec * SEC_TO_NSEC + now.tv_nsec); + } else { + sq = vblank.reply.sequence; + return static_cast(vblank.reply.tval_sec * SEC_TO_NSEC + vblank.reply.tval_usec * USEC_TO_NSEC); + } } 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..ce9b93d7c16836ced9c37c94d323964874442ee6 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 @@ -77,7 +77,33 @@ int32_t DisplayBufferVdiImpl::InvalidateCache(const BufferHandle& handle) const int32_t DisplayBufferVdiImpl::IsSupportedAlloc(const std::vector& infos, std::vector& supporteds) const { - return HDF_ERR_NOT_SUPPORT; + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::RegisterBuffer(const BufferHandle& handle) +{ + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::SetMetadata(const BufferHandle& handle, uint32_t key, const std::vector& value) +{ + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::GetMetadata(const BufferHandle& handle, uint32_t key, std::vector& value) +{ + return DISPLAY_NOT_SUPPORT; +} + +int32_t DisplayBufferVdiImpl::ListMetadataKeys(const BufferHandle& handle, std::vector& keys) +{ + 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() 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..fcd2c9b5d4ce17fc540e87c114a531f5ad55040e 100644 --- a/device_soc_phytium/d2000/hardware/vpu/BUILD.gn +++ b/device_soc_phytium/d2000/hardware/vpu/BUILD.gn @@ -15,52 +15,42 @@ import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") import("vpu_config.gni") -if (VPU_KERNEL_4_19) { - vpu_libs_dir = "lib64_kenel_4.19" -}else{ - vpu_libs_dir = "lib64_kenel_5.10" -} +#if (VPU_KERNEL_4_19) { +# vpu_libs_dir = "lib64_kenel_4.19" +#}else{ +# vpu_libs_dir = "lib64_kenel_5.10" +#} vpu_all_lib_deps = [] ohos_prebuilt_shared_library("libgstomx") { - source = "$vpu_libs_dir/libgstomx.so" + source = "libgstomx.so" 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 += [ ":libgstomx" ] -ohos_prebuilt_shared_library("libomx_vxd") { - source = "$vpu_libs_dir/libomx_vxd.so" +ohos_prebuilt_shared_library("libOMX_Core") { + source = "libOMX_Core.z.so" install_enable = true # relative_install_dir = "media/plugins" - install_images = [ system_base_dir ] + install_images = [ vendor_base_dir ] subsystem_name = "phytium_products" - part_name = "phytium_products" + part_name = "device_d2000" } -vpu_all_lib_deps += [ ":libomx_vxd" ] +vpu_all_lib_deps += [ ":libOMX_Core" ] -ohos_prebuilt_shared_library("img_mem") { - source = "$vpu_libs_dir/img_mem.ko" +ohos_prebuilt_shared_library("libgstyuvconvert") { + source = "libgstyuvconvert.z.so" 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" ] - -ohos_prebuilt_shared_library("vxd") { - source = "$vpu_libs_dir/vxd.ko" - install_enable = true - relative_install_dir = "media/plugins" - install_images = [ system_base_dir ] - subsystem_name = "phytium_products" - part_name = "phytium_products" -} -vpu_all_lib_deps += [ ":vxd" ] +vpu_all_lib_deps += [ ":libgstyuvconvert" ] ohos_prebuilt_shared_library("gstomx.conf") { source = "gstomx.conf" @@ -68,21 +58,23 @@ 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" ] - -ohos_prebuilt_shared_library("pvdec_full_bin.fw") { - source = "pvdec_full_bin.fw" - install_enable = true -# relative_install_dir = "lib/firmware" - module_install_dir = "lib/firmware" - install_images = [ "system" ] - subsystem_name = "phytium_products" - part_name = "phytium_products" +if (enable_ramdisk) { + ohos_prebuilt_etc("pvdec_full_bin.fw") { + source = "pvdec_full_bin.fw" + subsystem_name = "phytium_products" + part_name = "device_d2000" + install_enable = true + install_images = [ + "ramdisk", + ] + module_install_dir = "lib/firmware" + } + vpu_all_lib_deps += [ ":pvdec_full_bin.fw" ] } -vpu_all_lib_deps += [ ":pvdec_full_bin.fw" ] group("vpu-libs"){ deps = diff --git a/device_soc_phytium/d2000/hardware/vpu/gstomx.conf b/device_soc_phytium/d2000/hardware/vpu/gstomx.conf index 2d2bbb53113eb22f18ce68246e27d88e203f12c5..1c6bcde7be36ba08343083c9eb4f04ef722fce52 100644 --- a/device_soc_phytium/d2000/hardware/vpu/gstomx.conf +++ b/device_soc_phytium/d2000/hardware/vpu/gstomx.conf @@ -1,6 +1,6 @@ [omxh264dec] type-name=GstOMXH264Dec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.AVC rank=260 in-port-index=0 @@ -9,7 +9,7 @@ sink-template-caps=video/x-h264, parsed=(boolean) true, alignment=(string) au, s [omxh265dec] type-name=GstOMXHEVCDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.HEVC rank=260 in-port-index=0 @@ -18,7 +18,7 @@ sink-template-caps=video/x-h265, parsed=(boolean) true, alignment=(string) au [omxmpeg4videodec] type-name=GstOMXMPEG4VideoDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.MPEG4 rank=260 in-port-index=0 @@ -27,7 +27,7 @@ sink-template-caps=video/mpeg, mpegversion = (int) 4, parsed = (boolean) false, [omxmpeg2videodec] type-name=GstOMXMPEG2VideoDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.MPEG2 rank=260 in-port-index=0 @@ -36,7 +36,7 @@ sink-template-caps=video/mpeg, mpegversion=(int)2, systemstream=(boolean)false, [omxh263dec] type-name=GstOMXH263Dec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.H263 rank=260 in-port-index=0 @@ -44,7 +44,7 @@ out-port-index=1 [omxmjpegdec] type-name=GstOMXMJPEGDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.JPEG rank=260 in-port-index=0 @@ -52,7 +52,7 @@ out-port-index=1 [omxvc1dec] type-name=GstOMXWMVDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.VC1 rank=260 in-port-index=0 @@ -61,7 +61,7 @@ sink-template-caps=video/x-wmv,wmvversion=(int)3,format=(string){WMV3,WVC1} [omxvp6dec] type-name=GstOMXVP6Dec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.VP6 rank=260 in-port-index=0 @@ -70,7 +70,7 @@ sink-template-caps=video/x-vp6; video/x-vp6-flash; video/x-vp6-alpha [omxvp8dec] type-name=GstOMXVP8Dec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.VP8 rank=260 in-port-index=0 @@ -78,7 +78,7 @@ out-port-index=1 [omxsorensondec] type-name=GstOMXSORENSONDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.SORENSON sink-template-caps=video/x-flash-video rank=260 @@ -87,7 +87,7 @@ out-port-index=1 [omxrealvideodec] type-name=GstOMXREALVideoDec -core-name=libomx_vxd.so +core-name=libOMX_Core.z.so component-name=OMX.IMG.MSVDX.Decoder.REAL rank=260 in-port-index=0 diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/img_mem.ko b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/img_mem.ko deleted file mode 100644 index 94c5a65d3f13a55be17fef3f44b3db2c0fe4f4f9..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/img_mem.ko and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstomx.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstomx.so deleted file mode 100644 index fe6b1c6f6eb8cee3d6c1cdf78bce0ab66f112818..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libgstomx.so and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libomx_vxd.so b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libomx_vxd.so deleted file mode 100644 index 66d5d2a2794edeb5b271722f73826c394d8ecf3a..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/libomx_vxd.so and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/vxd.ko b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/vxd.ko deleted file mode 100644 index 279fed84b3f08fdcbf4c910af2b589aa519f1c34..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_4.19/vxd.ko and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/img_mem.ko b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/img_mem.ko deleted file mode 100644 index 68241be8c095a54757e0f8a806e3d2d22413ba29..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/img_mem.ko and /dev/null 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 deleted file mode 100644 index c5f35459b3b27414d512c11808aab1b99a95f446..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libgstomx.so and /dev/null 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 deleted file mode 100644 index 32acc65130ca1008e040e72fa7d3c64be4619b2d..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/libomx_vxd.so and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/vxd.ko b/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/vxd.ko deleted file mode 100644 index 8ee6a3886e2be5684a4e31630283866b377ccf29..0000000000000000000000000000000000000000 Binary files a/device_soc_phytium/d2000/hardware/vpu/lib64_kenel_5.10/vxd.ko and /dev/null differ diff --git a/device_soc_phytium/d2000/hardware/vpu/libOMX_Core.z.so b/device_soc_phytium/d2000/hardware/vpu/libOMX_Core.z.so new file mode 100755 index 0000000000000000000000000000000000000000..253480525ec8ad05f2fd93c59415f9180dbb0587 Binary files /dev/null and b/device_soc_phytium/d2000/hardware/vpu/libOMX_Core.z.so differ diff --git a/device_soc_phytium/d2000/hardware/vpu/libgstomx.so b/device_soc_phytium/d2000/hardware/vpu/libgstomx.so new file mode 100644 index 0000000000000000000000000000000000000000..351d5517da69190ff5785588a208c9bb421a74fb Binary files /dev/null and b/device_soc_phytium/d2000/hardware/vpu/libgstomx.so differ diff --git a/device_soc_phytium/d2000/hardware/vpu/libgstyuvconvert.z.so b/device_soc_phytium/d2000/hardware/vpu/libgstyuvconvert.z.so new file mode 100755 index 0000000000000000000000000000000000000000..1d724c3f426dfd2f0a0f80266f3469cc5c886033 Binary files /dev/null and b/device_soc_phytium/d2000/hardware/vpu/libgstyuvconvert.z.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 { + } + } +}