rk3399启动适配和cpu点屏

标准系统适配流程

https://laval.csdn.net/64afc2bb8e3f043cd26d8082.html

 

OpenHarmony的启动流程主要包括以下几个步骤:

引导加载:系统启动时,首先会执行引导加载程序,加载并初始化系统的基本硬件和软件环境。

内核初始化:引导加载程序会加载内核,并执行内核初始化操作,包括设置系统环境、初始化内存管理、中断处理等。

进程初始化:内核初始化完成后,会创建第一个用户进程,该进程成为系统的init进程。init进程是系统的根进程,负责启动其他进程。

服务启动:init进程会根据系统配置文件启动各种系统服务,如文件系统服务、网络服务等。

 

rk3399系统启动

处理内核不断重启的问题

内不断重启,log分析

[    2.904831] <<-GTP-ERROR->> I2C Read: 0x8000, 10 bytes failed, errcode: -6! Process reset.
[    3.000723] <<-GTP-ERROR->> I2C read 0x8000, 10 bytes, double check failed!
[    3.001333] <<-GTP-ERROR->> Failed to get chip-type, set chip type default: GOODIX_GT9
[    3.002793] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -6! Process reset.
[    3.097382] <<-GTP-ERROR->> GTP i2c test failed time 1.
[    3.114813] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -6! Process reset.
[    3.210722] <<-GTP-ERROR->> GTP i2c test failed time 2.
[    3.228151] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -6! Process reset.
[    3.324055] <<-GTP-ERROR->> GTP i2c test failed time 3.
[    3.341499] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -6! Process reset.
[    3.437389] <<-GTP-ERROR->> GTP i2c test failed time 4.
[    3.454816] <<-GTP-ERROR->> I2C Read: 0x8047, 1 bytes failed, errcode: -6! Process reset.
[    3.550721] <<-GTP-ERROR->> GTP i2c test failed time 5.
[    3.567387] <goodix_ts_probe>_2786    I2C communication ERROR!
​
[    3.651509] ### [smdt]:MCU check Failed! check_data =0x89
[    3.652493] ### [smdt]:MCU check Failed! check_data =0x89
[    3.653480] ### [smdt]:MCU check Failed! check_data =0x89
[    3.654464] ### [smdt]:MCU check Failed! check_data =0x89
[    3.655447] ### [smdt]:MCU check Failed! check_data =0x89
[    3.656435] ### [smdt]:MCU check Failed! check_data =0x89
[    3.657425] ### [smdt]:MCU check Failed! check_data =0x89
[    3.658403] ### [smdt]:MCU check Failed! check_data =0x89
[    3.658878] SMP: stopping secondary CPUs
DDR Version 1.24 20191016

发现每次在mcu fail的时候重启

查找log发现Log出现在device/board/isoftstone/yangfan/kernel/src/mcu/mcu.o,因为没有源码无法确认这部分的内容,尝试修改设备树,关闭mcu开关。

首先找到工程使用的设备树

如何找到杨帆使用哪个设备树,找到内核编译脚本->查找编译内核的命令->确认设备树

out/kernel/src_tmp/linux-5.10/make-ohos.sh

sapphire-rk3399 arm64 0xff1a0000 rk3399-sapphire-excavator-linux Image rockchip_linux_defconfig

vendor/isoftstone/yangfan/kernel_core/arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator-linux.dts

刷机验证后设备不再重启。

内核异常报错类型汇总

https://blog.csdn.net/qq_35399548/article/details/122817988

解决分区挂载问题

vendor分区挂载不成功

Kernel command line: earlycon=uart8250,mmio32,0xff1a0000 root=/dev/mmcblk2p5 rw rootwait rootfstype=ext4 console=uart8250,mmio32,0xff1a0000 coherent_pool=1m hardware=rk3399
行 2305: [    3.828042] [pid=1][BEGET][ERROR][fstab_mount.c:484][fs_manager][error] Read fstab file " /vendor/etc/fstab.rk3399
行 2307: [    3.830000] [pid=1][Init][INFO][init_cmds.c:297]Mount partitions from fstab file " /vendor/etc/fstab.rk3399
行 2311: [    3.833023] [pid=1][Init][ERROR][init_common_cmds.c:342]Create directory '/data/vendor/log' failed, err=2.
行 2324: [    3.880993] [pid=215][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk2p6->/dev/block/platform/fe330000.sdhci/by-name/vendor
行 2416: [    4.080694] [pid=220][PLUGIN][INFO][init_context.c:196]Exec cmd 'chown  vendor_mpp_driver vendor_mpp_driver /dev/mpp_service' in sub init u:r:chipset_init:s0
行 2417: [    4.082424] [pid=220][PLUGIN][INFO][init_context.c:196]Exec cmd 'chown  system vendor_mpp_driver /dev/rga' in sub init u:r:chipset_init:s0
行 2470: [    4.175418] [pid=224][Init][INFO][init_service.c:173]Service /vendor/bin/hdf_devmgr skip enter chipset sandbox.
行 2635: [    4.422871] [pid=1][Init][ERROR][init_common_cmds.c:342]Create directory '/data/vendor' failed, err=30.

分区挂载会读取fstab.rk3399,看到Create directory '/data/vendor/log' failed, err=2. 确认vendor分区没有挂载成功

最后发现cmdline没有配置好,coherent_pool=1m之后不能有空格

修改尝试:

console=uart8250,mmio32,0xff1a0000 rw root=/dev/mmcblk2p5 rootfstype=ext4 rootwait hardware=rk3399 coherent_pool=1m

console=uart8250,mmio32,0xff1a0000 rw root=/dev/mmcblk2p5 rootfstype=ext4 rootwait coherent_pool=1m

最后把hardware=rk3399放在ext4之后,验证解决vendor分区挂载问题

 

 

data分区挂载不成功

外部表现是创建文件提示Read-only

echo 0 > /proc/sys/kernel/printk  //关闭串口打印
cd /data/ 
mkdir test 
mkdir: 'test': Read-only file system
[    5.741777] [pid=1][BEGET][INFO][fstab_mount.c:81]Execute /system/bin/resize2fs begin
[    5.782556] [pid=1][BEGET][ERROR][fstab_mount.c:92]Command /system/bin/resize2fs failed with status 1
[    5.783275] [pid=1][BEGET][INFO][fstab_mount.c:94]Execute /system/bin/resize2fs end
[    5.784159] [pid=1][BEGET][ERROR][fstab_mount.c:381]Failed to resize2fs dir /dev/block/platform/fe330000.sdhci/by-name/userdata , ret = 1
[    5.784981] [pid=1][BEGET][INFO][fstab_mount.c:81]Execute /system/bin/e2fsck begin
[    5.834814] [pid=1][BEGET][ERROR][fstab_mount.c:92]Command /system/bin/e2fsck failed with status 8
[    5.835510] [pid=1][BEGET][INFO][fstab_mount.c:94]Execute /system/bin/e2fsck end
[    5.836316] [pid=1][BEGET][ERROR][fstab_mount.c:385]Failed to e2fsck dir /dev/block/platform/fe330000.sdhci/by-name/userdata , ret = 8
[    5.837715] EXT4-fs (mmcblk2p7): VFS: Can't find ext4 filesystem
[    5.839403] [pid=1][BEGET][WARNING][fstab_mount.c:395]Mount /dev/block/platform/fe330000.sdhci/by-name/userdata to /data failed, err = 22. Ignore failure

[ 5.837715] EXT4-fs (mmcblk2p7): VFS: Can't find ext4 filesystem

log显示无法通过ext4的方式挂载 参考zhiyuan修改挂载方式

./zhiyuan/configure/vendor/etc/linux-5.10/fstab.required:/dev/block/platform/soc@3000000/4022000.sdmmc/by-name/userdata               /data       f2fs     discard,noatime,nosuid,nodev,fscrypt=2:aes-256-cts:aes-256-xts  wait,check,fileencryption=software,quota

文件系统挂载方式的修改:device/board/isoftstone/yangfan/cfg/rootfs/fstab.rk3399

 

挂载方式修改之后根据log提示打开CONFIG_QUOTA(RDWR without CONFIG_QUOTA)开关

[    4.366157] [pid=1][BEGET][ERROR][fstab_mount.c:371]Failed to resize.f2fs dir /dev/block/platform/fe330000.sdhci/by-name/userdata , ret = 255
[    4.366905] [pid=1][BEGET][INFO][fstab_mount.c:81]Execute /system/bin/fsck.f2fs begin
[    5.477792] vendor storage:20190527 ret = -1
[    5.598793] [pid=1][BEGET][INFO][fstab_mount.c:94]Execute /system/bin/fsck.f2fs end
[    5.599845] F2FS-fs (mmcblk2p7): Filesystem with quota feature cannot be mounted RDWR without CONFIG_QUOTA
[    5.601412] [pid=1][BEGET][WARNING][fstab_mount.c:395]Mount /dev/block/platform/fe330000.sdhci/by-name/userdata to /data failed, err = 22. Ignore failure
[    5.601440] [pid=1][Init][INFO][init_cmds.c:297]Mount partitions from fstab file " /vendor/etc/fstab.rk3399 " finish ret 0
[    5.602652] [pid=1][Init][INFO][init_common_cmds.c:769]Execute command "mount_fstab  /vendor/etc/fstab.${ohos.boot.hardware}" took 1779 ms

Log分析 F2FS-fs (mmcblk2p7): Filesystem with quota feature cannot be mounted RDWR without CONFIG_QUOTA,需要打开内核配置开关

kernel/linux/config/linux-5.10/yangfan/arch/arm64_defconfig

CONFIG_QUOTA=y

修改完成后data分区正常挂载

f2fs挂载参数的解释

https://wenku.baidu.com/view/9a4d22afbfd126fff705cc1755270722182e591e.html?_wkts_=1709864375811&bdQuery=f2fs%E6%8C%82%E8%BD%BD%E5%8F%82%E6%95%B0&needWelcomeRecommand=1

解决应用安装问题

通过命令查看ps -ef | grep com.*

 

发现没有一个应用起来,查找原因发现应用安装的配置文件都没有

# ls -l /system/etc/app/
total 36
-rw-r--r-- 1 root root  5851 2024-02-19 15:21 install_list.json
-rw-r--r-- 1 root root  9345 2024-02-19 15:21 install_list_capability.json
-rw-r--r-- 1 root root 10661 2024-02-19 15:21 install_list_permissions.json
-rw-r--r-- 1 root root    57 2024-02-19 15:21 uninstall_list.json

对比3568拷贝preinstall-config 到vendor/isoftstone/yangfan/preinstall-config

然后增加编译配置vendor/isoftstone/yangfan/ohos.build

 

修改好后应用正常安装启动

CPU点屏流程

https://laval.csdn.net/64c7a6439a15ac690d7c7035.html

 

openharmony 3.2版本composer由render_service通过单例拉起,4.0通过composer service拉起接口实现层libdisplay_composer_vdi_impl.z.so,对外提供标准的IPC服务.

进程名字由disp_gralloc_host变更成allocator_host。通过allocator_service拉起接口实现层libdisplay_buffer_vdi_impl.z.so,对外提供标准的IPC服务。

 

samgr OpenHarmony的核心组件,提供OpenHarmony系统服务启动、注册、查询等功能。

softbus_server 软总线作为系统服务,在系统启动,Init进程加载时,通过解析配置文件softbus_server.rc完成系统服务的启动

render_service 图形显示框架的基础框架

userdata分区挂载成功后samgr和softbus_server都会正常启动,下一步是调试显示部分的服务了。

ps -ef | grep render_service

ps -ef | grep foundation

ps -ef | grep composer_host

ps -ef | grep allocator_host

因为rk3399 4.0还没有适配过GPU点屏, 所以先用CPU点屏的方式验证各通路

关闭GPU开关

vendor/isoftstone/yangfan/config.json

  • diff --git a/yangfan/config.json b/yangfan/config.json
    index 03e1d7c..688b66c 100644
    --- a/yangfan/config.json
    +++ b/yangfan/config.json
    @@ -34,7 +34,7 @@
             {
               "component": "graphic_2d",
               "features": [
    -            "graphic_2d_feature_ace_enable_gpu = true"
    +            "graphic_2d_feature_ace_enable_gpu = false"
               ]
             }
    
    @@ -66,7 +76,7 @@
               "component": "ace_engine",
               "features": [
                 "ace_engine_feature_enable_accessibility = true",
    
    -            "ace_engine_feature_enable_web = true"
    
    +            "ace_engine_feature_enable_web = false"
                 ]
                 }
                 ]

foundation/graphic/graphic_2d/graphic_config.gni

diff --git a/graphic_config.gni b/graphic_config.gni
index f7b7b3bdb..635197e80 100644
--- a/graphic_config.gni
+++ b/graphic_config.gni
@@ -13,9 +13,9 @@
 
 declare_args() {
   graphic_2d_feature_bootanimation_enable = true
-  graphic_2d_feature_ace_enable_gpu = true
+  graphic_2d_feature_ace_enable_gpu = false
   graphic_2d_feature_color_gamut_enable = false
   graphic_2d_feature_rs_enable_eglimage = false
   graphic_2d_feature_rs_enable_uni_render = false
   graphic_2d_feature_wuji_enable = false
   graphic_2d_feature_enable_afbc = false
diff --git a/rosen/modules/effect/skia_effectChain/BUILD.gn b/rosen/modules/effect/skia_effectChain/BUILD.gn
index b4a23f6ca..7e29b369b 100644
--- a/rosen/modules/effect/skia_effectChain/BUILD.gn
+++ b/rosen/modules/effect/skia_effectChain/BUILD.gn
@@ -37,6 +37,7 @@ config("effect_SKeffectChian_public_config") {
     "//foundation/multimedia/image_framework/interfaces/innerkits/include",
     "$graphic_2d_root/utils/log",
     "include",
+    "//third_party/openGLES/api",
   ]
 }
 
@@ -44,6 +45,8 @@ ohos_shared_library("skeffectchain") {
   public_deps = [
     "$graphic_2d_root:libsurface",
     "$graphic_2d_root/rosen/modules/effect/egl:libegl_effect",
+    "//third_party/EGL:libEGL",
+    "//third_party/openGLES:libGLES",
   ]
 
   if (ace_enable_gpu) {
@@ -51,6 +54,7 @@ ohos_shared_library("skeffectchain") {
     public_deps += [ "$graphic_2d_root:libgl" ]
   }
 
+  public_deps += [ "$graphic_2d_root:libgl" ]
   if (defined(use_new_skia) && use_new_skia) {
     public_deps += [ "//third_party/skia:skia_ohos" ]
   } else {
diff --git a/rosen/modules/render_service/BUILD.gn b/rosen/modules/render_service/BUILD.gn
index 77b26ea2f..b27faca7c 100644
--- a/rosen/modules/render_service/BUILD.gn
+++ b/rosen/modules/render_service/BUILD.gn
@@ -183,6 +183,13 @@ ohos_shared_library("librender_service") {
     defines += accessibility_defines
   }
 
+  cflags = [
+    "-Wall",
+    "-Wno-unused-const-variable",
+  ]
+
+  cflags_cc = [ "-Wno-unused-const-variable" ]
+
   part_name = "graphic_2d"
   subsystem_name = "graphic"
 }
diff --git a/rosen/modules/render_service/core/pipeline/rs_base_render_engine.cpp b/rosen/modules/render_service/core/pipeline/rs_base_render_engine.cpp
index c7418e0fb..fac0a162d 100644
--- a/rosen/modules/render_service/core/pipeline/rs_base_render_engine.cpp
+++ b/rosen/modules/render_service/core/pipeline/rs_base_render_engine.cpp
@@ -85,6 +85,7 @@ void RSBaseRenderEngine::Init()
 
 bool RSBaseRenderEngine::NeedForceCPU(const std::vector<LayerInfoPtr>& layers)
 {
+#ifdef RS_ENABLE_GL
     bool forceCPU = false;
     for (const auto& layer: layers) {
         if (layer == nullptr) {
@@ -113,6 +114,9 @@ bool RSBaseRenderEngine::NeedForceCPU(const std::vector<LayerInfoPtr>& layers)
     }
 
     return forceCPU;
+#else
+    return true;
+#endif
 }
 
 #ifndef USE_ROSEN_DRAWING
diff --git a/rosen/modules/render_service_base/src/platform/ohos/BUILD.gn b/rosen/modules/render_service_base/src/platform/ohos/BUILD.gn
index e1bf2eb3b..cfa6676f1 100644
--- a/rosen/modules/render_service_base/src/platform/ohos/BUILD.gn
+++ b/rosen/modules/render_service_base/src/platform/ohos/BUILD.gn
@@ -109,6 +109,7 @@ ohos_source_set("rosen_ohos_sources") {
     "//drivers/peripheral/display/interfaces/include/",
     "$graphic_2d_root/rosen/modules/render_service_client/core",
     "$graphic_2d_root/utils/log",
+    "//third_party/openGLES/api",
   ]
 
   public_deps = [
@@ -116,6 +117,8 @@ ohos_source_set("rosen_ohos_sources") {
     "$graphic_2d_root/rosen/modules/2d_graphics:2d_graphics",
     "$graphic_2d_root/rosen/modules/composer/vsync:libvsync",
     "$graphic_2d_root/utils:sync_fence",
+    "//third_party/EGL:libEGL",
+    "//third_party/openGLES:libGLES",
   ]
   if (defined(use_new_skia) && use_new_skia) {
     public_deps += [ "//third_party/skia:skia_ohos" ]

增加device info配置文件

vendor/isoftstone/yangfan/hdf_config/uhdf/device_info.hcs

 

 

增加device_soc显示so库编译配置

对比3568, 把3568 device/soc/rockchip/rk3568的代码拷贝到3399上,然后增加编译配置

device/board/isoftstone/yangfan/BUILD.gn

  • diff --git a/yangfan/BUILD.gn b/yangfan/BUILD.gn
    index e0b8231..5e37fa9 100644
    --- a/yangfan/BUILD.gn
    +++ b/yangfan/BUILD.gn
    @@ -13,5 +13,7 @@ group("rk3399_group") {
         "cfg/rootfs:init_configs",
         "kernel:kernel",
         "//device/soc/rockchip/rk3399/hardware:hardware_group",
    
    +    "//device/soc/rockchip/rk3399/hardware/display:display_buffer_model",
    +    "//device/soc/rockchip/rk3399/hardware/display:display_composer_model",
         ]
          }

libdisplay_buffer_vdi_impl.z.so编译生成路径

out/yangfan/packages/phone/vendor/lib/chipset-sdk/libdisplay_buffer_vdi_impl.z.so

配置图形合成方式

gfx硬件合成

验证阶段可以在代码强制配置

//CompositionType defaultCompType = UseCompositionClient(layers) ? COMPOSITION_CLIENT : COMPOSITION_DEVICE;
CompositionType defaultCompType = UseCompositionClient(layers) ?  COMPOSITION_DEVICE;

device/soc/rockchip/rk3568/hardware/display/src/display_device/hdi_gfx_composition.cpp

 int32_t HdiGfxComposition::Apply(bool modeSet)
 {
+    StartTrace(HITRACE_TAG_HDF, "HDI:DISP:Apply");
     int32_t ret;
-    DISPLAY_DEBUGLOG("composer layers size %{public}zd", mCompLayers.size());
+    static std::shared_ptr<IDisplayBufferVdi> g_buffer = nullptr;
+    DISPLAY_LOGD("map composer layers size %{public}zd", mCompLayers.size());
     for (uint32_t i = 0; i < mCompLayers.size(); i++) {
         HdiLayer *layer = mCompLayers[i];
         CompositionType compType = layer->GetCompositionType();
@@ -185,15 +215,39 @@ int32_t HdiGfxComposition::Apply(bool modeSet)
                     DISPLAY_LOGE("clear layer %{public}d failed", i));
                 break;
             case COMPOSITION_DEVICE:
-                ret = BlitLayer(*layer, *mClientLayer);
-                DISPLAY_CHK_RETURN((ret != DISPLAY_SUCCESS), DISPLAY_FAILURE,
-                    DISPLAY_LOGE("blit layer %{public}d failed ", i));
+                // ret = BlitLayer(*layer, *mClientLayer);
+                // DISPLAY_CHK_RETURN((ret != DISPLAY_SUCCESS), DISPLAY_FAILURE,
+                //     DISPLAY_LOGE("blit layer %{public}d failed ", i));
+                {
+                    if (g_buffer== nullptr) {
+                        IDisplayBufferVdi* dispBuf = new DisplayBufferVdiImpl();
+                        DISPLAY_CHK_RETURN((dispBuf == nullptr), DISPLAY_FAILURE, DISPLAY_LOGE("map dispBuf init failed"));
+                        g_buffer.reset(dispBuf);
+                        DISPLAY_LOGD("map new DisplayBufferVdiImpl");
+                    }
+                    char *clientBuff = (char *)g_buffer->Mmap(mClientLayer->GetCurrentBuffer()->mHandle);
+                    if(clientBuff) {
+                        DISPLAY_LOGD("map in int");
+                        HdiLayerBuffer *hdiLayer = layer->GetCurrentBuffer();
+                        char *layerBuff = (char *)g_buffer->Mmap(hdiLayer->mHandle);
+                        for(int y = 0; y < hdiLayer->GetHeight(); y++) {
+                            memcpy(&clientBuff[mClientLayer->GetCurrentBuffer()->GetStride() *
+                            (y + layer->GetLayerDisplayRect().y) + layer->GetLayerDisplayRect().x * 4],
+                            (char *)(&layerBuff[hdiLayer->GetStride() * y]), hdiLayer->GetStride());
+                        }
+                        g_buffer->Unmap(hdiLayer->mHandle);
+                        g_buffer->Unmap(mClientLayer->GetCurrentBuffer()->mHandle);
+                    } else {
+                        DISPLAY_LOGD("map in err");
+                    }
+                }
                 break;
             default:
                 DISPLAY_LOGE("the gfx composition can not surpport the type %{public}d", compType);
                 break;
         }
     }
+    FinishTrace(HITRACE_TAG_HDF);
     return DISPLAY_SUCCESS;
 }

 

cpu合成

验证阶段可以在代码强制配置

//CompositionType defaultCompType = UseCompositionClient(layers) ? COMPOSITION_CLIENT : COMPOSITION_DEVICE;
CompositionType defaultCompType = UseCompositionClient(layers) ?  COMPOSITION_CLIENT;

 

图形测试

如果上述流程配置好后桌面没有正常显示那么就需要用源码中自带modetest和hello_composer来测试显示模块的通路

在用户态,drm提供了libdrm库,并提供了modetest测试程序,来测试drm驱动是否完成了基础适配。

在OpenHarmony的第三方库libdrm自带了modetest,但默认没有参考编译,编译方法如下:

环境搭建

modetest

1、 为 modetest 添加 BUILD.gn

third_party\libdrm\tests\modetest\BUILD.gn:

import("//build/ohos.gni")
ohos_executable("modetest") {
  sources = [
    "buffers.c",
    "cursor.c",
    "modetest.c",
  ]

  cflags = [
      "-Wno-pointer-arith",
  ]

  include_dirs = [
    "../",
    ".",
  ]

  configs = [ "//third_party/libdrm:libdrm_config" ]

  public_configs = [ "//third_party/libdrm:libdrm_public_config" ]

  deps = [
    "//third_party/libdrm:libdrm",
    "//third_party/libdrm/tests/util/:util",
  ]

  public_deps = []

  install_images = [
    "system",
    "updater",
  ]
  part_name = "graphic_standard"
  subsystem_name = "graphic"
}

 

2、添加其它依赖:third_party\libdrm\tests\util\BUILD.gn

import("//build/ohos.gni")

ohos_static_library("util") {

  sources = [
    "format.c",
    "kms.c",
    "pattern.c",
  ]

  cflags = []

  include_dirs = [
    "../",
    ".",
  ]

  configs = [ "//third_party/libdrm:libdrm_config" ]

  public_configs = [ "//third_party/libdrm:libdrm_public_config" ]

  deps = [
    "//third_party/libdrm:libdrm",
  ]

  public_deps = []
}

3、加入编译框架,添加到graphic依赖项:

foundation/graphic/graphic_2d/bundle.json

  • diff --git a/bundle.json b/bundle.json
    index 755e6d2..f1bb7ef 100755
    --- a/bundle.json
    +++ b/bundle.json
    @@ -56,6 +56,8 @@
             "group_type": {
               "base_group": [
                 "//third_party/libpng:libpng",
    
    +            "//third_party/libdrm/tests/util:util",
    +            "//third_party/libdrm/tests/modetest:modetest",
                 "//foundation/graphic/graphic_2d/interfaces/kits/napi:napi_packages",
                 "//foundation/graphic/graphic_2d/rosen/modules/composer:libcomposer",
                 "//foundation/graphic/graphic_2d/rosen/modules/composer/native_vsync:libnative_vsync",

     

编译生成路径:out/yangfan/obj/third_party/libdrm/tests/modetest/modetest

  • IOCTL方式

    /system/bin/modetest -M rockchip -s 123@68:720x1280
    -M 指定drm驱动名称
    -s 指定屏幕信息
       123:connector id
       68: crtc id
       720x1280: 屏幕分辨率
  • atomic方式(OHOS Display HDI使用的方式)

    modetest -M rockchip -D 0 -a -s 123@68:720x1280 -P 54@68:720x1280
    -M 指定drm驱动名称
    -s 指定屏幕信息
       123:connector id
       68: crtc id
       720x1280: 屏幕分辨率
    -P 指定plane信息
       54: 可用的plane id
       68: crtc id
       720x1280: plane大小

由于HDI使用的是atomic方式,我们需要使用atomic方式测试drm接口成功,才能确保HDI正常使用。

直接运行modetest可以获取所有参数:

     /system/bin/modetest
    ……
    Encoders:
    id    crtc    type    possible crtcs    possible clones    
    120    0    Virtual    0x00000003    0x00000001
    122    0    TMDS    0x00000001    0x00000002
    135    85    DSI    0x00000002    0x00000004
    ……复制

如果遍历了所有驱动后都找不到合适的驱动名称就退出了,而无法运行,就需要使用-D来指定dri的名称。

查看dri设备信息

ls -l /dev/dri/by-path/
total 0
lrwxrwxrwx l root system 8 2017-08-07 13:34 platform-display-subsystem-card -> ../card0
lrwxrwxrwx l root system 8 2017-08-07 13:33 platform-display-subsystem-render -> ../renderD128

然后我们就可以使用“-D display-subsystem”来替换“-M rockchip”。

./modetest  -D display-subsystem -a -s 140@108:1920x1080 -P 84@108:1920x1080

 

 

hello_composer

foundation/graphic/graphic_2d/bundle.json

  • diff --git a/bundle.json b/bundle.json
    index 755e6d2..28bc995 100755
    --- a/bundle.json
    +++ b/bundle.json
    @@ -63,6 +63,7 @@
                 "//foundation/graphic/graphic_2d/rosen/samples/2d_graphics:drawing_sample_rs",
                 "//foundation/graphic/graphic_2d/rosen/samples/2d_graphics:drawing_engine_sample",
                 "//foundation/graphic/graphic_2d/rosen/samples/2d_graphics/test:drawing_sample",
    
    +            "//foundation/graphic/graphic_2d/rosen/samples/composer:hello_composer",
                 "//foundation/graphic/graphic_2d/rosen/modules/effect/effectChain:libeffectchain",
                 "//foundation/graphic/graphic_2d/rosen/modules/effect/color_picker:color_picker",
                 "//foundation/graphic/graphic_2d/rosen/modules/effect/skia_effectChain:skeffectchain",

     

编译生成路径:out/yangfan/packages/phone/vendor/bin/hello_composer

service_control stop render_service

./hello_composer

 

 

 

参考

OpenHarmony标准系统芯片适配指南

https://laval.csdn.net/64afc2bb8e3f043cd26d8082.html

点屏参考链接

https://laval.csdn.net/64c7a6439a15ac690d7c7035.html

modetest和composer_host测试流程参考

https://laval.csdn.net/64c7a6439a15ac690d7c7035.html

 

 

 

 

 

 

 

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐