Thread (6 messages) 6 messages, 3 authors, 2008-08-07

[RFC] double buffering for atmel_lcdfb

flat view

From: Stanislaw Gruszka <stf_xl@wp.pl>
Date: 2008-08-06 09:36:41
Subsystem: framebuffer layer, the rest · Maintainers: Helge Deller, Linus Torvalds

Hello.

I try to implement double buffering for Atmel LCD display on AT91SAM9263 based 
board. I could not find any document about panning display on linux 
framebuffer, so I have some question about it and generic question about 
double buffer design. 

1) Is FBIOPAN_DISPLAY ioctl right way to implement double buffering?

2) What is the difference between ypanstep and ywrapstep, which one should be 
used for double buffering.

3) Does double buffer stuff should be turned on using module parameter, 
compile time parameter, board specific parameter (flag from platform device).
As it consume 2x memory I don't thing anyone want it by default.

I think double buffer for Atmel LCD should go mainline, of course after doing 
it reliable. After your comments and advice, I think I will be able to send 
right done and signed-off patch. 

Below is patch I have already done. I also attached program which I used for 
for tests - as far result are quite nice.

Cheers
Stanislaw Gruszka
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index b004036..d0b2bed 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -7,7 +7,6 @@
  * License.  See the file COPYING in the main directory of this archive for
  * more details.
  */
-
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
@@ -41,6 +40,8 @@
 #if defined(CONFIG_ARCH_AT91)
 #define	ATMEL_LCDFB_FBINFO_DEFAULT	FBINFO_DEFAULT
 
+static int double_buffering = 1;
+
 static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
 					struct fb_var_screeninfo *var)
 {
@@ -789,7 +790,13 @@ static int __init atmel_lcdfb_probe(struct 
platform_device *pdev)
 		 * Don't clear the framebuffer -- someone may have set
 		 * up a splash image.
 		 */
+		double_buffering = 0;
+ 		dev_info(dev, "dissable double buffering\n");
 	} else {
+ 		if (double_buffering) {
+ 			info->fix.ypanstep = info->var.yres_virtual;
+ 			info->var.yres_virtual *= 2;
+		}
 		/* alocate memory buffer */
 		ret = atmel_lcdfb_alloc_video_memory(sinfo);
 		if (ret < 0) {

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help