系列文章请扫点击如下链接!
Android Display Graphics系列文章-汇总
本文主要包括部分:
一、Android13的Kernel 5.15版本
1.1 Kernel 5.15 情况说明
1.2 前置条件
二、QCM61*5 plane配置
2.1 multi-card配置
2.2 移植msm-lease
2.3 配置信息确认
三、Kernel 5.15 mutil-card方案实现
3.1 移植详细代码实现
一、Android13的Kernel 5.15版本
1.1 Kernel 5.15 情况说明
高通提供Android 13基线代码,有的是基于Kernel 5.15,在前两篇文章中,讲解了Kernel 5.4、5.10中就已经不存在msm-lease了。所以在Kernel 5.15版本上,也是一样的。
在Kernel 5.15中,msm的驱动已经移至 target_ap/vendor/qcom/opensource/display-drivers路径下;需要将msm-lease移植适配到此路径下,msm-lease同样需要移植到此路径下;
1.2 前置条件
移植multi-card的前置条件是,DSI屏和DP屏的驱动已经调试正常,单card(android默认)下是显示相同内容的。
此时再按照以下patch实现multi-card。
二、QCM 6**5 plane配置
2.1 multi-card配置
以QCM61*5为例,说明配置card信息;
下面配置:sde_card1的接口是DSI,并且分配了4个plane;sde_card2的接口是DP1,分配了2个plane。实际使用场景可以根据对现实的需求分配。
+
+
+ sde_card1: qcom,sde-kms-lease@0 {
+ compatible = "qcom,sde-kms-lease";
+ qcom,dev-name = "msm_drm1";
+ qcom,lease-connectors = "DSI-1";
+ qcom,lease-planes = "plane-0","plane-1","plane-2","plane-5";
+ };
+
+ sde_card2: qcom,sde-kms-lease@1 {
+ compatible = "qcom,sde-kms-lease";
+ qcom,dev-name = "msm_drm2";
+
+ qcom,lease-connectors = "DP-1";
+ qcom,lease-planes ="plane-3","plane-4";
+ };
+};
+&sde_dp {
+ status = "okay";
+ qcom,dp-hpd-gpio = <&tlmm 100 0>;
+ qcom,dp-low-power-hw-hpd;
};
2.2 移植msm-lease
将适合该平台的msm-lease文件放到target_ap/vendor/qcom/opensource/display-drivers/路径下,并在内核中增加配置。
--- a/config/trinketdisp.conf
+++ b/config/trinketdisp.conf
@@ -14,3 +14,4 @@
export CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG=y
export CONFIG_DRM_SDE_RSC=y
export CONFIG_DRM_CLIENT_BOOTSPLASH=y
+export CONFIG_DRM_MSM_LEASE=y
\ No newline at end of file
--- a/config/trinketdispconf.h
+++ b/config/trinketdispconf.h
@@ -16,3 +16,4 @@
#define CONFIG_MSM_SDE_ROTATOR_EVTLOG_DEBUG 1
#define CONFIG_DRM_SDE_RSC 1
#define CONFIG_DRM_CLIENT_BOOTSPLASH 1
+#define CONFIG_DRM_MSM_LEASE 1
在内核中要增加头文件:
kernel_platform/common/include/drm/drmP.h
kernel_platform/common/include/drm/drm_os_linux.h
kernel_platform/common/include/drm/drm_pci.h
kernel_platform/msm-kernel/include/drm/drmP.h
kernel_platform/msm-kernel/include/drm/drm_os_linux.h
kernel_platform/msm-kernel/include/drm/drm_pci.h
修改vendor/qcom/opensource/display-drivers/msm/msm_drv.h
vendor/qcom/opensource/display-drivers/msm/msm_drv.c ,使其调用msm_drm_register()注册drm时,调用msm_lease_drm_unregister()注册lease_drm。
移植完成,同样可以看到两个card节点,
2.3 配置信息确认
可以查看上两篇文章 中此章节内容
三、Kernel 5.15 mutil-card方案实现
3.1 移植详细代码实现
dtsi的card配置信息,修改路径在target/vendor/qcom/proprietary/
diff --git a/display-devicetree/display/trinket-sde-display-iot-dp-idp.dtsi b/display-devicetree/display/trinket-sde-display-iot-dp-idp.dtsi
--- a/display-devicetree/display/trinket-sde-display-iot-dp-idp.dtsi
+++ b/display-devicetree/display/trinket-sde-display-iot-dp-idp.dtsi
@@ -16,7 +16,7 @@
&mdss_mdp {
qcom,sde-crtc-num-pref = <5>;
qcom,sde-reg-dma-version = <0>;
- connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp>;
+ connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp &sde_card1 &sde_card2>;
};
&qupv3_se5_i2c {
diff --git a/display-devicetree/display/trinket-sde-display-iot-dp-usbc-idp.dtsi b/display-devicetree/display/trinket-sde-display-iot-dp-usbc-idp.dtsi
--- a/display-devicetree/display/trinket-sde-display-iot-dp-usbc-idp.dtsi
+++ b/display-devicetree/display/trinket-sde-display-iot-dp-usbc-idp.dtsi
@@ -5,5 +5,6 @@
};
&mdss_mdp {
- connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp>;
+ /delete-property/ connectors;
+ connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp &sde_card1 &sde_card2>;
};
diff --git a/display-devicetree/display/trinket-sde-display-iot-idp.dtsi b/display-devicetree/display/trinket-sde-display-iot-idp.dtsi
--- a/display-devicetree/display/trinket-sde-display-iot-idp.dtsi
+++ b/display-devicetree/display/trinket-sde-display-iot-idp.dtsi
@@ -36,7 +36,7 @@
};
&mdss_mdp {
- connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp>;
+ connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp &sde_card1 &sde_card2>;
};
&qupv3_se2_i2c {
diff --git a/display-devicetree/display/trinket-sde-display.dtsi b/display-devicetree/display/trinket-sde-display.dtsi
--- a/display-devicetree/display/trinket-sde-display.dtsi
+++ b/display-devicetree/display/trinket-sde-display.dtsi
@@ -135,12 +135,34 @@
cell-index = <0>;
label = "wb_display";
};
+
+
+ sde_card1: qcom,sde-kms-lease@0 {
+ compatible = "qcom,sde-kms-lease";
+ qcom,dev-name = "msm_drm1";
+ qcom,lease-connectors = "DSI-1";
+ qcom,lease-planes = "plane-0","plane-1","plane-2","plane-5";
+ };
+
+ sde_card2: qcom,sde-kms-lease@1 {
+ compatible = "qcom,sde-kms-lease";
+ qcom,dev-name = "msm_drm2";
+
+ qcom,lease-connectors = "DP-1";
+ qcom,lease-planes ="plane-3","plane-4";
+ };
+};
+&sde_dp {
+ status = "okay";
+ qcom,dp-hpd-gpio = <&tlmm 100 0>;
+ qcom,dp-low-power-hw-hpd;
};
&mdss_mdp {
- connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp>;
+ connectors = <&smmu_sde_unsec &smmu_sde_sec &sde_wb &ivi_serder_driver &sde_dsi &sde_dp &sde_card1 &sde_card2>;
};
+
&dsi_sim_vid {
qcom,dsi-select-clocks = "pll_byte_clk0", "pll_dsi_clk0";
*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************详见如下系列文章**************************
Android Display Graphics系列文章-汇总
Android Display Graphics系列文章-汇总
*****************************************************************