[parisc-linux-cvs] fix stifb & sticon

Helge Deller deller@gmx.de
Tue, 15 Oct 2002 23:37:28 +0200


--Boundary-00=_YqIr9VSZabLXiDV
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tuesday 15 October 2002 23:34, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux-2.5
> Changes by:	deller	02/10/15 15:34:46
>
> Modified files:
> 	drivers/video/sti: stifb.c
>
> Log message:
> fix stifb. Now it works with kernel 2.5 :-)

stifb and sticon tested on hppa2.0/kernel 2.5.

--Boundary-00=_YqIr9VSZabLXiDV
Content-Type: text/plain;
  charset="iso-8859-1";
  name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="diff"

Index: sti/stifb.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/video/sti/stifb.c,v
retrieving revision 1.3
diff -u -p -r1.3 stifb.c
--- sti/stifb.c	15 Oct 2002 20:49:18 -0000	1.3
+++ sti/stifb.c	15 Oct 2002 21:33:35 -0000
@@ -1103,17 +1103,13 @@ stifb_init_fb(struct sti_struct *sti, in
 	struct fb_fix_screeninfo *fix;
 	struct fb_var_screeninfo *var;
 	struct display *disp;
+	struct display_switch *dispsw;
 	struct stifb_info *fb;
 	struct fb_info *info;
 	unsigned long sti_rom_address;
 	char *dev_name;
 	int bpp, xres, yres;
 
-#if 1	
-	printk(KERN_ERR "%s: stifb doesn't work yet in kernel 2.5\n", __FUNCTION__);
-	return -ENODEV;
-#endif
-	
 	fb = kmalloc(sizeof(*fb), GFP_ATOMIC);
 	if (!fb) {
 		printk(KERN_ERR "stifb: Could not allocate stifb structure\n");
@@ -1127,6 +1123,7 @@ stifb_init_fb(struct sti_struct *sti, in
 	fix = &info->fix;
 	var = &info->var;
 	disp = &fb->disp;
+	info->disp = &fb->disp;
 
 	fb->sti = sti;
 	/* store upper 32bits of the graphics id */
@@ -1240,13 +1237,13 @@ stifb_init_fb(struct sti_struct *sti, in
 	    case 1:
 		fix->type = FB_TYPE_PLANES;	/* well, sort of */
 		fix->visual = FB_VISUAL_MONO10;
-		disp->dispsw = &fbcon_sti;
+		dispsw = &fbcon_sti;
 		break;
 #ifdef FBCON_HAS_CFB8		
 	    case 8:
 		fix->type = FB_TYPE_PACKED_PIXELS;
 		fix->visual = FB_VISUAL_PSEUDOCOLOR;
-	 	disp->dispsw = &fbcon_cfb8;
+	 	dispsw = &fbcon_cfb8;
 		var->red.length = var->green.length = var->blue.length = 8;
 		break;
 #endif
@@ -1254,8 +1251,7 @@ stifb_init_fb(struct sti_struct *sti, in
 	    case 32:
 		fix->type = FB_TYPE_PACKED_PIXELS;
 		fix->visual = FB_VISUAL_TRUECOLOR;
-		disp->dispsw = &fbcon_cfb32;
-/*	FIXME:	disp->dispsw_data = fb->fbcon_cmap.cfb32; */
+		dispsw = &fbcon_cfb32;
 		var->red.length = var->green.length = var->blue.length = var->transp.length = 8;
 		var->blue.offset = 0;
 		var->green.offset = 8;
@@ -1264,7 +1260,7 @@ stifb_init_fb(struct sti_struct *sti, in
 		break;
 #endif
 	    default:
-		disp->dispsw = &fbcon_dummy;
+		dispsw = &fbcon_dummy;
 		break;
 	}
 	
@@ -1287,6 +1283,7 @@ stifb_init_fb(struct sti_struct *sti, in
 	fb_alloc_cmap(&info->cmap, 256, 0);
 	stifb_init_display(fb);
 	gen_set_disp(-1, info);
+	disp->dispsw = dispsw;
 
 	if (!request_mem_region(fix->smem_start, fix->smem_len, "stifb")) {
 		printk(KERN_ERR "stifb: cannot reserve fb region 0x%04lx-0x%04lx\n",

--Boundary-00=_YqIr9VSZabLXiDV--