[parisc-linux-cvs] converting STI graphics_id from u8[8] to u32[2]

Helge Deller deller@gmx.de
Tue, 1 May 2001 16:19:46 +0200


The following patch removes a compiler warning from the STI_CALL() function 
and converts the storage for graphics_id in the STI code from
u8[8] to u32[2]. This value is also returned for later analysis in the 
framebuffer-code in the sti_struct struct.

Index: sticon-bmode.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticon-bmode.c,v
retrieving revision 1.6
diff -u -r1.6 sticon-bmode.c
--- sticon-bmode.c	2001/02/18 22:24:40	1.6
+++ sticon-bmode.c	2001/05/01 14:05:07
@@ -27,15 +27,9 @@
 	printk(" conforms to STI ROM spec revision %d.%02x\n",
 		STI_U8(rom->revno[0]) >> 4, STI_U8(rom->revno[0]) & 0x0f);
 	printk(__FUNCTION__ ": %d\n", __LINE__);
-	printk(" graphics id %02x%02x%02x%02x%02x%02x%02x%02x\n",
-		(unsigned int) STI_U8(rom->graphics_id[0]), 
-		(unsigned int) STI_U8(rom->graphics_id[1]), 
-		(unsigned int) STI_U8(rom->graphics_id[2]), 
-		(unsigned int) STI_U8(rom->graphics_id[3]), 
-		(unsigned int) STI_U8(rom->graphics_id[4]), 
-		(unsigned int) STI_U8(rom->graphics_id[5]), 
-		(unsigned int) STI_U8(rom->graphics_id[6]), 
-		(unsigned int) STI_U8(rom->graphics_id[7]));
+	printk(" graphics id %04x%04x\n",
+		(unsigned int) STI_U32(rom->graphics_id[0]), 
+		(unsigned int) STI_U32(rom->graphics_id[1]) );
 	printk(" font start %08x\n",  STI_U32(rom->font_start));
 	printk(" region list %08x\n", STI_U32(rom->region_list));
 	printk(" init_graph %08x\n",  STI_U32(rom->init_graph));
@@ -227,7 +221,9 @@
 	sti->font->raw.bmode = STI_PTR(sti->font->raw.bmode);
 			 
 	sti->sti_mem_request = STI_U32(raw->sti_mem_req);
-
+	sti->graphics_id[0] =  STI_U32(raw->graphics_id[0]); 
+	sti->graphics_id[1] =  STI_U32(raw->graphics_id[1]); 
+	
 	return 1;
 
 out_err:
Index: sticon-bmode.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticon-bmode.h,v
retrieving revision 1.3
diff -u -r1.3 sticon-bmode.h
--- sticon-bmode.h	2001/02/18 22:24:40	1.3
+++ sticon-bmode.h	2001/05/01 14:05:07
@@ -45,7 +45,7 @@
 	 sti_u8 num_mons;
 	 sti_u8 revno[2];
 
-	 sti_u8 graphics_id[8];			/* 0x010 */
+	sti_u32 graphics_id[2];			/* 0x010 */
 
 	sti_u32 font_start;			/* 0x030 */
 	sti_u32 statesize;
Index: sticon-wmode.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticon-wmode.c,v
retrieving revision 1.8
diff -u -r1.8 sticon-wmode.c
--- sticon-wmode.c	2001/02/18 22:24:40	1.8
+++ sticon-wmode.c	2001/05/01 14:05:07
@@ -24,15 +24,9 @@
 	printk(" supports %d monitors\n", rom->num_mons);
 	printk(" conforms to STI ROM spec revision %d.%02x\n",
 		rom->revno[0] >> 4, rom->revno[0] & 0x0f);
-	printk(" graphics id %02x%02x%02x%02x%02x%02x%02x%02x\n",
+	printk(" graphics id %04x%04x\n",
 		rom->graphics_id[0], 
-		rom->graphics_id[1], 
-		rom->graphics_id[2], 
-		rom->graphics_id[3], 
-		rom->graphics_id[4], 
-		rom->graphics_id[5], 
-		rom->graphics_id[6], 
-		rom->graphics_id[7]);
+		rom->graphics_id[1]);
 	printk(" font start %08x\n", rom->font_start);
 	printk(" region list %08x\n", rom->region_list);
 	printk(" init_graph %08x\n", rom->init_graph);
@@ -132,7 +126,9 @@
 	sti->font->raw.wmode = STI_PTR(sti->font->raw.wmode);
 
 	sti->sti_mem_request = raw->sti_mem_req;
-
+	sti->graphics_id[0] = raw->graphics_id[0];
+	sti->graphics_id[1] = raw->graphics_id[1];
+	
 	wmode_sti_dump_rom(raw);
 	
 	return 1;
Index: sticon-wmode.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticon-wmode.h,v
retrieving revision 1.3
diff -u -r1.3 sticon-wmode.h
--- sticon-wmode.h	2001/02/18 22:24:40	1.3
+++ sticon-wmode.h	2001/05/01 14:05:07
@@ -21,7 +21,7 @@
 	 u8 res004;
 	 u8 num_mons;
 	 u8 revno[2];
-	 u8 graphics_id[8];
+	u32 graphics_id[2];
 
 	u32 font_start;
 	u32 statesize;
Index: sticore.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.c,v
retrieving revision 1.8
diff -u -r1.8 sticore.c
--- sticore.c	2001/02/18 22:24:40	1.8
+++ sticore.c	2001/05/01 14:05:08
@@ -549,7 +549,11 @@
 	sti_inq_conf(sti);
 	sti_dump_globcfg(PTR_STI(sti->glob_cfg), sti->sti_mem_request);
 	
-	printk("STI device: %s\n", sti->outptr.dev_name);
+	printk( "STI device: %s\n"
+		"STI device-ID: %04x-%04x\n", 
+			sti->outptr.dev_name,
+			sti->graphics_id[0], 
+			sti->graphics_id[1]);
 
 	sti_rom[num_sti_roms] = sti;
 	num_sti_roms++;
Index: sticore.h
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/video/sti/sticore.h,v
retrieving revision 1.8
diff -u -r1.8 sticore.h
--- sticore.h	2001/04/06 05:10:58	1.8
+++ sticore.h	2001/05/01 14:05:08
@@ -47,8 +47,9 @@
 #define STI_CALL(func, flags, inptr, outptr, glob_cfg) \
 	({	 						\
 		pdc_sti_call( func, (unsigned long)STI_PTR(flags), \
-				    STI_PTR(inptr), STI_PTR(outptr), \
-				    glob_cfg); \
+				    (unsigned long)STI_PTR(inptr), \
+				    (unsigned long)STI_PTR(outptr), \
+				    (unsigned long)glob_cfg); \
 	})
 
 
@@ -267,6 +268,7 @@
 	int font_height;
 	/* char **mon_strings; */
 	int sti_mem_request;
+	u32 graphics_id[2];
 
 	struct sti_cooked_rom *rom;