From apatard@mandriva.com Tue Jun 1 13:18:40 2010 From: apatard@mandriva.com Date: Wed, 19 May 2010 10:44:14 +0200 Subject: staging: Add framebuffer driver for XGI chipsets To: gregkh@suse.de Cc: greg@kroah.com, Arnaud Patard Message-ID: <20100519084507.177397958@mandriva.com> This driver handles XG20, XG21, XG40, XG42 chipsets from XGI. They're also known as Z7,Z9,Z11 chipsets. It's based on the SiS fb driver but has been heavily modified by XGI to support their newer chipsets. Signed-off-by: Arnaud Patard Signed-off-by: Greg Kroah-Hartman --- drivers/staging/Kconfig | 2 drivers/staging/Makefile | 1 drivers/staging/xgifb/Kconfig | 11 drivers/staging/xgifb/Makefile | 4 drivers/staging/xgifb/TODO | 15 drivers/staging/xgifb/XGI.h | 10 drivers/staging/xgifb/XGI_accel.c | 596 + drivers/staging/xgifb/XGI_accel.h | 511 + drivers/staging/xgifb/XGI_main.h | 1023 +++ drivers/staging/xgifb/XGI_main_26.c | 3773 ++++++++++++ drivers/staging/xgifb/XGIfb.h | 215 drivers/staging/xgifb/osdef.h | 153 drivers/staging/xgifb/vb_def.h | 1017 +++ drivers/staging/xgifb/vb_ext.c | 1370 ++++ drivers/staging/xgifb/vb_ext.h | 32 drivers/staging/xgifb/vb_init.c | 3444 +++++++++++ drivers/staging/xgifb/vb_init.h | 7 drivers/staging/xgifb/vb_setmode.c |10736 ++++++++++++++++++++++++++++++++++++ drivers/staging/xgifb/vb_setmode.h | 40 drivers/staging/xgifb/vb_struct.h | 534 + drivers/staging/xgifb/vb_table.h | 4406 ++++++++++++++ drivers/staging/xgifb/vb_util.c | 263 drivers/staging/xgifb/vb_util.h | 15 drivers/staging/xgifb/vgatypes.h | 325 + 24 files changed, 28503 insertions(+) --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -141,5 +141,7 @@ source "drivers/staging/ti-st/Kconfig" source "drivers/staging/adis16255/Kconfig" +source "drivers/staging/xgifb/Kconfig" + endif # !STAGING_EXCLUDE_BUILD endif # STAGING --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -51,3 +51,4 @@ obj-$(CONFIG_CRYSTALHD) += crystalhd/ obj-$(CONFIG_CXT1E1) += cxt1e1/ obj-$(CONFIG_TI_ST) += ti-st/ obj-$(CONFIG_ADIS16255) += adis16255/ +obj-$(CONFIG_FB_XGI) += xgifb/ --- /dev/null +++ b/drivers/staging/xgifb/Kconfig @@ -0,0 +1,11 @@ +config FB_XGI + tristate "XGI display support" + depends on FB && PCI + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This driver supports notebooks with XGI Z7,Z9,Z11 PCI chips. + Say Y if you have such a graphics card. + To compile this driver as a module, choose M here: the + module will be called xgifb.ko --- /dev/null +++ b/drivers/staging/xgifb/Makefile @@ -0,0 +1,4 @@ +obj-$(CONFIG_FB_XGI) += xgifb.o + +xgifb-objs := XGI_main_26.o XGI_accel.o vb_init.o vb_setmode.o vb_util.o vb_ext.o + --- /dev/null +++ b/drivers/staging/xgifb/TODO @@ -0,0 +1,15 @@ +This drivers still need a lot of work. I can list all cleanups to do but it's +going to be long. So, I'm writing "cleanups" and not the list. + +Arnaud + +TODO: +- clean ups +- fix build warnings when module +- sort out dup ids with SiS driver +- remove useless/wrong/unused #ifdef/code/... +- fix printk usages +- get rid of non-linux related stuff + +Please send patches to: +Arnaud Patard --- /dev/null +++ b/drivers/staging/xgifb/XGI.h @@ -0,0 +1,10 @@ +#ifndef _XGI_H +#define _XGI_H + +#if 1 +#define TWDEBUG(x) +#else +#define TWDEBUG(x) printk(KERN_INFO x "\n"); +#endif + +#endif --- /dev/null +++ b/drivers/staging/xgifb/XGI_accel.c @@ -0,0 +1,596 @@ +/* + * XGI 300/630/730/540/315/550/650/740 frame buffer driver + * for Linux kernels 2.4.x and 2.5.x + * + * 2D acceleration part + * + * Based on the X driver's XGI300_accel.c which is + * Copyright Xavier Ducoin + * Copyright 2002 by Thomas Winischhofer, Vienna, Austria + * and XGI310_accel.c which is + * Copyright 2002 by Thomas Winischhofer, Vienna, Austria + * + * Author: Thomas Winischhofer + * (see http://www.winischhofer.net/ + * for more information and updates) + */ + +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +/* +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include +#else +#include