diff --git a/vendor/rkh/README_zh.md b/vendor/rkh/README_zh.md new file mode 100644 index 0000000000000000000000000000000000000000..fc1231e6a4046c7d4f8fba454505442f266a0369 --- /dev/null +++ b/vendor/rkh/README_zh.md @@ -0,0 +1,24 @@ +## 打rkh_patch + +1. 本rkh_patch 需要在hisilicon的patch打完之后再打 +2. 将rkh_patch 目录 和 rkh_patch_build.sh 放到与ohos的同级目录下 +3. 手动运行./rkh_patch_build.sh 即可完成 打patch的操作 + +## 编译 + +1. 参考//sdk/open_source/mbedtls/readme.txt说明下载 mbedtls-2.16.10.tar.gz +2. 参考//sdk/open_source/trusted-firmware-a/readme.txt说明下载 arm-trusted-firmware-2.2.tar.gz +3. 到ohos目录下运行 编译命令 ./build.sh --product-name=ipcamera_hispark_ss928v100_linux --ccache --no-prebuilt-sdk + +## 生成镜像 + +1. 编译完成到//out/hispark_ss928v100/ipcamera_hispark_ss928v100_linux 目录下可以看到生成的镜像文件 +2. 镜像文件包括 boot_image_4GB.bin、uboot_env_4GB.bin、fip.bin、rootfs_ext4.img、userfs_ext4.img、userdata_ext4.img 以及烧写配置文件emmc_burn_table.xml +3. 第一次烧写需要配置bootargs,脚本如下 +--- +setenv bootargs 'mem=512M console=ttyAMA0,115200 clk_ignore_unused rw rootwait root=/dev/mmcblk0p4 +rootfstype=ext4 blkdevparts=mmcblk0:512K(fastboot),512K(env),20M(kernel),200M(rootfs),50M(userfs),100M(userdata)'; +setenv bootcmd 'mmc read 0 0x50000000 0x800 0xA000; bootm 50000000'; setenv bootdelay 1; +sa; +re + diff --git a/vendor/rkh/rkh_patch/applications/applications_sample_camera.patch b/vendor/rkh/rkh_patch/applications/applications_sample_camera.patch new file mode 100644 index 0000000000000000000000000000000000000000..644f6b19e3ff7bad7cb1db7ef0228a3609de71a0 --- /dev/null +++ b/vendor/rkh/rkh_patch/applications/applications_sample_camera.patch @@ -0,0 +1,10 @@ +--- ohos/applications/sample/camera/bundle.json 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/bundle.json 2025-10-08 13:41:00.674524400 +0800 +@@ -45,6 +45,7 @@ + "//applications/sample/camera/cameraApp:cameraApp_hap", + "//applications/sample/camera/setting:setting_hap", + "//applications/sample/camera/gallery:gallery_hap", ++ "//applications/sample/camera/gallery:test_jpeg", + "//applications/sample/camera/media:media_sample" + ], + "inner_kits": [], diff --git a/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery.patch b/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery.patch new file mode 100644 index 0000000000000000000000000000000000000000..d675bd61d539b20ec4d7472b4d645f3e051da453 --- /dev/null +++ b/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery.patch @@ -0,0 +1,92 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/gallery/BUILD.gn ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/BUILD.gn +--- ohos/applications/sample/camera/gallery/BUILD.gn 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/BUILD.gn 2025-10-08 13:43:21.920153645 +0800 +@@ -61,6 +61,14 @@ shared_library("gallery") { + ] + } + ++copy("test_jpeg") { ++ sources = [ ++ "resources/photo1.jpeg", ++ "resources/photo2.jpeg" ++ ] ++ outputs = [ "${root_out_dir}/system/internal/{{source_file_part}}" ] ++} ++ + hap_pack("gallery_hap") { + deps = [ ":gallery" ] + mode = "hap" +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/gallery/include/gallery_config.h ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/include/gallery_config.h +--- ohos/applications/sample/camera/gallery/include/gallery_config.h 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/include/gallery_config.h 2025-09-22 11:11:14.522277012 +0800 +@@ -16,7 +16,11 @@ + #ifndef OHOS_GALLERY_CONFIG_H + #define OHOS_GALLERY_CONFIG_H + ++#include "components/ui_view_group.h" ++#define GALLERY_BACKGROUND_COLOR Color::ColorTo32(Color::GetColorFromRGB(0xdd, 0xdd, 0xdd)) ++ + namespace OHOS { ++ + /** icon resource file path */ + static const char* const BACK_ICON_PATH = "/gallery/assets/gallery/resources/drawable/ic_back.png"; + static const char* const VIDEO_TAG_ICON_PATH = "/gallery/assets/gallery/resources/drawable/ic_gallery_video_tag.png"; +@@ -34,8 +38,8 @@ static const char* const VIDEO_SOURCE_DI + /** general page configuration */ + static constexpr int ROOT_VIEW_POSITION_X = 0; + static constexpr int ROOT_VIEW_POSITION_Y = 0; +-static constexpr int ROOT_VIEW_WIDTH = 960; +-static constexpr int ROOT_VIEW_HEIGHT = 480; ++static constexpr int ROOT_VIEW_WIDTH = 1920; ++static constexpr int ROOT_VIEW_HEIGHT = 1080; + static constexpr uint16_t ROOT_VIEW_OPACITY = 255; + + static const char* const FONT_NAME = "SourceHanSansSC-Regular.otf"; +@@ -91,5 +95,6 @@ static constexpr uint16_t SLIDER_WIDTH = + static constexpr uint16_t KNOB_WIDTH = 25; + + static constexpr uint16_t PLAYER_FONT_SIZE = 18; ++ + } // namespace OHOS + #endif // OHOS_GALLERY_CONFIG_H +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/gallery/src/gallery_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/src/gallery_ability_slice.cpp +--- ohos/applications/sample/camera/gallery/src/gallery_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/src/gallery_ability_slice.cpp 2025-09-22 11:11:14.526276990 +0800 +@@ -175,6 +175,7 @@ void GalleryAbilitySlice::InitPictureLis + picContainer_->SetPosition(0, LABEL_POSITION_Y + LABEL_HEIGHT); + picContainer_->Resize(ROOT_VIEW_WIDTH, (THUMBNAIL_RESOLUTION_Y + THUMBNAIL_SPACE) * THUMBNAIL_COLUMN); + picContainer_->SetStyle(STYLE_BACKGROUND_OPA, 0); ++ picContainer_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Silver().full); + rootView_->Add(picContainer_); + + picList_ = new UIViewGroup(); +@@ -249,6 +250,7 @@ UIView* GalleryAbilitySlice::CreateImage + pictureOnClickListener_[pictureOnClickListenerCount_] = GetImageClickListener(imageName); + imageView->SetOnClickListener(pictureOnClickListener_[pictureOnClickListenerCount_++]); + imageView->SetTouchable(true); ++ imageView->SetResizeMode(UIImageView::FILL); + + if (strncmp(imageName, PHOTO_PREFIX, strlen(PHOTO_PREFIX)) == 0) { + imageView->SetPosition(pos.x, pos.y); +@@ -354,7 +356,7 @@ void GalleryAbilitySlice::OnStart(const + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(ROOT_VIEW_POSITION_X, ROOT_VIEW_POSITION_Y); + rootView_->Resize(ROOT_VIEW_WIDTH, ROOT_VIEW_HEIGHT); +- rootView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); ++ rootView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + + const char* pathHeader = GetSrcPath(); + if (sprintf_s(backIconAbsolutePath, MAX_PATH_LENGTH, "%s%s", pathHeader, BACK_ICON_PATH) < 0) { +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/gallery/src/picture_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/src/picture_ability_slice.cpp +--- ohos/applications/sample/camera/gallery/src/picture_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/gallery/src/picture_ability_slice.cpp 2025-09-22 11:11:14.526276990 +0800 +@@ -124,7 +124,7 @@ void PictureAbilitySlice::OnStart(const + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(ROOT_VIEW_POSITION_X, ROOT_VIEW_POSITION_Y); + rootView_->Resize(ROOT_VIEW_WIDTH, ROOT_VIEW_HEIGHT); +- rootView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); ++ rootView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + + uint16_t imagePathLen = strlen(PHOTO_DIRECTORY) + strlen(reinterpret_cast(want.data)) + 1; + if (imagePathLen > MAX_PATH_LENGTH) { diff --git a/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery_resources.patch b/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery_resources.patch new file mode 100644 index 0000000000000000000000000000000000000000..4f5495c9ce0fc0410839f755b29bb5c085cad202 Binary files /dev/null and b/vendor/rkh/rkh_patch/applications/applications_sample_camera_gallery_resources.patch differ diff --git a/vendor/rkh/rkh_patch/applications/applications_sample_camera_launcher.patch b/vendor/rkh/rkh_patch/applications/applications_sample_camera_launcher.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2d5de73082b3c4bdab6b5ffce1dff73b99929e7 --- /dev/null +++ b/vendor/rkh/rkh_patch/applications/applications_sample_camera_launcher.patch @@ -0,0 +1,39 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/launcher/launcher/src/main/cpp/app_info.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/app_info.cpp +--- ohos/applications/sample/camera/launcher/launcher/src/main/cpp/app_info.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/app_info.cpp 2025-10-08 12:53:52.552575764 +0800 +@@ -64,8 +64,9 @@ void AppInfo::SetButton(UILabelButton* b + button->SetStyle(STYLE_BORDER_RADIUS, BUTTON_RADIUS); + button->SetStyle(STYLE_BACKGROUND_OPA, TOTAL_OPACITY); + button->SetStyle(STYLE_BORDER_OPA, TOTAL_OPACITY); +- button->SetStyle(STYLE_TEXT_COLOR, Color::ColorTo32(Color::White())); ++ button->SetStyle(STYLE_TEXT_COLOR, Color::ColorTo32(Color::Black())); + button->SetImageSrc(appIconDir_, appIconDir_); ++ button->SetImagePosition(buttonHV_.x / 4, buttonHV_.y / 4); + button_ = button; + } + +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/launcher/launcher/src/main/cpp/main_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/main_ability_slice.cpp +--- ohos/applications/sample/camera/launcher/launcher/src/main/cpp/main_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/main_ability_slice.cpp 2025-10-08 12:45:15.168756672 +0800 +@@ -112,7 +112,8 @@ void MainAbilitySlice::OnStart(const Wan + rootview_->Resize(Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + rootview_->SetStyle(STYLE_BACKGROUND_OPA, UN_OPACITY); + rootview_->SetStyle(STYLE_BACKGROUND_COLOR, Color::ColorTo32(Color::GetColorFromRGB(0x30, 0x30, 0x30))); +- ++ // SetImageView(); ++ // SetOhos(); + SetHead(); + SetTail(); + SetSwipe(); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/launcher/launcher/src/main/cpp/ui_config.h ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/ui_config.h +--- ohos/applications/sample/camera/launcher/launcher/src/main/cpp/ui_config.h 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/launcher/launcher/src/main/cpp/ui_config.h 2025-10-08 13:00:36.990780167 +0800 +@@ -24,7 +24,7 @@ static constexpr int16_t LABLE_TITLE_HEI + static constexpr int16_t LABLE_TAIL_HEIGHT = 30; + static constexpr int16_t APP_WIDTH_COUNT = 7; // blank + app + blank + app + blank + static constexpr int16_t APP_HEIGHT_COUNT = 4; // app + lable + app + lable +-static constexpr int16_t MAX_VIEWGROUP = 3; // swipe window count ++static constexpr int16_t MAX_VIEWGROUP = 1; // swipe window count + static constexpr int16_t APP_ROW_COUNT = 2; // a swipe view app count in row + static constexpr int16_t APP_COL_COUNT = 3; // a sswipe view app count in col + static constexpr int16_t LAUNCHER_FOND_ID = 16; // other view fond id diff --git a/vendor/rkh/rkh_patch/applications/applications_sample_camera_setting.patch b/vendor/rkh/rkh_patch/applications/applications_sample_camera_setting.patch new file mode 100644 index 0000000000000000000000000000000000000000..156566830003add295b4dcc75ee9006efdfa0cb3 --- /dev/null +++ b/vendor/rkh/rkh_patch/applications/applications_sample_camera_setting.patch @@ -0,0 +1,191 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/app_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/app_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/app_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/app_ability_slice.cpp 2025-09-22 11:11:14.530276969 +0800 +@@ -171,6 +171,7 @@ void AppAbilitySlice::OnStart(const Want + + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + SetButtonListener(); + SetHead(); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/app_info_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/app_info_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/app_info_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/app_info_ability_slice.cpp 2025-09-22 11:11:14.534276945 +0800 +@@ -148,6 +148,7 @@ void AppInfoAbilitySlice::OnStart(const + } + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + SetButtonListener(); + SetHead(); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.cpp 2025-10-04 21:59:17.051898643 +0800 +@@ -308,7 +308,7 @@ void MainAbilitySlice::SetScrollView() + scrollView_->SetYScrollBarVisible(false); + rootView_->Add(scrollView_); + SetWifiButtonView(); +- SetAppButtonView(); ++ // SetAppButtonView(); + SetDisplayButtonView(); + SetAboutButtonView(); + } +@@ -322,6 +322,7 @@ void MainAbilitySlice::OnStart(const Wan + SetButtonListenerAbout(); + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + + SetHead(); +@@ -356,4 +357,4 @@ void MainAbilitySlice::OnStop() + { + AbilitySlice::OnStop(); + } +-} // namespace OHOS +\ No newline at end of file ++} // namespace OHOS +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.h ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.h +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.h 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/main_ability_slice.h 2025-09-22 11:11:14.534276945 +0800 +@@ -90,7 +90,7 @@ private: + constexpr static int DISPALY_BUTTON_Y = 190; + + constexpr static int ABOUT_BUTTON_X = 0; +- constexpr static int ABOUT_BUTTON_Y = 190; ++ constexpr static int ABOUT_BUTTON_Y = 95; + constexpr static int ABOUT_BUTTON_HEIGHT = 113; + constexpr static int ABOUT_BUTTON_TEXT_ABOUT_Y = 5; + constexpr static int ABOUT_BUTTON_TEXT_SYSTEM_X = 18; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.cpp 2025-09-22 11:11:14.534276945 +0800 +@@ -77,6 +77,8 @@ void SettingAboutAbilitySlice::SetHead() + headView_ = new UIViewGroup(); + rootView_->Add(headView_); + headView_->SetPosition(DE_HEAD_X, DE_HEAD_Y, DE_HEAD_WIDTH, DE_HEAD_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + headView_->SetStyle(STYLE_BACKGROUND_OPA, 0); + headView_->SetTouchable(true); + headView_->SetOnClickListener(buttonBackListener_); +@@ -126,7 +128,7 @@ void SettingAboutAbilitySlice::SetScroll + scrollView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_SCROLL_COLOR); + scrollView_->SetPosition(DE_SCROLL_X, DE_SCROLL_Y, DE_SCROLL_WIDTH, DE_SCROLL_HEIGHT); + scrollView_->SetXScrollBarVisible(false); +- scrollView_->SetYScrollBarVisible(true); ++ scrollView_->SetYScrollBarVisible(false); + rootView_->Add(scrollView_); + for (int count = 0; count < SCROLL_ITEM_NUM; count++) { + SetScrollItem(count); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.h ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.h +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.h 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_about_ability_slice.h 2025-09-22 11:11:14.534276945 +0800 +@@ -60,7 +60,7 @@ private: + constexpr static int SCROLL_ITEM_NUM = 9; + const char *itemInfo_[SCROLL_ITEM_NUM][2]; + constexpr static int ITEM_X = 0; +- constexpr static int ITEM_INFO_X = 465; ++ constexpr static int ITEM_INFO_X = 1225; + constexpr static int ITEM_INFO_Y = 36; + }; + } // namespace OHOS +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_display_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_display_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_display_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_display_ability_slice.cpp 2025-09-22 11:11:14.534276945 +0800 +@@ -113,6 +113,7 @@ void SettingDisplayAbilitySlice::OnStart + + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + SetButtonListener(); + SetHead(); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_utils.h ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_utils.h +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_utils.h 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_utils.h 2025-10-08 13:15:29.401574159 +0800 +@@ -28,15 +28,15 @@ namespace OHOS { + + #define DE_ROOT_X 0 + #define DE_ROOT_Y 0 +-#define DE_ROOT_WIDTH 960 +-#define DE_ROOT_HEIGHT 480 +-#define DE_ROOT_BACKGROUND_COLOR Color::ColorTo32(Color::Black()) ++#define DE_ROOT_WIDTH 1920 ++#define DE_ROOT_HEIGHT 1080 ++#define DE_ROOT_BACKGROUND_COLOR Color::ColorTo32(Color::Gray()) + + #define DE_SCROLL_X 36 + #define DE_SCROLL_Y 72 +-#define DE_SCROLL_WIDTH 888 +-#define DE_SCROLL_HEIGHT 408 +-#define DE_SCROLL_COLOR Color::ColorTo32(Color::Black()) ++#define DE_SCROLL_WIDTH 1840 ++#define DE_SCROLL_HEIGHT 1008 ++#define DE_SCROLL_COLOR Color::ColorTo32(Color::Gray()) + + #define DE_HEAD_X 0 + #define DE_HEAD_Y 0 +@@ -55,7 +55,7 @@ namespace OHOS { + #define DE_HEAD_TEXT_SIZE 32 + #define DE_HEAD_TEXT_COLOR Color::ColorTo32(Color::White()) + +-#define DE_BUTTON_WIDTH 888 ++#define DE_BUTTON_WIDTH 1840 + #define DE_BUTTON_HEIGHT 89 + #define DE_BUTTON_BACKGROUND_COLOR Color::ColorTo32(Color::GetColorFromRGB(0x33, 0x33, 0x33)) + #define DE_BUTTON_RADIUS 16 +@@ -67,17 +67,17 @@ namespace OHOS { + #define DE_TITLE_TEXT_SIZE 26 + #define DE_TITLE_TEXT_COLOR Color::ColorTo32(Color::White()) + +-#define DE_SUBTITLE_TEXT_WIDTH 400 ++#define DE_SUBTITLE_TEXT_WIDTH 600 + #define DE_SUBTITLE_TEXT_HEIGHT 40 + #define DE_SUBTITLE_TEXT_COLOR Color::ColorTo32(Color::GetColorFromRGB(0x9F, 0x9F, 0x9F)) + #define DE_SUBTITLE_TEXT_SIZE 24 + +-#define DE_FORWARD_IMG_X 855 ++#define DE_FORWARD_IMG_X 1805 + #define DE_FORWARD_IMG_Y 24 + #define DE_FORWARD_IMG_WIDTH 12 + #define DE_FORWARD_IMG_HEIGHT 12 + +-#define DE_TOGGLE_BUTTON_X 816 ++#define DE_TOGGLE_BUTTON_X 1776 + #define DE_TOGGLE_BUTTON_Y 14 + + #define DE_ITEM_INTERVAL 95 +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_ability_slice.cpp 2025-09-22 11:11:14.534276945 +0800 +@@ -212,7 +212,7 @@ void SettingWifiAbilitySlice::SetScrollW + scrollView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_SCROLL_COLOR); + scrollView_->SetPosition(DE_SCROLL_X, SCROLL_WIFI_Y, DE_SCROLL_WIDTH, SCROLL_WIFI_HEIGHT); + scrollView_->SetXScrollBarVisible(false); +- scrollView_->SetYScrollBarVisible(true); ++ scrollView_->SetYScrollBarVisible(false); + rootView_->Add(scrollView_); + g_wifiStatus = 0; + AddWifi(); +@@ -239,6 +239,7 @@ void SettingWifiAbilitySlice::OnStart(co + + rootView_ = RootView::GetWindowRootView(); + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + SetButtonListener(); + SetHead(); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_input_password_ability_slice.cpp ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_input_password_ability_slice.cpp +--- ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_input_password_ability_slice.cpp 2025-05-03 17:54:14.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/applications/sample/camera/setting/setting/src/main/cpp/setting_wifi_input_password_ability_slice.cpp 2025-09-22 11:11:14.534276945 +0800 +@@ -245,6 +245,7 @@ void SettingWifiInputPasswordAbilitySlic + g_inputCount = 0; + g_cursorPositionX = 20; // 20 + rootView_->SetPosition(DE_ROOT_X, DE_ROOT_Y, DE_ROOT_WIDTH, DE_ROOT_HEIGHT); ++ rootView_->Resize(DE_ROOT_WIDTH, DE_ROOT_HEIGHT); + rootView_->SetStyle(STYLE_BACKGROUND_COLOR, DE_ROOT_BACKGROUND_COLOR); + SetButtonListener(); + SetHead(); diff --git a/vendor/rkh/rkh_patch/base/security_appverify.patch b/vendor/rkh/rkh_patch/base/security_appverify.patch new file mode 100644 index 0000000000000000000000000000000000000000..106bef475ce256ca66565dbc53e16b0e83820425 --- /dev/null +++ b/vendor/rkh/rkh_patch/base/security_appverify.patch @@ -0,0 +1,11 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/base/security/appverify/interfaces/innerkits/appverify_lite/include/app_file.h ../../../../../hi3403_l1_0922/ohos/base/security/appverify/interfaces/innerkits/appverify_lite/include/app_file.h +--- ohos/base/security/appverify/interfaces/innerkits/appverify_lite/include/app_file.h 2025-05-03 17:54:30.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/base/security/appverify/interfaces/innerkits/appverify_lite/include/app_file.h 2025-09-22 11:11:27.094206976 +0800 +@@ -17,6 +17,7 @@ + #define SECURITY_APP_FILE_H + + #include ++#include + + #ifdef __cplusplus + #if __cplusplus diff --git a/vendor/rkh/rkh_patch/base/startup_appspawn.patch b/vendor/rkh/rkh_patch/base/startup_appspawn.patch new file mode 100644 index 0000000000000000000000000000000000000000..100efb8650aa14ed15dea0726325c453662f80d6 --- /dev/null +++ b/vendor/rkh/rkh_patch/base/startup_appspawn.patch @@ -0,0 +1,12 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/base/startup/appspawn/lite/appspawn_process.c ../../../../../hi3403_l1_0922/ohos/base/startup/appspawn/lite/appspawn_process.c +--- ohos/base/startup/appspawn/lite/appspawn_process.c 2025-05-03 17:54:32.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/base/startup/appspawn/lite/appspawn_process.c 2025-09-22 11:11:28.586198626 +0800 +@@ -144,7 +144,7 @@ static int SetCapabilities(struct AppSpa + } + + #ifndef APPSPAWN_TEST +- unsigned int tmpCaps[] = {17}; // 17 means CAP_SYS_RAWIO ++ unsigned int tmpCaps[] = {17, 21, 23}; // 17 means CAP_SYS_RAWIO, CAP_SYS_ADMIN (21), CAP_SYS_NICE (23) + unsigned int tmpsCapCnt = sizeof(tmpCaps) / sizeof(tmpCaps[0]); + if (SetCapability(tmpsCapCnt, tmpCaps) != 0) { + APPSPAWN_LOGE("[appspawn] setrlimit failed, err: %d.", errno); diff --git a/vendor/rkh/rkh_patch/base/startup_init.patch b/vendor/rkh/rkh_patch/base/startup_init.patch new file mode 100644 index 0000000000000000000000000000000000000000..b904d48bfa915b18558de5a2efd288c8c8902d02 --- /dev/null +++ b/vendor/rkh/rkh_patch/base/startup_init.patch @@ -0,0 +1,9 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/base/startup/init/ueventd/etc/ueventd_l1.config ../../../../../hi3403_l1_0922/ohos/base/startup/init/ueventd/etc/ueventd_l1.config +--- ohos/base/startup/init/ueventd/etc/ueventd_l1.config 2025-05-03 17:54:32.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/base/startup/init/ueventd/etc/ueventd_l1.config 2025-09-22 11:11:28.774197573 +0800 +@@ -18,3 +18,5 @@ + /dev/urandom 0666 0 0 + /dev/mmz_userdev 0666 0 0 + /dev/watchdog 0660 watchdog watchdog ++/dev/ot_tde 0666 0 0 ++/dev/ot_proc 0666 0 0 diff --git a/vendor/rkh/rkh_patch/device/device_soc_hisilicon_ss928v100_burn.patch b/vendor/rkh/rkh_patch/device/device_soc_hisilicon_ss928v100_burn.patch new file mode 100644 index 0000000000000000000000000000000000000000..86b26110517cef9177f6e624874d07c8020312ad Binary files /dev/null and b/vendor/rkh/rkh_patch/device/device_soc_hisilicon_ss928v100_burn.patch differ diff --git a/vendor/rkh/rkh_patch/foundation/arkui_ace_engine_lite.patch b/vendor/rkh/rkh_patch/foundation/arkui_ace_engine_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3c9eab616fa870d9564c874eb888deaf788aaf9 --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/arkui_ace_engine_lite.patch @@ -0,0 +1,48 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ace_engine_lite/bundle.json ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ace_engine_lite/bundle.json +--- ohos/foundation/arkui/ace_engine_lite/bundle.json 2025-05-03 17:56:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ace_engine_lite/bundle.json 2025-09-22 11:11:57.150037233 +0800 +@@ -47,8 +47,7 @@ + ] + }, + "build": { +- "sub_component": [ +- "//foundation/arkui/ace_engine_lite/test:unittest", ++ "sub_component": [ + "//foundation/arkui/ace_engine_lite/frameworks:jsfwk" + ], + "inner_kits": [ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ace_engine_lite/frameworks/module_manager/ohos_module_config.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ace_engine_lite/frameworks/module_manager/ohos_module_config.h +--- ohos/foundation/arkui/ace_engine_lite/frameworks/module_manager/ohos_module_config.h 2025-05-03 17:56:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ace_engine_lite/frameworks/module_manager/ohos_module_config.h 2025-09-22 11:11:57.214036869 +0800 +@@ -29,9 +29,12 @@ extern void InitAppModule(JSIValue expor + #if (FEATURE_SUPPORT_HTTP == 1) + extern void InitFetchModule(JSIValue exports); + #endif // FEATURE_SUPPORT_HTTP +-#if (FEATURE_MODULE_AUDIO == 1) +-extern void InitAudioModule(JSIValue exports); +-#endif // FEATURE_MODULE_AUDIO ++ ++// rkh_build ++// #if (FEATURE_MODULE_AUDIO == 1) ++// extern void InitAudioModule(JSIValue exports); ++// #endif // FEATURE_MODULE_AUDIO ++ + #if (FEATURE_ACELITE_DFX_MODULE == 1) + extern void InitDfxModule(JSIValue exports); + #endif // FEATURE_ACELITE_DFX_MODULE +@@ -102,9 +105,12 @@ const Module OHOS_MODULES[] = { + #if (FEATURE_SUPPORT_HTTP == 1) + {"fetch", InitFetchModule}, + #endif // FEATURE_SUPPORT_HTTP +-#if (FEATURE_MODULE_AUDIO == 1) +- {"audio", InitAudioModule}, +-#endif // FEATURE_MODULE_AUDIO ++ ++// rkh_build ++// #if (FEATURE_MODULE_AUDIO == 1) ++// {"audio", InitAudioModule}, ++// #endif // FEATURE_MODULE_AUDIO ++ + #if (FEATURE_ACELITE_DFX_MODULE == 1) + {"dfx", InitDfxModule}, + #endif // FEATURE_ACELITE_DFX_MODULE diff --git a/vendor/rkh/rkh_patch/foundation/arkui_ui_lite.patch b/vendor/rkh/rkh_patch/foundation/arkui_ui_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..2e2d1f3d7407c8f304c4898c35faaf125539d76d --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/arkui_ui_lite.patch @@ -0,0 +1,1255 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/BUILD.gn ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/BUILD.gn +--- ohos/foundation/arkui/ui_lite/BUILD.gn 2025-05-03 17:56:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/BUILD.gn 2025-09-22 12:34:40.964729466 +0800 +@@ -185,7 +185,6 @@ if (os_level != "standard") { + "frameworks/draw/draw_triangle.cpp", + "frameworks/draw/draw_utils.cpp", + "frameworks/engines/gfx/gfx_engine_manager.cpp", +- "frameworks/engines/gfx/hi3516/hi3516_engine.cpp", + "frameworks/engines/gfx/soft_engine.cpp", + "frameworks/events/event.cpp", + "frameworks/font/base_font.cpp", +@@ -207,6 +206,8 @@ if (os_level != "standard") { + "frameworks/imgdecode/cache_manager.cpp", + "frameworks/imgdecode/file_img_decoder.cpp", + "frameworks/imgdecode/image_load.cpp", ++ "frameworks/imgdecode/png_img_decoder.cpp", ++ "frameworks/imgdecode/jpeg_img_decoder.cpp", + "frameworks/layout/flex_layout.cpp", + "frameworks/layout/grid_layout.cpp", + "frameworks/layout/list_layout.cpp", +@@ -219,6 +220,12 @@ if (os_level != "standard") { + "frameworks/window/window_impl.cpp", + ] + ++ if (board_name == "hispark_ss927v100" || board_name == "hispark_ss928v100") { ++ sources += ["frameworks/engines/gfx/hi3519/hi3519_engine.cpp"] ++ } else { ++ sources += ["frameworks/engines/gfx/hi3516/hi3516_engine.cpp"] ++ } ++ + if (ohos_kernel_type == "liteos_m") { + target_type = "static_library" + include_dirs = [ +@@ -260,7 +267,7 @@ if (os_level != "standard") { + + if (ui_lite_enable_video_component_config) { + defines += [ "ENABLE_VIDEO_COMPONENT=1" ] +- source += [ "frameworks/components/ui_video.cpp" ] ++ sources += [ "frameworks/components/ui_video.cpp" ] + + deps += [ "//foundation/multimedia/media_lite/frameworks/player_lite:player_lite" ] + } +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/common/graphic_startup.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/common/graphic_startup.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/common/graphic_startup.cpp 2025-05-03 17:56:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/common/graphic_startup.cpp 2025-09-22 12:34:40.964729466 +0800 +@@ -38,6 +38,7 @@ + #endif + #if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES + #include "hals/gfx_engines.h" ++#include "hals/gralloc_engines.h" + #endif + #include "securec.h" + +@@ -150,6 +151,7 @@ void GraphicStartUp::Init() + #endif + #if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES + GfxEngines::GetInstance()->InitDriver(); ++ GrallocEngines::GetInstance()->Init(); + #endif + } + } // namespace OHOS +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/common/image.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/common/image.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/common/image.cpp 2025-05-03 17:56:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/common/image.cpp 2025-09-22 12:34:40.964729466 +0800 +@@ -103,7 +103,7 @@ bool Image::SetStandardSrc(const char* s + return false; + } + +-#if ENABLE_JPEG || ENABLE_PNG ++#if (ENABLE_JPEG || ENABLE_PNG) && (!CACHE_JPEG_AND_PNG) + ImageType imageType = CheckImgType(src); + #if ENABLE_PNG + if (imageType == IMG_PNG) { +@@ -250,7 +250,7 @@ bool Image::PreParse(const char *src) + } + path_ = path; + bool isSucess = true; +-#if ENABLE_JPEG || ENABLE_PNG ++#if (ENABLE_JPEG || ENABLE_PNG) && (!CACHE_JPEG_AND_PNG) + ImageType imageType = CheckImgType(src); + if (imageType == IMG_PNG) { + #if ENABLE_PNG +@@ -285,7 +285,7 @@ void Image::DrawImage(BufferInfo& gfxDst + } + } + +-#if ENABLE_PNG ++#if ENABLE_PNG && (!CACHE_JPEG_AND_PNG) + static inline void FreePngBytep(png_bytep** rowPointer, uint16_t size) + { + png_bytep* tmpRowPointer = *rowPointer; +@@ -409,7 +409,7 @@ bool Image::SetPNGSrc(const char* src) + } + #endif + +-#if ENABLE_JPEG ++#if ENABLE_JPEG && (!CACHE_JPEG_AND_PNG) + bool Image::SetJPEGSrc(const char* src) + { + struct jpeg_decompress_struct cinfo; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/components/root_view.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/root_view.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/components/root_view.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/root_view.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -19,6 +19,9 @@ + #include "core/render_manager.h" + #include "draw/draw_utils.h" + #include "gfx_utils/graphic_log.h" ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++#include "hals/gralloc_engines.h" ++#endif + #if defined(ENABLE_WINDOW) && ENABLE_WINDOW + #include "window/window_impl.h" + #endif +@@ -576,7 +579,13 @@ void RootView::BlitMapBuffer(Rect& curVi + imageInfo.header.height = dc_.mapBufferInfo->height; + imageInfo.header.reserved = 0; + imageInfo.data = reinterpret_cast(dc_.mapBufferInfo->virAddr); ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ imageInfo.phyAddr = reinterpret_cast(dc_.mapBufferInfo->phyAddr); ++ TransformDataInfo imageTranDataInfo = {imageInfo.header, imageInfo.data, ++ imageInfo.phyAddr, pxSize, LEVEL0, BILINEAR}; ++#else + TransformDataInfo imageTranDataInfo = {imageInfo.header, imageInfo.data, pxSize, LEVEL0, BILINEAR}; ++#endif + BaseGfxEngine::GetInstance()->DrawTransform(*dc_.bufferInfo, invalidRect, {0, 0}, Color::Black(), OPA_OPAQUE, + transMap, imageTranDataInfo); + } +@@ -843,14 +852,34 @@ void RootView::InitMapBufferInfo(BufferI + BaseGfxEngine* baseGfxEngine = BaseGfxEngine::GetInstance(); + baseGfxEngine->AdjustLineStride(*dc_.mapBufferInfo); + uint32_t bufferSize = dc_.mapBufferInfo->stride * dc_.mapBufferInfo->height; ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ AllocInfo info; ++ info.expectedSize = bufferSize; ++ info.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_MMZ; ++ ++ GrallocBuffer buffer; ++ if (!GrallocEngines::GetInstance()->AllocBuffer(info, buffer)) { ++ GRAPHIC_LOGE("AllocBuffer failed."); ++ delete dc_.mapBufferInfo; ++ dc_.mapBufferInfo = nullptr; ++ return; ++ } ++ dc_.mapBufferInfo->virAddr = buffer.virAddr; ++ dc_.mapBufferInfo->phyAddr = reinterpret_cast(buffer.phyAddr); ++#else + dc_.mapBufferInfo->virAddr = dc_.mapBufferInfo->phyAddr = + baseGfxEngine->AllocBuffer(bufferSize, BUFFER_MAP_SURFACE); ++#endif + } + + void RootView::DestroyMapBufferInfo() + { + if (dc_.mapBufferInfo != nullptr) { ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ GrallocEngines::GetInstance()->FreeBuffer(static_cast(dc_.mapBufferInfo->virAddr)); ++#else + BaseGfxEngine::GetInstance()->FreeBuffer(static_cast(dc_.mapBufferInfo->virAddr), BUFFER_MAP_SURFACE); ++#endif + dc_.mapBufferInfo->virAddr = dc_.mapBufferInfo->phyAddr = nullptr; + delete dc_.mapBufferInfo; + dc_.mapBufferInfo = nullptr; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/components/ui_analog_clock.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_analog_clock.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/components/ui_analog_clock.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_analog_clock.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -280,8 +280,13 @@ void UIAnalogClock::DrawHandImage(Buffer + return; + } + uint8_t pxSize = DrawUtils::GetPxSizeByColorMode(hand.imageInfo_.header.colorMode); ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ TransformDataInfo imageTranDataInfo = {hand.imageInfo_.header, hand.imageInfo_.data, hand.imageInfo_.phyAddr, ++ pxSize, BlurLevel::LEVEL0, TransformAlgorithm::BILINEAR}; ++#else + TransformDataInfo imageTranDataInfo = {hand.imageInfo_.header, hand.imageInfo_.data, pxSize, BlurLevel::LEVEL0, + TransformAlgorithm::BILINEAR}; ++#endif + BaseGfxEngine::GetInstance()->DrawTransform(gfxDstBuffer, invalidatedArea, {0, 0}, Color::Black(), opaScale_, + hand.trans_, imageTranDataInfo); + } +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/components/ui_canvas.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_canvas.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/components/ui_canvas.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_canvas.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -1472,8 +1472,14 @@ void UICanvas::BlitMapBuffer(BufferInfo + imageInfo.header.reserved = 0; + uint8_t* addr = reinterpret_cast(gfxMapBuffer.virAddr); + imageInfo.data = addr; ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ imageInfo.phyAddr = reinterpret_cast(gfxMapBuffer.phyAddr); ++ TransformDataInfo imageTranDataInfo = {imageInfo.header, imageInfo.data, imageInfo.phyAddr, pxSize, ++ BlurLevel::LEVEL0, TransformAlgorithm::BILINEAR}; ++#else + TransformDataInfo imageTranDataInfo = {imageInfo.header, imageInfo.data, pxSize, + BlurLevel::LEVEL0, TransformAlgorithm::BILINEAR}; ++#endif + BaseGfxEngine::GetInstance()->DrawTransform(gfxDstBuffer, invalidatedArea, {0, 0}, Color::Black(), + OPA_OPAQUE, transMap, imageTranDataInfo); + } +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/components/ui_image_view.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_image_view.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/components/ui_image_view.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/components/ui_image_view.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -456,9 +456,15 @@ void UIImageView::OnDraw(BufferInfo& gfx + imgInfo = *(GetImageInfo()); + } + uint8_t pxSize = DrawUtils::GetPxSizeByColorMode(imgInfo.header.colorMode); ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ TransformDataInfo imageTranDataInfo = {imgInfo.header, imgInfo.data, imgInfo.phyAddr, pxSize, ++ static_cast(blurLevel_), ++ static_cast(algorithm_)}; ++#else + TransformDataInfo imageTranDataInfo = {imgInfo.header, imgInfo.data, pxSize, + static_cast(blurLevel_), + static_cast(algorithm_)}; ++#endif + OpacityType opaScale = DrawUtils::GetMixOpacity(opa, style_->imageOpa_); + Matrix4 scaleMatrix = drawTransMap_->GetScaleMatrix(); + int16_t paddingX = style_->paddingLeft_ * scaleMatrix[0][0]; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/draw/draw_image.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_image.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/draw/draw_image.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_image.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -28,8 +28,13 @@ void DrawImage::DrawCommon(BufferInfo& g + } + OpacityType opa = DrawUtils::GetMixOpacity(opaScale, style.imageOpa_); + uint8_t pxBitSize = DrawUtils::GetPxSizeByColorMode(img->header.colorMode); ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ DrawUtils::GetInstance()->DrawImage(gfxDstBuffer, coords, mask, img->data, opa, pxBitSize, ++ static_cast(img->header.colorMode), img->phyAddr); ++#else + DrawUtils::GetInstance()->DrawImage(gfxDstBuffer, coords, mask, img->data, opa, pxBitSize, + static_cast(img->header.colorMode)); ++#endif + } + + void DrawImage::DrawCommon(BufferInfo& gfxDstBuffer, const Rect& coords, const Rect& mask, +@@ -47,8 +52,14 @@ void DrawImage::DrawCommon(BufferInfo& g + + uint8_t pxBitSize = DrawUtils::GetPxSizeByColorMode(entry.GetImageInfo().header.colorMode); + if (entry.InCache()) { ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ DrawUtils::GetInstance()->DrawImage(gfxDstBuffer, coords, mask, entry.GetImgData(), opa, pxBitSize, ++ static_cast(entry.GetImageInfo().header.colorMode), ++ entry.GetImageInfo().phyAddr); ++#else + DrawUtils::GetInstance()->DrawImage(gfxDstBuffer, coords, mask, entry.GetImgData(), opa, pxBitSize, + static_cast(entry.GetImageInfo().header.colorMode)); ++#endif + } else { + Rect valid = coords; + if (!valid.Intersect(valid, mask)) { +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/draw/draw_label.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_label.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/draw/draw_label.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_label.cpp 2025-09-22 12:34:40.968729460 +0800 +@@ -287,10 +287,13 @@ void DrawLabel::DrawLetterWithRotate(Buf + // Avoiding errors caused by rounding calculations + transMap.Translate(Vector2(posX + node.left, posY + offset - node.top)); + transMap.Rotate(letterInfo.rotateAngle, Vector2(posX, posY)); +- ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ TransformDataInfo letterTranDataInfo = {ImageHeader{colorMode, 0, 0, 0, node.cols, node.rows}, fontMap, nullptr, ++ fontWeight, BlurLevel::LEVEL0, TransformAlgorithm::BILINEAR}; ++#else + TransformDataInfo letterTranDataInfo = {ImageHeader{colorMode, 0, 0, 0, node.cols, node.rows}, fontMap, fontWeight, + BlurLevel::LEVEL0, TransformAlgorithm::BILINEAR}; +- ++#endif + uint8_t* buffer = nullptr; + if (letterInfo.hasAnimator) { + bool inRange = DrawLabel::CalculatedTransformDataInfo(&buffer, letterTranDataInfo, letterInfo); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.cpp 2025-09-22 12:34:40.972729454 +0800 +@@ -381,7 +381,8 @@ void DrawUtils::DrawImage(BufferInfo& gf + const uint8_t* image, + OpacityType opa, + uint8_t pxBitSize, +- ColorMode colorMode) const ++ ColorMode colorMode, ++ const uint8_t* imgPhyAddr) const + { + if (image == nullptr) { + return; +@@ -404,6 +405,11 @@ void DrawUtils::DrawImage(BufferInfo& gf + + src.virAddr = static_cast(const_cast(image)); + src.stride = imageWidthInByte; ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ src.width = area.GetWidth(); ++ src.height = area.GetHeight(); ++ src.phyAddr = static_cast(const_cast(imgPhyAddr)); ++#endif + src.mode = colorMode; + src.color = 0; + +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.h +--- ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.h 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/draw/draw_utils.h 2025-09-22 12:34:40.972729454 +0800 +@@ -230,7 +230,8 @@ public: + const OpacityType opa) const; + + void DrawImage(BufferInfo& gfxDstBuffer, const Rect& area, const Rect& mask, +- const uint8_t* image, OpacityType opa, uint8_t pxBitSize, ColorMode colorMode) const; ++ const uint8_t* image, OpacityType opa, uint8_t pxBitSize, ColorMode colorMode, ++ const uint8_t* imgPhyAddr = nullptr) const; + + static void + GetXAxisErrForJunctionLine(bool ignoreJunctionPoint, bool isRightPart, int16_t& xMinErr, int16_t& xMaxErr); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.cpp 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.cpp 2025-09-22 12:34:40.972729454 +0800 +@@ -0,0 +1,169 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "engines/gfx/hi3519/hi3519_engine.h" ++#include "draw/draw_utils.h" ++#include "hals/gfx_engines.h" ++#include "lite_wm_type.h" ++ ++namespace OHOS { ++const int16_t HARDWARE_ACC_SIZE_LIMIT = 50 * 50; // 50: Minimum supported pixel width and height ++ ++#define ALIGN_BYTE(byte, align) (((byte) + (align) - 1) & (~((align) -1))) ++ ++__attribute__((constructor)) void RegisterHi3519GfxEngine() ++{ ++ BaseGfxEngine::InitGfxEngine(new Hi3519GfxEngine()); ++} ++ ++ImagePixelFormat Hi3519GfxEngine::GetPixelFormatByColorMode(ColorMode colorMode) ++{ ++ ImagePixelFormat format = IMAGE_PIXEL_FORMAT_NONE; ++ switch (colorMode) { ++ case ARGB8888: ++ format = IMAGE_PIXEL_FORMAT_ARGB8888; ++ break; ++ case RGB888: ++ format = IMAGE_PIXEL_FORMAT_RGB888; ++ break; ++ case RGB565: ++ format = IMAGE_PIXEL_FORMAT_RGB565; ++ break; ++ case ARGB1555: ++ format = IMAGE_PIXEL_FORMAT_ARGB1555; ++ break; ++ default: ++ GRAPHIC_LOGE("current color mode not support!"); ++ break; ++ } ++ return format; ++} ++ ++uint8_t GetByteSizeByColorMode(uint8_t colorMode) ++{ ++ switch (colorMode) { ++ case ARGB8888: ++ return 4; // 4: 4 Byte ++ case RGB888: ++ return 3; // 3: 3 Byte ++ case RGB565: ++ case ARGB1555: ++ case ARGB4444: ++ return 2; // 2: 2 Byte ++ default: ++ return 0; ++ } ++} ++ ++void Hi3519GfxEngine::Blit(BufferInfo& dst, const Point& dstPos, const BufferInfo& src, ++ const Rect& subRect, const BlendOption& blendOption) ++{ ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ LiteSurfaceData srcData; ++ srcData.phyAddr = (uint8_t *)src.phyAddr; ++ srcData.width = src.width; ++ srcData.height = src.height; ++ srcData.stride = src.stride; ++ srcData.pixelFormat = GetPixelFormatByColorMode(src.mode); ++ ++ LiteSurfaceData dstData; ++ dstData.phyAddr = (uint8_t *)dst.phyAddr; ++ dstData.width = dst.width; ++ dstData.height = dst.height; ++ dstData.stride = dst.stride; ++ dstData.pixelFormat = GetPixelFormatByColorMode(dst.mode); ++ Rect dstRect; ++ dstRect.SetX(subRect.GetX()); ++ dstRect.SetY(subRect.GetY()); ++ dstRect.SetWidth(src.rect.GetWidth()); ++ dstRect.SetHeight(src.rect.GetHeight()); ++ if (GfxEngines::GetInstance()->GfxBlitWithOpt(srcData, src.rect, dstData, dstRect, blendOption.opacity)) { ++ return; ++ } ++#endif ++ SoftEngine::Blit(dst, dstPos, src, subRect, blendOption); ++} ++ ++void Hi3519GfxEngine::Fill(BufferInfo& dst, ++ const Rect& fillArea, ++ const ColorType color, ++ const OpacityType opacity) ++{ ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ if (fillArea.GetSize() >= HARDWARE_ACC_SIZE_LIMIT) { ++ LiteSurfaceData data; ++ data.phyAddr = static_cast(dst.phyAddr); ++ data.width = dst.width; ++ data.height = dst.height; ++ data.stride = dst.stride; ++ data.pixelFormat = IMAGE_PIXEL_FORMAT_ARGB8888; ++ if (GfxEngines::GetInstance()->GfxFillArea(data, fillArea, color, opacity)) { ++ return; ++ } ++ } ++#endif ++ SoftEngine::Fill(dst, fillArea, color, opacity); ++} ++ ++void Hi3519GfxEngine::DrawTransform(BufferInfo& dst, const Rect& mask, const Point& position, ColorType color, ++ OpacityType opacity, const TransformMap& transMap, const TransformDataInfo& dataInfo) ++{ ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ if ((transMap.GetRotateAngle() == 0) && (dataInfo.phyAddr != nullptr) && ++ (dataInfo.header.width != 0) && (dataInfo.header.height != 0)) { ++ LiteSurfaceData srcData; ++ srcData.phyAddr = const_cast(dataInfo.phyAddr); ++ srcData.width = dataInfo.header.width; ++ srcData.height = dataInfo.header.height; ++ uint32_t rowSize = srcData.width * GetByteSizeByColorMode(dataInfo.header.colorMode); ++ srcData.stride = ALIGN_BYTE(rowSize, 4); // 4:Align Byte ++ srcData.pixelFormat = GetPixelFormatByColorMode(static_cast(dataInfo.header.colorMode)); ++ ++ LiteSurfaceData dstData; ++ dstData.phyAddr = (uint8_t *)dst.phyAddr; ++ dstData.width = dst.width; ++ dstData.height = dst.height; ++ dstData.stride = dst.stride; ++ dstData.pixelFormat = GetPixelFormatByColorMode(dst.mode); ++ ++ Rect trans = transMap.GetBoxRect(); ++ if ((trans.GetWidth() == 0) || (trans.GetHeight() == 0)) { ++ GRAPHIC_LOGE("transMap rect error, size %u %u\n", trans.GetWidth(), trans.GetHeight()); ++ return; ++ } ++ double xScale = 1.0f * trans.GetWidth() / dataInfo.header.width; ++ double yScale = 1.0f * trans.GetHeight() / dataInfo.header.height; ++ trans.SetX(trans.GetX() + position.x); ++ trans.SetY(trans.GetY() + position.y); ++ Rect dstRect; ++ if (!dstRect.Intersect(trans, mask)) { ++ return; ++ } ++ ++ Rect srcRect; ++ int32_t leftOffset = dstRect.GetLeft() - trans.GetLeft(); ++ int32_t topOffset = dstRect.GetTop() - trans.GetTop(); ++ srcRect.SetLeft(leftOffset / xScale); ++ srcRect.SetTop(topOffset / yScale); ++ srcRect.SetWidth(dstRect.GetWidth() / xScale); ++ srcRect.SetHeight(dstRect.GetHeight() / yScale); ++ if (GfxEngines::GetInstance()->GfxBlitWithOpt(srcData, srcRect, dstData, dstRect, opacity)) { ++ return; ++ } ++ } ++#endif ++ SoftEngine::DrawTransform(dst, mask, position, color, opacity, transMap, dataInfo); ++} ++} +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.h +--- ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.h 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/engines/gfx/hi3519/hi3519_engine.h 2025-09-22 12:34:40.972729454 +0800 +@@ -0,0 +1,47 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef GRAPHIC_LITE_HI3519_ENGINE_H ++#define GRAPHIC_LITE_HI3519_ENGINE_H ++ ++#include "engines/gfx/soft_engine.h" ++#include "gfx_utils/pixel_format_utils.h" ++ ++namespace OHOS { ++class Hi3519GfxEngine : public SoftEngine { ++public: ++ void Blit(BufferInfo& dst, ++ const Point& dstPos, ++ const BufferInfo& src, ++ const Rect& subRect, ++ const BlendOption& blendOption) override; ++ ++ void Fill(BufferInfo& dst, ++ const Rect& fillArea, ++ const ColorType color, ++ const OpacityType opacity) override; ++ ++ void DrawTransform(BufferInfo& dst, ++ const Rect& mask, ++ const Point& position, ++ ColorType color, ++ OpacityType opacity, ++ const TransformMap& transMap, ++ const TransformDataInfo& dataInfo) override; ++private: ++ ImagePixelFormat GetPixelFormatByColorMode(ColorMode colorMode); ++}; ++} ++#endif // GRAPHIC_LITE_HI3519_ENGINE_H +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/cache_manager.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/cache_manager.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/cache_manager.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/cache_manager.cpp 2025-09-22 12:34:40.972729454 +0800 +@@ -18,6 +18,10 @@ + #include "hal_tick.h" + #include "securec.h" + ++#include "common/image.h" ++#include "jpeg_img_decoder.h" ++#include "png_img_decoder.h" ++ + namespace OHOS { + const uint8_t* CacheEntry::GetImgData() const + { +@@ -126,7 +130,6 @@ RetCode CacheManager::Open(const char* p + uint16_t indexHitted = 0; + RetCode ret = GetIndex(path, indexHitted); + if (ret == RetCode::OK) { +- ReadToCache(entryArr_[indexHitted]); + entry = entryArr_[indexHitted]; + return RetCode::OK; + } +@@ -139,11 +142,21 @@ RetCode CacheManager::Open(const char* p + uint32_t startTime = HALTick::GetInstance().GetTime(); + entryArr_[indexHitted].life_ = 0; + +- ret = TryDecode(path, style, entryArr_[indexHitted]); ++ char realPath[PATH_MAX + 1] = {0}; ++ if (strlen(path) > PATH_MAX || realpath(path, realPath) == nullptr) { ++ return RetCode::FAIL; ++ } ++ ++ ret = TryDecode(realPath, style, entryArr_[indexHitted]); ++ if (ret != RetCode::OK) { ++ GRAPHIC_LOGE("CacheManager TryDecode %s faild\n", path); ++ return ret; ++ } ++ ret = ReadToCache(entryArr_[indexHitted]); + if (ret != RetCode::OK) { ++ Clear(entryArr_[indexHitted]); + return ret; + } +- ReadToCache(entryArr_[indexHitted]); + entryArr_[indexHitted].life_ = HALTick::GetInstance().GetElapseTime(startTime); + entry = entryArr_[indexHitted]; + return RetCode::OK; +@@ -268,27 +281,34 @@ RetCode CacheManager::SelectEntryToRepla + + RetCode CacheManager::TryDecode(const char* path, const Style& style, CacheEntry& entry) + { +- FileImgDecoder* decoder = &(FileImgDecoder::GetInstance()); +- if (decoder == nullptr) { +- Clear(entry); +- return RetCode::FAIL; +- } +- + entry.dsc_.srcType = IMG_SRC_FILE; + RetCode ret = entry.SetSrc(path); + if (ret != RetCode::OK) { + Clear(entry); + return ret; + } ++ FileImgDecoder* decoder = &(FileImgDecoder::GetInstance()); ++ ++ Image::ImageType type = Image::CheckImgType(path); ++ if (type == Image::IMG_PNG) { ++ decoder = &(PngImgDecoder::GetInstance()); ++ } else if (type == Image::IMG_JPEG) { ++ decoder = &(JpegImgDecoder::GetInstance()); ++ } ++ ++ if (decoder == nullptr) { ++ Clear(entry); ++ return RetCode::FAIL; ++ } + entry.dsc_.decoder = decoder; + +- ret = entry.dsc_.decoder->GetHeader(entry.dsc_); ++ ret = entry.dsc_.decoder->Open(entry.dsc_); + if (ret != RetCode::OK) { + Clear(entry); + return ret; + } + +- ret = entry.dsc_.decoder->Open(entry.dsc_); ++ ret = entry.dsc_.decoder->GetHeader(entry.dsc_); + if (ret != RetCode::OK) { + Clear(entry); + return ret; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.cpp 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.cpp 2025-09-22 12:34:40.972729454 +0800 +@@ -17,6 +17,7 @@ + #include "gfx_utils/mem_api.h" + #include "imgdecode/file_img_decoder.h" + #include "imgdecode/image_load.h" ++#include "securec.h" + + namespace OHOS { + FileImgDecoder& FileImgDecoder::GetInstance() +@@ -39,12 +40,7 @@ RetCode FileImgDecoder::Open(ImgResDsc& + + dsc.imgInfo.data = nullptr; + dsc.inCache_ = false; +- uint8_t colorMode = dsc.imgInfo.header.colorMode; +- if (IsImgValidMode(colorMode)) { +- return RetCode::OK; +- } else { +- return RetCode::FAIL; +- } ++ return RetCode::OK; + } + + RetCode FileImgDecoder::Close(ImgResDsc& dsc) +@@ -57,33 +53,26 @@ RetCode FileImgDecoder::Close(ImgResDsc& + close(dsc.fd); + dsc.fd = -1; + } +- ++ dsc.inCache_ = false; + return RetCode::OK; + } + + RetCode FileImgDecoder::GetHeader(ImgResDsc& dsc) + { +- int32_t fd; +- int32_t readCount; +-#ifdef _WIN32 +- fd = open(dsc.path, O_BINARY); +-#else +- fd = open(dsc.path, O_RDONLY); +-#endif +- if (fd == -1) { ++ if (dsc.fd == -1) { + return RetCode::FAIL; + } +- +- readCount = read(fd, &dsc.imgInfo.header, sizeof(ImageHeader)); +- close(fd); +- dsc.fd = -1; ++ int32_t readCount = read(dsc.fd, &dsc.imgInfo.header, sizeof(ImageHeader)); + if (readCount != sizeof(ImageHeader)) { + dsc.imgInfo.header.width = 0; + dsc.imgInfo.header.height = 0; + dsc.imgInfo.header.colorMode = UNKNOWN; + return RetCode::FAIL; + } +- ++ uint8_t colorMode = dsc.imgInfo.header.colorMode; ++ if (!IsImgValidMode(colorMode)) { ++ return RetCode::FAIL; ++ } + return RetCode::OK; + } + +@@ -116,16 +105,32 @@ RetCode FileImgDecoder::ReadToCache(ImgR + } + + bool readSuccess = false; +- if (dsc.imgInfo.header.compressMode != COMPRESS_MODE_NONE) { ++ if (dsc.imgInfo.header.compressMode != COMPRESS_MODE_NONE) { + readSuccess = ImageLoad::GetImageInfo(dsc.fd, pxCount, dsc.imgInfo); + } else { ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ int rowSize = dsc.imgInfo.header.width * DrawUtils::GetByteSizeByColorMode(dsc.imgInfo.header.colorMode); ++ /* tde requires 4-byte alignment of stride */ ++ dsc.imgInfo.dataSize = rowSize * dsc.imgInfo.header.height; ++#else + dsc.imgInfo.dataSize = pxCount; ++#endif + dsc.imgInfo.data = reinterpret_cast(ImageCacheMalloc(dsc.imgInfo)); + if (dsc.imgInfo.data == nullptr) { + return RetCode::OK; + } + uint8_t* tmp = const_cast(dsc.imgInfo.data); ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ int32_t readTotalSize = 0; ++ memset_s(reinterpret_cast(tmp), dsc.imgInfo.dataSize, 0, dsc.imgInfo.dataSize); ++ for (int i = 0; i < dsc.imgInfo.header.height; i++) { ++ readTotalSize += read(dsc.fd, reinterpret_cast(tmp), rowSize); ++ tmp += rowSize; ++ } ++ readSuccess = (readTotalSize == rowSize * dsc.imgInfo.header.height); ++#else + readSuccess = (static_cast(pxCount) == read(dsc.fd, reinterpret_cast(tmp), pxCount)); ++#endif + } + if (!readSuccess) { + ImageCacheFree(dsc.imgInfo); +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.h +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.h 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/file_img_decoder.h 2025-09-22 12:34:40.976729447 +0800 +@@ -45,20 +45,21 @@ public: + bool inCache_; + }; + +- RetCode Open(ImgResDsc& dsc); ++ virtual RetCode Open(ImgResDsc& dsc); + +- RetCode Close(ImgResDsc& dsc); ++ virtual RetCode Close(ImgResDsc& dsc); + +- RetCode GetHeader(ImgResDsc& dsc); ++ virtual RetCode GetHeader(ImgResDsc& dsc); + +- RetCode ReadLine(ImgResDsc& dsc, const Point& start, int16_t len, uint8_t* buf); ++ virtual RetCode ReadLine(ImgResDsc& dsc, const Point& start, int16_t len, uint8_t* buf); + +- RetCode ReadToCache(ImgResDsc& dsc); ++ virtual RetCode ReadToCache(ImgResDsc& dsc); + +-private: ++protected: + FileImgDecoder() {} +- ~FileImgDecoder() {} ++ virtual ~FileImgDecoder() {} + ++private: + bool IsImgValidMode(uint8_t colorMode) + { + if ((colorMode == RGB565) || (colorMode == RGB888) || (colorMode == ARGB8888)) { +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.cpp 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.cpp 2025-09-22 12:34:40.976729447 +0800 +@@ -0,0 +1,128 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "imgdecode/jpeg_img_decoder.h" ++#include "gfx_utils/file.h" ++#include "gfx_utils/graphic_log.h" ++#include "gfx_utils/mem_api.h" ++#include "securec.h" ++ ++namespace OHOS { ++RetCode JpegImgDecoder::Open(ImgResDsc& dsc) ++{ ++ fp_ = fopen(dsc.path, "rb"); ++ if (fp_ == nullptr) { ++ GRAPHIC_LOGE("open file:%s failed\n", dsc.path); ++ return RetCode::FAIL; ++ } ++ ++ dsc.imgInfo.data = nullptr; ++ dsc.inCache_ = false; ++ ++ return RetCode::OK; ++} ++ ++RetCode JpegImgDecoder::Close(ImgResDsc& dsc) ++{ ++ if (dsc.imgInfo.data != nullptr) { ++ ImageCacheFree(dsc.imgInfo); ++ dsc.imgInfo.data = nullptr; ++ } ++ ++ if (fp_ != nullptr) { ++ fclose(fp_); ++ fp_ = nullptr; ++ } ++ ++ dsc.inCache_ = false; ++ return RetCode::OK; ++} ++ ++RetCode JpegImgDecoder::CreateDecoder(void) ++{ ++ if (fp_ == nullptr) { ++ GRAPHIC_LOGE("File is not opened, call Open first\n"); ++ return RetCode::FAIL; ++ } ++ ++ cinfo_.err = jpeg_std_error(&jerr_); ++ jpeg_create_decompress(&cinfo_); ++ jpeg_stdio_src(&cinfo_, fp_); ++ jpeg_read_header(&cinfo_, TRUE); ++ jpeg_start_decompress(&cinfo_); ++ ++ return RetCode::OK; ++} ++ ++void JpegImgDecoder::DestroyDecoder(void) ++{ ++ if (fp_ != nullptr) { ++ fclose(fp_); ++ fp_ = nullptr; ++ } ++ ++ jpeg_finish_decompress(&cinfo_); ++ jpeg_destroy_decompress(&cinfo_); ++} ++ ++RetCode JpegImgDecoder::GetHeader(ImgResDsc& dsc) ++{ ++ if (CreateDecoder() != RetCode::OK) { ++ GRAPHIC_LOGE("Decoder is created failed\n"); ++ return RetCode::FAIL; ++ } ++ ++ dsc.imgInfo.header.width = cinfo_.output_width; ++ dsc.imgInfo.header.height = cinfo_.output_height; ++ dsc.imgInfo.header.colorMode = ARGB8888; ++ ++ return RetCode::OK; ++} ++ ++RetCode JpegImgDecoder::ReadToCache(ImgResDsc& dsc) ++{ ++ JSAMPARRAY buffer; ++ uint8_t pixelByteSize = DrawUtils::GetPxSizeByColorMode(ARGB8888) >> 3; // 3: Shift right 3 bits ++ uint16_t width = cinfo_.output_width; ++ uint16_t height = cinfo_.output_height; ++ uint32_t dataSize = width * height * pixelByteSize; ++ uint16_t rowStride = cinfo_.output_width * pixelByteSize; ++ buffer = (*cinfo_.mem->alloc_sarray)(reinterpret_cast(&cinfo_), ++ JPOOL_IMAGE, rowStride, 1); // 1: one-row-high array ++ ++ dsc.imgInfo.dataSize = dataSize; ++ uint8_t* srcData = static_cast(ImageCacheMalloc(dsc.imgInfo)); ++ dsc.imgInfo.data = srcData; ++ if (srcData == nullptr) { ++ DestroyDecoder(); ++ return RetCode::FAIL; ++ } ++ ++ uint32_t n = 0; ++ while (cinfo_.output_scanline < cinfo_.output_height) { ++ jpeg_read_scanlines(&cinfo_, buffer, 1); // 1: read one line each time ++ for (uint16_t x = 0; x < width * 3; x += 3) { // 3: color components per pixel ++ srcData[n++] = buffer[0][x + 2]; // 2: B channel ++ srcData[n++] = buffer[0][x + 1]; // 1: G channel ++ srcData[n++] = buffer[0][x + 0]; // 0: R channel ++ srcData[n++] = 255; // 255: set alpha channel ++ } ++ } ++ DestroyDecoder(); ++ dsc.inCache_ = true; ++ ++ return RetCode::OK; ++} ++} // namespace OHOS +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.h +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.h 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/jpeg_img_decoder.h 2025-09-22 12:34:40.976729447 +0800 +@@ -0,0 +1,63 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef GRAPHIC_LITE_JPEG_IMG_DECODER_H ++#define GRAPHIC_LITE_JPEG_IMG_DECODER_H ++ ++#include "file_img_decoder.h" ++#include "draw/draw_image.h" ++#include "draw/draw_utils.h" ++#include "jpeglib.h" ++ ++namespace OHOS { ++class JpegImgDecoder : public FileImgDecoder { ++public: ++ static JpegImgDecoder& GetInstance() ++ { ++ static JpegImgDecoder instance; ++ return instance; ++ } ++ ++ RetCode Open(ImgResDsc& dsc) override; ++ ++ RetCode Close(ImgResDsc& dsc) override; ++ ++ RetCode GetHeader(ImgResDsc& dsc) override; ++ ++ RetCode ReadToCache(ImgResDsc& dsc) override; ++ ++ RetCode ReadLine(ImgResDsc& dsc, const Point& start, int16_t len, uint8_t* buf) override ++ { ++ return RetCode::FAIL; ++ } ++ ++private: ++ FILE* fp_ {nullptr}; ++ struct jpeg_decompress_struct cinfo_ {0}; ++ struct jpeg_error_mgr jerr_ {0}; ++ JpegImgDecoder() {}; ++ virtual ~JpegImgDecoder() {}; ++ ++ RetCode CreateDecoder(void); ++ ++ void DestroyDecoder(void); ++ ++ JpegImgDecoder(const JpegImgDecoder&) = delete; ++ JpegImgDecoder& operator=(const JpegImgDecoder&) = delete; ++ JpegImgDecoder(JpegImgDecoder&&) = delete; ++ JpegImgDecoder& operator=(JpegImgDecoder&&) = delete; ++}; ++} ++#endif +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.cpp ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.cpp +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.cpp 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.cpp 2025-09-22 12:34:40.976729447 +0800 +@@ -0,0 +1,194 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "imgdecode/png_img_decoder.h" ++#include "gfx_utils/mem_api.h" ++#include "gfx_utils/file.h" ++#include "gfx_utils/graphic_log.h" ++ ++namespace OHOS { ++ ++#define FREE_RES(ptr) \ ++ do { \ ++ UIFree(ptr); \ ++ ptr = nullptr; \ ++ } while (0) ++ ++RetCode PngImgDecoder::Open(ImgResDsc& dsc) ++{ ++ fp_ = fopen(dsc.path, "rb"); ++ if (fp_ == nullptr) { ++ GRAPHIC_LOGE("open file:%s failed\n", dsc.path); ++ return RetCode::FAIL; ++ } ++ ++ dsc.imgInfo.data = nullptr; ++ dsc.inCache_ = false; ++ dsc.fd = -1; // don't use fd here ++ ++ return RetCode::OK; ++} ++ ++RetCode PngImgDecoder::Close(ImgResDsc& dsc) ++{ ++ if (dsc.imgInfo.data != nullptr) { ++ ImageCacheFree(dsc.imgInfo); ++ dsc.imgInfo.data = nullptr; ++ } ++ ++ if (fp_ != nullptr) { ++ fclose(fp_); ++ fp_ = nullptr; ++ } ++ ++ dsc.inCache_ = false; ++ ++ return RetCode::OK; ++} ++ ++RetCode PngImgDecoder::CreateDecoder(void) ++{ ++ if (fp_ == nullptr) { ++ GRAPHIC_LOGE("File is not opened, call Open first\n"); ++ return RetCode::FAIL; ++ } ++ ++ png_ = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); ++ if (png_ == nullptr) { ++ return RetCode::FAIL; ++ } ++ ++ info_ = png_create_info_struct(png_); ++ if (info_ == nullptr) { ++ png_destroy_read_struct(&png_, nullptr, nullptr); ++ return RetCode::FAIL; ++ } ++ ++ png_init_io(png_, fp_); ++ png_read_info(png_, info_); ++ ++ return RetCode::OK; ++} ++ ++void PngImgDecoder::DestroyDecoder(void) ++{ ++ if (fp_ != nullptr) { ++ fclose(fp_); ++ fp_ = nullptr; ++ } ++ ++ if (png_ != nullptr && info_ != nullptr) { ++ png_destroy_read_struct(&png_, &info_, nullptr); ++ } else if (png_ != nullptr && info_ == nullptr) { ++ png_destroy_read_struct(&png_, nullptr, nullptr); ++ } ++} ++ ++RetCode PngImgDecoder::GetHeader(ImgResDsc& dsc) ++{ ++ if (CreateDecoder() != RetCode::OK) { ++ GRAPHIC_LOGE("Decoder is created failed\n"); ++ return RetCode::FAIL; ++ } ++ ++ dsc.imgInfo.header.width = png_get_image_width(png_, info_); ++ dsc.imgInfo.header.height = png_get_image_height(png_, info_); ++ dsc.imgInfo.header.colorMode = ARGB8888; ++ ++ return RetCode::OK; ++} ++ ++void PngImgDecoder::UpdateInfo(void) ++{ ++ uint8_t colorType = png_get_color_type(png_, info_); ++ uint8_t bitDepth = png_get_bit_depth(png_, info_); ++ if (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8) { // 8: Expand grayscale images to the full 8 bits ++ png_set_expand_gray_1_2_4_to_8(png_); ++ } ++ if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA) { ++ png_set_gray_to_rgb(png_); ++ } ++ if (colorType == PNG_COLOR_TYPE_PALETTE) { ++ png_set_palette_to_rgb(png_); ++ } ++ if (bitDepth == 16) { // 16: Chop 16-bit depth images to 8-bit depth ++ png_set_strip_16(png_); ++ } ++ ++ if (png_get_valid(png_, info_, PNG_INFO_tRNS)) { ++ png_set_tRNS_to_alpha(png_); ++ } ++ if (!(colorType & PNG_COLOR_MASK_ALPHA)) { ++ png_set_add_alpha(png_, 0xFF, PNG_FILLER_AFTER); ++ } ++ png_set_interlace_handling(png_); ++ png_read_update_info(png_, info_); ++} ++ ++RetCode PngImgDecoder::ReadToCache(ImgResDsc& dsc) ++{ ++ uint8_t pixelByteSize = DrawUtils::GetPxSizeByColorMode(ARGB8888) >> 3; // 3: Shift right 3 bits ++ uint16_t width = dsc.imgInfo.header.width; ++ uint16_t height = dsc.imgInfo.header.height; ++ uint32_t dataSize = height * width * pixelByteSize; ++ ++ UpdateInfo(); ++ png_bytep* rowPointer = static_cast(UIMalloc(sizeof(png_bytep) * height)); ++ if (rowPointer == nullptr) { ++ DestroyDecoder(); ++ return RetCode::FAIL; ++ } ++ for (uint16_t y = 0; y < height; y++) { ++ rowPointer[y] = static_cast(UIMalloc(png_get_rowbytes(png_, info_))); ++ if (rowPointer[y] == nullptr) { ++ for (uint16_t i = 0; i < y; i++) { ++ FREE_RES(rowPointer[i]); ++ } ++ FREE_RES(rowPointer); ++ DestroyDecoder(); ++ return RetCode::FAIL; ++ } ++ } ++ png_read_image(png_, rowPointer); ++ ++ dsc.imgInfo.dataSize = dataSize; ++ uint8_t* srcData = static_cast(ImageCacheMalloc(dsc.imgInfo)); ++ dsc.imgInfo.data = srcData; ++ if (srcData == nullptr) { ++ for (uint16_t i = 0; i < height; i++) { ++ FREE_RES(rowPointer[i]); ++ } ++ FREE_RES(rowPointer); ++ DestroyDecoder(); ++ return RetCode::FAIL; ++ } ++ uint32_t n = 0; ++ for (uint16_t y = 0; y < height; y++) { ++ png_bytep row = rowPointer[y]; ++ for (uint16_t x = 0; x < width * pixelByteSize; x += pixelByteSize) { ++ srcData[n++] = row[x + 2]; // 2: B channel ++ srcData[n++] = row[x + 1]; // 1: G channel ++ srcData[n++] = row[x + 0]; // 0: R channel ++ srcData[n++] = row[x + 3]; // 3: Alpha channel ++ } ++ FREE_RES(row); ++ } ++ FREE_RES(rowPointer); ++ ++ DestroyDecoder(); ++ dsc.inCache_ = true; ++ return RetCode::OK; ++} ++} // namespace OHOS +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.h +--- ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.h 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/frameworks/imgdecode/png_img_decoder.h 2025-09-22 12:34:40.976729447 +0800 +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef GRAPHIC_LITE_PNG_IMG_DECODER_H ++#define GRAPHIC_LITE_PNG_IMG_DECODER_H ++ ++#include "file_img_decoder.h" ++#include "draw/draw_image.h" ++#include "draw/draw_utils.h" ++#include "png.h" ++ ++namespace OHOS { ++class PngImgDecoder : public FileImgDecoder { ++public: ++ static PngImgDecoder& GetInstance() ++ { ++ static PngImgDecoder instance; ++ return instance; ++ } ++ ++ RetCode Open(ImgResDsc& dsc) override; ++ ++ RetCode Close(ImgResDsc& dsc) override; ++ ++ RetCode GetHeader(ImgResDsc& dsc) override; ++ ++ RetCode ReadToCache(ImgResDsc& dsc) override; ++ ++ RetCode ReadLine(ImgResDsc& dsc, const Point& start, int16_t len, uint8_t* buf) override ++ { ++ return RetCode::FAIL; ++ } ++ ++private: ++ FILE* fp_; ++ png_structp png_; ++ png_infop info_; ++ ++ PngImgDecoder() : fp_(nullptr), png_(nullptr), info_(nullptr) {}; ++ virtual ~PngImgDecoder() {}; ++ ++ RetCode CreateDecoder(void); ++ void DestroyDecoder(void); ++ ++ PngImgDecoder(const PngImgDecoder&) = delete; ++ PngImgDecoder& operator=(const PngImgDecoder&) = delete; ++ PngImgDecoder(PngImgDecoder&&) = delete; ++ PngImgDecoder& operator=(PngImgDecoder&&) = delete; ++ void UpdateInfo(void); ++}; ++} ++#endif +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/interfaces/innerkits/engines/gfx/gfx_engine_manager.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/interfaces/innerkits/engines/gfx/gfx_engine_manager.h +--- ohos/foundation/arkui/ui_lite/interfaces/innerkits/engines/gfx/gfx_engine_manager.h 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/interfaces/innerkits/engines/gfx/gfx_engine_manager.h 2025-09-22 12:34:40.976729447 +0800 +@@ -69,6 +69,9 @@ struct ArcInfo { + struct TransformDataInfo { + ImageHeader header; + const uint8_t* data; ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ const uint8_t* phyAddr; ++#endif + uint8_t pxSize; + BlurLevel blurLevel; + TransformAlgorithm algorithm; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/arkui/ui_lite/interfaces/kits/common/image.h ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/interfaces/kits/common/image.h +--- ohos/foundation/arkui/ui_lite/interfaces/kits/common/image.h 2025-05-03 17:56:01.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/arkui/ui_lite/interfaces/kits/common/image.h 2025-09-22 12:34:40.976729447 +0800 +@@ -167,14 +167,15 @@ private: + bool mallocFlag_; + bool SetLiteSrc(const char* src); + bool SetStandardSrc(const char* src); +-#if ENABLE_JPEG ++#if ENABLE_JPEG && (!CACHE_JPEG_AND_PNG) + bool SetJPEGSrc(const char* src); + #endif +-#if ENABLE_PNG ++#if ENABLE_PNG && (!CACHE_JPEG_AND_PNG) + bool SetPNGSrc(const char* src); + #endif + #if ENABLE_JPEG || ENABLE_PNG +- ImageType CheckImgType(const char* src); ++ friend class CacheManager; ++ static ImageType CheckImgType(const char* src); + #endif + bool IsImgValid(const char* suffix) + { diff --git a/vendor/rkh/rkh_patch/foundation/bundlemanager_bundle_framework_lite.patch b/vendor/rkh/rkh_patch/foundation/bundlemanager_bundle_framework_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..61762d394dd247e51f4f09aad1d3f54622580dc8 --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/bundlemanager_bundle_framework_lite.patch @@ -0,0 +1,69 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/bundlemanager/bundle_framework_lite/services/bundlemgr_lite/src/hap_sign_verify.cpp ../../../../../hi3403_l1_0922/ohos/foundation/bundlemanager/bundle_framework_lite/services/bundlemgr_lite/src/hap_sign_verify.cpp +--- ohos/foundation/bundlemanager/bundle_framework_lite/services/bundlemgr_lite/src/hap_sign_verify.cpp 2025-05-03 17:56:05.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/bundlemanager/bundle_framework_lite/services/bundlemgr_lite/src/hap_sign_verify.cpp 2025-09-22 11:11:59.934021351 +0800 +@@ -12,20 +12,56 @@ + * See the License for the specific language governing permissions and + * limitations under the License. + */ +- ++#include ++#include ++#include + #include "hap_sign_verify.h" + + #include "appexecfwk_errors.h" + #include "bundle_manager_service.h" + #include "bundle_log.h" + ++#define SKIP_APPVERIFY 0 ++ + namespace OHOS { ++ ++#if SKIP_APPVERIFY ++uint8_t HapSignVerify::VerifySignature(const std::string &hapFilepath, SignatureInfo &signatureInfo) ++{ ++ bool mode = ManagerService::GetInstance().IsDebugMode(); ++ HILOG_INFO(HILOG_MODULE_APP, "current mode is %d!", mode); ++ VerifyResult verifyResult; ++ // verify signature ++ HILOG_INFO(HILOG_MODULE_APP, "sf0827 hapFilepath %s!", hapFilepath.c_str()); ++ if (hapFilepath == std::string("/system/internal/launcher.hap")) { ++ signatureInfo.appId = std::string("com.huawei.launcher_1errff456"); ++ signatureInfo.provisionBundleName = std::string("com.huawei.launcher"); ++ } else if (hapFilepath == std::string("/system/internal/setting.hap")) { ++ signatureInfo.appId = std::string("com.huawei.setting_3egrff486"); ++ signatureInfo.provisionBundleName = std::string("com.huawei.setting"); ++ } else if (hapFilepath == std::string("/system/internal/gallery.hap")) { ++ signatureInfo.appId = std::string("com.huawei.gallery_6erddf436"); ++ signatureInfo.provisionBundleName = std::string("com.huawei.gallery"); ++ } else if (hapFilepath == std::string("/system/internal/screensaver.hap")) { ++ signatureInfo.appId = std::string("com.huawei.screensaver_9erdee435"); ++ signatureInfo.provisionBundleName = std::string("com.huawei.screensaver"); ++ } else if (hapFilepath == std::string("/system/internal/cameraApp.hap")) { ++ signatureInfo.appId = std::string("com.huawei.cameraApp_6erdet425"); ++ signatureInfo.provisionBundleName = std::string("com.huawei.cameraApp"); ++ } else if (hapFilepath == std::string("/system/internal/entry-default-signed.hap")) { ++ signatureInfo.appId = std::string("com.rkh.myapplication_9dddet215"); ++ signatureInfo.provisionBundleName = std::string("com.rkh.myapplication"); ++ } ++ return ERR_OK; ++} ++#else + uint8_t HapSignVerify::VerifySignature(const std::string &hapFilepath, SignatureInfo &signatureInfo) + { + bool mode = ManagerService::GetInstance().IsDebugMode(); + HILOG_INFO(HILOG_MODULE_APP, "current mode is %d!", mode); + VerifyResult verifyResult; + // verify signature ++ HILOG_INFO(HILOG_MODULE_APP, "hapFilepath %s!", hapFilepath.c_str()); + int32_t ret = APPVERI_AppVerify(hapFilepath.c_str(), &verifyResult); + uint8_t errorCode = SwitchErrorCode(ret); + if (errorCode != ERR_OK) { +@@ -41,6 +77,7 @@ uint8_t HapSignVerify::VerifySignature(c + APPVERI_FreeVerifyRst(&verifyResult); + return ERR_OK; + } ++#endif + + uint8_t HapSignVerify::SwitchErrorCode(int32_t errorCode) + { diff --git a/vendor/rkh/rkh_patch/foundation/graphic_graphic_utils_lite.patch b/vendor/rkh/rkh_patch/foundation/graphic_graphic_utils_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..4c4d146e55be94535434a65fdc8f4fe5b54200bc --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/graphic_graphic_utils_lite.patch @@ -0,0 +1,443 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/BUILD.gn ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/BUILD.gn +--- ohos/foundation/graphic/graphic_utils_lite/BUILD.gn 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/BUILD.gn 2025-09-22 12:35:38.848604401 +0800 +@@ -74,6 +74,7 @@ lite_library("graphic_utils_lite") { + "frameworks/hal_cpu.cpp", + "frameworks/hal_tick.cpp", + "frameworks/mem_api.cpp", ++ "frameworks/mem_custom.cpp", + "frameworks/pixel_format_utils.cpp", + "frameworks/style.cpp", + "frameworks/trans_affine.cpp", +@@ -86,7 +87,10 @@ lite_library("graphic_utils_lite") { + public_deps = + [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ] + } else { +- deps = [ "//third_party/bounds_checking_function:libsec_shared" ] ++ deps = [ ++ ":graphic_hals", ++ "//third_party/bounds_checking_function:libsec_shared" ++ ] + public_deps = + [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared" ] + } +@@ -97,6 +101,8 @@ config("graphic_utils_public_config") { + "interfaces/innerkits", + "interfaces/kits", + "$product_path/graphic_config", ++ "//drivers/peripheral/base", ++ "//drivers/peripheral/display/interfaces/include", + ] + + defines += [ +@@ -132,12 +138,13 @@ if (ohos_kernel_type != "liteos_m") { + sources = [ + "frameworks/hals/gfx_engines.cpp", + "frameworks/hals/hi_fbdev.cpp", ++ "frameworks/hals/gralloc_engines.cpp" + ] + include_dirs = + [ "//foundation/window/window_manager_lite/interfaces/innerkits" ] + deps = [ +- ":utils_lite", + "//drivers/peripheral/display/hal:hdi_display", ++ "//third_party/bounds_checking_function:libsec_shared" + ] + public_configs = [ ":graphic_hals_public_config" ] + ldflags = [ +@@ -150,6 +157,7 @@ if (ohos_kernel_type != "liteos_m") { + + config("graphic_hals_public_config") { + include_dirs = [ ++ "interfaces/kits", + "interfaces/innerkits", + "//drivers/peripheral/base", + "//drivers/peripheral/display/interfaces/include", +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gfx_engines.cpp ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gfx_engines.cpp +--- ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gfx_engines.cpp 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gfx_engines.cpp 2025-09-22 12:35:38.848604401 +0800 +@@ -16,6 +16,7 @@ + #include "hals/gfx_engines.h" + + #include "gfx_utils/graphic_log.h" ++#include "securec.h" + + namespace OHOS { + struct { +@@ -161,4 +162,43 @@ bool GfxEngines::GfxBlit(const LiteSurfa + } + return true; + } ++ ++bool GfxEngines::GfxBlitWithOpt(const LiteSurfaceData& srcSurfaceData, ++ const Rect& srcRect, ++ const LiteSurfaceData& dstSurfaceData, ++ const Rect& dstRect, ++ uint8_t opa) ++{ ++ if (gfxFuncs_ == nullptr || srcSurfaceData.phyAddr == nullptr || dstSurfaceData.phyAddr == nullptr) { ++ return false; ++ } ++ ISurface srcSurface = {}; ++ ISurface dstSurface = {}; ++ if (Convert2ISurface(srcSurfaceData, srcSurface) == false) { ++ return false; ++ } ++ if (Convert2ISurface(dstSurfaceData, dstSurface) == false) { ++ return false; ++ } ++ IRect srcIRect = {}; ++ IRect dstIRect = {}; ++ Convert2IRect(srcRect, srcIRect); ++ Convert2IRect(dstRect, dstIRect); ++ GfxOpt opt; ++ if (memset_s(&opt, sizeof(GfxOpt), 0, sizeof(GfxOpt)) != EOK) { ++ return false; ++ } ++ opt.enPixelAlpha = true; ++ opt.blendType = BLEND_SRCOVER; ++ opt.enableScale = true; ++ opt.enGlobalAlpha = true; ++ opt.globalAlpha = opa; ++ ++ if (gfxFuncs_->Blit(&srcSurface, &srcIRect, &dstSurface, &dstIRect, &opt) == DISPLAY_FAILURE) { ++ GRAPHIC_LOGW("HW blit failed, and retry SW blit."); ++ return false; ++ } ++ return true; ++} ++ + } // namespace OHOS +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gralloc_engines.cpp ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gralloc_engines.cpp +--- ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gralloc_engines.cpp 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/hals/gralloc_engines.cpp 2025-09-22 12:35:38.848604401 +0800 +@@ -0,0 +1,81 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "hals/gralloc_engines.h" ++#include ++#include "display_type.h" ++#include "gfx_utils/graphic_log.h" ++#include "securec.h" ++namespace OHOS { ++static std::map buffers; ++ ++GrallocEngines* GrallocEngines::GetInstance() ++{ ++ static GrallocEngines instance; ++ return &instance; ++} ++ ++bool GrallocEngines::Init() ++{ ++ if (grallocFuncs_ != nullptr) { ++ GRAPHIC_LOGI("GrallocEngines has init succeed."); ++ return true; ++ } ++#ifdef ENABLE_GFX_ENGINES ++ if (GrallocInitialize(&grallocFuncs_) != DISPLAY_SUCCESS) { ++ return false; ++ } ++#endif ++ return true; ++} ++ ++bool GrallocEngines::AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer) ++{ ++ if (grallocFuncs_ == nullptr) { ++ GRAPHIC_LOGE("GrallocEngines not init!"); ++ return false; ++ } ++ BufferHandle* bufferHandle = nullptr; ++ if (grallocFuncs_->AllocMem(&info, &bufferHandle) != DISPLAY_SUCCESS) { ++ return false; ++ } ++ buffers.insert(std::make_pair(reinterpret_cast(bufferHandle->virAddr), bufferHandle)); ++ buffer.phyAddr = bufferHandle->phyAddr; ++ buffer.virAddr = bufferHandle->virAddr; ++ return true; ++} ++ ++void GrallocEngines::FreeBuffer(const uint8_t* virAddr) ++{ ++ if (grallocFuncs_ == nullptr) { ++ GRAPHIC_LOGE("GrallocEngines not init!"); ++ return; ++ } ++ ++ if (virAddr == nullptr) { ++ return; ++ } ++ ++ uint64_t addr = reinterpret_cast(virAddr); ++ auto iter = buffers.find(addr); ++ if (iter != buffers.end()) { ++ BufferHandle* handle = iter->second; ++ if (handle != nullptr) { ++ buffers.erase(iter); ++ grallocFuncs_->FreeMem(handle); ++ } ++ } ++} ++} // namespace OHOS +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_api.cpp ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_api.cpp +--- ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_api.cpp 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_api.cpp 2025-09-22 12:35:38.848604401 +0800 +@@ -17,6 +17,7 @@ + #include "gfx_utils/common_macros.h" + + namespace OHOS { ++#ifndef IMG_CACHE_MEMORY_CUSTOM + UI_WEAK_SYMBOL void* ImageCacheMalloc(const ImageInfo& info) + { + return malloc(info.dataSize); +@@ -29,6 +30,7 @@ UI_WEAK_SYMBOL void ImageCacheFree(Image + info.data = nullptr; + return; + } ++#endif + + UI_WEAK_SYMBOL void* UIMalloc(uint32_t size) + { +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_custom.cpp ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_custom.cpp +--- ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_custom.cpp 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/frameworks/mem_custom.cpp 2025-09-22 12:35:38.848604401 +0800 +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#include "gfx_utils/mem_api.h" ++#include "gfx_utils/common_macros.h" ++#ifdef IMG_CACHE_MEMORY_CUSTOM ++#include "hals/gralloc_engines.h" ++#include "gfx_utils/graphic_log.h" ++ ++namespace OHOS { ++UI_WEAK_SYMBOL void* ImageCacheMalloc(const ImageInfo& info) ++{ ++ AllocInfo allocInfo; ++ allocInfo.expectedSize = info.dataSize; ++ allocInfo.usage = HBM_USE_ASSIGN_SIZE | HBM_USE_MEM_MMZ; ++ GrallocBuffer buffer; ++ if (!GrallocEngines::GetInstance()->AllocBuffer(allocInfo, buffer)) { ++ GRAPHIC_LOGE("AllocBuffer failed."); ++ return nullptr; ++ } ++ uint8_t** buf = const_cast(&info.phyAddr); ++ *buf = reinterpret_cast(buffer.phyAddr); ++ buf = const_cast(&info.data); ++ *buf = reinterpret_cast(buffer.virAddr); ++ return buffer.virAddr; ++} ++ ++UI_WEAK_SYMBOL void ImageCacheFree(ImageInfo& info) ++{ ++ if (info.data == nullptr) { ++ return; ++ } ++ GrallocEngines::GetInstance()->FreeBuffer(info.data); ++ info.phyAddr = nullptr; ++ info.data = nullptr; ++ return; ++} ++} ++#endif +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_config.h ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_config.h +--- ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_config.h 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_config.h 2025-09-22 12:35:38.848604401 +0800 +@@ -257,12 +257,28 @@ namespace OHOS { + #ifndef ENABLE_PNG + #define ENABLE_PNG 1 + #endif ++ ++/** ++ * @brief Customize the memory area when loading image resources ++ */ ++#ifndef IMG_CACHE_MEMORY_CUSTOM ++#define IMG_CACHE_MEMORY_CUSTOM 1 ++#endif ++ ++/** ++ * @brief Cache the decoded content for Jpeg and Png image ++ */ ++#ifndef CACHE_JPEG_AND_PNG ++#define CACHE_JPEG_AND_PNG 1 ++#endif ++ + /** + * @brief ARM NEON ability, which is enabled by default on other platforms. + */ + #ifndef ENABLE_ARM_NEON + #define ENABLE_ARM_NEON 1 + #endif ++ + /** + * @brief Graphics rendering hardware acceleration, which is disabled by default on other platforms. + */ +@@ -480,12 +496,12 @@ static constexpr uint8_t MAX_FONT_SEARCH + + /* Resolution width of a graphics display screen. The default value is 960. */ + #ifndef HORIZONTAL_RESOLUTION +-#define HORIZONTAL_RESOLUTION 960 ++#define HORIZONTAL_RESOLUTION 1920 + #endif + + /* Resolution height of a graphics display screen. The default value is 480. */ + #ifndef VERTICAL_RESOLUTION +-#define VERTICAL_RESOLUTION 480 ++#define VERTICAL_RESOLUTION 1080 + #endif + + #endif +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_neon_utils.h ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_neon_utils.h +--- ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_neon_utils.h 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/graphic_neon_utils.h 2025-09-22 11:12:05.265990858 +0800 +@@ -105,6 +105,18 @@ static void NeonMemcpy(void* dst, int32_ + src = (uint8_t*)src + mod; + } + ++#if defined(__aarch64__) // ARMv8专有代码 rkh_build ++ asm volatile( ++ "NEONCopyPLD: \n" ++ " PRFM PLDL1KEEP, [%[src], #192] \n" // ARMv8 预取指令 ++ " LD1 {v0.16b, v1.16b, v2.16b, v3.16b}, [%[src]], #64 \n" // 加载 4x128bit=64字节 ++ " ST1 {v0.16b, v1.16b, v2.16b, v3.16b}, [%[dst]], #64 \n" // 存储 64字节 ++ " SUBS %[sz], %[sz], #0x40 \n" // 减少剩余字节计数 ++ " B.GT NEONCopyPLD \n" // 条件跳转 ++ : [dst] "+r"(dst), [src] "+r"(src), [sz] "+r"(sz) ++ : ++ : "v0", "v1", "v2", "v3", "cc", "memory"); ++#elif defined(__arm__) // ARMv7兼容 + asm volatile( + "NEONCopyPLD: \n" + " PLD [%[src], #0xC0] \n" +@@ -115,6 +127,7 @@ static void NeonMemcpy(void* dst, int32_ + : [dst] "+r"(dst), [src] "+r"(src), [sz] "+r"(sz) + : + : "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "cc", "memory"); ++#endif + } + + static inline void NeonBlendRGBA(uint8x8_t& r1, uint8x8_t& g1, uint8x8_t& b1, uint8x8_t& a1, +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gfx_engines.h ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gfx_engines.h +--- ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gfx_engines.h 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gfx_engines.h 2025-09-22 12:35:38.848604401 +0800 +@@ -40,6 +40,12 @@ public: + const LiteSurfaceData& dstSurfaceData, + int16_t x, + int16_t y); ++ ++ bool GfxBlitWithOpt(const LiteSurfaceData& srcSurfaceData, ++ const Rect& srcRect, ++ const LiteSurfaceData& dstSurfaceData, ++ const Rect& dstRect, ++ uint8_t opa); + private: + GfxEngines() : gfxFuncs_(nullptr) {} + virtual ~GfxEngines() {} +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gralloc_engines.h ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gralloc_engines.h +--- ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gralloc_engines.h 1970-01-01 08:00:00.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/innerkits/hals/gralloc_engines.h 2025-09-22 12:35:38.848604401 +0800 +@@ -0,0 +1,44 @@ ++/* ++ * Copyright (c) 2025 HiSilicon (Shanghai) Technologies Co., Ltd. ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef GRAPHIC_LITE_GRALLOC_ENGINES_H ++#define GRAPHIC_LITE_GRALLOC_ENGINES_H ++#include "display_gralloc.h" ++#include "display_type.h" ++#ifndef __LITEOS_M__ ++#include "buffer_handle.h" ++#endif ++ ++namespace OHOS { ++typedef struct { ++ void* virAddr; ++ uint64_t phyAddr; ++} GrallocBuffer; ++ ++class GrallocEngines { ++public: ++ static GrallocEngines* GetInstance(); ++ bool Init(); ++ ++ bool AllocBuffer(const AllocInfo& info, GrallocBuffer& buffer); ++ void FreeBuffer(const uint8_t* virAddr); ++ ++private: ++ GrallocEngines() : grallocFuncs_(nullptr) {} ++ ~GrallocEngines() {} ++ GrallocFuncs* grallocFuncs_; ++}; ++} // end namespace ++#endif // GRAPHIC_LITE_GRALLOC_ENGINES_H +\ No newline at end of file +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/interfaces/kits/gfx_utils/image_info.h ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/kits/gfx_utils/image_info.h +--- ohos/foundation/graphic/graphic_utils_lite/interfaces/kits/gfx_utils/image_info.h 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/interfaces/kits/gfx_utils/image_info.h 2025-09-22 12:35:38.848604401 +0800 +@@ -36,6 +36,7 @@ + #define GRAPHIC_LITE_IMAGE_INFO_H + + #include ++#include "graphic_config.h" + + namespace OHOS { + /** +@@ -63,6 +64,9 @@ struct ImageInfo { + uint32_t dataSize; + /** Pixel color data of pixelmap images */ + const uint8_t* data; ++#if IMG_CACHE_MEMORY_CUSTOM ++ const uint8_t* phyAddr; ++#endif + /** User-defined data */ + void* userData; + }; +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/graphic/graphic_utils_lite/utils.gni ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/utils.gni +--- ohos/foundation/graphic/graphic_utils_lite/utils.gni 2025-05-03 17:56:19.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/graphic/graphic_utils_lite/utils.gni 2025-09-22 12:35:38.852604391 +0800 +@@ -51,4 +51,5 @@ graphic_hals_include_dirs = [ + graphic_hals_sources = [ + "$GRAPHIC_GRAPHIC_UTILS_LITE_PATH/frameworks/hals/gfx_engines.cpp", + "$GRAPHIC_GRAPHIC_UTILS_LITE_PATH/frameworks/hals/hi_fbdev.cpp", ++ "$GRAPHIC_GRAPHIC_UTILS_LITE_PATH/frameworks/hals/gralloc_engines.cpp", + ] diff --git a/vendor/rkh/rkh_patch/foundation/systemabilitymgr_samgr_lite.patch b/vendor/rkh/rkh_patch/foundation/systemabilitymgr_samgr_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..fbd910c8ea929e1aa05286123ec0641ce045d2a7 --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/systemabilitymgr_samgr_lite.patch @@ -0,0 +1,38 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/systemabilitymgr/samgr_lite/samgr/source/service.c ../../../../../hi3403_l1_0922/ohos/foundation/systemabilitymgr/samgr_lite/samgr/source/service.c +--- ohos/foundation/systemabilitymgr/samgr_lite/samgr/source/service.c 2025-05-03 17:57:10.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/systemabilitymgr/samgr_lite/samgr/source/service.c 2025-09-22 11:12:23.221887469 +0800 +@@ -14,12 +14,18 @@ + */ + #include "service_impl.h" + #include ++#include + #include "memory_adapter.h" + #include "thread_adapter.h" + #include "time_adapter.h" + #include "feature_impl.h" + #include "service_registry.h" + ++#undef LOG_TAG ++#undef LOG_DOMAIN ++#define LOG_TAG "Samgr" ++#define LOG_DOMAIN 0xD001800 ++ + static const char *GetFeatureName(const FeatureImpl *featureImpl); + + ServiceImpl *SAMGR_CreateServiceImpl(Service *service, uint8 step) +@@ -72,6 +78,7 @@ void DEFAULT_Initialize(ServiceImpl *imp + + impl->service->Initialize(impl->service, id); + const char *serviceName = impl->service->GetName(impl->service); ++ HILOG_INFO(HILOG_MODULE_SAMGR, "SAMGR_RegisterServiceApi serviceName %s", serviceName); + SAMGR_RegisterServiceApi(serviceName, NULL, &id, impl->defaultApi); + + int16 size = VECTOR_Size(&impl->features); +@@ -95,6 +102,7 @@ void DEFAULT_MessageHandle(ServiceImpl * + + if (identity->featureId < 0) { + if (serviceImpl->service->MessageHandle != NULL) { ++ HILOG_INFO(HILOG_MODULE_SAMGR, "serviceImpl->service->MessageHandle"); + serviceImpl->service->MessageHandle(serviceImpl->service, msg); + } + return; diff --git a/vendor/rkh/rkh_patch/foundation/window_window_manager_lite.patch b/vendor/rkh/rkh_patch/foundation/window_window_manager_lite.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3a41f8480d8f6e4c959ca5488919fbb0ce00876 --- /dev/null +++ b/vendor/rkh/rkh_patch/foundation/window_window_manager_lite.patch @@ -0,0 +1,47 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/foundation/window/window_manager_lite/services/wms/lite_win.cpp ../../../../../hi3403_l1_0922/ohos/foundation/window/window_manager_lite/services/wms/lite_win.cpp +--- ohos/foundation/window/window_manager_lite/services/wms/lite_win.cpp 2025-05-03 17:57:12.000000000 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/foundation/window/window_manager_lite/services/wms/lite_win.cpp 2025-09-22 12:34:40.976729447 +0800 +@@ -131,13 +131,31 @@ void LiteWindow::UpdateBackBuf() + if (acquireBufVirAddr != nullptr && backBufVirAddr != nullptr) { + GRAPHIC_LOGI("memcpy, backBuf size=%d, acquireBuffer size=%d", + backBuf_->GetSize(), acquireBuffer->GetSize()); ++ bool ret = false; ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES ++ uintptr_t srcPhyAddr = acquireBuffer->GetPhyAddr(); ++ uintptr_t dstPhyAddr = backBuf_->GetPhyAddr(); ++ LiteSurfaceData srcData; ++ LiteSurfaceData dstData; ++ srcData.width = config_.rect.GetWidth(); ++ srcData.height = config_.rect.GetHeight(); ++ srcData.pixelFormat = static_cast(surface_->GetFormat()); ++ srcData.stride = surface_->GetStride(); ++ srcData.phyAddr = reinterpret_cast(srcPhyAddr); ++ dstData.width = surface_->GetWidth(); ++ dstData.height = surface_->GetHeight(); ++ dstData.pixelFormat = static_cast(surface_->GetFormat()); ++ dstData.stride = surface_->GetStride(); ++ dstData.phyAddr = reinterpret_cast(dstPhyAddr); ++ Rect updateRect; ++ updateRect.SetRect(0, 0, config_.rect.GetWidth() - 1, config_.rect.GetHeight() -1); ++ ret = GfxEngines::GetInstance()->GfxBlit(srcData, updateRect, dstData, 0, 0); ++#endif ++ if (!ret) { + #ifdef ARM_NEON_OPT +- { + DEBUG_PERFORMANCE_TRACE("UpdateBackBuf_neon"); + NeonMemcpy(backBufVirAddr, backBuf_->GetSize(), acquireBufVirAddr, acquireBuffer->GetSize()); +- } + #else +- { + DEBUG_PERFORMANCE_TRACE("UpdateBackBuf"); + if (memcpy_s(backBufVirAddr, backBuf_->GetSize(), + acquireBufVirAddr, acquireBuffer->GetSize()) != EOK) { +@@ -232,7 +250,7 @@ void LiteWindow::Flush(const Rect& srcRe + } + + GraphicLocker lock(backBufMutex_); +-#if ENABLE_GFX_ENGINES ++#if defined(ENABLE_GFX_ENGINES) && ENABLE_GFX_ENGINES + uintptr_t phyaddr = backBuf_->GetPhyAddr(); + if (IsCoverMode() && phyaddr) { + LiteSurfaceData srcData; diff --git a/vendor/rkh/rkh_patch/kernel/kernel_linux_config.patch b/vendor/rkh/rkh_patch/kernel/kernel_linux_config.patch new file mode 100644 index 0000000000000000000000000000000000000000..84262c75036f4d50fadbcc8f3bb279952ce7856d --- /dev/null +++ b/vendor/rkh/rkh_patch/kernel/kernel_linux_config.patch @@ -0,0 +1,74 @@ +diff -uparN '--exclude=prebuilts' '--exclude=.git' '--exclude=.repo' ohos/kernel/linux/config/linux-6.6/arch/arm64/configs/hispark_ss928v100_small_defconfig ../../../../../hi3403_l1_0922/ohos/kernel/linux/config/linux-6.6/arch/arm64/configs/hispark_ss928v100_small_defconfig +--- ohos/kernel/linux/config/linux-6.6/arch/arm64/configs/hispark_ss928v100_small_defconfig 2025-10-08 16:39:08.265839694 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/kernel/linux/config/linux-6.6/arch/arm64/configs/hispark_ss928v100_small_defconfig 2025-09-22 11:12:24.477880197 +0800 +@@ -1468,6 +1468,45 @@ CONFIG_INPUT_EVDEV=y + # Input Device Drivers + # + # CONFIG_INPUT_KEYBOARD is not set ++ ++# ++# Input Device Drivers ++# ++CONFIG_INPUT_KEYBOARD=y ++# CONFIG_KEYBOARD_ADP5588 is not set ++# CONFIG_KEYBOARD_ADP5589 is not set ++CONFIG_KEYBOARD_ATKBD=y ++# CONFIG_KEYBOARD_QT1050 is not set ++# CONFIG_KEYBOARD_QT1070 is not set ++# CONFIG_KEYBOARD_QT2160 is not set ++# CONFIG_KEYBOARD_DLINK_DIR685 is not set ++# CONFIG_KEYBOARD_LKKBD is not set ++# CONFIG_KEYBOARD_GPIO is not set ++# CONFIG_KEYBOARD_GPIO_POLLED is not set ++# CONFIG_KEYBOARD_TCA6416 is not set ++# CONFIG_KEYBOARD_TCA8418 is not set ++# CONFIG_KEYBOARD_MATRIX is not set ++# CONFIG_KEYBOARD_LM8333 is not set ++# CONFIG_KEYBOARD_MAX7359 is not set ++# CONFIG_KEYBOARD_MCS is not set ++# CONFIG_KEYBOARD_MPR121 is not set ++# CONFIG_KEYBOARD_NEWTON is not set ++# CONFIG_KEYBOARD_OPENCORES is not set ++# CONFIG_KEYBOARD_SAMSUNG is not set ++# CONFIG_KEYBOARD_STOWAWAY is not set ++# CONFIG_KEYBOARD_SUNKBD is not set ++# CONFIG_KEYBOARD_OMAP4 is not set ++# CONFIG_KEYBOARD_XTKBD is not set ++# CONFIG_KEYBOARD_CAP11XX is not set ++# CONFIG_KEYBOARD_BCM is not set ++# CONFIG_KEYBOARD_CYPRESS_SF is not set ++# CONFIG_INPUT_MOUSE is not set ++# CONFIG_INPUT_JOYSTICK is not set ++# CONFIG_INPUT_TABLET is not set ++# CONFIG_INPUT_TOUCHSCREEN is not set ++# CONFIG_INPUT_MISC is not set ++# CONFIG_RMI4_CORE is not set ++ + CONFIG_INPUT_MOUSE=y + CONFIG_MOUSE_PS2=y + CONFIG_MOUSE_PS2_ALPS=y +@@ -2241,6 +2280,16 @@ CONFIG_USB_XHCI_PLATFORM=y + # CONFIG_USB_DWC2 is not set + # CONFIG_USB_ISP1760 is not set + ++CONFIG_USB_DWC3=y ++CONFIG_USB_DWC3_HOST=y ++ ++# ++# Platform Glue Driver Support ++# ++CONFIG_USB_DWC3_OF_SIMPLE=y ++# CONFIG_USB_DWC2 is not set ++# CONFIG_USB_ISP1760 is not set ++ + # + # USB port drivers + # +@@ -2634,6 +2683,7 @@ CONFIG_USB_WING=y + CONFIG_WING_UPS_PHY=y + CONFIG_WING_UPS_XVP_PHY=y + CONFIG_WING_UPS_NANO_PHY=y ++CONFIG_WING_UPS_MISSILE_PHY=y + # CONFIG_WING_UPS_MISSILE_PHY is not set + # end of Wing UPS Phy + diff --git a/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_config.patch b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_config.patch new file mode 100644 index 0000000000000000000000000000000000000000..7748d4b81e0ea8cda0271bfe46bc7e8882f03bee --- /dev/null +++ b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_config.patch @@ -0,0 +1,60 @@ +--- ohos/vendor/hisilicon/hispark_ss928v100_linux/config.json 2025-10-08 23:45:40.460493945 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/vendor/hisilicon/hispark_ss928v100_linux/config.json 2025-10-08 13:31:29.372972609 +0800 +@@ -13,7 +13,7 @@ + { + "subsystem": "systemabilitymgr", + "components": [ +- { "component": "samgr_lite", "features":[] }, ++ { "component": "samgr_lite", "features":["ability_lite_enable_ohos_appexecfwk_feature_ability = true"] }, + { "component": "safwk_lite", "features":[] } + ] + }, +@@ -55,7 +55,11 @@ + { + "subsystem": "hdf", + "components": [ +- { "component": "hdf_core", "features":[ "hdf_core_platform_test_support = true" ] } ++ { "component": "hdf_core", "features":[ "hdf_core_platform_test_support = true" ] }, ++ { "component": "drivers_peripheral_display", "features":[] }, ++ { "component": "drivers_peripheral_input", "features":[ ++ "drivers_peripheral_input_feature_lite_support_test = true" ++ ] } + ] + }, + { +@@ -88,12 +92,14 @@ + { + "subsystem": "communication", + "components": [ +- { "component": "dhcp", "features":[] } ++ { "component": "dhcp", "features":[] }, ++ { "component": "ipc", "features":[] } + ] + }, + { + "subsystem": "arkui", + "components": [ ++ { "component": "ace_engine_lite", "features":[ "" ] }, + { "component": "ui_lite", "features":[ "ui_lite_enable_graphic_font_config = true" ] } + ] + }, +@@ -118,6 +124,19 @@ + { "component": "audio_lite", "features":[] }, + { "component": "media_service", "features":[] } + ] ++ }, ++ { ++ "subsystem": "powermgr", ++ "components": [ ++ { "component": "powermgr_lite", "features":[ "enable_screensaver = true" ] } ++ ] ++ }, ++ { ++ "subsystem": "applications", ++ "components": [ ++ { "component": "camera_sample_app", "features":[] }, ++ { "component": "camera_screensaver_app", "features":[] } ++ ] + } + ], + "third_party_dir": "//third_party", diff --git a/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_fstab.patch b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_fstab.patch new file mode 100644 index 0000000000000000000000000000000000000000..eb5938a99ed0196402986ffc07eaecfbd90cd9f5 --- /dev/null +++ b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_fstab.patch @@ -0,0 +1,7 @@ +--- ohos/vendor/hisilicon/hispark_ss928v100_linux/init_configs/etc/fstab 2025-10-09 00:40:39.045670980 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/vendor/hisilicon/hispark_ss928v100_linux/init_configs/etc/fstab 2025-09-22 11:13:44.805404979 +0800 +@@ -1,2 +1,4 @@ + proc /proc proc defaults,nodev,nosuid 0 0 + sysfs /sys sysfs defaults,nodev,nosuid 0 0 ++/dev/mmcblk0p5 /storage ext4 defaults,nosuid 0 0 ++/dev/mmcblk0p6 /data ext4 defaults,nosuid 0 0 diff --git a/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_init_cfg.patch b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_init_cfg.patch new file mode 100644 index 0000000000000000000000000000000000000000..ea7e83ce14b48c2b072742ed42e79696a476882a --- /dev/null +++ b/vendor/rkh/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_init_cfg.patch @@ -0,0 +1,30 @@ +--- ohos/vendor/hisilicon/hispark_ss928v100_linux/init_configs/init_linux_openharmony.cfg 2025-10-08 23:45:40.464493934 +0800 ++++ ../../../../../hi3403_l1_0922/ohos/vendor/hisilicon/hispark_ss928v100_linux/init_configs/init_linux_openharmony.cfg 2025-10-08 13:30:57.942875072 +0800 +@@ -83,6 +83,10 @@ + "mkdir /storage/data/service/el1/public/huks_service 0711 12 12", + "mkdir /storage/data/service/el1/public/huks_service/maindata 0711 12 12", + "mkdir /storage/data/service/el1/public/huks_service/bakdata 0711 12 12", ++ "copy /system/internal/photo1.jpeg /userdata/thumb/photo1.jpeg", ++ "copy /system/internal/photo2.jpeg /userdata/thumb/photo2.jpeg", ++ "copy /system/internal/photo1.jpeg /userdata/photo/photo1.jpeg", ++ "copy /system/internal/photo2.jpeg /userdata/photo/photo2.jpeg", + "exec /bin/hks_compatibility_bin", + + "start ueventd", +@@ -94,6 +98,7 @@ + "start faultloggerd", + "start media_server", + "start wms_server", ++ "start deviceauth_service", + "start devattest_service", + "start huks_server" + ] +@@ -133,7 +138,7 @@ + "gid" : 1, + "once" : 0, + "importance" : 0, +- "caps" : [2, 6, 7, 8, 11, 17, 23, 24] ++ "caps" : [2, 6, 7, 8, 11, 17, 21, 23, 24] + }, { + "name" : "apphilogcat", + "path" : ["/bin/apphilogcat"], diff --git a/vendor/rkh/rkh_patch_build.sh b/vendor/rkh/rkh_patch_build.sh new file mode 100644 index 0000000000000000000000000000000000000000..2dcc734e8a585aa7086a6a38e855776b0e2e1d29 --- /dev/null +++ b/vendor/rkh/rkh_patch_build.sh @@ -0,0 +1,43 @@ +#!/bin/bash +####################################### +# Copyright (c) 2024-2025 rkh +# for release L1 build entirely +# How to use: +# 1. 在ohos同一级目录下手动执行 ./rkh_patch_build.sh 脚本 +####################################### +set -e + + +function patch_build() +{ + SOURCE_ROOT_DIR=$(cd $(dirname $0);pwd) + + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/base/security_appverify.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/base/startup_appspawn.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/base/startup_init.patch + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/arkui_ace_engine_lite.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/bundlemanager_bundle_framework_lite.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/systemabilitymgr_samgr_lite.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/arkui_ui_lite.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/graphic_graphic_utils_lite.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/foundation/window_window_manager_lite.patch + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/applications/applications_sample_camera.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/applications/applications_sample_camera_gallery.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/applications/applications_sample_camera_gallery_resources.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/applications/applications_sample_camera_launcher.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/applications/applications_sample_camera_setting.patch + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/device/device_soc_hisilicon_ss928v100_burn.patch + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/kernel/kernel_linux_config.patch + + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_config.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_init_cfg.patch + patch -p0 < ${SOURCE_ROOT_DIR}/rkh_patch/vendor/vendor_hisiliconhispark_ss928v100_linux_fstab.patch + +} + +patch_build \ No newline at end of file