在另外一台机上发现一个小问题。之前做的修改,其中的LOGO_REPEAT_RIGHT功能是把logo右边4像素宽的区域截取出来作为一个临时Image,然后把这个Image用类似tile blit的方式连续绘制到屏幕上作为logo栏的背景。正常情况下,logo显示时会覆盖在这个背景上,然而在那台机上logo却是以XOR的方式显示的,结果就显示得乱糟糟。而且试着用ROP_COPY来fillarea,看到的效果也是ROP_XOR的效果。于是只好在显示logo前先用fb_copyarea对要显示logo的区域进行操作,由于是XOR方式,所以把那个区域复制到自身的结果就是那段区域被清空了,接下来显示logo就正常了。修正后的代码diff如下:
--- /gs2e/source/linux26-2edev/drivers/video/fbmem.c2006-08-29 14:07:15.000000000 +0800
+++ drivers/video/fbmem.c2006-10-13 10:18:46.000000000 +0800
@@ -375,9 +375,10 @@
 int fb_show_logo(struct fb_info *info)
 {
 u32 *palette = NULL, *saved_pseudo_palette = NULL;
-unsigned char *logo_new = NULL;
-struct fb_image image;
-int x;
+unsigned char *logo_new = NULL, *border = NULL;
+struct fb_image image, imageborder;
+int x, xoffset;
+struct fb_copyarea region;

 /* Return if the frame buffer is not mapped or suspended */
 if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING)
@@ -421,12 +422,57 @@
 image.height = fb_logo.logo->height;
 image.dy = 0;

+
+printk("Screen resolution:%d x %d\n", info->var.xres,info->var.yres);
+#ifdef CONFIG_LOGO_REPEAT_RIGHT
+//#if 0
+border = kmalloc(4 * fb_logo.logo->height, GFP_KERNEL);
+if (border != NULL){
+  for (x = 0; x < fb_logo.logo->height; x++){ /* use x as y */
+*((u32 *)border + x) = /* will repeat 4 pixels of the right side*/
+*(u32 *)(image.data + (x+1)*fb_logo.logo->width - 4);
+  }
+  imageborder.depth = 8;
+  imageborder.data = border;
+  imageborder.width = 4;
+  imageborder.height = image.height;
+  imageborder.dy = 0;
+  for (x = 0; x < info->var.xres; x+=4){
+imageborder.dx = x;
+info->fbops->fb_imageblit(info, &imageborder);
+  }
+  kfree(border);
+}
+#endif
+region.width = image.width;
+region.height = image.height;
+region.dy = 0;
+region.sy = 0;
+#ifndef CONFIG_CENTER_LOGO
+//#if 0
+xoffset = 0;
 for (x = 0; x < num_online_cpus() * (fb_logo.logo->width + 8) &&
      x <= info->var.xres-fb_logo.logo->width; x += (fb_logo.logo->width + 8)) {
+        region.dx = region.sx = x;
+        info->fbops->fb_copyarea(info, &region);
+/* XOR to blank. fix for cards that only support XOR mode - by Returner*/
 image.dx = x;
 info->fbops->fb_imageblit(info, &image);
 }
-
+#else
+xoffset = (info->var.xres - num_online_cpus() * (fb_logo.logo->width + 8))>>1;
+//xoffset = (info->var.xres - 2 * (fb_logo.logo->width + 8))>>1;
+if (xoffset<0)xoffset = 0;
+        for (x = xoffset; x < num_online_cpus() * (fb_logo.logo->width + 8) + xoffset  &&
+        //for (x = xoffset; x < 2 * (fb_logo.logo->width + 8) + xoffset  &&
+             x <= info->var.xres-fb_logo.logo->width+xoffset; x += (fb_logo.logo->width + 8)) {
+region.dx = region.sx = x;
+info->fbops->fb_copyarea(info, &region);
+/* XOR to blank. fix for cards that only support XOR mode - by Returner*/
+image.dx = x;
+info->fbops->fb_imageblit(info, &image);
+}
+#endif
 kfree(palette);
 if (saved_pseudo_palette != NULL)
 info->pseudo_palette = saved_pseudo_palette;