Skip to content

Commit 6ee7c15

Browse files
Tom 'spot' Callawaydavem330
authored andcommitted
[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>
1 parent a271c24 commit 6ee7c15

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎drivers/video/tcx.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static int tcx_blank(int, struct fb_info *);
3636
static int tcx_mmap(struct fb_info *, struct file *, struct vm_area_struct *);
3737
static int tcx_ioctl(struct inode *, struct file *, unsigned int,
3838
unsigned long, struct fb_info *);
39+
static int tcx_pan_display(struct fb_var_screeninfo *, struct fb_info *);
3940

4041
/*
4142
* Frame buffer operations
@@ -45,6 +46,7 @@ static struct fb_ops tcx_ops = {
4546
.owner = THIS_MODULE,
4647
.fb_setcolreg = tcx_setcolreg,
4748
.fb_blank = tcx_blank,
49+
.fb_pan_display = tcx_pan_display,
4850
.fb_fillrect = cfb_fillrect,
4951
.fb_copyarea = cfb_copyarea,
5052
.fb_imageblit = cfb_imageblit,
@@ -153,6 +155,12 @@ static void tcx_reset (struct fb_info *info)
153155
spin_unlock_irqrestore(&par->lock, flags);
154156
}
155157

158+
static int tcx_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
159+
{
160+
tcx_reset(info);
161+
return 0;
162+
}
163+
156164
/**
157165
* tcx_setcolreg - Optional function. Sets a color register.
158166
* @regno: boolean, 0 copy local, 1 get_user() function
@@ -366,6 +374,9 @@ static void tcx_init_one(struct sbus_dev *sdev)
366374
all->par.lowdepth = prom_getbool(sdev->prom_node, "tcx-8-bit");
367375

368376
sbusfb_fill_var(&all->info.var, sdev->prom_node, 8);
377+
all->info.var.red.length = 8;
378+
all->info.var.green.length = 8;
379+
all->info.var.blue.length = 8;
369380

370381
linebytes = prom_getintdefault(sdev->prom_node, "linebytes",
371382
all->info.var.xres);
@@ -439,6 +450,7 @@ static void tcx_init_one(struct sbus_dev *sdev)
439450
return;
440451
}
441452

453+
fb_set_cmap(&all->info.cmap, &all->info);
442454
tcx_init_fix(&all->info, linebytes);
443455

444456
if (register_framebuffer(&all->info) < 0) {
@@ -466,7 +478,7 @@ int __init tcx_init(void)
466478
return -ENODEV;
467479

468480
for_all_sbusdev(sdev, sbus) {
469-
if (!strcmp(sdev->prom_name, "tcx"))
481+
if (!strcmp(sdev->prom_name, "SUNW,tcx"))
470482
tcx_init_one(sdev);
471483
}
472484

0 commit comments

Comments
 (0)