Commit 29985e92 authored by Thomas Winischhofer's avatar Thomas Winischhofer Committed by Linus Torvalds

[PATCH] fbdev: SiS framebuffer driver update 1.7.17

attached is an update for sisfb, lifting it up to version 1.7.17.

It contains all changes done behind my back by other people (viro,
torvalds, adaplas) in the meantime. Furthermore,

- all remaining sparse warnings were fixed (mainly caused by the ROM code)

- problems with very old and brand new BIOSes from SiS were fixed,

- LCD setup was simplified, allowing more display modes than before,

- UMC/charter bridge type handling was added,

- a code clean-up was performed, the new FB_BLANK-flags were taken over,
VBLANK status info was corrected, etc.
Signed-off-by: default avatarThomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df14c32b
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......@@ -80,6 +80,7 @@
#define VB_SIS302LV 0x0010
#define VB_SIS302ELV 0x0020
#define VB_SIS301C 0x0040
#define VB_UMC 0x4000
#define VB_NoLCD 0x8000
#define VB_SIS301BLV302BLV (VB_SIS301B|VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SIS301B302B (VB_SIS301B|VB_SIS301C|VB_SIS302B)
......@@ -87,6 +88,9 @@
#define VB_SISVB (VB_SIS301 | VB_SIS301BLV302BLV)
#define VB_SISTMDS (VB_SIS301 | VB_SIS301B302B)
#define VB_SISLVDS VB_SIS301LV302LV
#define VB_SISLCDA (VB_SIS302B|VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SISYPBPR (VB_SIS301C|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SISHIVISION (VB_SIS301|VB_SIS301B|VB_SIS302B)
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
......@@ -126,7 +130,7 @@
#define Mode24Bpp 0x06
#define Mode32Bpp 0x07
#define ModeInfoFlag 0x07
#define ModeTypeMask 0x07
#define IsTextMode 0x07
#define DACInfoFlag 0x0018
......@@ -139,7 +143,7 @@
#define CRT2Mode 0x0800
#define HalfDCLK 0x1000
#define NoSupportSimuTV 0x2000
#define NoSupportLCDScale 0x4000 /* TMDS: No scaling possible (no matter what panel) */
#define NoSupportLCDScale 0x4000 /* SiS bridge: No scaling possible (no matter what panel) */
#define DoubleScanMode 0x8000
/* Infoflag */
......@@ -402,17 +406,18 @@
#define Panel_1400x1050 0x09
#define Panel_1280x768 0x0a /* 30xB/C and LVDS only (BIOS: all) */
#define Panel_1600x1200 0x0b
#define Panel_1280x800 0x0c /* 661etc */
#define Panel_1280x800 0x0c /* 661etc (TMDS) */
#define Panel_1680x1050 0x0d /* 661etc */
#define Panel_1280x720 0x0e /* 661etc */
#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection */
#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection) */
#define Panel_320x480 0x10 /* SiS 550 fstn - TW: This is fake, can be any */
#define Panel_Barco1366 0x11
#define Panel_848x480 0x12
#define Panel_640x480_2 0x13 /* SiS 550 */
#define Panel_640x480_3 0x14 /* SiS 550 */
#define Panel_1280x768_2 0x15 /* 30xLV */
#define Panel_1280x768_3 0x16 /* 30xLV */
#define Panel_1280x768_3 0x16 /* (unused) */
#define Panel_1280x800_2 0x17 /* 30xLV */
/* Index in ModeResInfo table */
#define SIS_RI_320x200 0
......@@ -448,6 +453,7 @@
#define SIS_RI_1280x800 30
#define SIS_RI_1920x1080 31
#define SIS_RI_960x540 32
#define SIS_RI_960x600 33
/* CR5F */
#define IsM650 0x80
......@@ -475,7 +481,7 @@
#define VCLK108_3_300 0x42 /* Index in VCLKData table (300) */
#define VCLK100_300 0x43 /* Index in VCLKData table (300) */
#define VCLK34_300 0x3d /* Index in VCLKData table (300) */
#define VCLK_CUSTOM_300 0x46
#define VCLK_CUSTOM_300 0x47
#define VCLK65_315 0x0b /* Index in (VB)VCLKData table (315) */
#define VCLK108_2_315 0x19 /* Index in (VB)VCLKData table (315) */
#define VCLK81_315 0x5b /* Index in (VB)VCLKData table (315) */
......@@ -484,12 +490,11 @@
#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */
#define VCLK34_315 0x55
#define VCLK68_315 0x0d
#define VCLK69_315 0x5c /* deprecated ! Index in VBVCLKData table (315) */
#define VCLK83_315 0x5c /* Index in VBVCLKData table (315) */
#define VCLK_1280x800_315_2 0x5c /* Index in VBVCLKData table (315) */
#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */
#define VCLK_1280x720 0x5f
#define VCLK_1280x768_2 0x60
#define VCLK_1280x768_3 0x61
#define VCLK_1280x768_3 0x61 /* (unused?) */
#define VCLK_CUSTOM_315 0x62
#define VCLK_1280x720_2 0x63
#define VCLK_720x480 0x67
......@@ -501,6 +506,7 @@
#define VCLK_1024x576 0x51
#define VCLK_1152x864 0x64
#define VCLK_1360x768 0x58
#define VCLK_1280x800_315 0x6c
#define TVCLKBASE_300 0x21 /* Indices on TV clocks in VCLKData table (300) */
#define TVCLKBASE_315 0x3a /* Indices on TV clocks in (VB)VCLKData table (315) */
......
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......@@ -50,7 +50,7 @@
*
*/
const UCHAR SiS300_OEMTVDelay301[8][4] =
static const UCHAR SiS300_OEMTVDelay301[8][4] =
{
{0x08,0x08,0x08,0x08},
{0x08,0x08,0x08,0x08},
......@@ -62,7 +62,7 @@ const UCHAR SiS300_OEMTVDelay301[8][4] =
{0x20,0x20,0x20,0x20}
};
const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
static const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -74,7 +74,7 @@ const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
{0x20,0x20,0x20,0x20}
};
const UCHAR SiS300_OEMTVFlicker[8][4] =
static const UCHAR SiS300_OEMTVFlicker[8][4] =
{
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
......@@ -87,7 +87,7 @@ const UCHAR SiS300_OEMTVFlicker[8][4] =
};
#if 0 /* TW: Not used */
const UCHAR SiS300_OEMLCDDelay1[12][4]={
static const UCHAR SiS300_OEMLCDDelay1[12][4]={
{0x2c,0x2c,0x2c,0x2c},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -103,8 +103,8 @@ const UCHAR SiS300_OEMLCDDelay1[12][4]={
};
#endif
/* TW: From 630/301B BIOS */
const UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
/* From 630/301B BIOS */
static const UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -172,8 +172,8 @@ const UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
{0x20,0x20,0x20,0x20}
};
/* TW: From 300/301LV BIOS */
const UCHAR SiS300_OEMLCDDelay4[12][4] =
/* From 300/301LV BIOS */
static const UCHAR SiS300_OEMLCDDelay4[12][4] =
{
{0x2c,0x2c,0x2c,0x2c},
{0x20,0x20,0x20,0x20},
......@@ -189,8 +189,8 @@ const UCHAR SiS300_OEMLCDDelay4[12][4] =
{0x24,0x24,0x24,0x24}
};
/* TW: From 300/301LV BIOS */
const UCHAR SiS300_OEMLCDDelay5[32][4] =
/* From 300/301LV BIOS */
static const UCHAR SiS300_OEMLCDDelay5[32][4] =
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -226,8 +226,8 @@ const UCHAR SiS300_OEMLCDDelay5[32][4] =
{0x20,0x20,0x20,0x20},
};
/* TW: Added for LVDS */
const UCHAR SiS300_OEMLCDDelay3[64][4] = { /* For LVDS */
/* Added for LVDS */
static const UCHAR SiS300_OEMLCDDelay3[64][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -294,7 +294,7 @@ const UCHAR SiS300_OEMLCDDelay3[64][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20}
};
const UCHAR SiS300_Phase1[8][5][4] =
static const UCHAR SiS300_Phase1[8][5][4] =
{
{
{0x21,0xed,0x00,0x08},
......@@ -355,7 +355,7 @@ const UCHAR SiS300_Phase1[8][5][4] =
};
const UCHAR SiS300_Phase2[8][5][4] =
static const UCHAR SiS300_Phase2[8][5][4] =
{
{
{0x21,0xed,0x00,0x08},
......@@ -415,7 +415,7 @@ const UCHAR SiS300_Phase2[8][5][4] =
}
};
const UCHAR SiS300_Filter1[10][16][4] =
static const UCHAR SiS300_Filter1[10][16][4] =
{
{
{0x00,0xf4,0x10,0x38},
......@@ -599,7 +599,7 @@ const UCHAR SiS300_Filter1[10][16][4] =
},
};
const UCHAR SiS300_Filter2[10][9][7] =
static const UCHAR SiS300_Filter2[10][9][7] =
{
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
......@@ -714,7 +714,7 @@ const UCHAR SiS300_Filter2[10][9][7] =
};
/* Custom data for Barco iQ Pro R300 */
const UCHAR barco_p1[2][9][7][3] = {
static const UCHAR barco_p1[2][9][7][3] = {
{
{ { 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
......
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......@@ -51,9 +51,12 @@
*
*/
#ifndef _SIS_OSDEF_H_
#define _SIS_OSDEF_H_
/* The choices are: */
#define LINUX_KERNEL /* Kernel framebuffer */
/* #define LINUX_XF86 */ /* XFree86 */
#define LINUX_KERNEL /* Linux kernel framebuffer */
/* #define LINUX_XF86 */ /* XFree86/X.org */
#ifdef OutPortByte
#undef OutPortByte
......@@ -109,20 +112,20 @@
#endif
/**********************************************************************/
/* XFree86, X.org */
/* XFree86/X.org */
/**********************************************************************/
#ifdef LINUX_XF86
#define SIS300
#define SIS315H
#define OutPortByte(p,v) outb((IOADDRESS)(p),(CARD8)(v))
#define OutPortWord(p,v) outw((IOADDRESS)(p),(CARD16)(v))
#define OutPortLong(p,v) outl((IOADDRESS)(p),(CARD32)(v))
#define InPortByte(p) inb((IOADDRESS)(p))
#define InPortWord(p) inw((IOADDRESS)(p))
#define InPortLong(p) inl((IOADDRESS)(p))
#define OutPortByte(p,v) outSISREG((IOADDRESS)(p),(CARD8)(v))
#define OutPortWord(p,v) outSISREGW((IOADDRESS)(p),(CARD16)(v))
#define OutPortLong(p,v) outSISREGL((IOADDRESS)(p),(CARD32)(v))
#define InPortByte(p) inSISREG((IOADDRESS)(p))
#define InPortWord(p) inSISREGW((IOADDRESS)(p))
#define InPortLong(p) inSISREGL((IOADDRESS)(p))
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#endif
#endif /* _OSDEF_H_ */
/*
* SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
* SiS 300/630/730/540/315/550/[M]650/651/[M]661[FM]X/740/[M]741[GX]/330/[M]760[GX]
* frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3
*
* Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
......@@ -37,7 +37,7 @@
#define VER_MAJOR 1
#define VER_MINOR 7
#define VER_LEVEL 12
#define VER_LEVEL 17
#undef SIS_CONFIG_COMPAT
......@@ -55,6 +55,16 @@
#endif
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
#define SIS_IOTYPE1 void __iomem
#define SIS_IOTYPE2 __iomem
#define SISINITSTATIC static
#else
#define SIS_IOTYPE1 unsigned char
#define SIS_IOTYPE2
#define SISINITSTATIC
#endif
#undef SISFBDEBUG
#ifdef SISFBDEBUG
......@@ -180,6 +190,7 @@
#define SIS_CRT2_WENABLE_315 0x2F
#define SIS_PASSWORD 0x86 /* SR05 */
#define SIS_INTERLACED_MODE 0x20 /* SR06 */
#define SIS_8BPP_COLOR_MODE 0x0
#define SIS_15BPP_COLOR_MODE 0x1
......@@ -238,41 +249,58 @@
#define HW_DEVICE_EXTENSION SIS_HW_INFO
#define PHW_DEVICE_EXTENSION PSIS_HW_INFO
/* Useful macros */
/* I/O port access macros */
#define inSISREG(base) inb(base)
#define outSISREG(base,val) outb(val,base)
#define orSISREG(base,val) do { \
u8 __Temp = inb(base); \
outSISREG(base, __Temp | (val)); \
} while (0)
#define andSISREG(base,val) do { \
u8 __Temp = inb(base); \
outSISREG(base, __Temp & (val)); \
} while (0)
#define inSISIDXREG(base,idx,var) do { \
outb(idx,base); var=inb((base)+1); \
} while (0)
#define outSISIDXREG(base,idx,val) do { \
outb(idx,base); outb((val),(base)+1); \
} while (0)
#define orSISIDXREG(base,idx,val) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)|(val); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define andSISIDXREG(base,idx,and) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)&(and); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define setSISIDXREG(base,idx,and,or) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = (inb((base)+1)&(and))|(or); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define orSISREG(base,val) \
do { \
u8 __Temp = inSISREG(base); \
outSISREG(base, __Temp | (val)); \
} while (0)
#define andSISREG(base,val) \
do { \
u8 __Temp = inSISREG(base); \
outSISREG(base, __Temp & (val)); \
} while (0)
#define inSISIDXREG(base,idx,var) \
do { \
outSISREG(base, idx); \
var = inSISREG((base)+1); \
} while (0)
#define outSISIDXREG(base,idx,val) \
do { \
outSISREG(base, idx); \
outSISREG((base)+1, val); \
} while (0)
#define orSISIDXREG(base,idx,val) \
do { \
u8 __Temp; \
outSISREG(base, idx); \
__Temp = inSISREG((base)+1) | (val); \
outSISREG((base)+1, __Temp); \
} while (0)
#define andSISIDXREG(base,idx,and) \
do { \
u8 __Temp; \
outSISREG(base, idx); \
__Temp = inSISREG((base)+1) & (and); \
outSISREG((base)+1, __Temp); \
} while (0)
#define setSISIDXREG(base,idx,and,or) \
do { \
u8 __Temp; \
outSISREG(base, idx); \
__Temp = (inSISREG((base)+1) & (and)) | (or); \
outSISREG((base)+1, __Temp); \
} while (0)
/* MMIO access macros */
#define MMIO_IN8(base, offset) readb((base+offset))
......@@ -293,10 +321,52 @@
#define MMIO_QUEUE_WRITEPORT Q_WRITE_PTR
#define MMIO_QUEUE_READPORT Q_READ_PTR
#ifndef FB_BLANK_UNBLANK
#define FB_BLANK_UNBLANK 0
#endif
#ifndef FB_BLANK_NORMAL
#define FB_BLANK_NORMAL 1
#endif
#ifndef FB_BLANK_VSYNC_SUSPEND
#define FB_BLANK_VSYNC_SUSPEND 2
#endif
#ifndef FB_BLANK_HSYNC_SUSPEND
#define FB_BLANK_HSYNC_SUSPEND 3
#endif
#ifndef FB_BLANK_POWERDOWN
#define FB_BLANK_POWERDOWN 4
#endif
enum _SIS_LCD_TYPE {
LCD_INVALID = 0,
LCD_800x600,
LCD_1024x768,
LCD_1280x1024,
LCD_1280x960,
LCD_640x480,
LCD_1600x1200,
LCD_1920x1440,
LCD_2048x1536,
LCD_320x480, /* FSTN */
LCD_1400x1050,
LCD_1152x864,
LCD_1152x768,
LCD_1280x768,
LCD_1024x600,
LCD_640x480_2, /* DSTN */
LCD_640x480_3, /* DSTN */
LCD_848x480,
LCD_1280x800,
LCD_1680x1050,
LCD_1280x720,
LCD_CUSTOM,
LCD_UNKNOWN
};
enum _SIS_CMDTYPE {
MMIO_CMD = 0,
AGP_CMD_QUEUE,
VM_CMD_QUEUE,
MMIO_CMD = 0,
AGP_CMD_QUEUE,
VM_CMD_QUEUE,
};
typedef unsigned int SIS_CMDTYPE;
......@@ -360,10 +430,10 @@ struct sis_video_info {
unsigned long mmio_base;
unsigned long vga_base;
void __iomem * video_vbase;
void __iomem * mmio_vbase;
void __iomem * bios_vbase;
void * bios_abase;
SIS_IOTYPE1 *video_vbase;
SIS_IOTYPE1 *mmio_vbase;
unsigned char *bios_abase;
int mtrr;
......@@ -391,9 +461,9 @@ struct sis_video_info {
int sisfb_inverse;
#endif
u32 heapstart; /* offset */
void __iomem * sisfb_heap_start; /* address */
void __iomem * sisfb_heap_end; /* address */
u32 heapstart; /* offset */
SIS_IOTYPE1 *sisfb_heap_start; /* address */
SIS_IOTYPE1 *sisfb_heap_end; /* address */
u32 sisfb_heap_size;
int havenoheap;
#if 0
......@@ -434,6 +504,7 @@ struct sis_video_info {
int lcdxres, lcdyres;
int lcddefmodeidx, tvdefmodeidx, defmodeidx;
u32 CRT2LCDType; /* defined in "SIS_LCD_TYPE" */
int current_bpp;
int current_width;
......@@ -455,6 +526,7 @@ struct sis_video_info {
int newrom;
int registered;
int warncount;
#ifdef SIS_CONFIG_COMPAT
int ioctl32registered;
int ioctl32vblankregistered;
......@@ -469,7 +541,7 @@ struct sis_video_info {
u8 detectedpdca;
u8 detectedlcda;
void __iomem * hwcursor_vbase;
SIS_IOTYPE1 *hwcursor_vbase;
int chronteltype;
int tvxpos, tvypos;
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......@@ -53,13 +53,9 @@
#ifndef _VGATYPES_
#define _VGATYPES_
#ifdef LINUX_XF86
#include "xf86Version.h"
#include "xf86Pci.h"
#endif
#ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
#include <linux/ioctl.h>
#include <linux/version.h>
#endif
#ifndef FALSE
......@@ -99,15 +95,18 @@ typedef unsigned long ULONG;
#endif
#ifndef BOOLEAN
typedef UCHAR BOOLEAN;
typedef unsigned char BOOLEAN;
#endif
#ifndef bool
typedef UCHAR bool;
#endif
#define SISIOMEMTYPE
#ifdef LINUX_KERNEL
typedef unsigned long SISIOADDRESS;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
#include <linux/types.h> /* Need __iomem */
#undef SISIOMEMTYPE
#define SISIOMEMTYPE __iomem
#endif
#endif
#ifdef LINUX_XF86
......@@ -143,55 +142,26 @@ enum _SIS_CHIP_TYPE {
MAX_SIS_CHIP
};
#ifdef LINUX_KERNEL
enum _SIS_LCD_TYPE {
LCD_INVALID = 0,
LCD_800x600,
LCD_1024x768,
LCD_1280x1024,
LCD_1280x960,
LCD_640x480,
LCD_1600x1200,
LCD_1920x1440,
LCD_2048x1536,
LCD_320x480, /* FSTN */
LCD_1400x1050,
LCD_1152x864,
LCD_1152x768,
LCD_1280x768,
LCD_1024x600,
LCD_640x480_2, /* DSTN */
LCD_640x480_3, /* DSTN */
LCD_848x480,
LCD_1280x800,
LCD_1680x1050,
LCD_1280x720,
LCD_CUSTOM,
LCD_UNKNOWN
};
typedef unsigned int SIS_LCD_TYPE;
#endif
#ifndef SIS_HW_INFO
typedef struct _SIS_HW_INFO SIS_HW_INFO, *PSIS_HW_INFO;
typedef BOOLEAN (*PSIS_QUERYSPACE) (PSIS_HW_INFO, ULONG, ULONG, ULONG *);
struct _SIS_HW_INFO
{
#ifdef LINUX_XF86
PCITAG PciTag; /* PCI Tag */
#endif
UCHAR *pjVirtualRomBase; /* ROM image */
UCHAR *pjVirtualRomBase; /* ROM image */
BOOLEAN UseROM; /* Use the ROM image if provided */
UCHAR *pjVideoMemoryAddress;/* base virtual memory address */
#ifdef LINUX_KERNEL
UCHAR SISIOMEMTYPE *pjVideoMemoryAddress;
/* base virtual memory address */
/* of Linear VGA memory */
ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */
#endif
SISIOADDRESS ulIOAddress; /* base I/O address of VGA ports (0x3B0; relocated) */
......@@ -201,11 +171,6 @@ struct _SIS_HW_INFO
UCHAR jChipRevision; /* Used to Identify SiS Graphics Chip Revision */
BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
#ifdef LINUX_KERNEL
ULONG ulCRT2LCDType; /* defined in the data structure type */
/* "SIS_LCD_TYPE" */
#endif
};
#endif
......
......@@ -35,7 +35,7 @@
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
......@@ -50,12 +50,6 @@
*
*/
#ifdef _INIT_
#define EXTERN
#else
#define EXTERN extern
#endif /* _INIT_ */
#ifndef _VSTRUCT_
#define _VSTRUCT_
......@@ -286,7 +280,7 @@ typedef struct _SiS_Private
USHORT SiS_IF_DEF_FSTN;
USHORT SiS_SysFlags;
UCHAR SiS_VGAINFO;
#ifndef LINUX_KERNEL
#ifdef LINUX_XF86
USHORT SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
#endif
BOOLEAN SiS_UseROM;
......@@ -304,6 +298,7 @@ typedef struct _SiS_Private
BOOLEAN HaveEMILCD;
BOOLEAN OverruleEMI;
UCHAR EMI_30,EMI_31,EMI_32,EMI_33;
USHORT SiS_EMIOffset;
SHORT PDC, PDCA;
UCHAR SiS_MyCR63;
USHORT SiS_CRT1Mode;
......@@ -358,7 +353,7 @@ typedef struct _SiS_Private
USHORT SiS_PanelMin301;
const SiS_StStruct *SiS_SModeIDTable;
SiS_StandTableStruct *SiS_StandTable;
const SiS_StandTableStruct *SiS_StandTable;
const SiS_ExtStruct *SiS_EModeIDTable;
const SiS_Ext2Struct *SiS_RefIndex;
const SiS_VBModeStruct *SiS_VBModeIDTable;
......@@ -374,7 +369,7 @@ typedef struct _SiS_Private
const UCHAR *pSiS_SoftSetting;
const DRAM4Type *SiS_SR15; /* pointer : point to array */
#ifndef LINUX_XF86
#ifdef LINUX_KERNEL
UCHAR *pSiS_SR07;
const DRAM4Type *SiS_CR40; /* pointer : point to array */
UCHAR *SiS_CR49;
......@@ -420,8 +415,8 @@ typedef struct _SiS_Private
const SiS_LCDDataStruct *SiS_LCD1280x720Data;
const SiS_LCDDataStruct *SiS_StLCD1280x768_2Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x768_2Data;
const SiS_LCDDataStruct *SiS_LCD1280x768_3Data;
const SiS_LCDDataStruct *SiS_LCD1280x800Data;
const SiS_LCDDataStruct *SiS_LCD1280x800_2Data;
const SiS_LCDDataStruct *SiS_LCD1280x960Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_St2LCD1280x1024Data;
......@@ -663,6 +658,8 @@ typedef struct _SiS_Private
BOOLEAN CP_HaveCustomData;
int CP_PreferredX, CP_PreferredY, CP_PreferredIndex;
int CP_MaxX, CP_MaxY, CP_MaxClock;
UCHAR CP_PrefSR2B, CP_PrefSR2C;
USHORT CP_PrefClock;
BOOLEAN CP_Supports64048075;
int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */
int CP_HTotal[7], CP_VTotal[7];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment