瀏覽代碼

[SPARC]: TCX Framebuffer fixes

Using the same logic as the other framebuffer fixes committed in 2.6.11,
this is a set of fixes to make TCX functional on the console again. Adds
the tcx_pan_display function, sets the
all->info.var.{red,green,blue}.length values to 8, and runs fb_set_cmap.
Also looks for the correct SUNW,tcx prom value.

This patch just slipped through the cracks.

Originally by: Georg Chini <georg.chini@triaton-webhosting.com>

Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom 'spot' Callaway 20 年之前
父節點
當前提交
6ee7c15294
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      drivers/video/tcx.c

+ 13 - 1
drivers/video/tcx.c

@@ -36,6 +36,7 @@ static int tcx_blank(int, struct fb_info *);
 static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
 static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
 static int tcx_ioctl(struct inode *, struct file *, unsigned int,
 static int tcx_ioctl(struct inode *, struct file *, unsigned int,
 		     unsigned long, struct fb_info *);
 		     unsigned long, struct fb_info *);
+static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *);
 
 
 /*
 /*
  *  Frame buffer operations
  *  Frame buffer operations
@@ -45,6 +46,7 @@ static struct fb_ops tcx_ops = {
 	.owner			= THIS_MODULE,
 	.owner			= THIS_MODULE,
 	.fb_setcolreg		= tcx_setcolreg,
 	.fb_setcolreg		= tcx_setcolreg,
 	.fb_blank		= tcx_blank,
 	.fb_blank		= tcx_blank,
+	.fb_pan_display		= tcx_pan_display,
 	.fb_fillrect		= cfb_fillrect,
 	.fb_fillrect		= cfb_fillrect,
 	.fb_copyarea		= cfb_copyarea,
 	.fb_copyarea		= cfb_copyarea,
 	.fb_imageblit		= cfb_imageblit,
 	.fb_imageblit		= cfb_imageblit,
@@ -153,6 +155,12 @@ static void tcx_reset (struct fb_info *info)
 	spin_unlock_irqrestore(&par->lock, flags);
 	spin_unlock_irqrestore(&par->lock, flags);
 }
 }
 
 
+static int tcx_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
+{
+	tcx_reset(info);
+	return 0;
+}
+
 /**
 /**
  *      tcx_setcolreg - Optional function. Sets a color register.
  *      tcx_setcolreg - Optional function. Sets a color register.
  *      @regno: boolean, 0 copy local, 1 get_user() function
  *      @regno: boolean, 0 copy local, 1 get_user() function
@@ -366,6 +374,9 @@ static void tcx_init_one(struct sbus_dev *sdev)
 	all->par.lowdepth = prom_getbool(sdev->prom_node, "tcx-8-bit");
 	all->par.lowdepth = prom_getbool(sdev->prom_node, "tcx-8-bit");
 
 
 	sbusfb_fill_var(&all->info.var, sdev->prom_node, 8);
 	sbusfb_fill_var(&all->info.var, sdev->prom_node, 8);
+	all->info.var.red.length = 8;
+	all->info.var.green.length = 8;
+	all->info.var.blue.length = 8;
 
 
 	linebytes = prom_getintdefault(sdev->prom_node, "linebytes",
 	linebytes = prom_getintdefault(sdev->prom_node, "linebytes",
 				       all->info.var.xres);
 				       all->info.var.xres);
@@ -439,6 +450,7 @@ static void tcx_init_one(struct sbus_dev *sdev)
 		return;
 		return;
 	}
 	}
 
 
+	fb_set_cmap(&all->info.cmap, &all->info);
 	tcx_init_fix(&all->info, linebytes);
 	tcx_init_fix(&all->info, linebytes);
 
 
 	if (register_framebuffer(&all->info) < 0) {
 	if (register_framebuffer(&all->info) < 0) {
@@ -466,7 +478,7 @@ int __init tcx_init(void)
 		return -ENODEV;
 		return -ENODEV;
 
 
 	for_all_sbusdev(sdev, sbus) {
 	for_all_sbusdev(sdev, sbus) {
-		if (!strcmp(sdev->prom_name, "tcx"))
+		if (!strcmp(sdev->prom_name, "SUNW,tcx"))
 			tcx_init_one(sdev);
 			tcx_init_one(sdev);
 	}
 	}