Platform: RK3288
OS: Android 6.0
Kernel: 3.10.92
根据5.1的双屏显示patch,在android6.0上修改了下,因为没硬件环境,所以未经验证,仅供参考。edp是主屏,lvds是副屏。
edp屏:
lcd-LM133LFL01-EDP1920x1080_dual.dtsi
/*
* RockChip. DisplayPort screen LM133LFL01
*
*/
disp_timings: display-timings {
native-mode = <&lm133lfl01>;
lm133lfl01: timing0 {
screen-type = <SCREEN_EDP>;
out-face = <OUT_P666>;
clock-frequency = <43200000>;
hactive = <1920>;
vactive = <1080>;
hback-porch = <148>;
hfront-porch = <88>;
vback-porch = <36>;
vfront-porch = <4>;
hsync-len = <44>;
vsync-len = <5>;
hsync-active = <1>;
vsync-active = <1>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
};
lvds屏:
arch/arm/boot/dts/lcd-b101ew05_dual.dtsi
display-timings {
native-mode = <&b101ew05>;
b101ew05: timing0 {
screen-type = <SCREEN_LVDS>;
lvds-format = <LVDS_8BIT_2>;
out-face = <OUT_D888_P666>;
color-mode = <COLOR_RGB>;
clock-frequency = <71000000>;
hactive = <1024>;
vactive = <600>;
hback-porch = <100>;
hfront-porch = <18>;
vback-porch = <8>;
vfront-porch = <6>;
hsync-len = <10>;
vsync-len = <2>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
swap-rb = <0>;
swap-rg = <0>;
swap-gb = <0>;
};
};
其余部分:
diff --git a/arch/arm/boot/dts/rk3288-tb_8846.dts b/arch/arm/boot/dts/rk3288-tb_8846.dts
index f80578e..ec71f93 100755
--- a/arch/arm/boot/dts/rk3288-tb_8846.dts
+++ b/arch/arm/boot/dts/rk3288-tb_8846.dts
@@ -1,9 +1,11 @@
/dts-v1/;
#include "rk3288.dtsi"
-//#include "lcd-b101ew05.dtsi"
-#include "lcd-F402.dtsi"
-#include "vtl_ts_sdk8846.dtsi"
+
+//#include "lcd-F402.dtsi"
+//#include "vtl_ts_sdk8846.dtsi"
+
#include "rk3288-cif-sensor.dtsi"
/ {
fiq-debugger {
@@ -607,14 +609,60 @@
};
&fb {
- rockchip,disp-mode = <DUAL>;
- rockchip,uboot-logo-on = <1>;
+ rockchip,disp-mode = <DUAL_LCD>;
+ rockchip,uboot-logo-on = <0>;
};
&rk_screen {
- display-timings = <&disp_timings>;
+ status = "okay";
+ screen0 {
+ screen_prop = <PRMRY>;//PRMRY
+ native-mode = <DEFAULT_MODE>;
+ power_ctr {
+ lcd_en {
+ rockchip,power_type = <GPIO>;
+ gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
+ rockchip,delay = <10>;
+ };
+ lcd_cs {
+ rockchip,power_type = <GPIO>;
+ gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
+ rockchip,delay = <10>;
+ };
+ };
+ #include "lcd-LM133LFL01-EDP1920x1080_dual.dtsi"
+ };
+ screen1 {
+ screen_prop = <EXTEND>;//EXTEND
+ native-mode = <DEFAULT_MODE>;
+ power_ctr {
+ lcd_en {
+ rockchip,power_type = <GPIO>;
+ gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
+ rockchip,delay = <10>;
+ };
+ lcd_cs {
+ rockchip,power_type = <GPIO>;
+ gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
+ rockchip,delay = <10>;
+ };
+ };
+ #include "lcd-b101ew05_dual.dtsi"
+ };
};
+
+&lvds {
+ status = "okay";
+ prop = <EXTEND>;
+};
+
+&edp {
+ status = "okay";
+ prop = <PRMRY>;
+};
+
+
/*lcdc0 as PRMRY(LCD),lcdc1 as EXTEND(HDMI)*/
&lcdc0 {
status = "okay";
@@ -629,7 +677,7 @@
rockchip,delay = <5>;
};*/
- lcd_en:lcd_en {
+ /* lcd_en:lcd_en {
rockchip,power_type = <GPIO>;
gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
rockchip,delay = <10>;
@@ -639,7 +687,7 @@
rockchip,power_type = <GPIO>;
gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
rockchip,delay = <10>;
- };
+ }; */
/*lcd_rst:lcd_rst {
rockchip,power_type = <GPIO>;
@@ -657,7 +705,7 @@
};
&hdmi {
- status = "okay";
+ status = "disabled";
rockchip,hdmi_video_source = <DISPLAY_SOURCE_LCDC1>;
};
diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig
index 40edcbf..78a3f27 100644
--- a/arch/arm/configs/rockchip_defconfig
+++ b/arch/arm/configs/rockchip_defconfig
@@ -433,6 +433,7 @@ CONFIG_DP_ANX6345=y
CONFIG_RK32_DP=y
CONFIG_MIPI_DSI=y
CONFIG_RK32_MIPI_DSI=y
+CONFIG_SMART_DUAL_LCD=y
CONFIG_RK_HDMI=y
CONFIG_RK_TVENCODER=y
CONFIG_RK1000_TVOUT=y
diff --git a/drivers/video/rockchip/Kconfig b/drivers/video/rockchip/Kconfig
index 6034139..39543bc 100755
--- a/drivers/video/rockchip/Kconfig
+++ b/drivers/video/rockchip/Kconfig
@@ -58,6 +58,9 @@ config THREE_FB_BUFFER
help
select y if android support three buffer,like Jelly Bean
+config SMART_DUAL_LCD
+ bool"smart dual lcd support"
+ default n
source "drivers/video/rockchip/lcdc/Kconfig"
source "drivers/video/rockchip/screen/Kconfig"
diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c
index c45387c..8c5eb98 100755
--- a/drivers/video/rockchip/rk_fb.c
+++ b/drivers/video/rockchip/rk_fb.c
@@ -71,9 +71,16 @@ EXPORT_SYMBOL(video_data_to_mirroring);
extern phys_addr_t uboot_logo_base;
extern phys_addr_t uboot_logo_size;
extern phys_addr_t uboot_logo_offset;
+
+#ifndef CONFIG_SMART_DUAL_LCD
static struct rk_fb_trsm_ops *trsm_lvds_ops;
static struct rk_fb_trsm_ops *trsm_edp_ops;
static struct rk_fb_trsm_ops *trsm_mipi_ops;
+#else
+static struct rk_fb_trsm_ops *trsm_prmry_ops;
+static struct rk_fb_trsm_ops *trsm_extend_ops;
+#endif
+
static int uboot_logo_on;
static int rk_fb_debug_lvl;
@@ -107,6 +114,7 @@ int rk_fb_get_display_policy(void)
int rk_fb_trsm_ops_register(struct rk_fb_trsm_ops *ops, int type)
{
+#ifndef CONFIG_SMART_DUAL_LCD
switch (type) {
case SCREEN_RGB:
case SCREEN_LVDS:
@@ -127,13 +135,23 @@ int rk_fb_trsm_ops_register(struct rk_fb_trsm_ops *ops, int type)
__func__, type);
break;
}
+#else
+ if (type == PRMRY)
+ trsm_prmry_ops = ops;
+ else if (type == EXTEND)
+ trsm_extend_ops = ops;
+ else
+ pr_err("%s, type:%d\n", __func__, type);
+#endif
+
return 0;
}
struct rk_fb_trsm_ops *rk_fb_trsm_ops_get(int type)
{
- struct rk_fb_trsm_ops *ops;
+ struct rk_fb_trsm_ops *ops;
+#ifndef CONFIG_SMART_DUAL_LCD
switch (type) {
case SCREEN_RGB:
case SCREEN_LVDS:
@@ -155,6 +173,15 @@ struct rk_fb_trsm_ops *rk_fb_trsm_ops_get(int type)
__func__, type);
break;
}
+#else
+ if (type == PRMRY)
+ ops = trsm_prmry_ops;
+ else if (type == EXTEND)
+ ops = trsm_extend_ops;
+ else
+ pr_err("%s, type:%d\n", __func__, type);
+#endif
+
return ops;
}
@@ -309,10 +336,19 @@ static int rk_fb_data_fmt(int data_format, int bits_per_pixel)
/*
* rk display power control parse from dts
*/
+#ifndef CONFIG_SMART_DUAL_LCD
int rk_disp_pwr_ctr_parse_dt(struct rk_lcdc_driver *dev_drv)
+#else
+int rk_disp_pwr_ctr_parse_dt(struct device_node *np, struct rk_screen *rk_screen)
+#endif
{
+#ifndef CONFIG_SMART_DUAL_LCD
struct device_node *root = of_get_child_by_name(dev_drv->dev->of_node,
"power_ctr");
+#else
+ struct device_node *root = of_get_child_by_name(np, "power_ctr");
+#endif
+
struct device_node *child;
struct rk_disp_pwr_ctr_list *pwr_ctr;
struct list_head *pos;
@@ -321,10 +357,