[parisc-linux-cvs] 2.6.0-pa7: stifb on RDI precisionbook laptop

Helge Deller deller at gmx.de
Mon Dec 29 17:00:36 MST 2003


Here is the patch:
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.6/Makefile,v
retrieving revision 1.102
diff -u -p -r1.102 Makefile
--- Makefile	28 Dec 2003 15:29:50 -0000	1.102
+++ Makefile	29 Dec 2003 23:52:38 -0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 0
-EXTRAVERSION = -pa6
+EXTRAVERSION = -pa7
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
Index: drivers/video/stifb.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/video/stifb.c,v
retrieving revision 1.6
diff -u -p -r1.6 stifb.c
--- drivers/video/stifb.c	22 Dec 2003 23:09:04 -0000	1.6
+++ drivers/video/stifb.c	29 Dec 2003 23:52:39 -0000
@@ -42,6 +42,7 @@
  *	- 1bpp mode is completely untested
  *	- add support for h/w acceleration
  *	- add hardware cursor
+ *	- automatically disable double buffering (e.g. on RDI precisionbook laptop)
  */
 
 
@@ -50,6 +51,8 @@
  * #undef  FALLBACK_TO_1BPP to reject support for unsupported cards */
 #undef FALLBACK_TO_1BPP
 
+#undef DEBUG_STIFB_REGS		/* debug sti register accesses */
+
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -153,8 +156,27 @@ static int __initdata stifb_force_bpp[MA
 
 #define READ_BYTE(fb,reg)		__raw_readb((fb)->info.fix.mmio_start + (reg))
 #define READ_WORD(fb,reg)		__raw_readl((fb)->info.fix.mmio_start + (reg))
-#define WRITE_BYTE(value,fb,reg)	__raw_writeb((value),(fb)->info.fix.mmio_start + (reg))
-#define WRITE_WORD(value,fb,reg)	__raw_writel((value),(fb)->info.fix.mmio_start + (reg))
+
+
+#ifndef DEBUG_STIFB_REGS
+# define  DEBUG_OFF()
+# define  DEBUG_ON()
+# define WRITE_BYTE(value,fb,reg)	__raw_writeb((value),(fb)->info.fix.mmio_start + (reg))
+# define WRITE_WORD(value,fb,reg)	__raw_writel((value),(fb)->info.fix.mmio_start + (reg))
+#else
+  static int debug_on = 1;
+# define  DEBUG_OFF() debug_on=0
+# define  DEBUG_ON()  debug_on=1
+# define WRITE_BYTE(value,fb,reg)	do { if (debug_on) \
+						printk(KERN_DEBUG "%30s: WRITE_BYTE(0x%06x) = 0x%02x (old=0x%02x)\n", \
+							__FUNCTION__, reg, value, READ_BYTE(fb,reg)); 		  \
+					__raw_writeb((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
+# define WRITE_WORD(value,fb,reg)	do { if (debug_on) \
+						printk(KERN_DEBUG "%30s: WRITE_WORD(0x%06x) = 0x%08x (old=0x%08x)\n", \
+							__FUNCTION__, reg, value, READ_WORD(fb,reg)); 		  \
+					__raw_writel((value),(fb)->info.fix.mmio_start + (reg)); } while (0)
+#endif /* DEBUG_STIFB_REGS */
+
 
 #define ENABLE	1	/* for enabling/disabling screen */	
 #define DISABLE 0
@@ -448,6 +470,13 @@ SETUP_ATTR_ACCESS(struct stifb_info *fb,
 static void
 SET_ATTR_SIZE(struct stifb_info *fb, int width, int height) 
 {
+	/* REG_6 seems to have special values when run on a 
+	   RDI precisionbook parisc laptop (INTERNAL_EG_DX1024 or
+	   INTERNAL_EG_X1024).  The values are:
+		0x2f0: internal (LCD) & external display enabled
+		0x2a0: external display only
+		0x000: zero on standard artist graphic cards
+	*/ 
 	WRITE_WORD(0x00000000, fb, REG_6);
 	WRITE_WORD((width<<16) | height, fb, REG_9);
 	WRITE_WORD(0x05000000, fb, REG_6);
@@ -729,7 +758,7 @@ hyperResetPlanes(struct stifb_info *fb, 
 		controlPlaneReg = 0x00000F00; /* 0x00000100 should be enought, but lets clear all 4 bits */
 
 	switch (enable) {
-	case 1:		/* ENABLE */
+	case ENABLE:
 		/* clear screen */
 		if (IS_24_DEVICE(fb))
 			ngleDepth24_ClearImagePlanes(fb);
@@ -749,7 +778,7 @@ hyperResetPlanes(struct stifb_info *fb, 
 		hyperUndoITE(fb);
 		break;
 
-	case 0:		/* DISABLE */
+	case DISABLE:
 		/* clear screen */
 		if (IS_24_DEVICE(fb))
 			ngleDepth24_ClearImagePlanes(fb);
@@ -973,6 +1002,8 @@ stifb_setcolreg(u_int regno, u_int red, 
 	green >>= 8;
 	blue  >>= 8;
 
+	DEBUG_OFF();
+
 	START_IMAGE_COLORMAP_ACCESS(fb);
 	
 	if (fb->info.var.grayscale) {
@@ -1004,6 +1035,8 @@ stifb_setcolreg(u_int regno, u_int red, 
 		FINISH_IMAGE_COLORMAP_ACCESS(fb);
 	}
 
+	DEBUG_ON();
+
 	return 0;
 }
 
@@ -1144,19 +1177,17 @@ stifb_init_fb(struct sti_struct *sti, in
 	/* only supported cards are allowed */
 	switch (fb->id) {
 	case CRT_ID_VISUALIZE_EG:
-#if 0
-		/* check for 2d08c0a7-9a02587 (INTERNAL_EG_DX1024):
-		   this graphic card is used e.g. in an RDI PrecisionBook and
-		   this stifb driver does not yet support framebuffer on the
-		   internal flatscren */
-		if (fb->sti->graphics_id[1] == 0x9a02587) {
-			printk(KERN_WARNING 
-				"stifb: framebuffer support on internal RDI "
-				"precisionbook flatscreen not yet supported.\n");
-			goto out_err1;
+		/* look for a double buffering device like e.g. the 
+		   "INTERNAL_EG_DX1024" in the RDI precisionbook laptop
+		   which won't work. The same device in non-double 
+		   buffering mode returns "INTERNAL_EG_X1024". */
+		if (strstr(sti->outptr.dev_name, "EG_DX")) {
+		   printk(KERN_WARNING 
+			"stifb: ignoring '%s'. Disable double buffering in IPL menu.\n",
+			sti->outptr.dev_name);
+		   goto out_err0;
 		}
-#endif
-		/* fall through */
+		/* fall though */
 	case S9000_ID_ARTIST:
 	case S9000_ID_HCRX:
 	case S9000_ID_TIMBER:
@@ -1166,7 +1197,7 @@ stifb_init_fb(struct sti_struct *sti, in
 	default:
 		printk(KERN_WARNING "stifb: '%s' (id: 0x%08x) not supported.\n",
 			sti->outptr.dev_name, fb->id);
-		goto out_err1;
+		goto out_err0;
 	}
 	
 	/* default to 8 bpp on most graphic chips */
@@ -1244,7 +1275,7 @@ stifb_init_fb(struct sti_struct *sti, in
 			"stifb: Unsupported graphics card (id=0x%08x) "
 				"- skipping.\n",
 			fb->id);
-		goto out_err1;
+		goto out_err0;
 #endif
 	}
 
@@ -1337,6 +1368,7 @@ out_err2:
 	release_mem_region(fix->smem_start, fix->smem_len);
 out_err1:
 	fb_dealloc_cmap(&info->cmap);
+out_err0:
 	kfree(fb);
 	return -ENXIO;
 }


More information about the parisc-linux-cvs mailing list