2012年10月31日 w100fb double buffering patch for linux-3.1.10(zaurus ARMedslack-14.0)
_ double buffering patch for w100fb.c of linux-3.1.10
This double buffering patch for w100fb.c is based on w100_pan_display - steleto's diary.
*** drivers/video/w100fb.c.ORG 2012-10-30 12:21:33.240038082 +0900
--- drivers/video/w100fb.c 2012-10-30 13:23:10.080014686 +0900
***************
*** 520,526 ****
par->mode = w100fb_get_mode(par, &par->xres, &par->yres, 0);
info->fix.visual = FB_VISUAL_TRUECOLOR;
! info->fix.ypanstep = 0;
info->fix.ywrapstep = 0;
info->fix.line_length = par->xres * BITS_PER_PIXEL / 8;
--- 520,526 ----
par->mode = w100fb_get_mode(par, &par->xres, &par->yres, 0);
info->fix.visual = FB_VISUAL_TRUECOLOR;
! info->fix.ypanstep = 1;
info->fix.ywrapstep = 0;
info->fix.line_length = par->xres * BITS_PER_PIXEL / 8;
***************
*** 540,545 ****
--- 540,580 ----
}
+ static int w100fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
+ {
+ struct w100fb_par *par = info->par;
+ int yres = 0, offset = 0;
+
+ if (par->xres == par->mode->xres) {
+ if (par->flip) {
+ /* 180 degree */
+ yres = info->var.yres + var->yoffset;
+ offset = (info->var.xres * yres) - 1;
+ } else {
+ /* 0 degree */
+ offset = info->var.xres * var->yoffset;
+ }
+ } else {
+ if (par->flip) {
+ /* 270 degree */
+ offset = info->var.xres * var->yoffset - 1;
+ } else {
+ /* 90 degree */
+ yres = info->var.yres + var->yoffset;
+ offset = par->xres * (yres - 1);
+ }
+ }
+
+ w100_update_disable();
+
+ writel(W100_FB_BASE + ((offset * BITS_PER_PIXEL / 8) & ~0x03UL),
+ remapped_regs + mmGRAPHIC_OFFSET);
+
+ w100_update_enable();
+
+ return 0;
+ }
+
/*
* Frame buffer operations
*/
***************
*** 553,558 ****
--- 588,594 ----
.fb_copyarea = w100fb_copyarea,
.fb_imageblit = cfb_imageblit,
.fb_sync = w100fb_sync,
+ .fb_pan_display = w100fb_pan_display,
};
#ifdef CONFIG_PM
[ツッコミを入れる]