diff -Nbaru linux-2.6.7/drivers/video/Makefile linux-2.6.7-vws/drivers/video/Makefile
--- linux-2.6.7/drivers/video/Makefile	2004-06-16 07:18:58.000000000 +0200
+++ linux-2.6.7-vws/drivers/video/Makefile	2004-08-08 19:47:38.000000000 +0200
@@ -32,7 +32,7 @@
 obj-$(CONFIG_FB_CYBER)            += cyberfb.o
 obj-$(CONFIG_FB_CYBER2000)        += cyber2000fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_GBE)              += gbefb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
-obj-$(CONFIG_FB_SGIVW)            += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_SGIVW)            += sgivwfb.o sgi2c1600sw.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_3DFX)             += tdfxfb.o cfbimgblt.o
 obj-$(CONFIG_FB_MAC)              += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o 
 obj-$(CONFIG_FB_HP300)            += hpfb.o cfbfillrect.o cfbimgblt.o
diff -Nbaru linux-2.6.7/drivers/video/sgi2c1600sw.c linux-2.6.7-vws/drivers/video/sgi2c1600sw.c
--- linux-2.6.7/drivers/video/sgi2c1600sw.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.7-vws/drivers/video/sgi2c1600sw.c	2004-08-08 19:45:50.000000000 +0200
@@ -0,0 +1,245 @@
+/*
+ *  SGI 320/540 monitor query implementation.
+ *  Hacked together by Florian Boor <florian.boor@kernelconcepts.de>
+ * 
+ *  Based on 
+ *    linux-2.2.10/drivers/video/sgivwfb.c -- SGI DBE frame buffer device
+ *  by
+ *    Copyright (C) 1999 Silicon Graphics, Inc.
+ *    Jeffrey Newquist, newquist@engr.sgi.com
+ *  
+ *  and 
+ *    i2c-old.c Generic i2c interface for linux (old version)
+ *  by
+ *    (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
+ *
+ *  This file is subject to the terms and conditions of the GNU General Public
+ *  License. See the file COPYING in the main directory of this archive for
+ *  more details.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <asm/io.h>
+#include <asm/mtrr.h>
+#include <linux/types.h>
+
+#include "sgi2c1600sw.h"
+
+#define I2C_DELAY 1000
+#define I2C_FLATPANEL_BASE 0x70
+#define I2C_BUSID_SGIVWFB 1
+
+
+struct i2c_private {
+    int sda;
+    int scl;
+    volatile u32 *reg;
+};
+
+
+
+/* 1600sw i2c bus functions */
+static void i2c_setlines(struct i2c_bus *bus,int ctrl,int data);
+static int i2c_getdataline(struct i2c_bus *bus);
+static int i2c_flatpanel_status(struct i2c_bus *bus);
+static int i2c_flatpanel_id(struct i2c_bus *bus);
+static int i2c_flatpanel_power(struct i2c_bus *bus, int flag);
+
+static struct i2c_bus sgivwfb_i2c_bus_template = 
+{
+        .name = "sgivwfb",
+        .id = I2C_BUSID_SGIVWFB,
+        .data = NULL,
+        .i2c_setlines = i2c_setlines,
+        .i2c_getdataline = i2c_getdataline,
+};
+
+static struct i2c_private flatpanel_i2c =
+{
+    0, 0, NULL
+};
+
+
+
+/* generic i2c stuff */
+
+#define I2C_SET(bus,ctrl,data)  (bus->i2c_setlines(bus,ctrl,data))
+#define I2C_GET(bus)            (bus->i2c_getdataline(bus))
+
+void i2c_start(struct i2c_bus *bus)
+{
+	I2C_SET(bus,0,1);
+	I2C_SET(bus,1,1);
+	I2C_SET(bus,1,0);
+	I2C_SET(bus,0,0);
+	printk("%s: < ",bus->name);
+}
+
+void i2c_stop(struct i2c_bus *bus)
+{
+	I2C_SET(bus,0,0);
+	I2C_SET(bus,1,0);
+	I2C_SET(bus,1,1);
+	printk(">\n");
+}
+
+void i2c_one(struct i2c_bus *bus)
+{
+	I2C_SET(bus,0,1);
+	I2C_SET(bus,1,1);
+	I2C_SET(bus,0,1);
+}
+
+void i2c_zero(struct i2c_bus *bus)
+{
+	I2C_SET(bus,0,0);
+	I2C_SET(bus,1,0);
+	I2C_SET(bus,0,0);
+}
+
+int i2c_ack(struct i2c_bus *bus)
+{
+	int ack;
+    
+	I2C_SET(bus,0,1);
+	I2C_SET(bus,1,1);
+	ack = I2C_GET(bus);
+	I2C_SET(bus,0,1);
+	return ack;
+}
+
+int i2c_sendbyte(struct i2c_bus *bus,unsigned char data,int wait_for_ack)
+{
+	int i, ack;
+    
+	I2C_SET(bus,0,0);
+	for (i=7; i>=0; i--)
+		(data&(1<<i)) ? i2c_one(bus) : i2c_zero(bus);
+	if (wait_for_ack)
+		udelay(wait_for_ack);
+	ack=i2c_ack(bus);
+	printk("%02x%c ",(int)data,ack?'-':'+');
+	return ack;
+}
+
+unsigned char i2c_readbyte(struct i2c_bus *bus,int last)
+{
+	int i;
+	unsigned char data=0;
+    
+	I2C_SET(bus,0,1);
+	for (i=7; i>=0; i--) 
+	{
+		I2C_SET(bus,1,1);
+		if (I2C_GET(bus))
+			data |= (1<<i);
+		I2C_SET(bus,0,1);
+	}
+	last ? i2c_one(bus) : i2c_zero(bus);
+	printk("=%02x%c ",(int)data,last?'-':'+');
+	return data;
+}
+
+/* ----------------------------------------------------------------------- */
+
+int i2c_read(struct i2c_bus *bus, unsigned char addr)
+{
+	int ret;
+    
+	i2c_start(bus);
+	i2c_sendbyte(bus,addr,0);
+	ret = i2c_readbyte(bus,1);
+	i2c_stop(bus);
+	return ret;
+}
+
+
+/* Apply clock and data state to the i2c bus */
+static void i2c_setlines(struct i2c_bus *bus,int ctrl,int data)
+{
+    struct i2c_private *info = (struct i2c_private*)bus->data;
+    int timeout = 10000; /* 10ms timeout */
+    
+    if (info->scl==1 && ctrl==0) {
+        /* data change lags falling clock edge */
+        *info->reg = ~(ctrl<<1 | info->sda);
+        info->scl = ctrl;
+        udelay(I2C_DELAY);
+    }
+    /* apply data change, if any */
+    if (data != info->sda) {
+        *info->reg = ~(info->scl<<1 | data);
+        info->sda = data;
+        udelay(I2C_DELAY);
+    }
+    if (info->scl==0 && ctrl==1) {
+        /* data change leads rising clock edge */
+        *info->reg = ~(ctrl<<1 | info->sda);
+        info->scl = ctrl;
+        udelay(I2C_DELAY);
+        
+        /* wait for slave to be ready */
+        while (((~*info->reg)&2) == 0 && timeout != 0) {
+            timeout--;
+            udelay(1);
+        }
+        if (timeout==0)
+            printk("sgivwfb: i2c wait-state timeout.\n");
+    }
+}
+
+/* Get the data line state */
+static int i2c_getdataline(struct i2c_bus *bus)
+{
+    struct i2c_private *info = (struct i2c_private*)bus->data;
+    return (int)((~*info->reg) & 1);
+}
+
+static int i2c_flatpanel_status(struct i2c_bus *bus)
+{
+    return i2c_read(bus, I2C_FLATPANEL_BASE | 1);
+}
+
+static int i2c_flatpanel_id(struct i2c_bus *bus)
+{
+    int id = i2c_flatpanel_status(bus);
+    if (id == -1)
+        return -1;
+    id = (id & 0xe0) >> 5;
+    return id;
+}
+
+static int i2c_flatpanel_power(struct i2c_bus *bus, int flag)
+{
+    int status = i2c_flatpanel_status(bus);
+    if (status == -1)
+        return -1;
+    if (flag == -1)
+        return status & (1<<2);
+    return 0;
+}
+
+
+/* setup i2c support, set idle condition on i2c bus */
+
+int init_1600sw_i2c(u32 *addr)
+{
+	flatpanel_i2c.reg = addr;
+	sgivwfb_i2c_bus_template.data = (void*)&flatpanel_i2c;
+	i2c_setlines(&sgivwfb_i2c_bus_template, 1, 1);
+	return 0;
+}
+
+int check_1600sw_id(void)
+{
+	int i = i2c_flatpanel_id(&sgivwfb_i2c_bus_template);
+	printk("Flatpanel bus returned: %i\n",i);
+	return(i);
+}
diff -Nbaru linux-2.6.7/drivers/video/sgi2c1600sw.h linux-2.6.7-vws/drivers/video/sgi2c1600sw.h
--- linux-2.6.7/drivers/video/sgi2c1600sw.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.7-vws/drivers/video/sgi2c1600sw.h	2004-08-08 19:45:50.000000000 +0200
@@ -0,0 +1,21 @@
+#ifndef _SGI2C1600SW_H
+#define _SGI2C1600SW_H
+
+#include <linux/types.h>
+
+struct i2c_bus 
+{
+	char  name[32];         /* some useful label */
+	int   id;
+	void  *data;            /* free for use by the bus driver */
+
+	/* Software I2C */
+	void    (*i2c_setlines)(struct i2c_bus *bus, int ctrl, int data);
+	int     (*i2c_getdataline)(struct i2c_bus *bus);
+};
+
+
+extern int init_1600sw_i2c(u32 *addr);
+extern int check_1600sw_id(void);
+
+#endif
diff -Nbaru linux-2.6.7/drivers/video/sgivwfb.c linux-2.6.7-vws/drivers/video/sgivwfb.c
--- linux-2.6.7/drivers/video/sgivwfb.c	2004-06-16 07:19:23.000000000 +0200
+++ linux-2.6.7-vws/drivers/video/sgivwfb.c	2004-08-08 19:45:50.000000000 +0200
@@ -20,6 +20,7 @@
 #include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/mtrr.h>
+#include "sgi2c1600sw.h"
 
 #define INCLUDE_TIMING_TABLE_DATA
 #define DBE_REG_BASE default_par.regs
@@ -319,14 +320,14 @@
 		var->transp.length = 0;
 		break;
 	case 16:		/* RGBA 5551 */
-		var->red.offset = 11;
+		var->red.offset = 10;
 		var->red.length = 5;
-		var->green.offset = 6;
+		var->green.offset = 5;
 		var->green.length = 5;
-		var->blue.offset = 1;
+		var->blue.offset = 0;
 		var->blue.length = 5;
-		var->transp.offset = 0;
-		var->transp.length = 0;
+		var->transp.offset = 15;
+		var->transp.length = 1;
 		break;
 	case 32:		/* RGB 8888 */
 		var->red.offset = 0;
@@ -509,7 +510,8 @@
 		SET_DBE_FIELD(WID, TYP, outputVal, DBE_CMODE_I8);
 		break;
 	case 2:
-		SET_DBE_FIELD(WID, TYP, outputVal, DBE_CMODE_RGBA5);
+		SET_DBE_FIELD(WID, TYP, outputVal, DBE_CMODE_ARGB5);
+//	SET_DBE_FIELD(WID, TYP, outputVal, DBE_CMODE_RGBA5);
 		break;
 	case 4:
 		SET_DBE_FIELD(WID, TYP, outputVal, DBE_CMODE_RGB8);
@@ -733,19 +735,6 @@
 
 int __init sgivwfb_setup(char *options)
 {
-	char *this_opt;
-
-	if (!options || !*options)
-		return 0;
-
-	while ((this_opt = strsep(&options, ",")) != NULL) {
-		if (!strncmp(this_opt, "monitor:", 8)) {
-			if (!strncmp(this_opt + 8, "crt", 3))
-				flatpanel_id = -1;
-			else if (!strncmp(this_opt + 8, "1600sw", 6))
-				flatpanel_id = FLATPANEL_SGI_1600SW;
-		}
-	}
 	return 0;
 }
 
@@ -775,6 +764,12 @@
 
 	fb_info.fix = sgivwfb_fix;
 
+	/* init i2c interface of fp port */
+	init_1600sw_i2c(&default_par.regs->i2cfp);
+	
+	/* query panel for id */
+	flatpanel_id = check_1600sw_id();
+	
 	switch (flatpanel_id) {
 		case FLATPANEL_SGI_1600SW:
 			fb_info.var = sgivwfb_var1600sw;
@@ -807,6 +802,9 @@
 
 	printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n",      
 		fb_info.node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys);
+
+	sgivwfb_check_var(&fb_info.var,&fb_info);
+	
 	return 0;
 
 fail_register_framebuffer:
@@ -815,6 +813,7 @@
 	iounmap(default_par.regs);
 fail_ioremap_regs:
 	release_mem_region(DBE_REG_PHYS, DBE_REG_SIZE);
+	
 	return -ENXIO;
 }
 
