Pārlūkot izejas kodu

frame buffer change to 3

kvvipa 3 gadi atpakaļ
vecāks
revīzija
a671e0cdf5

+ 2 - 1
buildroot-external/board/arkmicro/ark1668e_devb/rootfs_overlay/etc/init.d/S04qtlaunch

@@ -4,12 +4,13 @@ export QT_QPA_FONTDIR=$QTDIR/lib/qt/fonts
 export QT_QPA_PLATFORM=eglfs
 export QT_QPA_PLATFORM=eglfs
 export QT_QPA_EGLFS_INTEGRATION=eglfs_mali
 export QT_QPA_EGLFS_INTEGRATION=eglfs_mali
 export QT_QPA_EGLFS_DEBUG=1
 export QT_QPA_EGLFS_DEBUG=1
-export QT_QPA_EGLFS_FORCEVSYNC=1
+#export QT_QPA_EGLFS_FORCEVSYNC=1
 #export QT_QPA_EGLFS_FORCE888=1
 #export QT_QPA_EGLFS_FORCE888=1
 export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/lib/qt/plugins
 export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/lib/qt/plugins
 export QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/event0
 export QT_QPA_GENERIC_PLUGINS=evdevtouch:/dev/input/event0
 export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
 export MALI_NOCLEAR=1
 export MALI_NOCLEAR=1
+export MALI_MAX_WINDOW_BUFFERS=3
 
 
 start() {
 start() {
 	eval `dbus-launch --auto-syntax`
 	eval `dbus-launch --auto-syntax`

+ 1 - 0
buildroot-external/board/arkmicro/ark1668e_devb_emmc/rootfs_overlay/etc/init.d/S04qtlaunch

@@ -1,5 +1,6 @@
 export QTDIR=/usr
 export QTDIR=/usr
 export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
 export MALI_NOCLEAR=1
 export MALI_NOCLEAR=1
+export MALI_MAX_WINDOW_BUFFERS=3
 
 
 /etc/build_adb.sh &
 /etc/build_adb.sh &

BIN
buildroot-external/package/libmali/lib/libMali.so


+ 1 - 0
linux/arch/arm/boot/dts/ark1668e.dtsi

@@ -961,6 +961,7 @@
 			status = "disabled";
 			status = "disabled";
 		};
 		};
 
 
+
 		gpu:gpu@e9000000 {
 		gpu:gpu@e9000000 {
 			compatible = "arm,mali-400", "arm,mali-utgard";
 			compatible = "arm,mali-400", "arm,mali-utgard";
 			reg = <0xe9000000 0x30000
 			reg = <0xe9000000 0x30000

+ 1 - 0
linux/arch/arm/boot/dts/ark1668e_c281.dts

@@ -117,6 +117,7 @@
 		lvds-con = <0x4545>;
 		lvds-con = <0x4545>;
 		lvds-con2 = <0xfa000101>;
 		lvds-con2 = <0xfa000101>;
 		bits-per-pixel = <32>;
 		bits-per-pixel = <32>;
+		fb-buffer-nums = <3>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		lcd-wiring-mode = "RGB";
 		lcd-wiring-mode = "RGB";
 		lcdcon-backlight;
 		lcdcon-backlight;

+ 5 - 0
linux/arch/arm/boot/dts/ark1668e_devb.dts

@@ -199,6 +199,7 @@
 		lvds-con = <0x4545>;
 		lvds-con = <0x4545>;
 		lvds-con2 = <0xfa200141>;
 		lvds-con2 = <0xfa200141>;
 		bits-per-pixel = <32>;
 		bits-per-pixel = <32>;
+		fb-buffer-nums = <3>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		lcd-wiring-mode = "RGB";
 		lcd-wiring-mode = "RGB";
 		lcdcon-backlight;
 		lcdcon-backlight;
@@ -419,3 +420,7 @@
 &can1{
 &can1{
 	status = "disabled";
 	status = "disabled";
 };
 };
+
+&gpu {
+	shared-mem-size = <0x8000000>;
+};

+ 5 - 0
linux/arch/arm/boot/dts/ark1668e_devb_emmc.dts

@@ -186,6 +186,7 @@
 		lvds-con = <0x4545>;
 		lvds-con = <0x4545>;
 		lvds-con2 = <0xfa000101>;
 		lvds-con2 = <0xfa000101>;
 		bits-per-pixel = <32>;
 		bits-per-pixel = <32>;
+		fb-buffer-nums = <3>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		power-control-gpio = <&gportd 0 GPIO_ACTIVE_HIGH>;
 		lcd-wiring-mode = "RGB";
 		lcd-wiring-mode = "RGB";
 		lcdcon-backlight;
 		lcdcon-backlight;
@@ -404,3 +405,7 @@
 &can1{
 &can1{
 	status = "disabled";
 	status = "disabled";
 };
 };
+
+&gpu {
+	shared-mem-size = <0x8000000>;
+};

+ 1 - 0
linux/drivers/video/fbdev/arkmicro/ark1668e_lcdc.h

@@ -95,6 +95,7 @@ struct ark1668e_lcdfb_pdata {
 	struct timer_list	backlight_timer;
 	struct timer_list	backlight_timer;
     int	backlight_value;
     int	backlight_value;
 	int	backlight_delay;
 	int	backlight_delay;
+	int fb_buffer_nums;
 	void (*ark1668e_lcdfb_power_control)(struct ark1668e_lcdfb_pdata *pdata, int on);
 	void (*ark1668e_lcdfb_power_control)(struct ark1668e_lcdfb_pdata *pdata, int on);
 	struct list_head	pwr_gpios;
 	struct list_head	pwr_gpios;
 };
 };

+ 11 - 5
linux/drivers/video/fbdev/arkmicro/ark1668e_lcdfb.c

@@ -260,8 +260,8 @@ static int ark1668e_lcdfb_check_var(struct fb_var_screeninfo *var,
 			     struct fb_info *info)
 			     struct fb_info *info)
 {
 {
 	struct device *dev = info->device;
 	struct device *dev = info->device;
-	/* struct ark1668e_lcdfb_info *sinfo = info->par;
-	struct ark1668e_lcdfb_pdata *pdata = &sinfo->pdata; */
+	struct ark1668e_lcdfb_info *sinfo = info->par;
+	struct ark1668e_lcdfb_pdata *pdata = &sinfo->pdata;
 
 
 	dev_dbg(dev, "%s:\n", __func__);
 	dev_dbg(dev, "%s:\n", __func__);
 
 
@@ -281,8 +281,12 @@ static int ark1668e_lcdfb_check_var(struct fb_var_screeninfo *var,
 	if (var->xres >= var->xres_virtual)
 	if (var->xres >= var->xres_virtual)
 		var->xres_virtual = var->xres;
 		var->xres_virtual = var->xres;
 
 
-	if (var->yres >= var->yres_virtual)
-		var->yres_virtual = var->yres * 3;
+	if (var->yres >= var->yres_virtual) {
+		if (pdata->fb_buffer_nums > 0)
+			var->yres_virtual = var->yres * pdata->fb_buffer_nums;
+		else
+			var->yres_virtual = var->yres * 3;
+	}
 
 
 	/* Force same alignment for each line */
 	/* Force same alignment for each line */
 	var->xres = (var->xres + 3) & ~3UL;
 	var->xres = (var->xres + 3) & ~3UL;
@@ -379,7 +383,7 @@ static int ark1668e_lcdfb_pan_display(struct fb_var_screeninfo *var,
 	addr = fix->smem_start + var->yoffset * fix->line_length
 	addr = fix->smem_start + var->yoffset * fix->line_length
 		+ var->xoffset * info->var.bits_per_pixel / 8;
 		+ var->xoffset * info->var.bits_per_pixel / 8;
 
 
-	lcdc_writel(sinfo, ARK1668E_LCDC_OSD2_ADDR, addr);
+	sinfo->render_addr[ARK1668E_LCDC_LAYER_OSD2].yaddr = addr;
 
 
 	//printk(KERN_ALERT "ark1668e_lcdfb_pan_display 0x%x.\n", addr);
 	//printk(KERN_ALERT "ark1668e_lcdfb_pan_display 0x%x.\n", addr);
 
 
@@ -626,6 +630,8 @@ static int ark1668e_lcdfb_of_init(struct ark1668e_lcdfb_info *sinfo)
 		goto put_display_node;
 		goto put_display_node;
 	}
 	}
 
 
+	ret = of_property_read_u32(display_np, "fb-buffer-nums", &pdata->fb_buffer_nums);
+
 	INIT_LIST_HEAD(&pdata->pwr_gpios);
 	INIT_LIST_HEAD(&pdata->pwr_gpios);
 	ret = -ENOMEM;
 	ret = -ENOMEM;
 	for (i = 0; i < of_gpio_named_count(display_np, "power-control-gpio"); i++) {
 	for (i = 0; i < of_gpio_named_count(display_np, "power-control-gpio"); i++) {