Commit 60677978 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sisfb update

From: Thomas Winischhofer <thomas@winischhofer.net>

sisfb is simply broken in current 2.6.x.  This patch updates sisfb to the
current development version which no less than 11 months ahead of the version
in the kernel.

Updated includes

- many fixes (duh)

- support for new chipsets (661, 741, 760)

- support for new video bridges (301C, 302ELV)

- removal of all offending fp code (as discussed earlier this month)

- a lot of code clean-up (which is the main reason for its size)
parent 9f61b232
......@@ -673,26 +673,27 @@ config FB_ATY_XL_INIT
Say Y here to support booting a Rage XL without BIOS support.
config FB_SIS
tristate "SIS acceleration"
tristate "SiS acceleration"
depends on FB && PCI
help
This is the frame buffer device driver for the SiS 630 and 640 Super
Socket 7 UMA cards. Specs available at <http://www.sis.com.tw/>.
This is the frame buffer device driver for the SiS 300, 315 and
330 series VGA chipsets. Specs available at http://www.sis.com
To compile this driver as a module, choose M here; the module
will be called sisfb.
config FB_SIS_300
bool "SIS 630/540/730 support"
bool "SiS 300 series support"
depends on FB_SIS
help
This is the frame buffer device driver for the SiS 630 and related
Super Socket 7 UMA cards. Specs available at
<http://www.sis.com.tw/>.
Say Y here to support use of the SiS 300/305, 540, 630 and 730.
config FB_SIS_315
bool "SIS 315H/315 support"
bool "SiS 315/330 series support"
depends on FB_SIS
help
This is the frame buffer device driver for the SiS 315 graphics
card. Specs available at <http://www.sis.com.tw/>.
Say Y here to support use of the SiS 315 and 330 series
(315/H/PRO, 55x, 650, 651, 740, 330, 661, 741, 760).
config FB_NEOMAGIC
tristate "NeoMagic display support"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* $XFree86$ */
/*
* Data and prototypes for init.c
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
#ifndef _INIT_
#define _INIT_
#include "osdef.h"
#include "initdef.h"
#include "vgatypes.h"
#include "vstruct.h"
#ifdef TC
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#endif
#ifdef LINUX_XF86
#include "xf86.h"
#include "xf86Pci.h"
......@@ -24,6 +71,9 @@
#endif
#ifdef LINUX_KERNEL
#ifdef SIS_CP
#undef SIS_CP
#endif
#include <linux/config.h>
#include <linux/version.h>
#include <linux/types.h>
......@@ -36,18 +86,38 @@
#endif
#endif
#ifdef WIN2000
#include <stdio.h>
#include <string.h>
#include <miniport.h>
#include "dderror.h"
#include "devioctl.h"
#include "miniport.h"
#include "ntddvdeo.h"
#include "video.h"
#include "sisv.h"
#include "tools.h"
#endif
/* Mode numbers */
const USHORT ModeIndex_320x200[] = {0x59, 0x41, 0x00, 0x4f};
const USHORT ModeIndex_320x240[] = {0x50, 0x56, 0x00, 0x53};
const USHORT ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00}; /* FSTN */
const USHORT ModeIndex_400x300[] = {0x51, 0x57, 0x00, 0x54};
const USHORT ModeIndex_512x384[] = {0x52, 0x58, 0x00, 0x5c};
const USHORT ModeIndex_640x400[] = {0x2f, 0x5d, 0x00, 0x5e};
const USHORT ModeIndex_640x480[] = {0x2e, 0x44, 0x00, 0x62};
const USHORT ModeIndex_720x480[] = {0x31, 0x33, 0x00, 0x35};
const USHORT ModeIndex_720x576[] = {0x32, 0x34, 0x00, 0x36};
const USHORT ModeIndex_768x576[] = {0x5f, 0x60, 0x00, 0x61};
const USHORT ModeIndex_800x480[] = {0x70, 0x7a, 0x00, 0x76};
const USHORT ModeIndex_800x600[] = {0x30, 0x47, 0x00, 0x63};
const USHORT ModeIndex_848x480[] = {0x39, 0x3b, 0x00, 0x3e};
const USHORT ModeIndex_856x480[] = {0x3f, 0x42, 0x00, 0x45};
const USHORT ModeIndex_1024x768[] = {0x38, 0x4a, 0x00, 0x64};
const USHORT ModeIndex_1024x576[] = {0x71, 0x74, 0x00, 0x77};
const USHORT ModeIndex_1024x600[] = {0x20, 0x21, 0x00, 0x22}; /* 300 series only */
const USHORT ModeIndex_1280x1024[] = {0x3a, 0x4d, 0x00, 0x65};
const USHORT ModeIndex_1280x960[] = {0x7c, 0x7d, 0x00, 0x7e};
const USHORT ModeIndex_1152x768[] = {0x23, 0x24, 0x00, 0x25}; /* 300 series only */
const USHORT ModeIndex_1152x864[] = {0x29, 0x2a, 0x00, 0x2b};
const USHORT ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
const USHORT ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
const USHORT ModeIndex_1280x720[] = {0x79, 0x75, 0x00, 0x78};
const USHORT ModeIndex_1360x768[] = {0x48, 0x4b, 0x00, 0x4e};
const USHORT ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72}; /* 300 series, BARCO only */
const USHORT ModeIndex_1400x1050[] = {0x26, 0x27, 0x00, 0x28}; /* 315 series only */
const USHORT ModeIndex_1600x1200[] = {0x3c, 0x3d, 0x00, 0x66};
const USHORT ModeIndex_1920x1440[] = {0x68, 0x69, 0x00, 0x6b};
const USHORT ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
const USHORT ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
const USHORT SiS_DRAMType[17][5]={
{0x0C,0x0A,0x02,0x40,0x39},
......@@ -144,187 +214,2650 @@ const USHORT SiS_VGA_DAC[] =
0x0B,0x0C,0x0D,0x0F,0x10
};
void SiS_SetReg1(USHORT, USHORT, USHORT);
void SiS_SetReg2(SiS_Private *, USHORT, USHORT, USHORT);
void SiS_SetReg3(USHORT, USHORT);
void SiS_SetReg4(USHORT, ULONG);
void SiS_SetReg5(USHORT, USHORT);
UCHAR SiS_GetReg1(USHORT, USHORT);
UCHAR SiS_GetReg2(USHORT);
ULONG SiS_GetReg3(USHORT);
USHORT SiS_GetReg4(USHORT);
void SiS_ClearDAC(SiS_Private *SiS_Pr, ULONG);
void SiS_SetMemoryClock(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDRAMModeRegister(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo);
void SiS_IsLowResolution(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
#ifdef SIS300
void SiS_SetDRAMSize_300(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_ChkBUSWidth_300(SiS_Private *SiS_Pr, ULONG FBAddress);
static const SiS_StResInfoStruct SiS_StResInfo[]=
{
{ 640,400},
{ 640,350},
{ 720,400},
{ 720,350},
{ 640,480}
};
static const SiS_ModeResInfoStruct SiS_ModeResInfo[] =
{
{ 320, 200, 8, 8}, /* 0x00 */
{ 320, 240, 8, 8}, /* 0x01 */
{ 320, 400, 8, 8}, /* 0x02 */
{ 400, 300, 8, 8}, /* 0x03 */
{ 512, 384, 8, 8}, /* 0x04 */
{ 640, 400, 8,16}, /* 0x05 */
{ 640, 480, 8,16}, /* 0x06 */
{ 800, 600, 8,16}, /* 0x07 */
{ 1024, 768, 8,16}, /* 0x08 */
{ 1280,1024, 8,16}, /* 0x09 */
{ 1600,1200, 8,16}, /* 0x0a */
{ 1920,1440, 8,16}, /* 0x0b */
{ 2048,1536, 8,16}, /* 0x0c */
{ 720, 480, 8,16}, /* 0x0d */
{ 720, 576, 8,16}, /* 0x0e */
{ 1280, 960, 8,16}, /* 0x0f */
{ 800, 480, 8,16}, /* 0x10 */
{ 1024, 576, 8,16}, /* 0x11 */
{ 1280, 720, 8,16}, /* 0x12 */
{ 856, 480, 8,16}, /* 0x13 */
{ 1280, 768, 8,16}, /* 0x14 */
{ 1400,1050, 8,16}, /* 0x15 */
{ 1152, 864, 8,16}, /* 0x16 */
{ 848, 480, 8,16}, /* 0x17 */
{ 1360, 768, 8,16}, /* 0x18 */
{ 1024, 600, 8,16}, /* 0x19 */
{ 1152, 768, 8,16}, /* 0x1a */
{ 768, 576, 8,16}, /* 0x1b */
{ 1360,1024, 8,16} /* 0x1c */
};
static SiS_StandTableStruct SiS_StandTable[]=
{
/* 0x00: MD_0_200 */
{
0x28,0x18,0x08,0x0800,
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x01: MD_1_200 */
{
0x28,0x18,0x08,0x0800,
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x02: MD_2_200 */
{
0x50,0x18,0x08,0x1000,
{0x01,0x03,0x00,0x02},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x03: MD_3_200 - mode 0x03 - 0 */
{
0x50,0x18,0x08,0x1000,
{0x01,0x03,0x00,0x02},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0xc7,0x06,0x07,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x04: MD_4 */
{
0x28,0x18,0x08,0x4000,
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x2c is 2b for 300 */
0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
0xff},
{0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x01,0x00,0x03,0x00},
{0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
0xff}
},
/* 0x05: MD_5 */
{
0x28,0x18,0x08,0x4000,
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x2c is 2b for 300 */
0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xa2,
0xff},
{0x00,0x13,0x15,0x17,0x02,0x04,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x01,0x00,0x03,0x00},
{0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
0xff}
},
/* 0x06: MD_6 */
{
0x50,0x18,0x08,0x4000,
{0x01,0x01,0x00,0x06},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 for 300 */
0x00,0xc1,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xc2,
0xff},
{0x00,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
0x01,0x00,0x01,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
0xff}
},
/* 0x07: MD_7 */
{
0x50,0x18,0x0e,0x1000,
{0x00,0x03,0x00,0x03},
0xa6,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
0x83,0x85,0x5d,0x28,0x0d,0x63,0xba,0xa3,
0xff},
{0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x0e,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
0xff}
},
/* 0x08: MDA_DAC */
{
0x00,0x00,0x00,0x0000,
{0x00,0x00,0x00,0x15},
0x15,
{0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
0x15,0x15,0x15,0x15,0x15,0x15,0x3f,0x3f,
0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00,0x00,
0x00},
{0x00,0x00,0x00,0x00,0x00,0x15,0x15,0x15,
0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
0x15,0x15,0x15,0x15},
{0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
0x3f}
},
/* 0x09: CGA_DAC */
{
0x00,0x10,0x04,0x0114,
{0x11,0x09,0x15,0x00},
0x10,
{0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x2a,0x3a,
0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x10,
0x04},
{0x14,0x01,0x11,0x09,0x15,0x00,0x10,0x04,
0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,0x2e,
0x3e,0x2b,0x3b,0x2f},
{0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
0x3f}
},
/* 0x0a: EGA_DAC */
{
0x00,0x10,0x04,0x0114,
{0x11,0x05,0x15,0x20},
0x30,
{0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
0x0c,0x1c,0x09,0x19,0x0d,0x1d,0x28,0x38,
0x2c,0x3c,0x29,0x39,0x2d,0x3d,0x02,0x12,
0x06},
{0x16,0x03,0x13,0x07,0x17,0x22,0x32,0x26,
0x36,0x23,0x33,0x27,0x37,0x0a,0x1a,0x0e,
0x1e,0x0b,0x1b,0x0f},
{0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
0x3f}
},
/* 0x0b: VGA_DAC */
{
0x00,0x10,0x04,0x0114,
{0x11,0x09,0x15,0x2a},
0x3a,
{0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
0x08,0x0b,0x0e,0x11,0x14,0x18,0x1c,0x20,
0x24,0x28,0x2d,0x32,0x38,0x3f,0x00,0x10,
0x1f},
{0x2f,0x3f,0x1f,0x27,0x2f,0x37,0x3f,0x2d,
0x31,0x36,0x3a,0x3f,0x00,0x07,0x0e,0x15,
0x1c,0x0e,0x11,0x15},
{0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
0x04}
},
/* 0x0c */
{
0x08,0x0c,0x10,0x0a08,
{0x0c,0x0e,0x10,0x0b},
0x0c,
{0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
0x00,0x00,0x01,0x00,0x02,0x02,0x01,0x00,
0x04,0x04,0x01,0x00,0x05,0x02,0x05,0x00,
0x06},
{0x01,0x06,0x05,0x06,0x00,0x08,0x01,0x08,
0x00,0x07,0x02,0x07,0x06,0x07,0x00,0x00,
0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00}
},
/* 0x0d: MD_D */
{
0x28,0x18,0x08,0x2000,
{0x09,0x0f,0x00,0x06},
0x63,
{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 2c is 2b for 300 */
0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x00,0x96,0xb9,0xe3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff}
},
/* 0x0e: MD_E */
{
0x50,0x18,0x08,0x4000,
{0x01,0x0f,0x00,0x06},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 for 300 */
0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x00,0x96,0xb9,0xe3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff}
},
/* 0x0f: ExtVGATable - modes > 0x13 */
{
0x00,0x00,0x00,0x0000,
{0x01,0x0f,0x00,0x0e},
0x23,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x01,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
0xff}
},
/* 0x10: ROM_SAVEPTR - totally different for 300 */
{
0x9f,0x3b,0x00,0x00c0,
{0x00,0x00,0x00,0x00},
0x00,
{0x00,0x00,0x00,0x00,0x00,0x00,0xbb,0x3f,
0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1a,0x00,0xac,0x3e,0x00,0xc0,
0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00}
},
/* 0x11: MD_F */
{
0x50,0x18,0x0e,0x8000,
{0x01,0x0f,0x00,0x06},
0xa2,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3, /* 82,84 is 83,85 on 300 */
0xff},
{0x00,0x08,0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x08,0x00,0x00,0x00,0x18,0x00,0x00,
0x0b,0x00,0x05,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
0xff}
},
/* 0x12: MD_10 */
{
0x50,0x18,0x0e,0x8000,
{0x01,0x0f,0x00,0x06},
0xa3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x82,0x84,0x5d,0x28,0x0f,0x63,0xba,0xe3, /* 82,84 is 83,85 on 300 */
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff}
},
/* 0x13: MD_0_350 */
{
0x28,0x18,0x0e,0x0800,
{0x09,0x03,0x00,0x02},
0xa3,
{0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f, /* b1 is a0 on 300 */
0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x14: MD_1_350 */
{
0x28,0x18,0x0e,0x0800,
{0x09,0x03,0x00,0x02},
0xa3,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
0x83,0x85,0x5d,0x14,0x1f,0x63,0xba,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x15: MD_2_350 */
{
0x50,0x18,0x0e,0x1000,
{0x01,0x03,0x00,0x02},
0xa3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x16: MD_3_350 - mode 0x03 - 1 */
{
0x50,0x18,0x0e,0x1000,
{0x01,0x03,0x00,0x02},
0xa3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0x4d,0x0b,0x0c,0x00,0x00,0x00,0x00,
0x83,0x85,0x5d,0x28,0x1f,0x63,0xba,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x17: MD_0_1_400 */
{
0x28,0x18,0x10,0x0800,
{0x08,0x03,0x00,0x02},
0x67,
{0x2d,0x27,0x28,0x90,0x2b,0xb1,0xbf,0x1f, /* b1 is a0 on 300 */
0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x14,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x0c,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x18: MD_2_3_400 - mode 0x03 - 2 */
{
0x50,0x18,0x10,0x1000,
{0x00,0x03,0x00,0x02},
0x67,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x1f,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x0c,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff}
},
/* 0x19: MD_7_400 */
{
0x50,0x18,0x10,0x1000,
{0x00,0x03,0x00,0x02},
0x66,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x00,0x4f,0x0d,0x0e,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x0f,0x96,0xb9,0xa3,
0xff},
{0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x10,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x0e,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
0xff}
},
/* 0x1a: MD_11 */
{
0x50,0x1d,0x10,0xa000,
{0x01,0x0f,0x00,0x06},
0xe3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, /* 55,81 is 54,80 on 300 */
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xc3, /* e9,8b is ea,8c on 300 */
0xff},
{0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
0xff}
},
/* 0x1b: ExtEGATable - Modes <= 0x02 */
{
0x50,0x1d,0x10,0xa000,
{0x01,0x0f,0x00,0x06},
0xe3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, /* 55,81 is 54,80 on 300 */
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0xe9,0x8b,0xdf,0x28,0x00,0xe7,0x04,0xe3, /* e9,8b is ea,8c on 300 */
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x14,0x07,
0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff}
},
/* 0x1c: MD_13 */
{
0x28,0x18,0x08,0x2000,
{0x01,0x0f,0x00,0x0e},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f, /* 55,81 is 54,80 on 300 */
0x00,0x41,0x00,0x00,0x00,0x00,0x00,0x00,
0x9c,0x8e,0x8f,0x28,0x40,0x96,0xb9,0xa3,
0xff},
{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x41,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
0xff}
}
};
/**************************************************************/
/* SIS VIDEO BRIDGE ----------------------------------------- */
/**************************************************************/
static const UCHAR SiS_SoftSetting = 0x30; /* RAM setting */
static const UCHAR SiS_OutputSelect = 0x40;
static const UCHAR SiS_NTSCTiming[] = {
0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
};
static const UCHAR SiS_PALTiming[] = {
0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,
0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,
0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
};
static const UCHAR SiS_HiTVExtTiming[] = {
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
};
static const UCHAR SiS_HiTVSt1Timing[] = {
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
};
static const UCHAR SiS_HiTVSt2Timing[] = {
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
};
#if 0
static const UCHAR SiS_HiTVTextTiming[] = {
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
};
#endif
#ifdef SIS315H
UCHAR SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_DDR_MRS(SiS_Private *SiS_Pr);
void SiS_SDR_MRS(SiS_Private *SiS_Pr);
void SiS_DisableRefresh(SiS_Private *SiS_Pr);
void SiS_EnableRefresh(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
void SiS_SetDRAMSize_310(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
void SiS_DisableChannelInterleaving(SiS_Private *SiS_Pr, int index,USHORT SiS_DDRDRAM_TYPE[][5]);
void SiS_SetDRAMSizingType(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5]);
void SiS_CheckBusWidth_310(SiS_Private *SiS_Pr, UCHAR *ROMAddress,ULONG FBAddress,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
int SiS_SetRank(SiS_Private *SiS_Pr, int index,UCHAR RankNo,USHORT DRAMTYPE_TABLE[][5]);
int SiS_SetDDRChannel(SiS_Private *SiS_Pr, int index,UCHAR ChannelNo,
USHORT DRAMTYPE_TABLE[][5]);
int SiS_CheckColumn(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckBanks(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_SDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
int SiS_DDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
int Is315E(SiS_Private *SiS_Pr);
void SiS_VerifyMclk(SiS_Private *SiS_Pr, ULONG FBAddr);
static const UCHAR SiS_HiTVGroup3Data[] = {
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
static const UCHAR SiS_HiTVGroup3Simu[] = {
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
#if 0
static const UCHAR SiS_HiTVGroup3Text[] = {
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
#endif
void SiS_HandleCRT1(SiS_Private *SiS_Pr);
void SiS_Handle301B_1400x1050(SiS_Private *SiS_Pr, USHORT ModeNo);
void SiS_SetEnableDstn(SiS_Private *SiS_Pr);
void SiS_Delay15us(SiS_Private *SiS_Pr);
BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
BOOLEAN SiS_CheckMemorySize(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeNo,USHORT ModeIdIndex);
UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
void SiS_SetSeqRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetMiscRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetCRTCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT StandTableIndex);
void SiS_SetATTRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGRCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetSync(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT RefreshRateTableIndex);
void SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
void SiS_ResetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
void SiS_SetVCLKState(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO, USHORT ModeNo,
USHORT RefreshRateTableIndex, USHORT ModeIdIndex);
void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_WriteDAC(SiS_Private *SiS_Pr, USHORT, USHORT, USHORT, USHORT, USHORT, USHORT);
void SiS_DisplayOn(SiS_Private *SiS_Pr);
void SiS_DisplayOff(SiS_Private *SiS_Pr);
void SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO,USHORT ModeNo,
USHORT ModeIdIndex,USHORT RefreshRateTableIndex);
void SiS_GetVBType(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
USHORT SiS_ChkBUSWidth(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
USHORT SiS_GetModeIDLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
USHORT SiS_GetRefindexLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
void SiS_SetInterlace(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex);
void SiS_Set_LVDS_TRUMPION(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
#ifdef SIS315H
void SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
static const UCHAR SiS_NTSCPhase[] = {0x21,0xed,0xba,0x08};
static const UCHAR SiS_PALPhase[] = {0x2a,0x05,0xe3,0x00};
static const UCHAR SiS_PALMPhase[] = {0x21,0xE4,0x2E,0x9B};
static const UCHAR SiS_PALNPhase[] = {0x21,0xF4,0x3E,0xBA};
static const UCHAR SiS_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6};
static const UCHAR SiS_PALPhase2[] = {0x2a,0x09,0x86,0xe9};
static const UCHAR SiS_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4};
static const UCHAR SiS_PALNPhase2[] = {0x21,0xF6,0x94,0x46};
static const UCHAR SiS_SpecialPhase[] = {0x1e,0x8c,0x5c,0x7a};
static const UCHAR SiS_SpecialPhaseM[]= {0x1e,0x83,0x0a,0xe0};
static const UCHAR SiS_SpecialPhaseJ[]= {0x25,0xd4,0xfd,0x5e};
static const SiS_TVDataStruct SiS_StPALData[] =
{
{ 1, 1, 864, 525,1270, 400, 100, 0, 760,0xf4,0xff,0x1c,0x22},
{ 1, 1, 864, 525,1270, 350, 100, 0, 760,0xf4,0xff,0x1c,0x22},
{ 1, 1, 864, 525,1270, 400, 0, 0, 720,0xf1,0x04,0x1f,0x18},
{ 1, 1, 864, 525,1270, 350, 0, 0, 720,0xf4,0x0b,0x1c,0x0a},
{ 1, 1, 864, 525,1270, 480, 50, 0, 760,0xf4,0xff,0x1c,0x22},
{ 1, 1, 864, 525,1270, 600, 50, 0, 0,0xf4,0xff,0x1c,0x22}
};
static const SiS_TVDataStruct SiS_ExtPALData[] =
{
{ 27, 10, 848, 448,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22}, /* 640x400, 320x200 */
{ 108, 35, 848, 398,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22},
{ 12, 5, 954, 448,1270, 530, 50, 0, 50,0xf1,0x04,0x1f,0x18},
{ 9, 4, 960, 463,1644, 438, 50, 0, 50,0xf4,0x0b,0x1c,0x0a},
{ 9, 4, 848, 528,1270, 530, 0, 0, 50,0xf5,0xfb,0x1b,0x2a}, /* 640x480, 320x240 */
/*{ 36, 25,1060, 648,1316, 530, 438, 0, 438,0xeb,0x05,0x25,0x16},*//* 800x600, 400x300 */
{ 36, 25,1060, 648,1270, 530, 438, 0, 438,0xeb,0x05,0x25,0x16}, /* 800x600, 400x300 - better */
{ 3, 2,1080, 619,1270, 540, 438, 0, 438,0xf3,0x00,0x1d,0x20}, /* 720x576 */
{ 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20}, /* 1024x768 */
{ 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20} /* 1024x768 (for NTSC equ) */
};
static const SiS_TVDataStruct SiS_StNTSCData[] =
{
{ 1, 1, 858, 525,1270, 400, 50, 0, 760,0xf1,0x04,0x1f,0x18},
{ 1, 1, 858, 525,1270, 350, 50, 0, 640,0xf1,0x04,0x1f,0x18},
{ 1, 1, 858, 525,1270, 400, 0, 0, 720,0xf1,0x04,0x1f,0x18},
{ 1, 1, 858, 525,1270, 350, 0, 0, 720,0xf4,0x0b,0x1c,0x0a},
{ 1, 1, 858, 525,1270, 480, 0, 0, 760,0xf1,0x04,0x1f,0x18}
};
static const SiS_TVDataStruct SiS_ExtNTSCData[] =
{
{ 143, 65, 858, 443,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18}, /* 640x400, 320x200 */
{ 88, 35, 858, 393,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18},
{ 143, 70, 924, 443,1270, 440, 92, 0, 92,0xf1,0x04,0x1f,0x18},
{ 143, 70, 924, 393,1270, 440, 92, 0, 92,0xf4,0x0b,0x1c,0x0a},
{ 143, 76, 836, 523,1270, 440, 224, 0, 0,0xf1,0x05,0x1f,0x16}, /* 640x480, 320x240 */
{ 143, 120,1056, 643,1270, 440, 0, 128, 0,0xf4,0x10,0x1c,0x00}, /* 800x600, 400x300 */
/*{ 2, 1, 858, 503,1270, 480, 0, 128, 0,0xee,0x0c,0x22,0x08},*/ /* 720x480 (old, from 650) */
{ 143, 76, 836, 523,1270, 440, 0, 128, 0,0xee,0x0c,0x22,0x08}, /* 720x480 - BETTER (from 300 series) */
/*{ 65, 64,1056, 791,1270, 480, 638, 0, 0,0xEE,0x0C,0x22,0x08} */ /* 1024x768 (525i) */
{ 1, 1,1100, 811,1412, 440, 0, 128, 0,0xee,0x0c,0x22,0x08}, /* 1024x768 (525i) CORRECTED */
{ 65, 64,1056, 791,1270, 480, 455, 0, 0,0x00,0x00,0x00,0x00} /* 1024x768 (525p) */
};
static const SiS_TVDataStruct SiS_StHiTVData[] = /* Slave + TVSimu */
{
{ 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x320, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x150,128, 0, 0x00,0x00,0x00,0x00}
};
static const SiS_TVDataStruct SiS_St2HiTVData[] = /* Slave */
{
{ 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 5, 2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00},
{ 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00}
};
static const SiS_TVDataStruct SiS_ExtHiTVData[] =
{
{ 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 5, 1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */
{ 16, 5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */
{ 25, 12, 0x4ec,0x353,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */
{ 5, 4, 0x627,0x464,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00}, /* 1280x1024 */
{ 4, 1, 0x41a,0x233,0x60c,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00}, /* 800x480 */
{ 5, 2, 0x578,0x293,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x576 */
{ 8, 5, 0x6d6,0x323,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 */
};
static const SiS_TVDataStruct SiS_St525pData[] =
{
{ 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x6b4,0x20d,0x4f6,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x6b4,0x20d,0x4f6,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x6b4,0x20d,0x4f6,0x1e0, 0, 0, 0x2f8, 0x00,0x00,0x00,0x00}
};
static const SiS_TVDataStruct SiS_St750pData[] =
{
{ 1, 1, 0x672,0x2ee,0x500,0x190, 50, 0, 0x2f8, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x672,0x2ee,0x500,0x15e, 50, 0, 0x280, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x672,0x2ee,0x500,0x190, 0, 0, 0x2d0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x672,0x2ee,0x500,0x15e, 0, 0, 0x2d0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x672,0x2ee,0x500,0x1e0, 0, 0, 0x2f8, 0x00,0x00,0x00,0x00}
};
static const SiS_TVDataStruct SiS_Ext750pData[] =
{
{ 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00},
{ 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00},
{ 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00},
{ 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */
{ 5, 4, 0x5d8,0x29e,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */
{ 2, 1, 0x35a,0x1f7,0x4f6,0x1e0, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */
{ 68, 64, 0x55f,0x346,0x500,0x2a8,0x27e, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */
};
static const SiS_LCDDataStruct SiS_LCD1280x960Data[] =
{
{ 9, 2, 800, 500,1800,1000},
{ 9, 2, 800, 500,1800,1000},
{ 4, 1, 900, 500,1800,1000},
{ 4, 1, 900, 500,1800,1000},
{ 9, 2, 800, 500,1800,1000},
{ 30, 11,1056, 625,1800,1000},
{ 5, 3,1350, 800,1800,1000},
{ 1, 1,1576,1050,1576,1050},
{ 1, 1,1800,1000,1800,1000}
};
/* 1280x768 panel data from Fujitsu 7911 (VL-17WDX8).
* Other 1280x768 panels (with clock != 81000, HTxVT != 1688x802)
* will be treated as custom panels.
*/
static const SiS_LCDDataStruct SiS_StLCD1280x768Data[] =
{
{ 211, 100, 2100, 408, 1688, 802 }, /* These values are *wrong* */
{ 211, 64, 1536, 358, 1688, 802 }, /* (which is why they aren't used yet) */
{ 211, 100, 2100, 408, 1688, 802 },
{ 211, 64, 1536, 358, 1688, 802 },
{ 211, 48, 840, 488, 1688, 802 },
{ 211, 72, 1008, 609, 1688, 802 },
{ 211, 128, 1400, 776, 1688, 802 },
{ 211, 205, 1680, 1041, 1688, 802 },
{ 1, 1, 1688, 802, 1688, 802 } /* That's the only one that is correct */
};
static const SiS_LCDDataStruct SiS_ExtLCD1280x768Data[] =
{
{ 211, 100, 2100, 408, 1688, 802 }, /* These values are *wrong* */
{ 211, 64, 1536, 358, 1688, 802 }, /* (which is why they aren't used yet) */
{ 211, 100, 2100, 408, 1688, 802 },
{ 211, 64, 1536, 358, 1688, 802 },
{ 211, 48, 840, 488, 1688, 802 },
{ 211, 72, 1008, 609, 1688, 802 },
{ 211, 128, 1400, 776, 1688, 802 },
{ 211, 205, 1680, 1041, 1688, 802 },
{ 1, 1, 1688, 802, 1688, 802 } /* That's the only one that is correct */
};
static const SiS_LCDDataStruct SiS_NoScaleData1280x768[] =
{
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802},
{ 1, 1, 1688, 802, 1688, 802}
};
static const SiS_LCDDataStruct SiS_StLCD1400x1050Data[] =
{
{ 211, 100, 2100, 408, 1688, 1066 },
{ 211, 64, 1536, 358, 1688, 1066 },
{ 211, 100, 2100, 408, 1688, 1066 },
{ 211, 64, 1536, 358, 1688, 1066 },
{ 211, 48, 840, 488, 1688, 1066 },
{ 211, 72, 1008, 609, 1688, 1066 },
{ 211, 128, 1400, 776, 1688, 1066 },
{ 211, 205, 1680, 1041, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 }
};
static const SiS_LCDDataStruct SiS_ExtLCD1400x1050Data[] =
{
{ 211, 100, 2100, 408, 1688, 1066 },
{ 211, 64, 1536, 358, 1688, 1066 },
{ 211, 100, 2100, 408, 1688, 1066 },
{ 211, 64, 1536, 358, 1688, 1066 },
{ 211, 48, 840, 488, 1688, 1066 },
{ 211, 72, 1008, 609, 1688, 1066 },
{ 211, 128, 1400, 776, 1688, 1066 },
{ 211, 205, 1680, 1041, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 }
};
static const SiS_LCDDataStruct SiS_NoScaleData1400x1050[] =
{
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 }
};
static const SiS_LCDDataStruct SiS_StLCD1600x1200Data[] =
{
{27, 4, 800, 500, 2160, 1250 },
{27, 4, 800, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{27, 1, 800, 500, 2160, 1250 },
{ 4, 1,1080, 625, 2160, 1250 },
{ 5, 2,1350, 800, 2160, 1250 },
{135,88,1600,1100, 2160, 1250 },
{135,88,1600,1100, 2160, 1250 },
{ 1, 1,2160,1250, 2160, 1250 }
};
static const SiS_LCDDataStruct SiS_ExtLCD1600x1200Data[] =
{
{27, 4, 800, 500, 2160, 1250 },
{27, 4, 800, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{27, 1, 800, 500, 2160, 1250 },
{ 4, 1,1080, 625, 2160, 1250 },
{ 5, 2,1350, 800, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 },
{ 1, 1,2160,1250, 2160, 1250 }
};
static const SiS_LCDDataStruct SiS_NoScaleData1600x1200[] =
{
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
{1, 1, 2160, 1250, 2048, 1250},
};
static const SiS_LCDDataStruct SiS_NoScaleData[] =
{
{ 1, 1, 800, 449, 800, 449 },
{ 1, 1, 800, 449, 800, 449 },
{ 1, 1, 900, 449, 900, 449 },
{ 1, 1, 900, 449, 900, 449 },
{ 1, 1, 800, 525, 800, 525 },
{ 1, 1,1056, 628,1056, 628 },
{ 1, 1,1344, 806,1344, 806 },
{ 1, 1,1688,1066,1688,1066 },
{ 1, 1,1688, 802,1688, 802 }, /* 1280x768: 802 was 806 in both cases */
{ 1, 1,2160,1250,2160,1250 }, /* 1600x1200 */
{ 1, 1,1800,1000,1800,1000 } /* 1280x960 */
};
/* *** LCDA *** */
static const SiS_LVDSDataStruct SiS_LCDA1024x768Data_1[]=
{
{ 960, 438,1344, 806},
{ 960, 388,1344, 806},
{ 1040, 438,1344, 806},
{ 1040, 388,1344, 806},
{ 960, 518,1344, 806}, /* 640x480 */
{ 1120, 638,1344, 806}, /* 800x600 */
{ 1344, 806,1344, 806}, /* 1024x768 */
#if 0
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 518,1344, 806}, /* 640x480 */
{1050, 638,1344, 806}, /* 800x600 */
{1344, 806,1344, 806}, /* 1024x768 */
#endif
#ifdef SIS300
void SiS_SetCRT1FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
void SiS_SetCRT1FIFO_630(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
USHORT SiS_CalcDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT VCLK,
USHORT colordepth, USHORT MCLK);
USHORT SiS_DoCalcDelay(SiS_Private *SiS_Pr, USHORT MCLK, USHORT VCLK, USHORT colordepth, USHORT key);
USHORT SiS_CalcDelay2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, UCHAR,PSIS_HW_DEVICE_INFO HwDeviceExtension);
};
static const SiS_LVDSDataStruct SiS_LCDA1024x768Data_2[]=
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
};
static const SiS_LVDSDataStruct SiS_LCDA1280x1024Data_1[]=
{ /* Acer, Compaq */
{1048, 442,1688,1066},
{1048, 392,1688,1066},
{1128, 442,1688,1066},
{1128, 392,1688,1066},
{1048, 522,1688,1066},
{1208, 642,1688,1066},
{1432, 810,1688,1066},
{1688,1066,1688,1066}
};
static const SiS_LVDSDataStruct SiS_LCDA1280x1024Data_2[]=
{ /* Corrected (illegal in Acer, correct in Compaq) */
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066}
};
static const SiS_LVDSDataStruct SiS_LCDA1400x1050Data_1[]=
{ /* Clevo */
{ 928, 416, 1688,1066},
{ 928, 366, 1688,1066},
{1008, 416, 1688,1066},
{1008, 366, 1688,1066},
{1200, 530, 1688,1066},
{1088, 616, 1688,1066},
{1312, 784, 1688,1066},
{1568,1040, 1688,1066},
{1688,1066, 1688,1066}
};
static const SiS_LVDSDataStruct SiS_LCDA1400x1050Data_2[]=
{ /* Clevo */
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066}
};
static const SiS_LVDSDataStruct SiS_LCDA1600x1200Data_1[]=
{ /* Clevo (Temporary data) */
{1200, 450, 2048,1250},
{1200, 400, 2048,1250},
{1280, 450, 2048,1250},
{1280, 400, 2048,1250},
{1200, 530, 2048,1250},
{1360, 650, 2048,1250},
{1584, 818, 2048,1250},
{1688,1066, 2048,1250},
{1688,1066, 2048,1250},
{2048,1250, 2048,1250} /* this should be correct */
#if 0
{2160,1250, 2048,1250} /* ? */
#endif
void SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT ModeNo);
void SiS_SetCRT1Group(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeNo,USHORT ModeIdIndex,USHORT BaseAddr);
void SiS_DetectMonitor(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
void SiS_GetSenseStatus(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,UCHAR *ROMAddr);
USHORT SiS_TestMonitorType(SiS_Private *SiS_Pr, UCHAR R_DAC,UCHAR G_DAC,UCHAR B_DAC);
USHORT SiS_SenseCHTV(SiS_Private *SiS_Pr);
BOOLEAN SiS_Sense(SiS_Private *SiS_Pr, USHORT tempbx,USHORT tempcx);
BOOLEAN SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
USHORT SiS_SenseLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
void SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
void SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo);
void SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr);
};
#ifdef LINUX_XF86
USHORT SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
void SiS_SetPitch(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT1(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT2(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
extern int SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
int *out_sbit, int *out_scale);
extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
extern USHORT SiS_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode);
static const SiS_LVDSDataStruct SiS_LCDA1600x1200Data_2[]=
{ /* Clevo (Temporary data. Seems invalid.) */
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250},
{2160,1250, 2160,1250}
};
/* LVDS SKEW for LCDA */
static const SiS_LVDSDesStruct SiS_PanelType1076_1[]=
{ /* 1024x768 */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}, /* 805; was 0, 0 -> top line cut away (26/09/03) */
};
static const SiS_LVDSDesStruct SiS_PanelType1076_2[]=
{ /* 1024x768; not expanded */
{ 1184, 622 },
{ 1184, 597 },
{ 1184, 622 },
{ 1184, 597 },
{ 1152, 650 }, /* 622 */
{ 1232, 722 },
{ 0, 0 }, /* 805; was 0, 0 -> top line cut away (26/09/03) */
};
static const SiS_LVDSDesStruct SiS_PanelType1210_1[]=
{ /* 1280x1024 */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 1065}, /* Acer */
{ 0 , 0}
};
static const SiS_LVDSDesStruct SiS_PanelType1210_2[]=
{ /* 1280x1024; not expanded */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
static const SiS_LVDSDesStruct SiS_PanelType1296_1[]=
{ /* 1400x1050 */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 1065} /* Was 0,0 */
};
static const SiS_LVDSDesStruct SiS_PanelType1296_2[]=
{ /* 1400x1050; not expanded */
{ 1308, 741 },
{ 1308, 716 },
{ 1308, 741 },
{ 1308, 716 },
{ 1308, 781 },
{ 1388, 841 },
{ 1500, 925 },
{ 1628,1053 },
{ 0,1065 }
#if 0
{ 808 , 740},
{ 0 , 715},
{ 632 , 740},
{ 632 , 715},
{ 1307, 780},
{ 1387,1157},
{ 1499, 924},
{ 1627,1052},
{ 0 , 0}
#endif
};
extern USHORT SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_PresetScratchregister(SiS_Private *SiS_Pr, USHORT SiS_P3d4,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO );
extern void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension, int chkcrt2mode);
extern BOOLEAN SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern USHORT SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
extern void SiS_LongWait(SiS_Private *SiS_Pr);
extern void SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
extern void SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
extern void SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
extern USHORT SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
extern void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
extern void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
USHORT *ResInfo,USHORT *DisplayType);
extern USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiS_IsM650(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern USHORT SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
static const SiS_LVDSDesStruct SiS_PanelType1600_1[]=
{ /* 1600x1200 */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
static const SiS_LVDSDesStruct SiS_PanelType1600_2[]=
{ /* 1600x1200; not expanded */
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
#ifdef SIS315H
/* LCDA CRT1 custom data */
static const SiS_LCDACRT1DataStruct Compaq1280x1024_LCDACRT1_1[]=
{
{{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x08,0x3e,
0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
0x00}},
{{0x92,0x63,0x63,0x96,0x6c,0x1a,0x80,0xf0,
0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
0x01}},
{{0xae,0x7f,0x7f,0x92,0x88,0x96,0x28,0xf5,
0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
0x01}},
{{0xce,0x9f,0x9f,0x92,0xa8,0x16,0x28,0x5a,
0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
0x01}}
};
static const SiS_LCDACRT1DataStruct Compaq1280x1024_LCDACRT1_1_H[]=
{
{{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
0x00}},
{{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
0x01}},
{{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
0x00}},
{{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
0x01}},
{{0x56,0x27,0x27,0x9a,0x30,0x1e,0x08,0x3e,
0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
0x00}},
{{0x60,0x31,0x31,0x84,0x3a,0x88,0x80,0xf0,
0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
0x01}},
{{0x6e,0x3f,0x3f,0x92,0x48,0x96,0x28,0xf5,
0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
0x01}}
};
static const SiS_LCDACRT1DataStruct Clevo1024x768_LCDACRT1_1[]=
{
{{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x55,0x86,0x04,0x3e,
0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
0x00}},
{{0x87,0x63,0x63,0x8B,0x69,0x1A,0x7c,0xf0,
0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x26,
0x01}},
{{0xA3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xFf,0xFf,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS_LCDACRT1DataStruct Clevo1024x768_LCDACRT1_1_H[]=
{
{{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x32,0x1b,0x04,0x3e,
0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x45,
0x00}},
{{0x55,0x31,0x31,0x99,0x46,0x1d,0x7c,0xf0,
0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x55,
0x01}},
{{0x63,0x3F,0x3F,0x87,0x4A,0x93,0x24,0xF5,
0x02,0x88,0xFF,0xFF,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS_LCDACRT1DataStruct Clevo1024x768_LCDACRT1_2[]=
{
{{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
0x01}},
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS_LCDACRT1DataStruct Clevo1024x768_LCDACRT1_2_H[]=
{
{{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x7f,0x86,0xdf,0xdf,0x25,0x10,0x00,0x01,
0x00 }},
{{0x71,0x31,0x31,0x95,0x46,0x97,0x24,0xf1,
0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x01,
0x01 }},
{{0x63,0x3f,0x3f,0x87,0x46,0x97,0x24,0xf5,
0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
0x01 }}
};
#endif /* 315 */
/**************************************************************/
/* LVDS ----------------------------------------------------- */
/**************************************************************/
static const SiS_LVDSDataStruct SiS_LVDS320x480Data_1[]=
{
{ 848, 433, 400, 525},
{ 848, 389, 400, 525},
{ 848, 433, 400, 525},
{ 848, 389, 400, 525},
{ 848, 518, 400, 525},
{1056, 628, 400, 525},
{ 400, 525, 400, 525},
{ 800, 449,1000, 644},
{ 800, 525,1000, 635}
};
static const SiS_LVDSDataStruct SiS_LVDS640x480Data_1[]=
{
{ 800, 445, 800, 525}, /* 800, 449, 800, 449 */
{ 800, 395, 800, 525},
{ 800, 445, 800, 525},
{ 800, 395, 800, 525},
{ 800, 525, 800, 525},
{ 800, 525, 800, 525}, /* pseudo */
{ 800, 525, 800, 525} /* pseudo */
};
/* FSTN 320x240 */
static const SiS_LVDSDataStruct SiS_LVDS640x480Data_2[]=
{
{ 800, 445, 800, 525},
{ 800, 395, 800, 525},
{ 800, 445, 800, 525},
{ 800, 395, 800, 525},
{ 800, 525, 800, 525},
{ 800, 525, 800, 525}, /* pseudo */
{ 800, 525, 800, 525} /* pseudo */
};
static const SiS_LVDSDataStruct SiS_LVDS800x600Data_1[]=
{
{ 848, 433,1060, 629},
{ 848, 389,1060, 629},
{ 848, 433,1060, 629},
{ 848, 389,1060, 629},
{ 848, 518,1060, 629},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{ 800, 449,1000, 644},
{ 800, 525,1000, 635}
};
static const SiS_LVDSDataStruct SiS_LVDS800x600Data_2[]=
{
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{ 800, 449,1000, 644},
{ 800, 525,1000, 635}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_1[]=
{
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 518,1344, 806}, /* 640x480 */
{1050, 638,1344, 806}, /* 800x600 */
{1344, 806,1344, 806}, /* 1024x768 */
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_2[]=
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x1024Data_1[]=
{
{1048, 442,1688,1066},
{1048, 392,1688,1066},
{1048, 442,1688,1066},
{1048, 392,1688,1066},
{1048, 522,1688,1066},
{1208, 642,1688,1066},
{1432, 810,1688,1066},
{1688,1066,1688,1066}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x1024Data_2[]=
{
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066},
{1688,1066,1688,1066}
};
static const SiS_LVDSDataStruct SiS_LVDS1400x1050Data_1[]=
{
{ 928, 416, 1688,1066},
{ 928, 366, 1688,1066},
{ 928, 416, 1688,1066},
{ 928, 366, 1688,1066},
{ 928, 496, 1688,1066},
{1088, 616, 1688,1066},
{1312, 784, 1688,1066},
{1568,1040, 1688,1066},
{1688,1066, 1688,1066}
};
static const SiS_LVDSDataStruct SiS_LVDS1400x1050Data_2[]=
{
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
};
static const SiS_LVDSDataStruct SiS_LVDS1600x1200Data_1[]=
{
{1088, 520, 2048,1320},
{1088, 470, 2048,1320},
{1088, 520, 2048,1320},
{1088, 470, 2048,1320},
{1088, 600, 2048,1320},
{1248, 720, 2048,1320},
{1472, 888, 2048,1320},
{1728,1144, 2048,1320},
{1848,1170, 2048,1320},
{2048,1320, 2048,1320}
#if 0
{1088, 450, 2048,1250},
{1088, 400, 2048,1250},
{1088, 450, 2048,1250},
{1088, 400, 2048,1250},
{1088, 530, 2048,1250},
{1248, 650, 2048,1250},
{1472, 818, 2048,1250},
{1728,1066, 2048,1250},
{1848,1066, 2048,1250},
{2048,1250, 2048,1250}
#endif
};
static const SiS_LVDSDataStruct SiS_LVDS1600x1200Data_2[]=
{
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320},
{2048,1320, 2048,1320}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x960Data_1[]=
{
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x960Data_2[]=
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x768Data_1[]=
{
{ 768, 438, 1408, 806},
{ 768, 388, 1408, 806},
{ 768, 438, 1408, 806},
{ 768, 388, 1408, 806},
{ 768, 518, 1408, 806},
{ 928, 638, 1408, 806},
{1152, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806}
};
static const SiS_LVDSDataStruct SiS_LVDS1280x768Data_2[]=
{
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806},
{1408, 806, 1408, 806}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_1[] =
{
{ 840, 604,1344, 800},
{ 840, 560,1344, 800},
{ 840, 604,1344, 800},
{ 840, 560,1344, 800},
{ 840, 689,1344, 800},
{1050, 800,1344, 800},
{1344, 800,1344, 800},
{ 800, 449,1280, 789},
{ 800, 525,1280, 785}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_2[] =
{
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_1[] =
{
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 438,1344, 806},
{ 840, 409,1344, 806},
{ 840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_2[] =
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
};
/* Pass 1:1 data */
static const SiS_LVDSDataStruct SiS_LVDSXXXxXXXData_1[]=
{
{ 800, 449, 800, 449},
{ 800, 449, 800, 449},
{ 900, 449, 900, 449},
{ 900, 449, 900, 449},
{ 800, 525, 800, 525}, /* 640x480 */
{1056, 628, 1056, 628}, /* 800x600 */
{1344, 806, 1344, 806}, /* 1024x768 */
{1344,1066, 1344,1066}, /* 1280x1024 */ /* INSERTED ! */
{1688, 806, 1688, 806}, /* 1280x768 */
/* No other panels ! */
};
/* Custom data for Barco iQ R series */
static const SiS_LVDSDataStruct SiS_LVDSBARCO1366Data_1[]=
{
{ 832, 438,1331, 806},
{ 832, 388,1331, 806},
{ 832, 438,1331, 806},
{ 832, 388,1331, 806},
{ 832, 518,1331, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{1688,1066,1688,1066},
{1688,1066,1688,1066} /* 1360x1024 */
};
/* Custom data for Barco iQ R series */
static const SiS_LVDSDataStruct SiS_LVDSBARCO1366Data_2[]=
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1688,1066,1688,1066},
{1688,1066,1688,1066} /* 1360x1024 */
};
/* Custom data for Barco iQ G series */
static const SiS_LVDSDataStruct SiS_LVDSBARCO1024Data_1[]=
{
{ 832, 438,1331, 806},
{ 832, 409,1331, 806},
{ 832, 438,1331, 806},
{ 832, 409,1331, 806},
{ 832, 518,1331, 806}, /* 640x480 */
{1050, 638,1344, 806}, /* 800x600 */
{1344, 806,1344, 806}, /* 1024x768 */
};
/* Custom data for Barco iQ G series */
static const SiS_LVDSDataStruct SiS_LVDSBARCO1024Data_2[]=
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
};
/* Custom data for 848x480 parallel panel */
static const SiS_LVDSDataStruct SiS_LVDS848x480Data_1[]=
{
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{1088, 525,1088, 525}, /* 640x480 TODO */
{1088, 525,1088, 525}, /* 800x600 TODO */
{1088, 525,1088, 525}, /* 1024x768 TODO */
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{1088, 525,1088, 525}, /* 848x480 */
{1088, 525,1088, 525} /* 1360x768 TODO */
};
/* Custom data for 848x480 parallel panel */
static const SiS_LVDSDataStruct SiS_LVDS848x480Data_2[]=
{
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{1088, 525,1088, 525}, /* 640x480 */
{1088, 525,1088, 525}, /* 800x600 */
{1088, 525,1088, 525}, /* 1024x768 */
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{ 0, 0, 0, 0},
{1088, 525,1088, 525}, /* 848x480 */
{1088, 525,1088, 525} /* 1360x768 TODO */
};
static const SiS_LVDSDataStruct SiS_CHTVUNTSCData[]=
{
{ 840, 600, 840, 600},
{ 840, 600, 840, 600},
{ 840, 600, 840, 600},
{ 840, 600, 840, 600},
{ 784, 600, 784, 600},
{1064, 750,1064, 750},
{1160, 945,1160, 945}
};
static const SiS_LVDSDataStruct SiS_CHTVONTSCData[]=
{
{ 840, 525, 840, 525},
{ 840, 525, 840, 525},
{ 840, 525, 840, 525},
{ 840, 525, 840, 525},
{ 784, 525, 784, 525},
{1040, 700,1040, 700},
{1160, 840,1160, 840}
};
/* LVDS Skew */
static const SiS_LVDSDesStruct SiS_PanelTypeNS_1[]=
{
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 806},
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS_PanelTypeNS_2[] =
{
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
/* Chrontel TV Skew */
static const SiS_LVDSDesStruct SiS_CHTVUNTSCDesData[]=
{
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS_CHTVONTSCDesData[]=
{
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS_CHTVUPALDesData[]=
{
{256, 0},
{256, 0},
{256, 0},
{256, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS_CHTVOPALDesData[]=
{
{256, 0},
{256, 0},
{256, 0},
{256, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0}
};
/* CRT1 CRTC data for slave modes */
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1320x480_1[] =
{
{{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
0x00 }},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00 }},
{{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
0x00 }},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00 }},
{{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
0x00 }},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01 }},
{{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00 }}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_1[] =
{
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_1_H[] =
{
{{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
0x00}},
{{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x83,0x85,0x63,0xba,0x00,0x00,0x00,
0x00}},
{{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x00,0x00,0x00,
0x00}},
{{0x2d,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
0x83,0x85,0x63,0xba,0x00,0x00,0x00,
0x00}},
{{0x2d,0x28,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_2[] =
{
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x30,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}},
{{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_2_H[] =
{
{{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}},
{{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_3[] =
{
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0x04,0x00,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}},
{{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1640x480_3_H[] =
{
{{0x65,0x4f,0x89,0x56,0x83,0xaa,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x83,0x1f,
0x5e,0x83,0x5d,0x79,0x10,0x00,0x05,
0x00}},
{{0x65,0x4f,0x89,0x56,0x83,0x04,0x3e,
0xe0,0x85,0xdf,0xfb,0x10,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}},
{{0x2d,0x27,0x90,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11024x600_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x2e,0x3e,
0xb9,0x80,0x5d,0x2f,0x00,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0xaf,0xba,
0x3b,0x82,0xdf,0xb0,0x00,0x00,0x01,
0x00}},
{{0x7e,0x63,0x82,0x68,0x15,0x1e,0xf1,
0xae,0x85,0x57,0x1f,0x30,0x00,0x26,
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x1e,0xf1,
0xae,0x85,0x57,0x1f,0x30,0x00,0x02,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11024x600_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
0x00}},
{{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
0x01}},
{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11024x600_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
0xae,0x84,0x57,0x25,0x30,0x00,0x02,
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11024x600_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
0xae,0x84,0x57,0x25,0x30,0x00,0x01,
0x01}},
{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11152x768_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x01,
0x00}},
{{0x64,0x4f,0x88,0x54,0x9f,0x04,0x3e,
0xe2,0x89,0xdf,0x05,0x00,0x00,0x01,
0x00}},
{{0x7e,0x63,0x82,0x68,0x15,0x7c,0xf0,
0x5a,0x8f,0x57,0x7d,0x20,0x00,0x26,
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11152x768_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x97,0x1f,
0x60,0x87,0x5d,0x83,0x10,0x00,0x44,
0x00}},
{{0x2f,0x27,0x93,0x2b,0x90,0x04,0x3e,
0xe2,0x89,0xdf,0x05,0x00,0x00,0x44,
0x00}},
{{0x3c,0x31,0x80,0x35,0x1c,0x7c,0xf0,
0x5a,0x8f,0x57,0x7d,0x20,0x00,0x55,
0x01}},
{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11152x768_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x72,0x88,0xdf,0x25,0x30,0x00,0x06,
0x00}},
{{0xa3,0x63,0x87,0x78,0x89,0x24,0xf1,
0xae,0x84,0x57,0x25,0x30,0x00,0x02,
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11152x768_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x31,0x87,0x5d,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x72,0x88,0xdf,0x25,0x30,0x00,0x01,
0x00}},
{{0x4f,0x31,0x93,0x3e,0x06,0x24,0xf1,
0xae,0x84,0x57,0x25,0x30,0x00,0x01,
0x01}},
{{0x4f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11280x768_1[] =
{
{{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
0x00}},
{{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
0x00}},
{{0x5b,0x4f,0x9f,0x55,0x19,0xb4,0x1f,
0x9c,0x8e,0x8f,0xb5,0x10,0x00,0x01,
0x00}},
{{0x5b,0x4f,0x9f,0x55,0x19,0x82,0x1f,
0x6a,0x8c,0x5d,0x83,0x30,0x00,0x01,
0x00}},
{{0x5b,0x4f,0x9f,0x55,0x19,0x04,0x3e,
0xec,0x8e,0xdf,0x05,0x20,0x00,0x01,
0x00}},
{{0x6f,0x63,0x93,0x69,0x8d,0x7c,0xf0,
0x64,0x86,0x57,0x7d,0x20,0x00,0x05,
0x01}},
{{0x8b,0x7f,0x8f,0x85,0x09,0x24,0xf5,
0x0c,0x8e,0xff,0x25,0x30,0x00,0x02,
0x01}},
{{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
0x01}},
{{0xab,0x9f,0x8f,0xa5,0x89,0x24,0xf5,
0x0c,0x8e,0xff,0x25,0x30,0x00,0x06,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11280x768_1_H[] =
{
{{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
0x93,0x86,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x47,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
0x92,0x86,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x47,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
0x60,0x84,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x47,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
0xe2,0x86,0xdf,0xef,0x10,0x00,0x05,
0x00}},
{{0x51,0x31,0x95,0x36,0x04,0x66,0xf0,
0x5a,0x8e,0x57,0x67,0x20,0x00,0x01,
0x01}},
{{0x5f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
0x02,0x86,0xff,0x0f,0x10,0x00,0x01,
0x01}},
{{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
0x01}},
{{0x6f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
0x02,0x86,0xff,0x0f,0x09,0x00,0x05,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11280x768_2[] =
{
{{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
0x00}},
{{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
0x00}},
{{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
0x54,0x86,0xdb,0xda,0x00,0x00,0x02,
0x00}},
{{0xab,0x60,0x9f,0x80,0x04,0x24,0xbb,
0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x02,
0x00}},
{{0xab,0x60,0x9f,0x80,0x04,0x24,0xb3,
0x7c,0x8e,0x03,0x02,0x10,0x00,0x02,
0x01}},
{{0xab,0x63,0x8f,0x8a,0x8e,0x24,0xf1,
0xb6,0x88,0x57,0x25,0x10,0x00,0x02,
0x01}},
{{0xab,0x7f,0x8f,0x98,0x9c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x02,
0x01}},
{{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
0x01}},
{{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11280x768_2_H[] =
{
{{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
0x00}},
{{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
0x00}},
{{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
0x54,0x86,0xdb,0xda,0x00,0x00,0x01,
0x00}},
{{0x83,0x38,0x97,0x58,0x9c,0x24,0xbb,
0x3b,0x8d,0xc2,0xc1,0x00,0x00,0x01,
0x00}},
{{0x83,0x38,0x97,0x58,0x9c,0x24,0xb3,
0x7c,0x8e,0x03,0x02,0x10,0x00,0x01,
0x01}},
{{0x79,0x31,0x9d,0x58,0x9c,0x24,0xf1,
0xb6,0x88,0x57,0x25,0x10,0x00,0x01,
0x01}},
{{0x6b,0x3f,0x8f,0x58,0x9c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x01,
0x01}},
{{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
0x01}},
{{0xab,0x9f,0x8f,0xa8,0x8c,0x24,0xf5,
0x0a,0x8c,0xff,0x25,0x30,0x00,0x06,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1XXXxXXX_1[] =
{
{{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
0x00}},
{{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x02,
0x01}},
{{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
0x00,0x84,0xff,0x29,0x09,0x00,0x07,
0x01}},
{{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x07,
0x01}}
};
static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT1XXXxXXX_1_H[] =
{
{{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
0x00}},
{{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
0x00}},
{{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
0x00}},
{{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
0x00}},
{{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
0x00}},
{{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
0x01}},
{{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x01,
0x01}}
};
/**************************************************************/
/* COMMON --------------------------------------------------- */
/**************************************************************/
#define SIS_PL_HSYNCP 0x01
#define SIS_PL_HSYNCN 0x02
#define SIS_PL_VSYNCP 0x04
#define SIS_PL_VSYNCN 0x08
#define SIS_PL_DVI 0x80
typedef struct _SiS_PlasmaModes
{
const char *name;
ULONG clock;
USHORT HDisplay, HTotal, HFrontPorch, HSyncWidth;
USHORT VDisplay, VTotal, VFrontPorch, VSyncWidth;
UCHAR SyncFlags;
} SiS_PlasmaModes;
typedef struct _SiS_PlasmaTables
{
USHORT vendor;
UCHAR productnum;
USHORT product[5];
const char *DDCnames[5];
const char *plasmaname;
UCHAR modenum;
UCHAR plasmamodes[20]; /* | 0x80 = DVI-capable, | 0x40 = analog */
} SiS_PlasmaTables;
static const SiS_PlasmaModes SiS_PlasmaMode[] = {
{ "640x400", /* 00: IBM 400@70 */
25175,
640, 800, 17, 64,
400, 449, 13, 2,
SIS_PL_HSYNCN | SIS_PL_VSYNCN },
{ "640x480", /* 01: VESA 480@72 */
31500,
640, 832, 24, 40,
480, 520, 9, 3,
SIS_PL_HSYNCN | SIS_PL_VSYNCN },
{ "800x600", /* 02: VESA 600@72 */
50000,
800, 1040, 56, 120,
600, 666, 37, 6,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "864x480", /* 03: Cereb wide 1 */
42526,
864, 1134, 22, 86,
480, 500, 1, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCN },
{ "848x480", /* 04: VESA wide (NEC1) */
33750,
848, 1088, 16, 112,
480, 517, 6, 8,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1024x576", /* 05: VESA wide (NEC2) */
47250,
1024, 1320, 16, 144,
576, 596, 2, 4,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1280x720", /* 06: VESA wide (NEC3) */
76500,
1280, 1696, 48, 176,
720, 750, 4, 8,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1360x765", /* 07: VESA wide (NEC4) */
85500,
1360, 1792, 64, 176,
765, 795, 4, 8,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1024x600", /* 08: CEREB wide 2 */
51200,
1024, 1352, 51, 164,
600, 628, 1, 4,
SIS_PL_HSYNCN | SIS_PL_VSYNCP },
{ "1024x768", /* 09: VESA 768@75 */
78750,
1024, 1312, 16, 96,
768, 800, 1, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1152x864", /* 10: VESA 1152x864@75 */
108000,
1152, 1600, 64, 128,
864, 900, 1, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1280x1024", /* 11: VESA 1024@60 */
108000,
1280, 1688, 48, 112,
1024, 1066, 1, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1280x768", /* 12: W_XGA */
81000,
1280, 1688, 48, 112,
768, 802, 3, 6,
SIS_PL_HSYNCP | SIS_PL_VSYNCN },
{ "1280x768", /* 13: I/O Data W_XGA@56Hz */
76064,
1280, 1688, 48, 112,
768, 802, 2, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1376x768", /* 14: I/O Wide XGA */
87340,
1376, 1808, 32, 128,
768, 806, 3, 6,
SIS_PL_HSYNCN | SIS_PL_VSYNCP },
{ "1280x960", /* 15: VESA 960@60 */
108000,
1280, 1800, 96, 112,
960, 1000, 1, 3,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1400x1050", /* 16: VESA 1050@60Hz */
108000,
1400, 1688, 48, 112,
1050, 1066, 1, 3,
SIS_PL_HSYNCN | SIS_PL_VSYNCN },
{ "1360x768", /* 17: VESA wide (NEC4/2) */
85500,
1360, 1792, 64, 112,
765, 795, 3, 6,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "800x600", /* 18: VESA 600@56 */
36000,
800, 1024, 24, 2,
600, 625, 1, 2,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "1072x600", /* 19: Panasonic 1072x600 (sync?) */
54100,
1072, 1424, 48, 176,
600, 628, 16, 1,
SIS_PL_HSYNCP | SIS_PL_VSYNCP },
{ "848x480", /* 20: Panasonic 848x480 (sync?) */
33070, /* is 852x480, but we can't use 852 */
848, 1068, 20, 40, /* differs from DDC data, better centered */
480, 516, 3, 5, /* won't work assumingly, because data is % 8 */
SIS_PL_HSYNCN | SIS_PL_VSYNCN },
};
static const SiS_PlasmaTables SiS_PlasmaTable[] = {
#if 0 /* Product IDs missing */
{ 0x38a3, 4,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 42VP4/42VP4D/42VP4G/42VP4DG",
11, /* All DVI, except 0, 7, 13 */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
17|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
#endif
#if 0 /* Product IDs missing */
{ 0x38a3, 3,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 42PD1/50PD1/50PD2",
5, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0, 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 42PD3",
10, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 7|0x40, 8|0xc0, 9|0xc0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 2,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 42VM3/61XM1",
11, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 8|0xc0, 9|0xc0,11|0xc0,
17|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 2,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 42MP1/42MP2",
6, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 50MP1",
10, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
#endif
{ 0x38a3, 4,
{ 0xa482, 0xa483, 0x0000, 0x0000, 0x0000 },
{ "PX-42VM", "", "", "", "" },
"NEC PlasmaSync 42MP3/42MP4/50MP2/61MP1",
11, /* All DVI except 0, 7, 13, 17 */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
17|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
#if 0 /* Product IDs missing */
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 3300W",
3,
{ 0|0x40, 1|0xc0,18|0xc0, 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 4200W",
4, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 4210W",
6, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x38a3, 1,
{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"NEC PlasmaSync 5000W",
7, /* DVI entirely unknown */
{ 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,11|0xc0, 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
#endif
{ 0x412f, 2,
{ 0x000c, 0x000b, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"Pioneer 503CMX/PDA-5002",
6, /* DVI unknown */
{ 1|0xc0, 2|0xc0, 9|0xc0,11|0xc0,12|0xc0,15|0xc0, 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x34a9, 1,
{ 0xa00e, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "", "", "", "", "" },
"Panasonic TH-42",
5, /* No DVI output */
{ 1|0x40, 2|0x40, 4|0x40, 9|0x40,15|0x40, 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x34a9, 1,
{ 0xa005, 0x0000, 0x0000, 0x0000, 0x0000 },
{ "TH-42PW*4", "", "", "", "" },
"Panasonic TH-42PW5",
1, /* No special modes otherwise; no DVI. */
{20|0x40,19|0x40, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }
},
{ 0x0000 }
};
USHORT SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
USHORT SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN,
USHORT CustomT, int LCDwith, int LCDheight);
USHORT SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
USHORT SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
void SiS_SetReg(SISIOADDRESS port, USHORT index, USHORT data);
void SiS_SetRegByte(SISIOADDRESS port, USHORT data);
void SiS_SetRegShort(SISIOADDRESS port, USHORT data);
void SiS_SetRegLong(SISIOADDRESS port, ULONG data);
UCHAR SiS_GetReg(SISIOADDRESS port, USHORT index);
UCHAR SiS_GetRegByte(SISIOADDRESS port);
USHORT SiS_GetRegShort(SISIOADDRESS port);
ULONG SiS_GetRegLong(SISIOADDRESS port);
void SiS_SetRegANDOR(SISIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR);
void SiS_SetRegAND(SISIOADDRESS Port,USHORT Index,USHORT DataAND);
void SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR);
void SiS_DisplayOn(SiS_Private *SiS_Pr);
void SiS_DisplayOff(SiS_Private *SiS_Pr);
void SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
void SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
void SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
void SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
USHORT SiS_GetMCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, USHORT *ModeNo, USHORT *ModeIdIndex);
UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
USHORT SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo);
void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT ModeIdIndex);
#ifdef LINUX_XF86
BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch);
BOOLEAN SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
DisplayModePtr mode, BOOLEAN IsCustom);
BOOLEAN SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
DisplayModePtr mode, BOOLEAN IsCustom);
BOOLEAN SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
DisplayModePtr mode, BOOLEAN IsCustom);
int SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber);
BOOLEAN SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_INFO);
USHORT SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
DisplayModePtr SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfordvi);
#else
BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo);
#endif
#ifdef LINUX_KERNEL
int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
unsigned char modeno, unsigned char rateindex);
int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
unsigned char modeno, unsigned char rateindex,
ULONG *left_margin, ULONG *right_margin,
ULONG *left_margin, ULONG *right_margin,
ULONG *upper_margin, ULONG *lower_margin,
ULONG *hsync_len, ULONG *vsync_len,
ULONG *sync, ULONG *vmode);
BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
#endif
extern void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_INFO HwInfo, int chkcrt2mode);
extern void SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_INFO HwInfo);
extern void SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
extern void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_DisableBridge(SiS_Private *, PSIS_HW_INFO);
extern BOOLEAN SiS_SetCRT2Group(SiS_Private *, PSIS_HW_INFO, USHORT);
extern USHORT SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_INFO HwInfo);
extern void SiS_WaitRetrace1(SiS_Private *SiS_Pr);
extern USHORT SiS_GetResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo);
extern BOOLEAN SiS_IsVAMode(SiS_Private *, PSIS_HW_INFO);
extern BOOLEAN SiS_IsDualEdge(SiS_Private *, PSIS_HW_INFO);
#ifdef LINUX_XF86
extern int SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
int *out_sbit, int *out_scale);
extern void SiSCalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned int *vclk);
extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
extern USHORT SiS_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned long VBFlags,
BOOLEAN hcm);
#endif
#endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.4 2000/12/02 01:16:17 dawes Exp $ */
/* $XFree86$ */
/*
* Data and prototypes for init301.c
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
#ifndef _INIT301_
#define _INIT301_
#include "osdef.h"
#include "initdef.h"
#include "vgatypes.h"
#include "vstruct.h"
#ifdef TC
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#endif
#ifdef LINUX_XF86
#include "xf86.h"
#include "xf86Pci.h"
......@@ -24,6 +70,9 @@
#endif
#ifdef LINUX_KERNEL
#ifdef SIS_CP
#undef SIS_CP
#endif
#include <linux/config.h>
#include <linux/version.h>
#include <asm/io.h>
......@@ -35,140 +84,195 @@
#endif
#endif
#ifdef WIN2000
#include <stdio.h>
#include <string.h>
#include <miniport.h>
#include "dderror.h"
#include "devioctl.h"
#include "miniport.h"
#include "ntddvdeo.h"
#include "video.h"
#include "sisv.h"
#endif
const UCHAR SiS_YPbPrTable[3][64] = {
{
0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53,
0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
},
{
0x1d,0x11,0x06,0x09,0x0b,0x0c,0x0c,0x0c,
0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13,
0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8,
0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4b,
0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00
},
{
0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c,
0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
0xed,0x50,0x70,0x9f,0x16,0x59,0x2b,0x13,
0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27,
0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
}
};
#if 0
extern const USHORT SiS_MDA_DAC[];
extern const USHORT SiS_CGA_DAC[];
extern const USHORT SiS_EGA_DAC[];
extern const USHORT SiS_VGA_DAC[];
#endif
const UCHAR SiS_HiTVGroup3_1[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13,
0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10,
0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80,
0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0,
0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e,
0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01
};
const UCHAR SiS_HiTVGroup3_2[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a,
0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10,
0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80,
0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94,
0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64,
0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
};
extern BOOLEAN SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *RomAddr, USHORT *);
/* 301C / 302ELV (?) extended Part2 TV registers */
BOOLEAN SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
BOOLEAN SiS_IsNotM650or651(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsDisableCRT2(SiS_Private *SiS_Pr, USHORT BaseAddr);
BOOLEAN SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_CRT2IsLCD(SiS_Private *SiS_Pr, USHORT BaseAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDefCRT2ExtRegs(SiS_Private *SiS_Pr, USHORT BaseAddr);
USHORT SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT MODEIdIndex,
USHORT RefreshRateTableIndex,USHORT *i,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo);
void SiS_GetCRT2Data(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
#ifdef SIS315H
void SiS_GetCRT2PtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex);
#endif
void SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index, USHORT *ResIndex);
void SiS_GetCRT2Data301(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT BaseAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO );
void SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesData(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
USHORT SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_CalcDelayVB(SiS_Private *SiS_Pr);
USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
void SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
void SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
USHORT SiS_GetVGAHT2(SiS_Private *SiS_Pr);
void SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeIdIndex, USHORT RefreshRateTableIndex,
USHORT BaseAddr, USHORT ModeNo);
void SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup5(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex);
void SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_EnableCRT2(SiS_Private *SiS_Pr);
void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension, int checkcrt2mode);
BOOLEAN SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeInSlave(SiS_Private *SiS_Pr);
void SiS_PresetScratchregister(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetTVSystem(SiS_Private *SiS_Pr);
void SiS_LongWait(SiS_Private *SiS_Pr);
USHORT SiS_GetQueueConfig(SiS_Private *SiS_Pr);
void SiS_VBLongWait(SiS_Private *SiS_Pr);
USHORT SiS_GetVCLKLen(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
void SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetraceDDC(SiS_Private *SiS_Pr);
void SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
#ifdef SIS315H
void SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex);
#endif
void SiS_SetTPData(SiS_Private *SiS_Pr);
void SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
void SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCHTVReg(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex);
void SiS_GetCHTVRegPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex);
void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
#ifdef LINUX_XF86
USHORT SiS_I2C_GetByte(SiS_Private *SiS_Pr);
Bool SiS_I2C_PutByte(SiS_Private *SiS_Pr, USHORT data);
Bool SiS_I2C_Address(SiS_Private *SiS_Pr, USHORT addr);
void SiS_I2C_Stop(SiS_Private *SiS_Pr);
static const UCHAR SiS_Part2CLVX_1[] = {
0x00,0x00,
0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
};
static const UCHAR SiS_Part2CLVX_2[] = {
0x00,0x00,
0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
0x7C,0x1D,0x09,0x7E,0x7C,0x1B,0x0B,0x7E,0x7C,0x19,0x0E,0x7D,0x7C,0x17,0x11,0x7C,
0x7C,0x14,0x14,0x7C,0x7C,0x11,0x17,0x7C,0x7D,0x0E,0x19,0x7C,0x7E,0x0B,0x1B,0x7C,
0x7E,0x09,0x1D,0x7C,0x7F,0x06,0x1F,0x7C,0x7F,0x04,0x20,0x7D,0x00,0x02,0x20,0x7E
};
static const UCHAR SiS_Part2CLVX_3[] = { /* NTSC, 525i, 525p */
0xE0,0x01,
0x04,0x1A,0x04,0x7E,0x03,0x1A,0x06,0x7D,0x01,0x1A,0x08,0x7D,0x00,0x19,0x0A,0x7D,
0x7F,0x19,0x0C,0x7C,0x7E,0x18,0x0E,0x7C,0x7E,0x17,0x10,0x7B,0x7D,0x15,0x12,0x7C,
0x7D,0x13,0x13,0x7D,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0E,0x18,0x7E,
0x7D,0x0C,0x19,0x7E,0x7D,0x0A,0x19,0x00,0x7D,0x08,0x1A,0x01,0x7E,0x06,0x1A,0x02,
0x58,0x02,
0x07,0x14,0x07,0x7E,0x06,0x14,0x09,0x7D,0x05,0x14,0x0A,0x7D,0x04,0x13,0x0B,0x7E,
0x03,0x13,0x0C,0x7E,0x02,0x12,0x0D,0x7F,0x01,0x12,0x0E,0x7F,0x01,0x11,0x0F,0x7F,
0x00,0x10,0x10,0x00,0x7F,0x0F,0x11,0x01,0x7F,0x0E,0x12,0x01,0x7E,0x0D,0x12,0x03,
0x7E,0x0C,0x13,0x03,0x7E,0x0B,0x13,0x04,0x7E,0x0A,0x14,0x04,0x7D,0x09,0x14,0x06,
0x00,0x03,
0x09,0x0F,0x09,0x7F,0x08,0x0F,0x09,0x00,0x07,0x0F,0x0A,0x00,0x06,0x0F,0x0A,0x01,
0x06,0x0E,0x0B,0x01,0x05,0x0E,0x0B,0x02,0x04,0x0E,0x0C,0x02,0x04,0x0D,0x0C,0x03,
0x03,0x0D,0x0D,0x03,0x02,0x0C,0x0D,0x05,0x02,0x0C,0x0E,0x04,0x01,0x0B,0x0E,0x06,
0x01,0x0B,0x0E,0x06,0x00,0x0A,0x0F,0x07,0x00,0x0A,0x0F,0x07,0x00,0x09,0x0F,0x08,
0xFF,0xFF
};
static const UCHAR SiS_Part2CLVX_4[] = { /* PAL */
0x58,0x02,
0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
0x00,0x03,
0x08,0x12,0x08,0x7E,0x07,0x12,0x09,0x7E,0x06,0x12,0x0A,0x7E,0x05,0x11,0x0B,0x7F,
0x04,0x11,0x0C,0x7F,0x03,0x11,0x0C,0x00,0x03,0x10,0x0D,0x00,0x02,0x0F,0x0E,0x01,
0x01,0x0F,0x0F,0x01,0x01,0x0E,0x0F,0x02,0x00,0x0D,0x10,0x03,0x7F,0x0C,0x11,0x04,
0x7F,0x0C,0x11,0x04,0x7F,0x0B,0x11,0x05,0x7E,0x0A,0x12,0x06,0x7E,0x09,0x12,0x07,
0x40,0x02,
0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F,
0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
0xFF,0xFF
};
static const UCHAR SiS_Part2CLVX_5[] = { /* 750p */
0x00,0x03,
0x05,0x19,0x05,0x7D,0x03,0x19,0x06,0x7E,0x02,0x19,0x08,0x7D,0x01,0x18,0x0A,0x7D,
0x00,0x18,0x0C,0x7C,0x7F,0x17,0x0E,0x7C,0x7E,0x16,0x0F,0x7D,0x7E,0x14,0x11,0x7D,
0x7D,0x13,0x13,0x7D,0x7D,0x11,0x14,0x7E,0x7D,0x0F,0x16,0x7E,0x7D,0x0E,0x17,0x7E,
0x7D,0x0C,0x18,0x7F,0x7D,0x0A,0x18,0x01,0x7D,0x08,0x19,0x02,0x7D,0x06,0x19,0x04,
0xFF,0xFF
};
static const UCHAR SiS_Part2CLVX_6[] = { /* 1080i */
0x00,0x04,
0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x1D /* 0x7D? */ ,0x7C,0x0D,0x18,0x7F,
0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
0xFF,0xFF,
};
#ifdef SIS315H
/* 661 et al LCD data structure */
static const UCHAR SiS_LCDStruct661[] = {
/* 1600x1200 */
0x0B,0xEA,0x81,0x10,0x00,0xC0,0x03,0x21,0x5A,0x23,0x5A,0x23,0x02,
0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
/* 1400x1050 */
0x09,0xEA,0x81,0x80,0xA3,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
/* 1280x1024 */
0x03,0xEA,0x81,0x40,0xA1,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
/* 1024x768 */
0x02,0xEA,0x80,0x00,0x11,0x88,0x06,0x0B,0xF5,0x6C,0x35,0x62,0x02,
0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x28,0x10,
0xFF,
};
#endif
void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_EnableCRT2(SiS_Private *SiS_Pr);
USHORT SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
void SiS_WaitRetrace1(SiS_Private *SiS_Pr);
BOOLEAN SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
BOOLEAN SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo);
void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
USHORT ModeIdIndex,PSIS_HW_INFO HwInfo,
int checkcrt2mode);
void SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
void SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo);
USHORT SiS_GetResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
BOOLEAN SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo);
void SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
#ifdef SIS315H
void SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_Chrontel701xOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_ChrontelInitTVVSync(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
#endif /* 315 */
USHORT SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
void SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
USHORT SiS_SetStart(SiS_Private *SiS_Pr);
USHORT SiS_SetStop(SiS_Private *SiS_Pr);
......@@ -178,184 +282,61 @@ USHORT SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
USHORT SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_CheckACK(SiS_Private *SiS_Pr);
USHORT SiS_ReadLCDDDC(SiS_Private *SiS_Pr, USHORT length, unsigned char *buffer);
USHORT SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
USHORT SiS_WriteDABDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareDDC(SiS_Private *SiS_Pr);
void SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
USHORT SiS_DoProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer);
USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
#ifdef LINUX_XF86
USHORT SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
USHORT SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
#endif
#ifdef SIS315H
void SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_OEMLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
USHORT ModeNo,USHORT ModeIdIndex);
void SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
USHORT ModeNo,USHORT ModeIdIndex, USHORT RRTI);
void SiS_FinalizeLCD(SiS_Private *, USHORT, USHORT, PSIS_HW_INFO);
#endif
#ifdef SIS300
void SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo);
void SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTabindex);
void SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
USHORT ModeNo, USHORT ModeIdIndex,USHORT RefTableIndex);
#endif
BOOLEAN SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* void SiS_CHACRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex); */
extern void SiS_SetReg(SISIOADDRESS, USHORT, USHORT);
extern void SiS_SetRegByte(SISIOADDRESS, USHORT);
extern void SiS_SetRegShort(SISIOADDRESS, USHORT);
extern void SiS_SetRegLong(SISIOADDRESS, ULONG);
extern UCHAR SiS_GetReg(SISIOADDRESS, USHORT);
extern UCHAR SiS_GetRegByte(SISIOADDRESS);
extern USHORT SiS_GetRegShort(SISIOADDRESS);
extern ULONG SiS_GetRegLong(SISIOADDRESS);
extern void SiS_SetRegANDOR(SISIOADDRESS Port,USHORT Index,USHORT DataAND,USHORT DataOR);
extern void SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR);
extern void SiS_SetRegAND(SISIOADDRESS Port,USHORT Index,USHORT DataAND);
BOOLEAN SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
void SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
#ifdef SIS315H
void SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
#endif
void SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
#ifdef SIS300
void SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
#ifdef SIS315H
void SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr, USHORT BaseAddr);
#endif
BOOLEAN SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_SetPanelDelay(SiS_Private *SiS_Pr, UCHAR* ROMAddr,PSIS_HW_DEVICE_INFO,USHORT DelayTime);
void SiS_SetPanelDelayLoop(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT DelayTime, USHORT DelayLoop);
void SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_VBWait(SiS_Private *SiS_Pr);
extern void SiS_DisplayOff(SiS_Private *SiS_Pr);
extern void SiS_DisplayOn(SiS_Private *SiS_Pr);
void SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_SearchModeID(SiS_Private *, USHORT *, USHORT *);
extern UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex);
void SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr);
void SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
#ifdef SIS315H
void SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT BaseAddr);
void SiS_Chrontel701xOff(SiS_Private *SiS_Pr);
void SiS_ChrontelResetDB(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething4(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr);
void SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
#ifdef NEWCH701x
void SiS_ChrontelDoSomething5(SiS_Private *SiS_Pr);
#endif
#endif /* 315 */
#if 0
BOOLEAN SiS_IsSomethingCR5F(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
#endif
BOOLEAN SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_IsSR13_CR30(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
extern USHORT SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo);
extern void SiS_SetReg1(USHORT, USHORT, USHORT);
extern void SiS_SetReg3(USHORT, USHORT);
extern UCHAR SiS_GetReg1(USHORT, USHORT);
extern UCHAR SiS_GetReg2(USHORT);
extern BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
extern BOOLEAN SiS_GetRatePtr(SiS_Private *SiS_Pr, ULONG, USHORT);
extern void SiS_SetReg4(USHORT, ULONG);
extern ULONG SiS_GetReg3(USHORT);
extern void SiS_SetReg5(USHORT, USHORT);
extern USHORT SiS_GetReg4(USHORT);
extern void SiS_DisplayOff(SiS_Private *SiS_Pr);
extern void SiS_DisplayOn(SiS_Private *SiS_Pr);
extern UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
extern BOOLEAN SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
extern void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex);
#ifdef SIS315H
extern UCHAR SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
#ifdef LINUX_XF86
/* DDC functions */
USHORT SiS_InitDDCRegs(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
USHORT SiS_WriteDABDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareDDC(SiS_Private *SiS_Pr);
void SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
USHORT SiS_DoProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ReadDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT DDCdatatype, unsigned char *buffer);
USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum,
USHORT DDCdatatype, unsigned char *buffer);
#endif
extern void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO,USHORT ModeNo,
USHORT ModeIdIndex);
const UCHAR SiS_HiVisionTable[3][64] = {
{
0x17, 0x1d, 0x03, 0x09, 0x05, 0x06, 0x0c, 0x0c,
0x94, 0x49, 0x01, 0x0a, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x1b,
0x0c, 0x50, 0x00, 0x97, 0x00, 0xd4, 0x4a, 0x17,
0x7d, 0x05, 0x4b, 0x00, 0x00, 0xe2, 0x00, 0x02,
0x03, 0x0a, 0x65, 0x9d, 0x08, 0x92, 0x8f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x53,
0x00, 0x40, 0x44, 0x00, 0xdb, 0x02, 0x3b, 0x00
},
{
0x1d, 0x1d, 0x06, 0x09, 0x0b, 0x0c, 0x0c, 0x0c,
0x98, 0x0a, 0x01, 0x0d, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f,
0x0c, 0x50, 0xb2, 0x2e, 0x16, 0xb5, 0xf4, 0x03,
0x7d, 0x11, 0x7d, 0xea, 0x30, 0x36, 0x18, 0x96,
0x21, 0x0a, 0x58, 0xee, 0x42, 0x92, 0x0f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x04, 0xf3,
0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00
},
{
0x13, 0x1d, 0xe8, 0x09, 0x09, 0xed, 0x0c, 0x0c,
0x98, 0x0a, 0x01, 0x0c, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f,
0xed, 0x50, 0x70, 0x9f, 0x16, 0x59, 0x2b, 0x13,
0x27, 0x0b, 0x27, 0xfc, 0x30, 0x27, 0x1c, 0xb0,
0x4b, 0x4b, 0x6f, 0x2f, 0x63, 0x92, 0x0f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x2a,
0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00
}
};
const UCHAR SiS_HiTVGroup3_1[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13,
0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10,
0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80,
0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0,
0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e,
0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01
};
const UCHAR SiS_HiTVGroup3_2[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a,
0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10,
0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80,
0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94,
0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64,
0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
};
#endif
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.4 2000/12/02 01:16:17 dawes Exp $ */
/* $XFree86$ */
/*
* Global definitions for init.c and init301.c
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
#ifndef _INITDEF_
#define _INITDEF_
#define SiS300 0x0300
#define SiS540 0x5300
#define SiS630 0x6300
#define SiS730 0x6300
#define IS_SIS330 (HwInfo->jChipType == SIS_330)
#define IS_SIS550 (HwInfo->jChipType == SIS_550)
#define IS_SIS650 (HwInfo->jChipType == SIS_650) /* All versions, incl 651, M65x */
#define IS_SIS740 (HwInfo->jChipType == SIS_740)
#define IS_SIS651 (SiS_Pr->SiS_SysFlags & (SF_Is651 | SF_Is652))
#define IS_SISM650 (SiS_Pr->SiS_SysFlags & (SF_IsM650 | SF_IsM652 | SF_IsM653))
#define IS_SIS65x (IS_SIS651 || IS_SISM650) /* Only special versions of 65x */
#define IS_SIS661 (HwInfo->jChipType == SIS_661)
#define IS_SIS741 (HwInfo->jChipType == SIS_741)
#define IS_SIS660 (HwInfo->jChipType == SIS_660)
#define IS_SIS760 (HwInfo->jChipType == SIS_760)
#define IS_SIS661741660760 (IS_SIS661 || IS_SIS741 || IS_SIS660 || IS_SIS760)
#define IS_SIS650740 ((HwInfo->jChipType >= SIS_650) && (HwInfo->jChipType < SIS_330))
#define IS_SIS550650740 (IS_SIS550 || IS_SIS650740)
#define IS_SIS650740660 (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
#define IS_SIS550650740660 (IS_SIS550 || IS_SIS650740660)
/* SiS_VBType */
#define VB_SIS301 0x0001
......@@ -15,23 +78,41 @@
#define VB_SIS302B 0x0004
#define VB_SIS301LV 0x0008
#define VB_SIS302LV 0x0010
#define VB_SIS30xLV VB_SIS301LV
#define VB_SIS30xNEW VB_SIS302LV
#define VB_SIS302ELV 0x0020
#define VB_SIS301C 0x0040
#define VB_NoLCD 0x8000
#define VB_SIS301BLV302BLV (VB_SIS301B|VB_SIS302B|VB_SIS301LV|VB_SIS302LV)
#define VB_SIS301B302B (VB_SIS301B|VB_SIS302B)
#define VB_SIS301LV302LV (VB_SIS301LV|VB_SIS302LV)
#define IS_SIS650740 ((HwDeviceExtension->jChipType >= SIS_650) && (HwDeviceExtension->jChipType < SIS_330))
#define VB_SIS301BLV302BLV (VB_SIS301B|VB_SIS301C|VB_SIS302B|VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SIS301B302B (VB_SIS301B|VB_SIS301C|VB_SIS302B)
#define VB_SIS301LV302LV (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
#define VB_SISVB (VB_SIS301 | VB_SIS301BLV302BLV)
#define IS_SIS650 (HwDeviceExtension->jChipType == SIS_650)
#define IS_SIS740 (HwDeviceExtension->jChipType == SIS_740)
#define IS_SIS330 (HwDeviceExtension->jChipType == SIS_330)
#define IS_SIS550 (HwDeviceExtension->jChipType == SIS_550)
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
#define SwitchCRT2 0x0002
#define SetCRT2ToAVIDEO 0x0004
#define SetCRT2ToSVIDEO 0x0008
#define SetCRT2ToSCART 0x0010
#define SetCRT2ToLCD 0x0020
#define SetCRT2ToRAMDAC 0x0040
#define SetCRT2ToHiVision 0x0080 /* for SiS bridge */
#define SetCRT2ToCHYPbPr SetCRT2ToHiVision /* for Chrontel */
#define SetNTSCTV 0x0000 /* CR 31 */
#define SetPALTV 0x0100 /* Deprecated here, now in TVMode */
#define SetInSlaveMode 0x0200
#define SetNotSimuMode 0x0400
#define SetNotSimuTVMode SetNotSimuMode
#define SetDispDevSwitch 0x0800
#define SetCRT2ToYPbPr525750 0x0800
#define LoadDACFlag 0x1000
#define DisableCRT2Display 0x2000
#define DriverMode 0x4000
#define HotKeySwitch 0x8000
#define SetCRT2ToLCDA 0x8000
#define CRT1Len 17
#define LVDSCRT1Len 15
#define CHTVRegDataLen 5
/* v-- Needs change in sis_vga.c if changed (GPIO) --v */
#define SetCRT2ToTV (SetCRT2ToYPbPr525750|SetCRT2ToHiVision|SetCRT2ToSCART|SetCRT2ToSVIDEO|SetCRT2ToAVIDEO)
#define SetCRT2ToTVNoYPbPrHiVision (SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
#define SetCRT2ToTVNoHiVision (SetCRT2ToYPbPr525750 | SetCRT2ToSCART | SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)
/* SiS_ModeType */
#define ModeText 0x00
......@@ -59,60 +140,66 @@
#define DoubleScanMode 0x8000
/* Infoflag */
#define SupportAllCRT2 0x0078
#define SupportTV 0x0008
#define SupportHiVisionTV 0x0010
#define SupportLCD 0x0020
#define SupportRAMDAC2 0x0040
#define NoSupportTV 0x0070
#define NoSupportHiVisionTV 0x0060
#define NoSupportLCD 0x0058
#define SupportTV1024 0x0800
#define SupportCHTV 0x0800
#define SupportTV1024 0x0800
#define Support64048060Hz 0x0800 /* Special for 640x480 LCD */
#define SupportHiVision 0x0010
#define SupportYPbPr 0x1000 /* TODO */
#define SupportLCD 0x0020
#define SupportRAMDAC2 0x0040 /* All (<= 100Mhz) */
#define SupportRAMDAC2_135 0x0100 /* All except DH (<= 135Mhz) */
#define SupportRAMDAC2_162 0x0200 /* B, C (<= 162Mhz) */
#define SupportRAMDAC2_202 0x0400 /* C (<= 202Mhz) */
#define InterlaceMode 0x0080
#define SupportHiVisionTV2 0x1000
#define SyncPP 0x0000
#define SyncPN 0x4000
#define SyncNP 0x8000
#define SyncNN 0xc000
#define ECLKindex0 0x0000
#define ECLKindex1 0x0100
#define ECLKindex2 0x0200
#define ECLKindex3 0x0300
#define ECLKindex4 0x0400
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
#define SwitchToCRT2 0x0002
#define SetCRT2ToAVIDEO 0x0004
#define SetCRT2ToSVIDEO 0x0008
#define SetCRT2ToSCART 0x0010
#define SetCRT2ToLCD 0x0020
#define SetCRT2ToRAMDAC 0x0040
#define SetCRT2ToHiVisionTV 0x0080
#define SetCRT2ToTV 0x009C /* alias */
#define SetNTSCTV 0x0000 /* CR 31 */
#define SetPALTV 0x0100
#define SetInSlaveMode 0x0200
#define SetNotSimuMode 0x0400
#define SetNotSimuTVMode 0x0400
#define SetDispDevSwitch 0x0800
#define LoadDACFlag 0x1000
#define SetCHTVOverScan 0x1000 /* TW: Re-defined (from 0x8000) */
#define DisableCRT2Display 0x2000
#define CRT2DisplayFlag 0x2000
#define DriverMode 0x4000
#define HotKeySwitch 0x8000 /* TW: ? */
#define SetCRT2ToLCDA 0x8000
#define PanelRGB18Bit 0x0100
#define PanelRGB24Bit 0x0000
#define TVOverScan 0x10 /* Bit in CR35 (300 series only) */
#define TVOverScanShift 4
#define ClearBufferFlag 0x20
/* CR32 (Newer 630, and 310/325 series)
/* SetFlag */
#define ProgrammingCRT2 0x0001
#define LowModeTests 0x0002
/* #define TVSimuMode 0x0002 - deprecated */
/* #define RPLLDIV2XO 0x0004 - deprecated */
#define LCDVESATiming 0x0008
#define EnableLVDSDDA 0x0010
#define SetDispDevSwitchFlag 0x0020
#define CheckWinDos 0x0040
#define SetDOSMode 0x0080
/* TVMode flag */
#define TVSetPAL 0x0001
#define TVSetNTSCJ 0x0002
#define TVSetPALM 0x0004
#define TVSetPALN 0x0008
#define TVSetCHOverScan 0x0010
#define TVSetYPbPr525i 0x0020
#define TVSetYPbPr525p 0x0040
#define TVSetYPbPr750p 0x0080
#define TVSetHiVision 0x0100 /* = 1080i, software-wise identical */
#define TVSetTVSimuMode 0x0800
#define TVRPLLDIV2XO 0x1000
#define TVSetNTSC1024 0x2000
/* YPbPr flag (>=315, <661) */
#define YPbPr525p 0x0001 /* 525p */
#define YPbPr750p 0x0002 /* 750p */
#define YPbPr525i 0x0004 /* 525p */
#define YPbPrHiVision 0x0008 /* HiVision or 1080i (bridge type dependent) */
#define YPbPrModeMask (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision)
/* SysFlags (to identify special versions) */
#define SF_Is651 0x0001
#define SF_IsM650 0x0002
#define SF_Is652 0x0004
#define SF_IsM652 0x0008
#define SF_IsM653 0x0010
#define SF_IsM661 0x0020
#define SF_IsM741 0x0040
#define SF_IsM760 0x0080
/* CR32 (Newer 630, and 315 series)
[0] VB connected with CVBS
[1] VB connected with SVHS
......@@ -121,9 +208,32 @@
[4] VB connected with CRT2 (secondary VGA)
[5] CRT1 monitor is connected
[6] VB connected with Hi-Vision TV
[7] VB connected with DVI combo connector
[7] <= 330: VB connected with DVI combo connector
>= 661: VB connected to YPbPr
*/
/* CR35 (300 series only) */
#define TVOverScan 0x10
#define TVOverScanShift 4
/* CR35 (661 series only)
[0] 1 = PAL, 0 = NTSC
[1] 1 = NTSC-J (if D0 = 0)
[2] 1 = PALM (if D0 = 1)
[3] 1 = PALN (if D0 = 1)
[4] 1 = Overscan (Chrontel only)
[7:5] (only if D2 in CR38 is set)
000 525i
001 525p
010 750p
011 1080i (or HiVision on 301, 301B)
These bits are being translated to TVMode flag.
*/
/*
CR37
[0] Set 24/18 bit (0/1) RGB to LVDS/TMDS transmitter (set by BIOS)
......@@ -134,11 +244,14 @@
011 LVDS + Tumpion Zurac
100 LVDS + Chrontel 7005
110 Chrontel 7005
310/325 series
315/330 series
001 SiS30x (never seen)
010 LVDS
011 LVDS + Chrontel 7019
660 series [2:1] only:
reserved (now in CR38)
All other combinations reserved
[3] 661 only: Pass 1:1 data
[4] LVDS: 0: Panel Link expands / 1: Panel Link does not expand
30x: 0: Bridge scales / 1: Bridge does not scale = Panel scales (if possible)
[5] LCD polarity select
......@@ -155,36 +268,60 @@
/* CR37: LCDInfo */
#define LCDRGB18Bit 0x0001
#define LCDNonExpanding 0x0010
#define LCDSync 0x0020
#define LCDPass11 0x0100
#define LCDDualLink 0x0200
#define DontExpandLCD LCDNonExpanding
#define LCDNonExpandingShift 4
#define DontExpandLCDShift LCDNonExpandingShift
#define LCDSync 0x0020
#define LCDPass11 0x0100
#define LCDSyncBit 0x00e0
#define LCDSyncShift 6
/* CR38 (310/325 series) */
#define EnableDualEdge 0x01
#define SetToLCDA 0x02 /* LCD channel A (302B/LV and 650+LVDS only) */
#define EnableSiSHiVision 0x04 /* HiVision (HDTV) on SiS bridge */
#define EnableLVDSScart 0x04 /* Scart on Ch7019 (unofficial definition - TW) */
#define EnableLVDSHiVision 0x08 /* YPbPr color format (480i HDTV); only on 650/Ch7019 systems */
#define SiSHiVision1 0x10 /* See SetHiVision() */
#define SiSHiVision2 0x20
/* CR38 (315 series) */
#define EnableDualEdge 0x01
#define SetToLCDA 0x02 /* LCD channel A (301C/302B/30x(E)LV and 650+LVDS only) */
#define EnableCHScart 0x04 /* Scart on Ch7019 (unofficial definition - TW) */
#define EnableCHYPbPr 0x08 /* YPbPr on Ch7019 (480i HDTV); only on 650/Ch7019 systems */
#define EnableSiSYPbPr 0x08 /* Enable YPbPr mode (30xLV/301C only) */
#define EnableYPbPr525i 0x00 /* Enable 525i YPbPr mode (30xLV/301C only) (mask 0x30) */
#define EnableYPbPr525p 0x10 /* Enable 525p YPbPr mode (30xLV/301C only) (mask 0x30) */
#define EnableYPbPr750p 0x20 /* Enable 750p YPbPr mode (30xLV/301C only) (mask 0x30) */
#define EnableYPbPr1080i 0x30 /* Enable 1080i YPbPr mode (30xLV/301C only) (mask 0x30) */
#define EnablePALM 0x40 /* 1 = Set PALM */
#define EnablePALN 0x80 /* 1 = Set PALN */
#define SetSCARTOutput 0x01
#define BoardTVType 0x02
#define EnableNTSCJ EnablePALM /* Not BIOS */
/* CR38 (661 and later)
D[7:5] 000 No VB
001 301 series VB
010 LVDS
011 Chrontel 7019
100 Conexant
D2 Enable YPbPr output (see CR35)
D[1:0] LCDA (like before)
*/
#define EnablePALMN 0x40 /* Romflag: 1 = Allow PALM/PALN */
/* CR39 (650) */
/* CR39 (650 only) */
#define LCDPass1_1 0x01 /* LVDS only; set by driver to pass 1:1 data to LVDS output */
#define Enable302LV_DualLink 0x04 /* 30xNEW (302LV) only; set by mode switching function */
#define Enable302LV_DualLink 0x04 /* 302LV only; enable dual link */
/* CR39 (661 and later)
D[1:0] YPbPr Aspect Ratio
00 4:3 letterbox
01 4:3
10 16:9
11 4:3
*/
/* CR3B (651+301C)
D[1:0] YPbPr Aspect Ratio
?
*/
/* CR79 (310/325 series only)
/* CR79 (315/330 series only; not 661 and later)
[3-0] Notify driver
0001 Mode Switch event (set by BIOS)
0010 Epansion On/Off event
......@@ -202,16 +339,6 @@
[7] TV UnderScan/OverScan (set by BIOS)
*/
/* SetFlag */
#define ProgrammingCRT2 0x01
#define TVSimuMode 0x02
#define RPLLDIV2XO 0x04
#define LCDVESATiming 0x08
#define EnableLVDSDDA 0x10
#define SetDispDevSwitchFlag 0x20
#define CheckWinDos 0x40
#define SetDOSMode 0x80
/* LCDResInfo */
#define Panel300_800x600 0x01 /* CR36 */
#define Panel300_1024x768 0x02
......@@ -220,7 +347,10 @@
#define Panel300_640x480 0x05
#define Panel300_1024x600 0x06
#define Panel300_1152x768 0x07
#define Panel300_320x480 0x08 /* fstn - TW: This is fake, can be any */
#define Panel300_1280x768 0x0a
#define Panel300_320x480 0x0e /* fstn - TW: This is fake, can be any */
#define Panel300_Custom 0x0f
#define Panel300_Barco1366 0x10
#define Panel310_800x600 0x01
#define Panel310_1024x768 0x02
......@@ -231,9 +361,12 @@
#define Panel310_1280x960 0x07
#define Panel310_1152x768 0x08 /* LVDS only */
#define Panel310_1400x1050 0x09
#define Panel310_1280x768 0x0a /* LVDS only */
#define Panel310_1280x768 0x0a
#define Panel310_1600x1200 0x0b
#define Panel310_320x480 0x0c /* fstn - TW: This is fake, can be any */
#define Panel310_640x480_2 0x0c
#define Panel310_640x480_3 0x0d
#define Panel310_320x480 0x0e /* fstn - TW: This is fake, can be any */
#define Panel310_Custom 0x0f
#define Panel_800x600 0x01 /* Unified values */
#define Panel_1024x768 0x02
......@@ -246,23 +379,50 @@
#define Panel_1400x1050 0x09
#define Panel_1280x768 0x0a /* LVDS only */
#define Panel_1600x1200 0x0b
#define Panel_320x480 0x0c /* fstn - TW: This is fake, can be any */
#define ExtChipType 0x0e
#define ExtChip301 0x02
#define ExtChipLVDS 0x04
#define ExtChipTrumpion 0x06
#define ExtChipCH7005 0x08
#define ExtChipMitacTV 0x0a /* TW: Incorrect, 0x0a = Chrontel 7005 only */
#define IsM650 0x80 /* TW: CR5F */
#define LCDDataLen 8
#define HiTVDataLen 12
#define TVDataLen 16
#define SetPALTV 0x0100
#define HalfDCLK 0x1000 /* modeflag */
#define Panel_640x480_2 0x0c
#define Panel_640x480_3 0x0d
#define Panel_320x480 0x0e /* fstn - TW: This is fake, can be any */
#define Panel_Custom 0x0f
#define Panel_Barco1366 0x10
#define Panel_848x480 0x11
#define Panel_1280x800 0x12 /* 661etc: 0x0c */
#define Panel_1680x1050 0x13 /* 661etc: 0x0d */
/* Index in ModeResInfo table */
#define SIS_RI_320x200 0
#define SIS_RI_320x240 1
#define SIS_RI_320x400 2
#define SIS_RI_400x300 3
#define SIS_RI_512x384 4
#define SIS_RI_640x400 5
#define SIS_RI_640x480 6
#define SIS_RI_800x600 7
#define SIS_RI_1024x768 8
#define SIS_RI_1280x1024 9
#define SIS_RI_1600x1200 10
#define SIS_RI_1920x1440 11
#define SIS_RI_2048x1536 12
#define SIS_RI_720x480 13
#define SIS_RI_720x576 14
#define SIS_RI_1280x960 15
#define SIS_RI_800x480 16
#define SIS_RI_1024x576 17
#define SIS_RI_1280x720 18
#define SIS_RI_856x480 19
#define SIS_RI_1280x768 20
#define SIS_RI_1400x1050 21
#define SIS_RI_1152x864 22 /* Up to this SiS conforming */
#define SIS_RI_848x480 23
#define SIS_RI_1360x768 24
#define SIS_RI_1024x600 25
#define SIS_RI_1152x768 26
#define SIS_RI_768x576 27
#define SIS_RI_1360x1024 28
/* CR5F */
#define IsM650 0x80
/* Timing data */
#define NTSCHT 1716
#define NTSC2HT 1920
#define NTSCVT 525
......@@ -275,37 +435,45 @@
#define ExtHiTVHT 2100
#define ExtHiTVVT 1125
#define VCLKStartFreq 25
#define SoftDramType 0x80
#define VCLK40 0x04 /* Index in VCLKData array */
#define VCLK65 0x09 /* Index in VCLKData array */
#define VCLK108_2 0x14 /* Index in VCLKData array */
#define TVVCLKDIV2 0x21 /* Indices in (VB)VCLKData arrays */
#define TVVCLK 0x22
#define HiTVVCLKDIV2 0x23
#define HiTVVCLK 0x24
#define HiTVSimuVCLK 0x25
#define HiTVTextVCLK 0x26
#define LoadDACFlag 0x1000
#define AfterLockCRT2 0x4000
#define SetCRT2ToAVIDEO 0x0004
#define SetCRT2ToSCART 0x0010
#define Ext2StructSize 5
/* Indices in (VB)VCLKData tables */
#define VCLK28 0x00 /* Index in VCLKData table (300 and 315) */
#define VCLK40 0x04 /* Index in VCLKData table (300 and 315) */
#define VCLK65_300 0x09 /* Index in VCLKData table (300) */
#define VCLK108_2_300 0x14 /* Index in VCLKData table (300) */
#define VCLK81_300 0x3f /* Index in VCLKData table (300) */
#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 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) */
#define VCLK162_315 0x21 /* Index in (VB)VCLKData table (315) */
#define VCLK108_3_315 0x45 /* Index in VBVCLKData table (315) */
#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */
#define VCLK34_315 0x55 /* Index in VBVCLKData table (315) */
#define VCLK68_315 0x0d
#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) */
#define TVVCLKDIV2 0x00 /* Index relative to TVCLKBASE */
#define TVVCLK 0x01 /* Index relative to TVCLKBASE */
#define HiTVVCLKDIV2 0x02 /* Index relative to TVCLKBASE */
#define HiTVVCLK 0x03 /* Index relative to TVCLKBASE */
#define HiTVSimuVCLK 0x04 /* Index relative to TVCLKBASE */
#define HiTVTextVCLK 0x05 /* Index relative to TVCLKBASE */
#define YPbPr750pVCLK 0x0f /* NOT relative to TVCLKBASE ! */
/* ------------------------------ */
#define SetSCARTOutput 0x01
#define AVIDEOSense 0x01
#define SVIDEOSense 0x02
#define SCARTSense 0x04
#define LCDSense 0x08
#define Monitor1Sense 0x20
#define Monitor2Sense 0x10
#define HiTVSense 0x40
#define BoardTVType 0x02
#define HotPlugFunction 0x08
#define StStructSize 0x06
#define SIS_VIDEO_CAPTURE 0x00 - 0x30
#define SIS_VIDEO_PLAYBACK 0x02 - 0x30
#define SIS_CRT2_PORT_04 0x04 - 0x30
#define SIS_CRT2_PORT_10 0x10 - 0x30
#define SIS_CRT2_PORT_12 0x12 - 0x30
......@@ -318,8 +486,11 @@
#define ADR_CHTVVCLKPtr 0x216
#define ADR_CHTVRegDataPtr 0x218
#define LCDDataLen 8
#define HiTVDataLen 12
#define TVDataLen 16
#define LVDSDataLen 6
#define EnableLVDSDDA 0x10
#define LVDSDesDataLen 3
#define ActiveNonExpanding 0x40
#define ActiveNonExpandingShift 6
......@@ -330,8 +501,6 @@
#define SoftSettingAddr 0x52
#define ModeSettingAddr 0x53
#define SelectCRT1Rate 0x4
#define _PanelType00 0x00
#define _PanelType01 0x08
#define _PanelType02 0x10
......@@ -350,7 +519,8 @@
#define _PanelType0F 0x78
#define PRIMARY_VGA 0 /* 1: SiS is primary vga 0:SiS is secondary vga */
#define BIOSIDCodeAddr 0x235 /* TW: Offsets to ptrs in BIOS image */
#define BIOSIDCodeAddr 0x235 /* Offsets to ptrs in BIOS image */
#define OEMUtilIDCodeAddr 0x237
#define VBModeIDTableAddr 0x239
#define OEMTVPtrAddr 0x241
......@@ -393,7 +563,7 @@
/*
=============================================================
for 310/325 series
for 315 series
=============================================================
*/
#define SoftDRAMType 0x80
......
/* OEM Data for 300 series */
/* $XFree86$ */
/*
* OEM Data for 300 series
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
const UCHAR SiS300_OEMTVDelay301[8][4] =
{
......@@ -245,140 +296,124 @@ const UCHAR SiS300_OEMLCDDelay3[64][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20}
};
const UCHAR SiS300_Phase1[8][6][4] =
const UCHAR SiS300_Phase1[8][5][4] =
{
{
{0x21,0xed,0x00,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0xff,0xff,0xff,0xff}
{0x21,0xed,0x8a,0x08}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x21,0xed,0x00,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0xff,0xff,0xff,0xff}
{0x21,0xed,0x8a,0x08}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
}
};
const UCHAR SiS300_Phase2[8][6][4] =
const UCHAR SiS300_Phase2[8][5][4] =
{
{
{0x21,0xed,0x00,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0xff,0xff,0xff,0xff}
{0x21,0xed,0x8a,0x08}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x21,0xed,0x00,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0x21,0xed,0x8a,0x08},
{0xff,0xff,0xff,0xff}
{0x21,0xed,0x8a,0x08}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
},
{
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0x2a,0x05,0xd3,0x00},
{0xff,0xff,0xff,0xff}
{0x2a,0x05,0xd3,0x00}
}
};
......@@ -680,325 +715,147 @@ const UCHAR SiS300_Filter2[10][9][7] =
}
};
const UCHAR SiS300_LCDHData[24][11][5] = {
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
/* Custom data for Barco iQ Pro R300 */
const UCHAR barco_p1[2][9][7][3] = {
{
{ { 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x19, 0x00 }
},
{
{ 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x1e, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x16, 0x00 }
},
{
{ 0x16, 0xcf, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x19, 0x00 },
{ 0, 0, 0 }
},
{
{ 0, 0, 0 }
},
{
{ 0x16, 0xcf, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x1e, 0x00 },
{ 0, 0, 0 }
},
{
{ 0x16, 0xd1, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x11, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x26, 0x00 }
},
{
{ 0x16, 0xd1, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x30, 0x00 },
{ 0, 0, 0 }
},
{
{ 0x16, 0x00, 0x00 },
{ 0x17, 0xa0, 0x00 },
{ 0x1a, 0xa0, 0x00 },
{ 0x1b, 0x2a, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0, 0, 0 }
},
{
{ 0x16, 0x00, 0x00 },
{ 0x17, 0xaa, 0x00 },
{ 0x1a, 0xa0, 0x00 },
{ 0x1b, 0x2a, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0, 0, 0 }
}
},
{
{
{ 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x19, 0x00 }
},
{
{ 0, 0, 0 }
},
{
{ 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x19, 0x00 },
},
{
{ 0, 0, 0 }
},
{
{ 0x16, 0xcf, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe7, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x1e, 0x00 }
},
{
{ 0x16, 0xd1, 0x00 },
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe6, 0x00 },
{ 0x1b, 0x11, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x26, 0x00 }
},
{
{ 0x18, 0x00, 0x00 },
{ 0x1a, 0xe0, 0x00 },
{ 0x1b, 0x26, 0x00 },
{ 0x1c, 0xff, 0x00 },
{ 0x1d, 0x1c, 0x00 },
{ 0x1e, 0x30, 0x00 },
{ 0, 0, 0 }
},
{
{ 0, 0, 0 }
},
{
{ 0, 0, 0 }
}
}
};
#if 0
const UCHAR SiS300_LCDVData[24][11][6] = {
{
{
},
};
#endif
/* $XFree86$ */
/*
* OEM Data for 315/330 series
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
/* OEM Data for 310/325/330 series */
const UCHAR SiS310_LCDDelayCompensation_301[] = /* 301 */
static const UCHAR SiS310_LCDDelayCompensation_301[] = /* 301 */
{
0x00,0x00,0x00, /* 800x600 */
0x0b,0x0b,0x0b, /* 1024x768 */
......@@ -21,7 +72,7 @@ const UCHAR SiS310_LCDDelayCompensation_301[] = /* 301 */
};
/* This is contained in 650+301B BIOSes, but it is wrong - so we don't use it */
UCHAR SiS310_LCDDelayCompensation_650301B[] = /* 30xB,LV */
static const UCHAR SiS310_LCDDelayCompensation_650301LV[] = /* 650 + 30xLV */
{
0x01,0x01,0x01, /* 800x600 */
0x01,0x01,0x01, /* 1024x768 */
......@@ -40,67 +91,9 @@ UCHAR SiS310_LCDDelayCompensation_650301B[] = /* 30xB,LV */
0x02,0x02,0x02
};
/* This data is correct, so we use it instead of the table above */
UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB,LV */
{
0x01,0x01,0x01, /* 800x600 */
0x0C,0x0C,0x0C, /* 1024x768 */
0x0C,0x0C,0x0C, /* 1280x1024 */
0x08,0x08,0x08, /* 640x480 */
0x0C,0x0C,0x0C, /* 1024x600 (guessed) */
0x0C,0x0C,0x0C, /* 1152x864 (guessed) */
0x0C,0x0C,0x0C, /* 1280x960 (guessed) */
0x0C,0x0C,0x0C, /* 1152x768 (guessed) */
0x0C,0x0C,0x0C, /* 1400x1050 (guessed) */
0x0C,0x0C,0x0C, /* 1280x768 (guessed) */
0x0C,0x0C,0x0C, /* 1600x1200 (guessed) */
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02
};
const UCHAR SiS310_LCDDelayCompensation_LVDS650[] = /* LVDS */
{
0x00,0x00,0x00, /* 800x600 */
0x00,0x00,0x00, /* 1024x768 */
0x00,0x00,0x00, /* 1280x1024 */
0x00,0x00,0x00, /* 640x480 (unknown) */
0x00,0x00,0x00, /* 1024x600 (unknown) */
0x00,0x00,0x00, /* 1152x864 (unknown) */
0x00,0x00,0x00, /* 1280x960 (guessed) */
0x00,0x00,0x00, /* 1152x768 (unknown) */
0x00,0x00,0x00, /* 1400x1050 */
0x00,0x00,0x00, /* 1280x768 (guessed) */
0x00,0x00,0x00, /* 1600x1200 */
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00
};
const UCHAR SiS310_LCDDelayCompensation_LVDS740[] = /* LVDS */
{
0x03,0x03,0x03, /* 800x600 */
0x03,0x03,0x03, /* 1024x768 */
0x03,0x03,0x03, /* 1280x1024 */
0x03,0x03,0x03, /* 640x480 (unknown) */
0x03,0x03,0x03, /* 1024x600 (unknown) */
0x03,0x03,0x03, /* 1152x864 (unknown) */
0x03,0x03,0x03, /* 1280x960 (guessed) */
0x03,0x03,0x03, /* 1152x768 (unknown) */
0x03,0x03,0x03, /* 1400x1050 */
0x03,0x03,0x03, /* 1280x768 (guessed) */
0x03,0x03,0x03, /* 1600x1200 */
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00
};
const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
static const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
{
0x33,0x33,0x33, /* 800x600 (guessed) */
0x33,0x33,0x33, /* 800x600 (guessed) - new: PanelType, not PanelRes ! */
0x33,0x33,0x33, /* 1024x768 */
0x33,0x33,0x33, /* 1280x1024 */
0x33,0x33,0x33, /* 640x480 (unknown) */
......@@ -117,7 +110,7 @@ const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
0x33,0x33,0x33
};
const UCHAR SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV */
static const UCHAR SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV */
{
0x33,0x33,0x33, /* 800x600 (guessed) */
0x33,0x33,0x33, /* 1024x768 */
......@@ -136,66 +129,111 @@ const UCHAR SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV */
0x33,0x33,0x33
};
const UCHAR SiS310_TVDelayCompensation_301[] = /* 301 */
static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB,LV */
{
0x01,0x01,0x01, /* 800x600 */
0x0C,0x0C,0x0C, /* 1024x768 */
0x0C,0x0C,0x0C, /* 1280x1024 */
0x08,0x08,0x08, /* 640x480 */
0x0C,0x0C,0x0C, /* 1024x600 (guessed) */
0x0C,0x0C,0x0C, /* 1152x864 (guessed) */
0x0C,0x0C,0x0C, /* 1280x960 (guessed) */
0x0C,0x0C,0x0C, /* 1152x768 (guessed) */
0x0C,0x0C,0x0C, /* 1400x1050 (guessed) */
0x0C,0x0C,0x0C, /* 1280x768 (guessed) */
0x0C,0x0C,0x0C, /* 1600x1200 (guessed) */
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02
};
static const UCHAR SiS310_TVDelayCompensation_301[] = /* 301 */
{
0x02,0x02, /* NTSC Enhanced, Standard */
0x02,0x02, /* PAL */
0x08,0x0b /* HiVision */
};
const UCHAR SiS310_TVDelayCompensation_301B[] = /* 30xB, 30xLV */
static const UCHAR SiS310_TVDelayCompensation_301B[] = /* 30xB, 30xLV */
{
0x03,0x03,
0x03,0x03,
0x03,0x03
};
const UCHAR SiS310_TVDelayCompensation_740301B[] = /* 740 + 30xB (30xLV?) */
static const UCHAR SiS310_TVDelayCompensation_740301B[] = /* 740 + 30xB (30xLV?) */
{
0x05,0x05,
0x05,0x05,
0x05,0x05
};
const UCHAR SiS310_TVDelayCompensation_LVDS[] = /* LVDS */
static const UCHAR SiS310_TVDelayCompensation_LVDS[] = /* LVDS */
{
0x0a,0x0a,
0x0a,0x0a,
0x0a,0x0a
};
const UCHAR SiS310_TVDelayCompensation_651301LV[] = /* M650, 651, 301LV */
static const UCHAR SiS310_TVDelayCompensation_651301LV[] = /* M650, 651, 301LV */
{
0x33,0x33,
0x33,0x33,
0x33,0x33
};
const UCHAR SiS310_TVDelayCompensation_651302LV[] = /* M650, 651, 302LV */
static const UCHAR SiS310_TVDelayCompensation_651302LV[] = /* M650, 651, 302LV */
{
0x33,0x33,
0x33,0x33,
0x33,0x33
};
const UCHAR SiS310_TVAntiFlick1[3][2] =
static const UCHAR SiS_TVDelay661_301[] = /* 661, 301 */
{
0x44,0x44,
0x44,0x44,
0x00,0x00,
0x44,0x44,
0x44,0x44,
0x44,0x44
};
static const UCHAR SiS_TVDelay661_301B[] = /* 661, 301B et al */
{
0x44,0x44,
0x44,0x44,
0x00,0x00,
0x44,0x44,
0x44,0x44,
0x44,0x44
};
static const UCHAR SiS310_TVAntiFlick1[6][2] =
{
{0x4,0x0},
{0x4,0x8},
{0x0,0x0},
{0x0,0x0},
{0x0,0x0},
{0x0,0x0}
};
const UCHAR SiS310_TVEdge1[3][2] =
static const UCHAR SiS310_TVEdge1[6][2] =
{
{0x0,0x4},
{0x0,0x4},
{0x0,0x0},
{0x0,0x0},
{0x0,0x0},
{0x0,0x0}
};
const UCHAR SiS310_TVYFilter1[3][8][4] =
static const UCHAR SiS310_TVYFilter1[5][8][4] =
{
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38}, /* NTSC */
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xf1,0x04,0x1f,0x18},
......@@ -205,7 +243,7 @@ const UCHAR SiS310_TVYFilter1[3][8][4] =
{0xeb,0x15,0x25,0xf6}
},
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38}, /* PAL */
{0x00,0xf4,0x10,0x38},
{0xf1,0xf7,0x1f,0x32},
{0xf3,0x00,0x1d,0x20},
......@@ -215,7 +253,7 @@ const UCHAR SiS310_TVYFilter1[3][8][4] =
{0xfc,0xfb,0x14,0x2a}
},
{
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00}, /* HiVision */
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
......@@ -223,13 +261,33 @@ const UCHAR SiS310_TVYFilter1[3][8][4] =
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xee,0x0c,0x22,0x08}
},
{
{0x00,0xf4,0x10,0x38}, /* PAL-M */
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x10,0x18},
{0xf7,0x06,0x19,0x14},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x15,0x25,0xf6}
},
{
{0x00,0xf4,0x10,0x38}, /* PAL-N */
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x10,0x18},
{0xf7,0x06,0x19,0x14},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x15,0x25,0xf6}
}
};
const UCHAR SiS310_TVYFilter2[3][9][7] =
static const UCHAR SiS310_TVYFilter2[5][9][7] =
{
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* NTSC */
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -240,7 +298,7 @@ const UCHAR SiS310_TVYFilter2[3][9][7] =
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
},
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL */
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -251,6 +309,7 @@ const UCHAR SiS310_TVYFilter2[3][9][7] =
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
},
{
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}, /* HiVision */
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
......@@ -259,53 +318,9 @@ const UCHAR SiS310_TVYFilter2[3][9][7] =
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22},
{0x00,0x00,0x00,0xF4,0xFF,0x1C,0x22}
}
};
const UCHAR SiS310_PALMFilter[16][4] =
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x10,0x18},
{0xf7,0x06,0x19,0x14},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x15,0x25,0xf6},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18}
};
const UCHAR SiS310_PALNFilter[16][4] =
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x10,0x18},
{0xf7,0x06,0x19,0x14},
{0x00,0xf4,0x10,0x38},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x15,0x25,0xf6},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18}
};
const UCHAR SiS310_PALMFilter2[9][7] =
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
},
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL-M */
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -314,11 +329,9 @@ const UCHAR SiS310_PALMFilter2[9][7] =
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0x01,0x01,0xFC,0xF8,0x08,0x26,0x38},
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
};
const UCHAR SiS310_PALNFilter2[9][7] =
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
},
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46}, /* PAL-N */
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -327,9 +340,10 @@ const UCHAR SiS310_PALNFilter2[9][7] =
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0x01,0x01,0xFC,0xF8,0x08,0x26,0x38},
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
}
};
const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
static const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
{
{
{0x21,0xed,0xba,0x08},
......@@ -345,15 +359,15 @@ const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
}
};
const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
static const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
{
{
{0x21,0xf0,0x7b,0xd6}, /* 1.10.7w; 1.10.6s: {0x1e,0x8b,0xda,0xa7}, old: {0x21,0xF1,0x37,0x56} */
{0x21,0xf0,0x7b,0xd6} /* 1.10.7w; 1.10.6s: {0x1e,0x8b,0xda,0xa7} old: {0x21,0xF1,0x37,0x56} */
{0x21,0xf0,0x7b,0xd6},
{0x21,0xf0,0x7b,0xd6}
},
{
{0x2a,0x0a,0x41,0xe9}, /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9}, */
{0x2a,0x0a,0x41,0xe9} /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9} */
{0x2a,0x0a,0x41,0xe9},
{0x2a,0x0a,0x41,0xe9}
},
{
{0x2a,0x05,0xd3,0x00},
......@@ -361,5 +375,239 @@ const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
}
};
static const UCHAR SiS661_TVPhase[] = {
0x21,0xED,0xBA,0x08,
0x2A,0x05,0xE3,0x00,
0x21,0xE4,0x2E,0x9B,
0x21,0xF4,0x3E,0xBA,
0x1E,0x8B,0xA2,0xA7,
0x1E,0x83,0x0A,0xE0,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x21,0xF0,0x7B,0xD6,
0x2A,0x09,0x86,0xE9,
0x21,0xE6,0xEF,0xA4,
0x21,0xF6,0x94,0x46,
0x1E,0x8B,0xA2,0xA7,
0x1E,0x83,0x0A,0xE0,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};
/**************************************************************/
/* CUSTOM TIMING DATA --------------------------------------- */
/**************************************************************/
/* Inventec / Compaq Presario 3045US, 3017 */
static const SiS_LCDDataStruct SiS310_ExtCompaq1280x1024Data[] =
{
{ 211, 60,1024, 501,1688,1066},
{ 211, 60,1024, 508,1688,1066},
{ 211, 60,1024, 501,1688,1066},
{ 211, 60,1024, 508,1688,1066},
{ 32, 15,1696, 501,1696,1066},
{ 212, 75,1024, 621,1696,1066},
{ 4, 3,1696, 810,1696,1066},
{ 1, 1,1696,1066,1696,1066}
};
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_1[] =
{
{{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x35,0x1B,0xA0,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x45,0x1C,0x20,0x3F,0xFF,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x49,0x1C,0x40,0x7F,0xFF,0xAD,0x23,0x0A,0x07,0xF3,0x8A,0x12}},
{{0x4C,0x1C,0x18,0x2F,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
};
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_2[] =
{
{{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
{{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
{{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
{{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
{{0x33,0x13,0x01,0x0D,0xFD,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
{{0x3F,0x1B,0x3D,0x49,0x39,0x54,0x23,0xC0,0x27,0x66,0x30,0x42}},
{{0x33,0x1B,0x91,0x9D,0x8D,0x8C,0x23,0xF8,0x27,0x9E,0x68,0x42}},
{{0x43,0x24,0x11,0x1D,0x0D,0xCC,0x23,0x38,0x37,0xDE,0xA8,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xEA,0x23,0x0A,0x07,0x32,0xC6,0x42}}
};
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_3[] =
{
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}}
};
/* LCDA CRT2 data is std */
static const SiS_LVDSDesStruct Compaq1280x1024Des_1[] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
static const SiS_LVDSDesStruct Compaq1280x1024Des_2[] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
/* Clevo L285/287 (dual-link 1024x768) */
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_1[] =
{
{{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x2C,0x12,0x9A,0xAE,0x88,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x38,0x13,0x16,0x0C,0xE6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
};
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_2[] =
{
{{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
{{0x2C,0x12,0x38,0x55,0x2F,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
{{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
{{0x2C,0x12,0x38,0x55,0x2F,0xE0,0x12,0xB1,0x47,0x30,0x71,0x33}},
{{0x2D,0x12,0x79,0x96,0x70,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
{{0x29,0x12,0xB5,0xD2,0xAC,0xF4,0x12,0xD9,0x47,0x44,0x99,0x33}},
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
#if 0
{{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
{{0x2C,0x12,0x38,0x55,0x2F,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
{{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
{{0x2C,0x12,0x38,0x55,0x2F,0xC1,0x35,0xB1,0x47,0xE9,0x71,0x33}},
{{0x2D,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
{{0x29,0x12,0xB5,0xD2,0xAC,0xE9,0x35,0xD9,0x47,0x11,0x99,0x33}},
{{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
#endif
};
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_3[] =
{
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}}, /* Corrected */
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
{{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x25,0x13,0xC9,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
};
/* CRT2 data is std */
static const SiS_LVDSDesStruct Clevo1024x768Des_1[] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
static const SiS_LVDSDesStruct Clevo1024x768Des_2[] =
{
{ 1184, 622 },
{ 1184, 597 },
{ 1184, 622 },
{ 1184, 597 },
{ 1152, 622 },
{ 1232, 722 },
{ 0, 0 }
};
/* Asus A2xxxH _2 */
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Asus1024x768_3[] =
{
{{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
{{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
{{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
{{0x38,0x13,0x16,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
};
static const SiS_LVDSDesStruct Asus1024x768Des_1[] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 }
};
static const SiS_LVDSDesStruct Asus1024x768Des_2[] =
{
{ 1184, 622 },
{ 1184, 597 },
{ 1184, 622 },
{ 1184, 597 },
{ 1152, 622 },
{ 1232, 722 },
{ 0, 0 }
};
/* CRT2 data is std */
/* Uniwill N243S9, ECS A928 */
static const SiS_LVDSDesStruct Uniwill1024x768Des_1[] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 805 }
};
static const SiS_LVDSDesStruct Uniwill1024x768Des_2[] =
{
{ 1184, 622 },
{ 1184, 597 },
{ 1184, 622 },
{ 1184, 597 },
{ 1152, 650 },
{ 1232, 722 },
{ 0, 805 },
};
/* #define WINCE_HEADER */
/* #define WIN2000 */
/* #define TC */
/* $XFree86$ */
/*
* OS depending defines
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
* Silicon Integrated Systems, Inc. (used by permission)
*
*/
/* The choices are: */
#define LINUX_KERNEL /* Kernel framebuffer */
/* #define LINUX_XF86 */ /* XFree86 */
/**********************************************************************/
#ifdef LINUX_KERNEL
#include <linux/config.h>
#include <linux/version.h>
#ifdef CONFIG_FB_SIS_300
#define SIS300
#endif
#ifdef CONFIG_FB_SIS_315
#define SIS315H
#endif
#if 1
#define SISFBACCEL /* Include 2D acceleration */
#endif
#if 1
#define SISFB_PAN /* Include Y-Panning code */
#endif
#else
/* #define SIS300*/
#define SIS315H
#endif
#ifdef LINUX_XF86
#define SIS300
/* #define SIS315H */ /* TW: done above */
#endif
#ifdef LINUX_KERNEL /* -------------------------- */
#include <linux/config.h>
#include <linux/version.h>
/**********************************************************************/
#ifdef TC
#endif
#ifdef WIN2000
#endif
#ifdef WINCE_HEADER
#endif
#ifdef LINUX_XF86
#endif
#ifdef LINUX_KERNEL
#endif
/**********************************************************************/
#ifdef TC
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
#ifdef CONFIG_FB_SIS_300
#define SIS300
#endif
#ifdef WIN2000
#define SiS_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value);
#ifdef CONFIG_FB_SIS_315
#define SIS315H
#endif
#ifdef WINCE_HEADER
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
#if 1
#define SISFBACCEL /* Include 2D acceleration */
#endif
#ifdef LINUX_XF86
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#endif
#ifdef LINUX_KERNEL
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#ifdef LINUX_XF86 /* ----------------------------- */
#define SIS300
#define SIS315H
#endif
/**********************************************************************/
/**********************************************************************/
#ifdef TC
#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
#endif
#ifdef WIN2000
#define SiS_MemoryCopy(Destination,Soruce,Length) /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/
#endif
#ifdef WINCE_HEADER
#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
#endif
#ifdef LINUX_XF86
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
#endif
#ifdef LINUX_KERNEL
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
#endif
......@@ -103,19 +119,6 @@
#undef InPortLong
#endif /* InPortLong */
/**********************************************************************/
/* TC */
/**********************************************************************/
#ifdef TC
#define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v))
#define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v))
#define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v))
#define InPortByte(p) inp((unsigned short)(p))
#define InPortWord(p) inp((unsigned short)(p))
#define InPortLong(p) ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p)))
#endif
/**********************************************************************/
/* LINUX XF86 */
/**********************************************************************/
......@@ -142,29 +145,4 @@
#define InPortLong(p) inl((u16)(p))
#endif
/**********************************************************************/
/* WIN 2000 */
/**********************************************************************/
#ifdef WIN2000
#define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v))
#define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v))
#define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v))
#define InPortByte(p) VideoPortReadPortUchar ((PUCHAR) (p))
#define InPortWord(p) VideoPortReadPortUshort ((PUSHORT) (p))
#define InPortLong(p) VideoPortReadPortUlong ((PULONG) (p))
#endif
/**********************************************************************/
/* WIN CE */
/**********************************************************************/
#ifdef WINCE_HEADER
#define OutPortByte(p,v) WRITE_PORT_UCHAR ((PUCHAR) (p), (UCHAR) (v))
#define OutPortWord(p,v) WRITE_PORT_USHORT((PUSHORT) (p), (USHORT) (v))
#define OutPortLong(p,v) WRITE_PORT_ULONG ((PULONG) (p), (ULONG) (v))
#define InPortByte(p) READ_PORT_UCHAR ((PUCHAR) (p))
#define InPortWord(p) READ_PORT_USHORT ((PUSHORT) (p))
#define InPortLong(p) READ_PORT_ULONG ((PULONG) (p))
#endif
/*
* SiS 300/630/730/540/315/550/650/740 frame buffer driver
* for Linux kernels 2.4.x and 2.5.x
* SiS 300/630/730/540/315/550/65x/74x/330/760 frame buffer driver
* for Linux kernels 2.4.x and 2.6.x
*
* 2D acceleration part
*
* Based on the X driver's sis300_accel.c which is
* Copyright Xavier Ducoin <x.ducoin@lectra.com>
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the named License,
* or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Based on the XFree86 driver's sis300_accel.c which is
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* and sis310_accel.c which is
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
* (see http://www.winischhofer.net/
......@@ -114,20 +127,14 @@ static const unsigned char myrops[] = {
};
#endif
/* 300 series */
/* 300 series ----------------------------------------------------- */
#ifdef CONFIG_FB_SIS_300
static void
SiS300Sync(void)
{
SiS300Idle
}
static void
SiS310Sync(void)
{
SiS310Idle
}
static void
SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
unsigned int planemask, int trans_color)
......@@ -210,8 +217,16 @@ SiS300SubsequentSolidFillRect(int x, int y, int w, int h)
SiS300SetupCMDFlag(X_INC | Y_INC | BITBLT)
SiS300DoCMD
}
#endif
/* 310/325 series ------------------------------------------------ */
/* 315/330 series ------------------------------------------------- */
#ifdef CONFIG_FB_SIS_315
static void
SiS310Sync(void)
{
SiS310Idle
}
static void
SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
......@@ -230,7 +245,7 @@ SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
/* SiSSetupCMDFlag(BITBLT | SRCVIDEO) */
}
SiS310SetupCMDFlag(ivideo.SiS310_AccelDepth)
/* TW: The 310/325 series is smart enough to know the direction */
/* The 315 series is smart enough to know the direction */
}
static void
......@@ -306,6 +321,7 @@ SiS310SubsequentSolidFillRect(int x, int y, int w, int h)
SiS310SetupCMDFlag(BITBLT)
SiS310DoCMD
}
#endif
/* --------------------------------------------------------------------- */
......@@ -322,22 +338,33 @@ int sisfb_initaccel(void)
void sisfb_syncaccel(void)
{
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
SiS310Sync();
#endif
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) /* --- KERNEL 2.5.34 and later --- */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* --------------- 2.5 --------------- */
int fbcon_sis_sync(struct fb_info *info)
{
if(!sisfb_accel) return 0;
CRITFLAGS
if(!ivideo.accel)
return 0;
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
SiS310Sync();
#endif
}
CRITEND
return 0;
......@@ -352,32 +379,36 @@ void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
if(!rect->width || !rect->height)
return;
if(!sisfb_accel) {
if(!ivideo.accel) {
cfb_fillrect(info, rect);
return;
}
switch(info->var.bits_per_pixel) {
case 8: col = rect->color;
break;
case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
}
case 8: col = rect->color;
break;
case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
}
if(sisvga_engine == SIS_300_VGA) {
CRITBEGIN
SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS300Sync();
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS300Sync();
#endif
} else {
CRITBEGIN
SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS310Sync();
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS310Sync();
#endif
}
}
......@@ -388,7 +419,7 @@ void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
CRITFLAGS
TWDEBUG("Inside sis_copyarea");
if(!sisfb_accel) {
if(!ivideo.accel) {
cfb_copyarea(info, area);
return;
}
......@@ -402,23 +433,27 @@ void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
else ydir = 1;
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS300SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
CRITEND
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS310SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
CRITEND
SiS310Sync();
#endif
}
}
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33) /* ------ KERNEL <2.5.34 ------ */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) /* -------------- 2.4 --------------- */
void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
int dsty, int dstx, int height, int width)
......@@ -460,25 +495,28 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
else ydir = 1;
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS300SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
CRITEND
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
CRITEND
SiS310Sync();
#if 0
#if 0
printk(KERN_INFO "sis_bmove sx %d sy %d dx %d dy %d w %d h %d\n",
srcx, srcy, dstx, dsty, width, height);
#endif
#endif
#endif
}
}
static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width, int color)
{
......@@ -490,17 +528,21 @@ static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
height *= fontheight(p);
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(color, 3, 0);
SiS300SubsequentSolidFillRect(srcx, srcy, width, height);
CRITEND
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(color, 3, 0);
SiS310SubsequentSolidFillRect(srcx, srcy, width, height);
CRITEND
SiS310Sync();
#endif
}
}
......@@ -575,54 +617,58 @@ void fbcon_sis_revc(struct display *p, int srcx, int srcy)
srcy *= fontheight(p);
if(sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(0, 0x0a, 0);
SiS300SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
CRITEND
SiS300Sync();
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(0, 0x0a, 0);
SiS310SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
CRITEND
SiS310Sync();
#endif
}
}
#ifdef FBCON_HAS_CFB8
struct display_switch fbcon_sis8 = {
setup: fbcon_cfb8_setup,
bmove: fbcon_sis_bmove,
clear: fbcon_sis_clear8,
putc: fbcon_cfb8_putc,
putcs: fbcon_cfb8_putcs,
revc: fbcon_cfb8_revc,
clear_margins: fbcon_cfb8_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
.setup = fbcon_cfb8_setup,
.bmove = fbcon_sis_bmove,
.clear = fbcon_sis_clear8,
.putc = fbcon_cfb8_putc,
.putcs = fbcon_cfb8_putcs,
.revc = fbcon_cfb8_revc,
.clear_margins = fbcon_cfb8_clear_margins,
.fontwidthmask = FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#endif
#ifdef FBCON_HAS_CFB16
struct display_switch fbcon_sis16 = {
setup: fbcon_cfb16_setup,
bmove: fbcon_sis_bmove,
clear: fbcon_sis_clear16,
putc: fbcon_cfb16_putc,
putcs: fbcon_cfb16_putcs,
revc: fbcon_sis_revc,
clear_margins: fbcon_cfb16_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
.setup = fbcon_cfb16_setup,
.bmove = fbcon_sis_bmove,
.clear = fbcon_sis_clear16,
.putc = fbcon_cfb16_putc,
.putcs = fbcon_cfb16_putcs,
.revc = fbcon_sis_revc,
.clear_margins = fbcon_cfb16_clear_margins,
.fontwidthmask = FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#endif
#ifdef FBCON_HAS_CFB32
struct display_switch fbcon_sis32 = {
setup: fbcon_cfb32_setup,
bmove: fbcon_sis_bmove,
clear: fbcon_sis_clear32,
putc: fbcon_cfb32_putc,
putcs: fbcon_cfb32_putcs,
revc: fbcon_sis_revc,
clear_margins: fbcon_cfb32_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
.setup = fbcon_cfb32_setup,
.bmove = fbcon_sis_bmove,
.clear = fbcon_sis_clear32,
.putc = fbcon_cfb32_putc,
.putcs = fbcon_cfb32_putcs,
.revc = fbcon_sis_revc,
.clear_margins = fbcon_cfb32_clear_margins,
.fontwidthmask = FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#endif
......
......@@ -4,11 +4,24 @@
*
* 2D acceleration part
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the named License,
* or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Based on the X driver's sis300_accel.h which is
* Copyright Xavier Ducoin <x.ducoin@lectra.com>
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
* and sis310_accel.h which is
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>:
* (see http://www.winischhofer.net/
......@@ -47,7 +60,7 @@
#define TRAPAZOID_FILL 0x00000005 /* Fill trapezoid */
#define TRANSPARENT_BITBLT 0x00000006 /* Transparent Blit */
/* Additional engine commands for 310/325 */
/* Additional engine commands for 315 */
#define ALPHA_BLEND 0x00000007 /* Alpha blend ? */
#define A3D_FUNCTION 0x00000008 /* 3D command ? */
#define CLEAR_Z_BUFFER 0x00000009 /* ? */
......@@ -90,11 +103,11 @@
#define NO_RESET_COUNTER 0x00400000
#define NO_LAST_PIXEL 0x00200000
/* Subfunctions for Color/Enhanced Color Expansion (310/325 only) */
/* Subfunctions for Color/Enhanced Color Expansion (315 only) */
#define COLOR_TO_MONO 0x00100000
#define AA_TEXT 0x00200000
/* Some general registers for 310/325 series */
/* Some general registers for 315 series */
#define SRC_ADDR 0x8200
#define SRC_PITCH 0x8204
#define AGP_BASE 0x8206 /* color-depth dependent value */
......@@ -326,7 +339,7 @@ int CmdQueLen;
/* ----------- SiS 310/325 series --------------- */
/* -------------- SiS 315 series --------------- */
/* Q_STATUS:
bit 31 = 1: All engines idle and all queues empty
......@@ -342,16 +355,27 @@ int CmdQueLen;
bits 7:0: 2D counter 1
Where is the command queue length (current amount of commands the queue
can accept) on the 310/325 series? (The current implementation is taken
from 300 series and certainly wrong...)
can accept) on the 315 series?
*/
/* TW: FIXME: CmdQueLen is... where....? */
/* We assume a length of 4 bytes per command; since 512K of
* of RAM are allocated, the number of commands is easily
* calculated (assuming that there is no 3D support yet)
* We calculate it very cautiously (128K only) and let the
* rest to the (never?)-to-come (?) 3D engine. (The 3D engine
* can use a similar technique, using the remaining 384K,
* hence a queue overflow is avoided)
* UPDATE: This technique causes a terrible system latency
* on integrated chipsets. Disable the queue handling for
* now.
*/
#define SiS310Idle \
{ \
while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, Q_STATUS); \
CmdQueLen = 0; \
/*CmdQueLen = ((128 * 1024) / 4) - 64; */ \
}
#define SiS310SetupSRCBase(base) \
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
* frame buffer driver for Linux kernels 2.4.x and 2.5.x
*
* Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the named License,
* or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*/
#ifndef _SISFB_MAIN
#define _SISFB_MAIN
/* Comments and changes marked with "TW" by Thomas Winischhofer <thomas@winischhofer.net> */
#include "vstruct.h"
/* ------------------- Constant Definitions ------------------------- */
#undef LINUXBIOS /* turn this on when compiling for LINUXBIOS */
#define AGPOFF /* default is turn off AGP */
#define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
#define VER_MAJOR 1
#define VER_MINOR 6
#define VER_LEVEL 1
#define VER_LEVEL 25
#include "sis.h"
/* TW: To be included in pci_ids.h */
/* To be included in pci_ids.h */
#ifndef PCI_DEVICE_ID_SI_650_VGA
#define PCI_DEVICE_ID_SI_650_VGA 0x6325
#endif
......@@ -31,13 +49,28 @@
#ifndef PCI_DEVICE_ID_SI_330
#define PCI_DEVICE_ID_SI_330 0x0330
#endif
#ifndef PCI_DEVICE_ID_SI_660_VGA
#define PCI_DEVICE_ID_SI_660_VGA 0x6330
#endif
#ifndef PCI_DEVICE_ID_SI_660
#define PCI_DEVICE_ID_SI_660 0x0661
#endif
#ifndef PCI_DEVICE_ID_SI_741
#define PCI_DEVICE_ID_SI_741 0x0741
#endif
#ifndef PCI_DEVICE_ID_SI_660
#define PCI_DEVICE_ID_SI_660 0x0660
#endif
#ifndef PCI_DEVICE_ID_SI_760
#define PCI_DEVICE_ID_SI_760 0x0760
#endif
/* To be included in fb.h */
#ifndef FB_ACCEL_SIS_GLAMOUR_2
#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 65x, 740, 661, 741 */
#endif
#ifndef FB_ACCEL_SIS_XABRE
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre"), 760 */
#endif
#define MAX_ROM_SCAN 0x10000
......@@ -53,13 +86,12 @@
#define TURBO_QUEUE_AREA_SIZE 0x80000 /* 512K */
#endif
/* For 315 series */
/* For 315/Xabre series */
#ifdef CONFIG_FB_SIS_315
#define COMMAND_QUEUE_AREA_SIZE 0x80000 /* 512K */
#define COMMAND_QUEUE_THRESHOLD 0x1F
#endif
/* TW */
#define HW_CURSOR_AREA_SIZE_315 0x4000 /* 16K */
#define HW_CURSOR_AREA_SIZE_300 0x1000 /* 4K */
......@@ -95,7 +127,9 @@
#define SISDAC2A SISPART5
#define SISDAC2D (SISPART5 + 1)
#define SISMISCR (SiS_Pr.RelIO + 0x1c)
#define SISINPSTAT (SiS_Pr.RelIO + 0x2a)
#define SISMISCW SiS_Pr.SiS_P3c2
#define SISINPSTAT (SiS_Pr.RelIO + 0x2a)
#define SISPEL SiS_Pr.SiS_P3c6
#define IND_SIS_PASSWORD 0x05 /* SRs */
#define IND_SIS_COLOR_MODE 0x06
......@@ -149,14 +183,6 @@
#define SIS_DATA_BUS_64 0x01
#define SIS_DATA_BUS_128 0x02
#define SIS315_DRAM_SIZE_MASK 0xF0 /* 315 SR14 */
#define SIS315_DRAM_SIZE_2MB 0x01
#define SIS315_DRAM_SIZE_4MB 0x02
#define SIS315_DRAM_SIZE_8MB 0x03
#define SIS315_DRAM_SIZE_16MB 0x04
#define SIS315_DRAM_SIZE_32MB 0x05
#define SIS315_DRAM_SIZE_64MB 0x06
#define SIS315_DRAM_SIZE_128MB 0x07
#define SIS315_DATA_BUS_MASK 0x02
#define SIS315_DATA_BUS_64 0x00
#define SIS315_DATA_BUS_128 0x01
......@@ -166,17 +192,6 @@
#define SIS315_ASYM_DDR 0x02
#define SIS315_DUAL_CHANNEL_1_RANK 0x3
#define SIS550_DRAM_SIZE_MASK 0x3F /* 550/650/740 SR14 */
#define SIS550_DRAM_SIZE_4MB 0x00
#define SIS550_DRAM_SIZE_8MB 0x01
#define SIS550_DRAM_SIZE_16MB 0x03
#define SIS550_DRAM_SIZE_24MB 0x05
#define SIS550_DRAM_SIZE_32MB 0x07
#define SIS550_DRAM_SIZE_64MB 0x0F
#define SIS550_DRAM_SIZE_96MB 0x17
#define SIS550_DRAM_SIZE_128MB 0x1F
#define SIS550_DRAM_SIZE_256MB 0x3F
#define SIS_SCRATCH_REG_1A_MASK 0x10
#define SIS_ENABLE_2D 0x40 /* SR1E */
......@@ -217,7 +232,7 @@
#define SIS_VB_TV (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
SIS_VB_SCART | SIS_VB_HIVISION)
#define SIS_EXTERNAL_CHIP_MASK 0x0E /* CR37 */
#define SIS_EXTERNAL_CHIP_MASK 0x0E /* CR37 (< SiS 660) */
#define SIS_EXTERNAL_CHIP_SIS301 0x01 /* in CR37 << 1 ! */
#define SIS_EXTERNAL_CHIP_LVDS 0x02 /* in CR37 << 1 ! */
#define SIS_EXTERNAL_CHIP_TRUMPION 0x03 /* in CR37 << 1 ! */
......@@ -236,12 +251,33 @@
#define BRI_DRAM_SIZE_32MB 0x04
#define BRI_DRAM_SIZE_64MB 0x05
#define HW_DEVICE_EXTENSION SIS_HW_DEVICE_INFO
#define PHW_DEVICE_EXTENSION PSIS_HW_DEVICE_INFO
#define HW_DEVICE_EXTENSION SIS_HW_INFO
#define PHW_DEVICE_EXTENSION PSIS_HW_INFO
#define SR_BUFFER_SIZE 5
#define CR_BUFFER_SIZE 5
/* entries for disp_state - deprecated as of 1.6.02 */
#define DISPTYPE_CRT1 0x00000008L
#define DISPTYPE_CRT2 0x00000004L
#define DISPTYPE_LCD 0x00000002L
#define DISPTYPE_TV 0x00000001L
#define DISPTYPE_DISP1 DISPTYPE_CRT1
#define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV)
#define DISPMODE_SINGLE 0x00000020L
#define DISPMODE_MIRROR 0x00000010L
#define DISPMODE_DUALVIEW 0x00000040L
/* Deprecated as of 1.6.02 - use vbflags instead */
#define HASVB_NONE 0x00
#define HASVB_301 0x01
#define HASVB_LVDS 0x02
#define HASVB_TRUMPION 0x04
#define HASVB_LVDS_CHRONTEL 0x10
#define HASVB_302 0x20
#define HASVB_303 0x40
#define HASVB_CHRONTEL 0x80
/* Useful macros */
#define inSISREG(base) inb(base)
#define outSISREG(base,val) outb(val,base)
......@@ -281,50 +317,48 @@
/* ------------------- Global Variables ----------------------------- */
/* Fbcon variables */
static struct fb_info sis_fb_info;
static int video_type = FB_TYPE_PACKED_PIXELS;
static struct fb_info *sis_fb_info;
static struct fb_var_screeninfo default_var = {
.xres = 0,
.yres = 0,
.xres_virtual = 0,
.yres_virtual = 0,
.xoffset = 0,
.yoffset = 0,
.bits_per_pixel = 0,
.grayscale = 0,
.red = {0, 8, 0},
.green = {0, 8, 0},
.blue = {0, 8, 0},
.transp = {0, 0, 0},
.nonstd = 0,
.activate = FB_ACTIVATE_NOW,
.height = -1,
.width = -1,
.accel_flags = 0,
.pixclock = 0,
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 0,
.vsync_len = 0,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
.reserved = {0, 0, 0, 0, 0, 0}
#endif
.xres = 0,
.yres = 0,
.xres_virtual = 0,
.yres_virtual = 0,
.xoffset = 0,
.yoffset = 0,
.bits_per_pixel = 0,
.grayscale = 0,
.red = {0, 8, 0},
.green = {0, 8, 0},
.blue = {0, 8, 0},
.transp = {0, 0, 0},
.nonstd = 0,
.activate = FB_ACTIVATE_NOW,
.height = -1,
.width = -1,
.accel_flags = 0,
.pixclock = 0,
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 0,
.vsync_len = 0,
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
.reserved = {0, 0, 0, 0, 0, 0}
#endif
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static struct fb_fix_screeninfo sisfb_fix = {
.id = "SiS",
.type = FB_TYPE_PACKED_PIXELS,
.xpanstep = 1,
.xpanstep = 0,
.ypanstep = 1,
};
static char myid[20];
static char myid[40];
static u32 pseudo_palette[17];
#endif
......@@ -347,62 +381,55 @@ static union {
} sis_fbcon_cmap;
static int sisfb_inverse = 0;
static int currcon = 0;
#endif
/* display status */
/* global flags */
static int sisfb_off = 0;
static int sisfb_crt1off = 0;
static int sisfb_forcecrt1 = -1;
static int sisvga_enabled = 0;
static int sisfb_userom = 1;
static int sisfb_useoem = -1;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static int currcon = 0;
#endif
/* global flags */
static int sisfb_registered;
static int sisfb_tvmode = 0;
static int sisfb_parm_rate = -1;
static int sisfb_registered = 0;
static int sisfb_mem = 0;
static int sisfb_pdc = 0;
static int enable_dstn = 0;
static int sisfb_ypan = -1;
static int sisfb_max = -1;
static int sisfb_nocrt2rate = 0;
static int sisfb_dstn = 0;
static int sisfb_fstn = 0;
VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
int sisfb_accel = -1;
/* TW: These are to adapted according to VGA_ENGINE type */
/* These are to adapted according to VGA_ENGINE type */
static int sisfb_hwcursor_size = 0;
static int sisfb_CRT2_write_enable = 0;
int sisfb_crt2type = -1; /* TW: CRT2 type (for overriding autodetection) */
int sisfb_tvplug = -1; /* PR: Tv plug type (for overriding autodetection) */
int sisfb_crt2type = -1; /* CRT2 type (for overriding autodetection) */
int sisfb_tvplug = -1; /* Tv plug type (for overriding autodetection) */
int sisfb_queuemode = -1; /* TW: Use MMIO queue mode by default (310/325 series only) */
int sisfb_queuemode = -1; /* Use MMIO queue mode by default (315 series only) */
unsigned char sisfb_detectedpdc = 0;
unsigned char sisfb_detectedlcda = 0xff;
/* data for sis components */
/* data for sis hardware ("par") */
struct video_info ivideo;
/* TW: For ioctl SISFB_GET_INFO */
/* For ioctl SISFB_GET_INFO */
sisfb_info sisfbinfo;
/* TW: Hardware extension; contains data on hardware */
HW_DEVICE_EXTENSION sishw_ext = {
NULL, NULL, FALSE, NULL, NULL,
0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL, NULL, NULL, NULL,
{0, 0, 0, 0},
0
};
/* Hardware info; contains data on hardware */
SIS_HW_INFO sishw_ext;
/* TW: SiS private structure */
/* SiS private structure */
SiS_Private SiS_Pr;
/* card parameters */
/* Card parameters */
static unsigned long sisfb_mmio_size = 0;
static u8 sisfb_caps = 0;
......@@ -412,7 +439,7 @@ typedef enum _SIS_CMDTYPE {
VM_CMD_QUEUE,
} SIS_CMDTYPE;
/* Supported SiS Chips list */
/* List of supported chips */
static struct board {
u16 vendor, device;
const char *name;
......@@ -424,16 +451,17 @@ static struct board {
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315, "SIS 315"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO, "SIS 315PRO"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 650/M650/651/740 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 65x/M65x/740 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, "SIS 330"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, "SIS 661FX/M661FX/741/760 VGA"},
{0, 0, NULL}
};
#define MD_SIS300 1
#define MD_SIS315 2
/* mode table */
/* NOT const - will be patched for 1280x960 mode number chaos reasons */
/* Mode table */
/* NOT const - will be patched for 1280x768 mode number chaos reasons */
struct _sisbios_mode {
char name[15];
u8 mode_no;
......@@ -447,14 +475,33 @@ struct _sisbios_mode {
u16 rows;
u8 chipset;
} sisbios_mode[] = {
#define MODE_INDEX_NONE 0 /* TW: index for mode=none */
{"none", 0xFF, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, MD_SIS300|MD_SIS315}, /* TW: for mode "none" */
{"320x240x16", 0x56, 0x0000, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS315},
{"320x480x8", 0x5A, 0x0000, 0x0000, 320, 480, 8, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"320x480x16", 0x5B, 0x0000, 0x0000, 320, 480, 16, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"640x480x8", 0x2E, 0x0101, 0x0101, 640, 480, 8, 1, 80, 30, MD_SIS300|MD_SIS315},
#define MODE_INDEX_NONE 0 /* index for mode=none */
{"none", 0xff, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, MD_SIS300|MD_SIS315},
{"320x200x8", 0x59, 0x0138, 0x0000, 320, 200, 8, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x200x16", 0x41, 0x010e, 0x0000, 320, 200, 16, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x200x24", 0x4f, 0x0000, 0x0000, 320, 200, 32, 1, 40, 12, MD_SIS300|MD_SIS315}, /* TW: That's for people who mix up color- and fb depth */
{"320x200x32", 0x4f, 0x0000, 0x0000, 320, 200, 32, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x240x8", 0x50, 0x0132, 0x0000, 320, 240, 8, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x16", 0x56, 0x0135, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x24", 0x53, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x32", 0x53, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x8", 0x5a, 0x0132, 0x0000, 320, 480, 8, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"320x240x16", 0x5b, 0x0135, 0x0000, 320, 480, 16, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"400x300x8", 0x51, 0x0133, 0x0000, 400, 300, 8, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x16", 0x57, 0x0136, 0x0000, 400, 300, 16, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x24", 0x54, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x32", 0x54, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315},
{"512x384x8", 0x52, 0x0000, 0x0000, 512, 384, 8, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x16", 0x58, 0x0000, 0x0000, 512, 384, 16, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x24", 0x5c, 0x0000, 0x0000, 512, 384, 32, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x32", 0x5c, 0x0000, 0x0000, 512, 384, 32, 1, 64, 24, MD_SIS300|MD_SIS315},
{"640x400x8", 0x2f, 0x0000, 0x0000, 640, 400, 8, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x400x16", 0x5d, 0x0000, 0x0000, 640, 400, 16, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x400x24", 0x5e, 0x0000, 0x0000, 640, 400, 32, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x400x32", 0x5e, 0x0000, 0x0000, 640, 400, 32, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x480x8", 0x2e, 0x0101, 0x0101, 640, 480, 8, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x16", 0x44, 0x0111, 0x0111, 640, 480, 16, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x24", 0x62, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315}, /* TW: That's for people who mix up color- and fb depth */
{"640x480x24", 0x62, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x32", 0x62, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315},
{"720x480x8", 0x31, 0x0000, 0x0000, 720, 480, 8, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x16", 0x33, 0x0000, 0x0000, 720, 480, 16, 1, 90, 30, MD_SIS300|MD_SIS315},
......@@ -464,63 +511,87 @@ struct _sisbios_mode {
{"720x576x16", 0x34, 0x0000, 0x0000, 720, 576, 16, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x24", 0x36, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x32", 0x36, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"768x576x8", 0x5f, 0x0000, 0x0000, 768, 576, 8, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x16", 0x60, 0x0000, 0x0000, 768, 576, 16, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x24", 0x61, 0x0000, 0x0000, 768, 576, 32, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x32", 0x61, 0x0000, 0x0000, 768, 576, 32, 1, 96, 36, MD_SIS300|MD_SIS315},
{"800x480x8", 0x70, 0x0000, 0x0000, 800, 480, 8, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x16", 0x7a, 0x0000, 0x0000, 800, 480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x24", 0x76, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x32", 0x76, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
#define DEFAULT_MODE 20 /* TW: index for 800x600x8 */
#define DEFAULT_LCDMODE 20 /* TW: index for 800x600x8 */
#define DEFAULT_TVMODE 20 /* TW: index for 800x600x8 */
#define DEFAULT_MODE 43 /* index for 800x600x8 */
#define DEFAULT_LCDMODE 43 /* index for 800x600x8 */
#define DEFAULT_TVMODE 43 /* index for 800x600x8 */
{"800x600x8", 0x30, 0x0103, 0x0103, 800, 600, 8, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x16", 0x47, 0x0114, 0x0114, 800, 600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x24", 0x63, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x32", 0x63, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"848x480x8", 0x39, 0x0000, 0x0000, 848, 480, 8, 2, 106, 30, MD_SIS300|MD_SIS315},
{"848x480x16", 0x3b, 0x0000, 0x0000, 848, 480, 16, 2, 106, 30, MD_SIS300|MD_SIS315},
{"848x480x24", 0x3e, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
{"848x480x32", 0x3e, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
{"856x480x8", 0x3f, 0x0000, 0x0000, 856, 480, 8, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x16", 0x42, 0x0000, 0x0000, 856, 480, 16, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x24", 0x45, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x32", 0x45, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
{"1024x576x8", 0x71, 0x0000, 0x0000, 1024, 576, 8, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x16", 0x74, 0x0000, 0x0000, 1024, 576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x24", 0x77, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x32", 0x77, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x600x8", 0x20, 0x0000, 0x0000, 1024, 600, 8, 1, 128, 37, MD_SIS300 }, /* TW: 300 series only */
{"1024x600x8", 0x20, 0x0000, 0x0000, 1024, 600, 8, 1, 128, 37, MD_SIS300 },
{"1024x600x16", 0x21, 0x0000, 0x0000, 1024, 600, 16, 1, 128, 37, MD_SIS300 },
{"1024x600x24", 0x22, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x600x32", 0x22, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x768x8", 0x38, 0x0105, 0x0105, 1024, 768, 8, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x16", 0x4A, 0x0117, 0x0117, 1024, 768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x16", 0x4a, 0x0117, 0x0117, 1024, 768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x24", 0x64, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x32", 0x64, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1152x768x8", 0x23, 0x0000, 0x0000, 1152, 768, 8, 1, 144, 48, MD_SIS300 }, /* TW: 300 series only */
{"1152x768x8", 0x23, 0x0000, 0x0000, 1152, 768, 8, 1, 144, 48, MD_SIS300 },
{"1152x768x16", 0x24, 0x0000, 0x0000, 1152, 768, 16, 1, 144, 48, MD_SIS300 },
{"1152x768x24", 0x25, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1152x768x32", 0x25, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1152x864x8", 0x29, 0x0000, 0x0000, 1152, 864, 8, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x16", 0x2a, 0x0000, 0x0000, 1152, 864, 16, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x24", 0x2b, 0x0000, 0x0000, 1152, 864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x32", 0x2b, 0x0000, 0x0000, 1152, 864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1280x720x8", 0x79, 0x0000, 0x0000, 1280, 720, 8, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x16", 0x75, 0x0000, 0x0000, 1280, 720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x24", 0x78, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x32", 0x78, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x768x8", 0x23, 0x0000, 0x0000, 1280, 768, 8, 1, 160, 48, MD_SIS315}, /* TW: 310/325 series only */
{"1280x768x16", 0x24, 0x0000, 0x0000, 1280, 768, 16, 1, 160, 48, MD_SIS315},
{"1280x768x24", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS315},
{"1280x768x32", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS315},
#define MODEINDEX_1280x960 48
{"1280x960x8", 0x7C, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315}, /* TW: Modenumbers being patched */
{"1280x960x16", 0x7D, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x24", 0x7E, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x32", 0x7E, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x1024x8", 0x3A, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x16", 0x4D, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
#define MODEINDEX_1280x768 79
{"1280x768x8", 0x23, 0x0000, 0x0000, 1280, 768, 8, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x16", 0x24, 0x0000, 0x0000, 1280, 768, 16, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x24", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x32", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x960x8", 0x7c, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x16", 0x7d, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x24", 0x7e, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x32", 0x7e, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x1024x8", 0x3a, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x16", 0x4d, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x24", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x32", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1400x1050x8", 0x26, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315}, /* TW: 310/325 series only */
{"1360x768x8", 0x48, 0x0000, 0x0000, 1360, 768, 8, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x768x16", 0x4b, 0x0000, 0x0000, 1360, 768, 16, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x768x24", 0x4e, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x768x32", 0x4e, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x1024x8", 0x67, 0x0000, 0x0000, 1360, 1024, 8, 1, 170, 64, MD_SIS300 },
{"1360x1024x16", 0x6f, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300 },
{"1360x1024x24", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 },
{"1360x1024x32", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 },
{"1400x1050x8", 0x26, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315},
{"1400x1050x16", 0x27, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65, MD_SIS315},
{"1400x1050x24", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
{"1400x1050x32", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
{"1600x1200x8", 0x3C, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x16", 0x3D, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x8", 0x3c, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x16", 0x3d, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x24", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x32", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1920x1440x8", 0x68, 0x013f, 0x0000, 1920, 1440, 8, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x16", 0x69, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x24", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x32", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"2048x1536x8", 0x6c, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315}, /* TW: 310/325 series only */
{"1920x1440x24", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x32", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"2048x1536x8", 0x6c, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315},
{"2048x1536x16", 0x6d, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96, MD_SIS315},
{"2048x1536x24", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
{"2048x1536x32", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
......@@ -536,39 +607,38 @@ int sisfb_mode_idx = -1; /* Use a default mode if we are inside th
u8 sisfb_mode_no = 0;
u8 sisfb_rate_idx = 0;
/* TW: CR36 evaluation */
/* CR36 evaluation */
const USHORT sis300paneltype[] =
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768,
LCD_320x480, LCD_1024x768, LCD_1024x768, LCD_1024x768,
LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768 };
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768,
LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768,
LCD_1024x768, LCD_1024x768, LCD_320x480, LCD_1024x768 };
const USHORT sis310paneltype[] =
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960,
LCD_1152x768, LCD_1400x1050,LCD_1280x768, LCD_1600x1200,
LCD_320x480, LCD_1024x768, LCD_1024x768, LCD_1024x768 };
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960,
LCD_1152x768, LCD_1400x1050, LCD_1280x768, LCD_1600x1200,
LCD_640x480_2, LCD_640x480_3, LCD_320x480, LCD_1024x768 };
#define FL_550_DSTN 0x01
#define FL_550_FSTN 0x02
static const struct _sis_crt2type {
char name[10];
int type_no;
int tvplug_no;
unsigned short flags;
} sis_crt2type[] = {
{"NONE", 0, -1},
{"LCD", DISPTYPE_LCD, -1},
{"TV", DISPTYPE_TV, -1},
{"VGA", DISPTYPE_CRT2, -1},
{"SVIDEO", DISPTYPE_TV, TVPLUG_SVIDEO},
{"COMPOSITE", DISPTYPE_TV, TVPLUG_COMPOSITE},
{"SCART", DISPTYPE_TV, TVPLUG_SCART},
{"none", 0, -1},
{"lcd", DISPTYPE_LCD, -1},
{"tv", DISPTYPE_TV, -1},
{"vga", DISPTYPE_CRT2, -1},
{"svideo", DISPTYPE_TV, TVPLUG_SVIDEO},
{"composite", DISPTYPE_TV, TVPLUG_COMPOSITE},
{"scart", DISPTYPE_TV, TVPLUG_SCART},
{"\0", -1, -1}
{"NONE", 0, -1, 0},
{"LCD", CRT2_LCD, -1, 0},
{"TV", CRT2_TV, -1, 0},
{"VGA", CRT2_VGA, -1, 0},
{"SVIDEO", CRT2_TV, TV_SVIDEO, 0},
{"COMPOSITE", CRT2_TV, TV_AVIDEO, 0},
{"SCART", CRT2_TV, TV_SCART, 0},
{"DSTN", CRT2_LCD, -1, FL_550_DSTN},
{"FSTN", CRT2_LCD, -1, FL_550_FSTN},
{"\0", -1, -1, 0}
};
/* Queue mode selection for 310 series */
......@@ -579,9 +649,6 @@ static const struct _sis_queuemode {
{"AGP", AGP_CMD_QUEUE},
{"VRAM", VM_CMD_QUEUE},
{"MMIO", MMIO_CMD},
{"agp", AGP_CMD_QUEUE},
{"vram", VM_CMD_QUEUE},
{"mmio", MMIO_CMD},
{"\0", -1}
};
......@@ -590,10 +657,8 @@ static const struct _sis_tvtype {
char name[6];
int type_no;
} sis_tvtype[] = {
{"PAL", 1},
{"NTSC", 2},
{"pal", 1},
{"ntsc", 2},
{"PAL", TV_PAL},
{"NTSC", TV_NTSC},
{"\0", -1}
};
......@@ -602,33 +667,103 @@ static const struct _sis_vrate {
u16 xres;
u16 yres;
u16 refresh;
BOOLEAN SiS730valid32bpp;
} sisfb_vrate[] = {
{1, 640, 480, 60}, {2, 640, 480, 72}, {3, 640, 480, 75}, {4, 640, 480, 85},
{5, 640, 480,100}, {6, 640, 480, 120}, {7, 640, 480, 160}, {8, 640, 480, 200},
{1, 720, 480, 60},
{1, 720, 576, 58},
{1, 800, 480, 60}, {2, 800, 480, 75}, {3, 800, 480, 85},
{1, 800, 600, 56}, {2, 800, 600, 60}, {3, 800, 600, 72}, {4, 800, 600, 75},
{5, 800, 600, 85}, {6, 800, 600, 100}, {7, 800, 600, 120}, {8, 800, 600, 160},
{1, 1024, 768, 43}, {2, 1024, 768, 60}, {3, 1024, 768, 70}, {4, 1024, 768, 75},
{5, 1024, 768, 85}, {6, 1024, 768, 100}, {7, 1024, 768, 120},
{1, 1024, 576, 60}, {2, 1024, 576, 75}, {3, 1024, 576, 85},
{1, 1024, 600, 60},
{1, 1152, 768, 60},
{1, 1280, 720, 60}, {2, 1280, 720, 75}, {3, 1280, 720, 85},
{1, 1280, 768, 60},
{1, 1280, 1024, 43}, {2, 1280, 1024, 60}, {3, 1280, 1024, 75}, {4, 1280, 1024, 85},
{1, 1280, 960, 70},
{1, 1400, 1050, 60},
{1, 1600, 1200, 60}, {2, 1600, 1200, 65}, {3, 1600, 1200, 70}, {4, 1600, 1200, 75},
{5, 1600, 1200, 85}, {6, 1600, 1200, 100}, {7, 1600, 1200, 120},
{1, 1920, 1440, 60}, {2, 1920, 1440, 65}, {3, 1920, 1440, 70}, {4, 1920, 1440, 75},
{5, 1920, 1440, 85}, {6, 1920, 1440, 100},
{1, 2048, 1536, 60}, {2, 2048, 1536, 65}, {3, 2048, 1536, 70}, {4, 2048, 1536, 75},
{5, 2048, 1536, 85},
{0, 0, 0, 0}
{1, 320, 200, 70, TRUE},
{1, 320, 240, 60, TRUE},
{1, 320, 480, 60, TRUE},
{1, 400, 300, 60, TRUE},
{1, 512, 384, 60, TRUE},
{1, 640, 400, 72, TRUE},
{1, 640, 480, 60, TRUE}, {2, 640, 480, 72, TRUE}, {3, 640, 480, 75, TRUE},
{4, 640, 480, 85, TRUE}, {5, 640, 480, 100, TRUE}, {6, 640, 480, 120, TRUE},
{7, 640, 480, 160, TRUE}, {8, 640, 480, 200, TRUE},
{1, 720, 480, 60, TRUE},
{1, 720, 576, 58, TRUE},
{1, 768, 576, 58, TRUE},
{1, 800, 480, 60, TRUE}, {2, 800, 480, 75, TRUE}, {3, 800, 480, 85, TRUE},
{1, 800, 600, 56, TRUE}, {2, 800, 600, 60, TRUE}, {3, 800, 600, 72, TRUE},
{4, 800, 600, 75, TRUE}, {5, 800, 600, 85, TRUE}, {6, 800, 600, 105, TRUE},
{7, 800, 600, 120, TRUE}, {8, 800, 600, 160, TRUE},
{1, 848, 480, 39, TRUE}, {2, 848, 480, 60, TRUE},
{1, 856, 480, 39, TRUE}, {2, 856, 480, 60, TRUE},
{1, 1024, 576, 60, TRUE}, {2, 1024, 576, 75, TRUE}, {3, 1024, 576, 85, TRUE},
{1, 1024, 600, 60, TRUE},
{1, 1024, 768, 43, TRUE}, {2, 1024, 768, 60, TRUE}, {3, 1024, 768, 70, FALSE},
{4, 1024, 768, 75, FALSE}, {5, 1024, 768, 85, TRUE}, {6, 1024, 768, 100, TRUE},
{7, 1024, 768, 120, TRUE},
{1, 1152, 768, 60, TRUE},
{1, 1152, 864, 75, TRUE}, {2, 1152, 864, 84, TRUE},
{1, 1280, 720, 60, TRUE}, {2, 1280, 720, 75, TRUE}, {3, 1280, 720, 85, TRUE},
{1, 1280, 768, 60, TRUE},
{1, 1280, 960, 60, TRUE}, {2, 1280, 960, 85, TRUE},
{1, 1280, 1024, 43, TRUE}, {2, 1280, 1024, 60, TRUE}, {3, 1280, 1024, 75, TRUE},
{4, 1280, 1024, 85, TRUE},
{1, 1360, 768, 60, TRUE},
{1, 1360, 1024, 59, TRUE},
{1, 1400, 1050, 60, TRUE}, {2, 1400, 1050, 75, TRUE},
{1, 1600, 1200, 60, TRUE}, {2, 1600, 1200, 65, TRUE}, {3, 1600, 1200, 70, TRUE},
{4, 1600, 1200, 75, TRUE}, {5, 1600, 1200, 85, TRUE}, {6, 1600, 1200, 100, TRUE},
{7, 1600, 1200, 120, TRUE},
{1, 1920, 1440, 60, TRUE}, {2, 1920, 1440, 65, TRUE}, {3, 1920, 1440, 70, TRUE},
{4, 1920, 1440, 75, TRUE}, {5, 1920, 1440, 85, TRUE}, {6, 1920, 1440, 100, TRUE},
{1, 2048, 1536, 60, TRUE}, {2, 2048, 1536, 65, TRUE}, {3, 2048, 1536, 70, TRUE},
{4, 2048, 1536, 75, TRUE}, {5, 2048, 1536, 85, TRUE},
{0, 0, 0, 0, FALSE}
};
static struct sisfb_monitor {
u16 hmin;
u16 hmax;
u16 vmin;
u16 vmax;
u32 dclockmax;
u8 feature;
BOOLEAN datavalid;
} sisfb_thismonitor;
static const struct _sisfbddcsmodes {
u32 mask;
u16 h;
u16 v;
u32 d;
} sisfb_ddcsmodes[] = {
{ 0x10000, 67, 75, 108000},
{ 0x08000, 48, 72, 50000},
{ 0x04000, 46, 75, 49500},
{ 0x01000, 35, 43, 44900},
{ 0x00800, 48, 60, 65000},
{ 0x00400, 56, 70, 75000},
{ 0x00200, 60, 75, 78800},
{ 0x00100, 80, 75, 135000},
{ 0x00020, 31, 60, 25200},
{ 0x00008, 38, 72, 31500},
{ 0x00004, 37, 75, 31500},
{ 0x00002, 35, 56, 36000},
{ 0x00001, 38, 60, 40000}
};
static const struct _sisfbddcfmodes {
u16 x;
u16 y;
u16 v;
u16 h;
u32 d;
} sisfb_ddcfmodes[] = {
{ 1280, 1024, 85, 92, 157500},
{ 1600, 1200, 60, 75, 162000},
{ 1600, 1200, 65, 82, 175500},
{ 1600, 1200, 70, 88, 189000},
{ 1600, 1200, 75, 94, 202500},
{ 1600, 1200, 85, 107,229500},
{ 1920, 1440, 60, 90, 234000},
{ 1920, 1440, 75, 113,297000}
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static u8 sisfb_lastrates[128];
#endif
static const struct _chswtable {
int subsysVendor;
int subsysCard;
......@@ -636,9 +771,152 @@ static const struct _chswtable {
char *cardName;
} mychswtable[] = {
{ 0x1631, 0x1002, "Mitachi", "0x1002" },
{ 0x1071, 0x7521, "Mitac" , "7521P" },
{ 0, 0, "" , "" }
};
static const struct _customttable {
unsigned short chipID;
char *biosversion;
char *biosdate;
unsigned long bioschksum;
unsigned short biosFootprintAddr[5];
unsigned char biosFootprintData[5];
unsigned short pcisubsysvendor;
unsigned short pcisubsyscard;
char *vendorName;
char *cardName;
unsigned long SpecialID;
char *optionName;
} mycustomttable[] = {
{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
0x3240A8,
{ 0x220, 0x227, 0x228, 0x229, 0x0ee },
{ 0x01, 0xe3, 0x9a, 0x6a, 0xef },
0x1039, 0x6300,
"Barco", "iQ R200L/300/400", CUT_BARCO1366, "BARCO_1366"
},
{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
0x323FBD,
{ 0x220, 0x227, 0x228, 0x229, 0x0ee },
{ 0x00, 0x5a, 0x64, 0x41, 0xef },
0x1039, 0x6300,
"Barco", "iQ G200L/300/400/500", CUT_BARCO1024, "BARCO_1024"
},
{ SIS_650, "", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x0e11, 0x083c,
"Inventec (Compaq)", "3017cl/3045US", CUT_COMPAQ12802, "COMPAQ_1280"
},
{ SIS_650, "", "",
0,
{ 0x00c, 0, 0, 0, 0 },
{ 'e' , 0, 0, 0, 0 },
0x1558, 0x0287,
"Clevo", "L285/L287 (Version 1)", CUT_CLEVO1024, "CLEVO_L28X_1"
},
{ SIS_650, "", "",
0,
{ 0x00c, 0, 0, 0, 0 },
{ 'y' , 0, 0, 0, 0 },
0x1558, 0x0287,
"Clevo", "L285/L287 (Version 2)", CUT_CLEVO10242, "CLEVO_L28X_2"
},
{ SIS_650, "", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1558, 0x0400, /* possibly 401 and 402 as well; not panelsize specific (?) */
"Clevo", "D400S/D410S/D400H/D410H", CUT_CLEVO1400, "CLEVO_D4X0"
},
{ SIS_650, "", "",
0, /* Shift LCD in LCD-via-CRT1 mode */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1558, 0x2263,
"Clevo", "D22ES/D27ES", CUT_UNIWILL1024, "CLEVO_D2X0ES"
},
{ SIS_650, "", "",
0, /* Shift LCD in LCD-via-CRT1 mode */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1734, 0x101f,
"Uniwill", "N243S9", CUT_UNIWILL1024, "UNIWILL_N243S9"
},
{ SIS_650, "", "",
0, /* Shift LCD in LCD-via-CRT1 mode */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1584, 0x5103,
"Uniwill", "N35BS1", CUT_UNIWILL10242, "UNIWILL_N35BS1"
},
{ SIS_650, "1.09.2c", "", /* Other versions, too? */
0, /* Shift LCD in LCD-via-CRT1 mode */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1019, 0x0f05,
"ECS", "A928", CUT_UNIWILL1024, "ECS_A928"
},
{ SIS_740, "1.11.27a", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1043, 0x1612,
"Asus", "L3000D/L3500D", CUT_ASUSL3000D, "ASUS_L3X00"
},
{ SIS_650, "1.10.9k", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1025, 0x0028,
"Acer", "Aspire 1700", CUT_ACER1280, "ACER_ASPIRE1700"
},
{ SIS_650, "1.10.7w", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x14c0, 0x0012,
"Compal", "??? (V1)", CUT_COMPAL1400_1, "COMPAL_1400_1"
},
{ SIS_650, "1.10.7x", "",
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x14c0, 0x0012,
"Compal", "??? (V2)", CUT_COMPAL1400_2, "COMPAL_1400_2"
},
{ SIS_650, "1.10.8o", "",
0, /* For EMI (unknown) */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1043, 0x1612,
"Asus", "A2H (V1)", CUT_ASUSA2H_1, "ASUS_A2H_1"
},
{ SIS_650, "1.10.8q", "",
0, /* For EMI */
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0x1043, 0x1612,
"Asus", "A2H (V2)", CUT_ASUSA2H_2, "ASUS_A2H_2"
},
{ 4321, "", "", /* never autodetected */
0,
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
0, 0,
"Generic", "LVDS/Parallel 848x480", CUT_PANEL848, "PANEL848x480"
},
{ 0, "", "",
0,
{ 0, 0, 0, 0 },
{ 0, 0, 0, 0 },
0, 0,
"", "", CUT_NONE, ""
}
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* Offscreen layout */
typedef struct _SIS_GLYINFO {
......@@ -648,6 +926,8 @@ typedef struct _SIS_GLYINFO {
u8 gmask[72];
int ngmask;
} SIS_GLYINFO;
static char sisfb_fontname[40];
#endif
typedef struct _SIS_OH {
......@@ -677,7 +957,6 @@ static unsigned long sisfb_heap_end;
static unsigned long sisfb_heap_size;
static SIS_HEAP sisfb_heap;
// Eden Chen
static const struct _sis_TV_filter {
u8 filter[9][4];
} sis_TV_filter[] = {
......@@ -697,7 +976,7 @@ static const struct _sis_TV_filter {
{0xF8,0xF4,0x18,0x38},
{0xFC,0xFB,0x14,0x2A},
{0x00,0x00,0x10,0x20},
{0x00,0x04,0x10,0x18},
{0x00,0x04,0x10,0x18},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_2 */
{0xF5,0xEE,0x1B,0x44},
......@@ -717,7 +996,7 @@ static const struct _sis_TV_filter {
{0xF9,0x0A,0x17,0x0C},
{0x00,0x07,0x10,0x12},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_4 */
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_4 - 320 */
{0x00,0xE0,0x10,0x60},
{0x00,0xEE,0x10,0x44},
{0x00,0xF4,0x10,0x38},
......@@ -726,7 +1005,7 @@ static const struct _sis_TV_filter {
{0x00,0x00,0x10,0x20},
{0x00,0x04,0x10,0x18},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_5 */
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_5 - 640 */
{0xF5,0xEE,0x1B,0x44},
{0xF8,0xF4,0x18,0x38},
{0xEB,0x04,0x25,0x18},
......@@ -735,7 +1014,7 @@ static const struct _sis_TV_filter {
{0xFA,0x06,0x16,0x14},
{0x00,0x04,0x10,0x18},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_6 */
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_6 - 720 */
{0xEB,0x04,0x25,0x18},
{0xE7,0x0E,0x29,0x04},
{0xEE,0x0C,0x22,0x08},
......@@ -744,7 +1023,7 @@ static const struct _sis_TV_filter {
{0xFC,0x0A,0x14,0x0C},
{0x00,0x08,0x10,0x10},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_7 */
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_7 - 800 */
{0xEC,0x02,0x24,0x1C},
{0xF2,0x04,0x1E,0x18},
{0xEB,0x15,0x25,0xF6},
......@@ -789,7 +1068,7 @@ static const struct _sis_TV_filter {
{0xFB,0x04,0x15,0x18},
{0x00,0x06,0x10,0x14},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_4 */
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_4 - 320 */
{0x00,0xE0,0x10,0x60},
{0x00,0xEE,0x10,0x44},
{0x00,0xF4,0x10,0x38},
......@@ -798,7 +1077,7 @@ static const struct _sis_TV_filter {
{0x00,0x00,0x10,0x20},
{0x00,0x04,0x10,0x18},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_5 */
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_5 - 640 */
{0xF5,0xEE,0x1B,0x44},
{0xF8,0xF4,0x18,0x38},
{0xF1,0xF7,0x1F,0x32},
......@@ -807,7 +1086,7 @@ static const struct _sis_TV_filter {
{0xFB,0x01,0x15,0x1E},
{0x00,0x04,0x10,0x18},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_6 */
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_6 - 720 */
{0xF5,0xEE,0x1B,0x2A},
{0xEE,0xFE,0x22,0x24},
{0xF3,0x00,0x1D,0x20},
......@@ -816,7 +1095,7 @@ static const struct _sis_TV_filter {
{0xFB,0x04,0x15,0x18},
{0x00,0x06,0x10,0x14},
{0xFF,0xFF,0xFF,0xFF} }},
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_7 */
{ {{0x00,0x00,0x00,0x40}, /* PALFilter_7 - 800 */
{0xF5,0xEE,0x1B,0x44},
{0xF8,0xF4,0x18,0x38},
{0xFC,0xFB,0x14,0x2A},
......@@ -829,9 +1108,8 @@ static const struct _sis_TV_filter {
static int filter = -1;
static unsigned char filter_tb;
//~Eden Chen
/* ---------------------- Routine prototypes ------------------------- */
/* ---------------------- Prototypes ------------------------- */
/* Interface used by the world */
#ifndef MODULE
......@@ -894,10 +1172,6 @@ extern void fbcon_sis_fillrect(struct fb_info *info,
const struct fb_fillrect *rect);
extern void fbcon_sis_copyarea(struct fb_info *info,
const struct fb_copyarea *area);
#if 0
extern void cfb_imageblit(struct fb_info *info,
const struct fb_image *image);
#endif
extern int fbcon_sis_sync(struct fb_info *info);
static int sisfb_ioctl(struct inode *inode,
struct file *file,
......@@ -905,14 +1179,14 @@ static int sisfb_ioctl(struct inode *inode,
unsigned long arg,
struct fb_info *info);
extern int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr,
PSIS_HW_DEVICE_INFO HwDeviceExtension,
PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex);
extern int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
extern int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex,
unsigned int *left_margin, unsigned int *right_margin,
unsigned int *upper_margin, unsigned int *lower_margin,
unsigned int *hsync_len, unsigned int *vsync_len,
unsigned int *sync, unsigned int *vmode);
unsigned int *sync, unsigned int *vmode);
#endif
static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
......@@ -923,9 +1197,9 @@ extern int sisfb_initaccel(void);
extern void sisfb_syncaccel(void);
/* Internal general routines */
static void sisfb_search_mode(const char *name);
static int sisfb_validate_mode(int modeindex);
static u8 sisfb_search_refresh_rate(unsigned int rate);
static void sisfb_search_mode(char *name, BOOLEAN quiet);
static int sisfb_validate_mode(int modeindex, unsigned long vbflags);
static u8 sisfb_search_refresh_rate(unsigned int rate, int index);
static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *fb_info);
......@@ -939,6 +1213,11 @@ static BOOLEAN sisfb_CheckVBRetrace(void);
static BOOLEAN sisfbcheckvretracecrt2(void);
static BOOLEAN sisfbcheckvretracecrt1(void);
static BOOLEAN sisfb_bridgeisslave(void);
static void sisfb_detect_VB_connect(void);
static void sisfb_get_VB_type(void);
static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno);
static BOOLEAN sisfb_interpret_edid(struct sisfb_monitor *monitor, unsigned char *buffer);
/* SiS-specific Export functions */
void sis_dispinfo(struct ap_data *rec);
......@@ -952,15 +1231,9 @@ u32 sisfb_get_reg3(u16 port);
/* Chipset-dependent internal routines */
#ifdef CONFIG_FB_SIS_300
static int sisfb_get_dram_size_300(void);
static void sisfb_detect_VB_connect_300(void);
static void sisfb_get_VB_type_300(void);
static int sisfb_has_VB_300(void);
#endif
#ifdef CONFIG_FB_SIS_315
static int sisfb_get_dram_size_315(void);
static void sisfb_detect_VB_connect_315(void);
static void sisfb_get_VB_type_315(void);
static int sisfb_has_VB_315(void);
#endif
/* Internal heap routines */
......@@ -973,30 +1246,46 @@ static SIS_OH *sisfb_poh_free(unsigned long base);
static void sisfb_free_node(SIS_OH *poh);
/* Internal routines to access PCI configuration space */
BOOLEAN sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
BOOLEAN sisfb_query_VGA_config_space(PSIS_HW_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
/* Sensing routines */
static void SiS_Sense30x(void);
static int SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
static void SiS_SenseCh(void);
/* Routines from init.c/init301.c */
extern void SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiSInit(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo);
extern void SiS_SetEnableDstn(SiS_Private *SiS_Pr);
extern void SiS_LongWait(SiS_Private *SiS_Pr);
extern USHORT SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
extern USHORT SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth,
BOOLEAN FSTN, USHORT CustomT, int LCDwith, int LCDheight);
extern USHORT SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
extern USHORT SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
extern void SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
extern BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo, USHORT ModeNo);
extern void SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
extern void SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
extern BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
/* TW: Chrontel TV functions */
/* Chrontel TV functions */
extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
extern USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
extern void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
extern void SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo);
extern USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
extern USHORT SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
extern void SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
extern void SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
extern void SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
extern void SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
/* TW: Sensing routines */
void SiS_Sense30x(void);
int SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
void SiS_SenseCh(void);
#endif
/* $XFree86$ */
/*
* General type definitions for universal mode switching modules
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
#ifndef _VGATYPES_
#define _VGATYPES_
#ifdef LINUX_XF86
#include "xf86Version.h"
#include "xf86Pci.h"
#endif
#ifdef LINUX_KERNEL /* TW: We don't want the X driver to depend on kernel source */
#ifdef LINUX_KERNEL /* We don't want the X driver to depend on kernel source */
#include <linux/ioctl.h>
#endif
#ifndef TC
#define far
#endif
#ifndef FALSE
#define FALSE 0
#endif
......@@ -49,47 +100,34 @@ typedef unsigned short USHORT;
typedef unsigned long ULONG;
#endif
#ifndef PUCHAR
typedef UCHAR far *PUCHAR;
#endif
#ifndef PUSHORT
typedef USHORT far *PUSHORT;
#endif
#ifndef PULONG
typedef ULONG far *PULONG;
#endif
#ifndef PVOID
typedef void far *PVOID;
#endif
#ifndef VOID
typedef void VOID;
#endif
#ifndef BOOLEAN
typedef UCHAR BOOLEAN;
#endif
#ifndef WINCE_HEADER
#ifndef bool
typedef UCHAR bool;
#endif
#endif /*WINCE_HEADER*/
#ifndef VBIOS_VER_MAX_LENGTH
#define VBIOS_VER_MAX_LENGTH 4
#ifdef LINUX_KERNEL
typedef unsigned long SISIOADDRESS;
#endif
#ifdef LINUX_XF86
#if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0)
typedef unsigned long IOADDRESS;
typedef unsigned long SISIOADDRESS;
#else
typedef IOADDRESS SISIOADDRESS;
#endif
#endif
#ifndef LINUX_KERNEL /* For kernel, this is defined in sisfb.h */
#ifndef WIN2000
#ifndef LINUX_KERNEL /* For the linux kernel, this is defined in sisfb.h */
#ifndef SIS_CHIP_TYPE
typedef enum _SIS_CHIP_TYPE {
SIS_VGALegacy = 0,
#ifdef LINUX_XF86
SIS_530, /* TW */
SIS_OLD, /* TW */
SIS_530,
SIS_OLD,
#endif
SIS_300,
SIS_630,
......@@ -101,30 +139,32 @@ typedef enum _SIS_CHIP_TYPE {
SIS_550,
SIS_650,
SIS_740,
SIS_330,
SIS_330,
SIS_661,
SIS_741,
SIS_660,
SIS_760,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
#endif
#endif
#endif
#ifndef WIN2000
#ifndef SIS_VB_CHIP_TYPE
typedef enum _SIS_VB_CHIP_TYPE {
VB_CHIP_Legacy = 0,
VB_CHIP_301,
VB_CHIP_301B,
VB_CHIP_301B,
VB_CHIP_301LV,
VB_CHIP_302,
VB_CHIP_302B,
VB_CHIP_302LV,
VB_CHIP_301C,
VB_CHIP_302ELV,
VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */
MAX_VB_CHIP
} SIS_VB_CHIP_TYPE;
#endif
#endif
#ifndef WIN2000
#ifndef SIS_LCD_TYPE
typedef enum _SIS_LCD_TYPE {
LCD_INVALID = 0,
......@@ -136,18 +176,22 @@ typedef enum _SIS_LCD_TYPE {
LCD_1600x1200,
LCD_1920x1440,
LCD_2048x1536,
LCD_320x480, /* TW: FSTN */
LCD_320x480, /* FSTN, DSTN */
LCD_1400x1050,
LCD_1152x864,
LCD_1152x768,
LCD_1280x768,
LCD_1024x600,
LCD_640x480_2, /* FSTN, DSTN */
LCD_640x480_3, /* FSTN, DSTN */
LCD_848x480,
LCD_1280x800,
LCD_1680x1050,
LCD_CUSTOM,
LCD_UNKNOWN
} SIS_LCD_TYPE;
#endif
#endif
#ifndef WIN2000 /* mark by Paul, Move definition to sisv.h*/
#ifndef PSIS_DSReg
typedef struct _SIS_DSReg
{
......@@ -156,36 +200,27 @@ typedef struct _SIS_DSReg
} SIS_DSReg, *PSIS_DSReg;
#endif
#ifndef SIS_HW_DEVICE_INFO
#ifndef SIS_HW_INFO
typedef struct _SIS_HW_DEVICE_INFO SIS_HW_DEVICE_INFO, *PSIS_HW_DEVICE_INFO;
typedef struct _SIS_HW_INFO SIS_HW_INFO, *PSIS_HW_INFO;
typedef BOOLEAN (*PSIS_QUERYSPACE) (PSIS_HW_DEVICE_INFO, ULONG, ULONG, ULONG *);
typedef BOOLEAN (*PSIS_QUERYSPACE) (PSIS_HW_INFO, ULONG, ULONG, ULONG *);
struct _SIS_HW_DEVICE_INFO
struct _SIS_HW_INFO
{
PVOID pDevice; /* The pointer to the physical device data structure
in each OS or NULL for unused. */
UCHAR *pjVirtualRomBase; /* base virtual address of VBIOS ROM Space */
/* or base virtual address of ROM image file. */
/* if NULL, then read from pjROMImage; */
/* Note:ROM image file is the file of VBIOS ROM */
BOOLEAN UseROM; /* TW: Use the ROM image if provided */
UCHAR *pjCustomizedROMImage;/* base virtual address of ROM image file. */
/* wincE:ROM image file is the file for OEM */
/* customized table */
/* Linux: not used */
/* NT : not used */
/* Note : pjCustomizedROMImage=NULL if no ROM image file */
#ifdef LINUX_XF86
PCITAG PciTag; /* PCI Tag */
#endif
UCHAR *pjVirtualRomBase; /* ROM image */
BOOLEAN UseROM; /* Use the ROM image if provided */
UCHAR *pjVideoMemoryAddress;/* base virtual memory address */
/* of Linear VGA memory */
ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */
ULONG ulIOAddress; /* base I/O address of VGA ports (0x3B0) */
SISIOADDRESS ulIOAddress; /* base I/O address of VGA ports (0x3B0) */
UCHAR jChipType; /* Used to Identify SiS Graphics Chip */
/* defined in the data structure type */
/* "SIS_CHIP_TYPE" */
......@@ -194,20 +229,12 @@ struct _SIS_HW_DEVICE_INFO
UCHAR ujVBChipID; /* the ID of video bridge */
/* defined in the data structure type */
/* "SIS_VB_CHIP_TYPE" */
#ifdef LINUX_KERNEL
BOOLEAN Is301BDH;
#endif
USHORT usExternalChip; /* NO VB or other video bridge(not */
USHORT usExternalChip; /* NO VB or other video bridge (other than */
/* SiS video bridge) */
/* if ujVBChipID = VB_CHIP_UNKNOWN, */
/* then bit0=1 : LVDS,bit1=1 : trumpion, */
/* bit2=1 : CH7005 & no video bridge if */
/* usExternalChip = 0. */
/* Note: CR37[3:1]: */
/* 001:SiS 301 */
/* 010:LVDS */
/* 011:Trumpion LVDS Scaling Chip */
/* 100:LVDS(LCD-out)+Chrontel 7005 */
/* 101:Single Chrontel 7005 */
/* TW: This has changed on 310/325 series! */
ULONG ulCRT2LCDType; /* defined in the data structure type */
/* "SIS_LCD_TYPE" */
......@@ -215,6 +242,8 @@ struct _SIS_HW_DEVICE_INFO
BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
BOOLEAN bSkipDramSizing; /* True: Skip video memory sizing. */
#ifdef LINUX_KERNEL
PSIS_DSReg pSR; /* restore SR registers in initial function. */
/* end data :(idx, val) = (FF, FF). */
/* Note : restore SR registers if */
......@@ -224,38 +253,25 @@ struct _SIS_HW_DEVICE_INFO
/* end data :(idx, val) = (FF, FF) */
/* Note : restore cR registers if */
/* bSkipDramSizing = TRUE */
#endif
PSIS_QUERYSPACE pQueryVGAConfigSpace; /* Get/Set VGA Configuration */
/* space */
PSIS_QUERYSPACE pQueryNorthBridgeSpace;/* Get/Set North Bridge */
/* space */
UCHAR szVBIOSVer[VBIOS_VER_MAX_LENGTH];
UCHAR pdc; /* TW: PanelDelayCompensation */
#ifdef LINUX_KERNEL
BOOLEAN Is301BDH;
#endif
#ifdef LINUX_XF86
PCITAG PciTag; /* PCI Tag for Linux XF86 */
#endif
};
#endif
#endif
/* TW: Addtional IOCTL for communication sisfb <> X driver */
/* If changing this, sisfb.h must also be changed (for sisfb) */
/* Addtional IOCTL for communication sisfb <> X driver */
/* If changing this, sisfb.h must also be changed (for sisfb) */
#ifdef LINUX_XF86 /* We don't want the X driver to depend on the kernel source */
/* TW: ioctl for identifying and giving some info (esp. memory heap start) */
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO 0x80046ef8 /* Wow, what a terrible hack... */
/* TW: Structure argument for SISFB_GET_INFO ioctl */
/* Structure argument for SISFB_GET_INFO ioctl */
typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
struct _SISFB_INFO {
......@@ -284,86 +300,19 @@ struct _SISFB_INFO {
unsigned char sisfb_lcda;
char reserved[235]; /* for future use */
};
#endif
#ifndef WIN2000
#ifndef WINCE_HEADER
#ifndef BUS_DATA_TYPE
typedef enum _BUS_DATA_TYPE {
ConfigurationSpaceUndefined = -1,
Cmos,
EisaConfiguration,
Pos,
CbusConfiguration,
PCIConfiguration,
VMEConfiguration,
NuBusConfiguration,
PCMCIAConfiguration,
MPIConfiguration,
MPSAConfiguration,
PNPISAConfiguration,
MaximumBusDataType
} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
#endif
#endif /* WINCE_HEADER */
#ifndef PCI_TYPE0_ADDRESSES
#define PCI_TYPE0_ADDRESSES 6
#endif
unsigned long sisfb_vbflags;
unsigned long sisfb_currentvbflags;
#ifndef PCI_TYPE1_ADDRESSES
#define PCI_TYPE1_ADDRESSES 2
#endif
int sisfb_scalelcd;
unsigned long sisfb_specialtiming;
#ifndef WINCE_HEADER
#ifndef PCI_COMMON_CONFIG
typedef struct _PCI_COMMON_CONFIG {
USHORT VendorID; /* (ro) */
USHORT DeviceID; /* (ro) */
USHORT Command; /* Device control */
USHORT Status;
UCHAR RevisionID; /* (ro) */
UCHAR ProgIf; /* (ro) */
UCHAR SubClass; /* (ro) */
UCHAR BaseClass; /* (ro) */
UCHAR CacheLineSize; /* (ro+) */
UCHAR LatencyTimer; /* (ro+) */
UCHAR HeaderType; /* (ro) */
UCHAR BIST; /* Built in self test */
union {
struct _PCI_HEADER_TYPE_0 {
ULONG BaseAddresses[PCI_TYPE0_ADDRESSES];
ULONG CIS;
USHORT SubVendorID;
USHORT SubSystemID;
ULONG ROMBaseAddress;
ULONG Reserved2[2];
UCHAR InterruptLine; /* */
UCHAR InterruptPin; /* (ro) */
UCHAR MinimumGrant; /* (ro) */
UCHAR MaximumLatency; /* (ro) */
} type0;
} u;
UCHAR DeviceSpecific[192];
} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
#endif
#endif /* WINCE_HEADER */
unsigned char sisfb_haveemi;
unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
unsigned char sisfb_haveemilcd;
#ifndef FIELD_OFFSET
#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
char reserved[213]; /* for future use */
};
#endif
#ifndef PCI_COMMON_HDR_LENGTH
#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET (PCI_COMMON_CONFIG, DeviceSpecific))
#endif
#endif
#endif
/* $XFree86$ */
/*
* General structure definitions for universal mode switching modules
*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* If distributed as part of the Linux kernel, the following license terms
* apply:
*
* * This program is free software; you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation; either version 2 of the named License,
* * or any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program; if not, write to the Free Software
* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*
* Otherwise, the following license terms apply:
*
* * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* * are met:
* * 1) Redistributions of source code must retain the above copyright
* * notice, this list of conditions and the following disclaimer.
* * 2) Redistributions in binary form must reproduce the above copyright
* * notice, this list of conditions and the following disclaimer in the
* * documentation and/or other materials provided with the distribution.
* * 3) All advertising materials mentioning features or use of this software
* * must display the following acknowledgement: "This product includes
* * software developed by Thomas Winischhofer, Vienna, Austria."
* * 4) 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 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,
* * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
*
*/
#ifdef _INIT_
#define EXTERN
#else
......@@ -58,7 +112,6 @@ typedef struct _SiS_LVDSCRT1DataStruct
UCHAR CR[15];
} SiS_LVDSCRT1DataStruct;
/*add for LCDA*/
typedef struct _SiS_LCDACRT1DataStruct
{
UCHAR CR[17];
......@@ -79,6 +132,7 @@ typedef struct _SiS_StStruct
UCHAR VB_StTVFlickerIndex;
UCHAR VB_StTVEdgeIndex;
UCHAR VB_StTVYFilterIndex;
UCHAR St_PDC;
} SiS_StStruct;
typedef struct _SiS_VBModeStruct
......@@ -110,14 +164,13 @@ typedef struct _SiS_ExtStruct
{
UCHAR Ext_ModeID;
USHORT Ext_ModeFlag;
USHORT Ext_ModeInfo;
USHORT Ext_Point;
UCHAR Ext_ModeOffset;
USHORT Ext_VESAID;
UCHAR Ext_VESAMEMSize;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
UCHAR VB_ExtTVEdgeIndex;
UCHAR VB_ExtTVYFilterIndex;
UCHAR VB_ExtTVYFilterIndexROM661;
UCHAR REFindex;
} SiS_ExtStruct;
......@@ -130,7 +183,7 @@ typedef struct _SiS_Ext2Struct
UCHAR ModeID;
USHORT XRes;
USHORT YRes;
USHORT ROM_OFFSET;
UCHAR Ext_PDC;
} SiS_Ext2Struct;
typedef struct _SiS_Part2PortTblStruct
......@@ -149,12 +202,6 @@ typedef struct _SiS_MCLKDataStruct
USHORT CLOCK;
} SiS_MCLKDataStruct;
typedef struct _SiS_ECLKDataStruct
{
UCHAR SR2E,SR2F,SR30;
USHORT CLOCK;
} SiS_ECLKDataStruct;
typedef struct _SiS_VCLKDataStruct
{
UCHAR SR2B,SR2C;
......@@ -183,41 +230,78 @@ typedef struct _SiS_ModeResInfoStruct
typedef UCHAR DRAM4Type[4];
/* Defines for SiS_CustomT */
/* Never change these for sisfb compatibility */
#define CUT_NONE 0
#define CUT_FORCENONE 1
#define CUT_BARCO1366 2
#define CUT_BARCO1024 3
#define CUT_COMPAQ1280 4
#define CUT_COMPAQ12802 5
#define CUT_PANEL848 6
#define CUT_CLEVO1024 7
#define CUT_CLEVO10242 8
#define CUT_CLEVO1400 9
#define CUT_CLEVO14002 10
#define CUT_UNIWILL1024 11
#define CUT_ASUSL3000D 12
#define CUT_UNIWILL10242 13
#define CUT_ACER1280 14
#define CUT_COMPAL1400_1 15
#define CUT_COMPAL1400_2 16
#define CUT_ASUSA2H_1 17
#define CUT_ASUSA2H_2 18
typedef struct _SiS_Private
{
#ifdef LINUX_KERNEL
USHORT RelIO;
SISIOADDRESS RelIO;
#endif
USHORT SiS_P3c4;
USHORT SiS_P3d4;
USHORT SiS_P3c0;
USHORT SiS_P3ce;
USHORT SiS_P3c2;
USHORT SiS_P3ca;
USHORT SiS_P3c6;
USHORT SiS_P3c7;
USHORT SiS_P3c8;
USHORT SiS_P3c9;
USHORT SiS_P3da;
USHORT SiS_Part1Port;
USHORT SiS_Part2Port;
USHORT SiS_Part3Port;
USHORT SiS_Part4Port;
USHORT SiS_Part5Port;
SISIOADDRESS SiS_P3c4;
SISIOADDRESS SiS_P3d4;
SISIOADDRESS SiS_P3c0;
SISIOADDRESS SiS_P3ce;
SISIOADDRESS SiS_P3c2;
SISIOADDRESS SiS_P3ca;
SISIOADDRESS SiS_P3c6;
SISIOADDRESS SiS_P3c7;
SISIOADDRESS SiS_P3c8;
SISIOADDRESS SiS_P3c9;
SISIOADDRESS SiS_P3cb;
SISIOADDRESS SiS_P3cd;
SISIOADDRESS SiS_P3da;
SISIOADDRESS SiS_Part1Port;
SISIOADDRESS SiS_Part2Port;
SISIOADDRESS SiS_Part3Port;
SISIOADDRESS SiS_Part4Port;
SISIOADDRESS SiS_Part5Port;
SISIOADDRESS SiS_VidCapt;
SISIOADDRESS SiS_VidPlay;
USHORT SiS_IF_DEF_LVDS;
USHORT SiS_IF_DEF_CH70xx;
USHORT SiS_IF_DEF_CONEX;
USHORT SiS_IF_DEF_TRUMPION;
USHORT SiS_IF_DEF_DSTN;
USHORT SiS_IF_DEF_FSTN;
USHORT SiS_IF_DEF_CH70xx;
USHORT SiS_IF_DEF_HiVision;
USHORT SiS_SysFlags;
UCHAR SiS_VGAINFO;
#ifndef LINUX_KERNEL
USHORT SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
#endif
BOOLEAN SiS_UseROM;
int SiS_CHOverScan;
BOOLEAN SiS_CHSOverScan;
BOOLEAN SiS_ChSW;
BOOLEAN SiS_UseLCDA;
int SiS_UseOEM;
ULONG SiS_CustomT;
USHORT SiS_Backup70xx;
BOOLEAN HaveEMI;
BOOLEAN HaveEMILCD;
BOOLEAN OverruleEMI;
UCHAR EMI_30,EMI_31,EMI_32,EMI_33;
UCHAR PDC;
UCHAR SiS_MyCR63;
USHORT SiS_CRT1Mode;
USHORT SiS_flag_clearbuffer;
int SiS_RAMType;
......@@ -225,12 +309,14 @@ typedef struct _SiS_Private
UCHAR SiS_DataBusWidth;
USHORT SiS_ModeType;
USHORT SiS_VBInfo;
USHORT SiS_TVMode;
USHORT SiS_LCDResInfo;
USHORT SiS_LCDTypeInfo;
USHORT SiS_LCDInfo;
USHORT SiS_LCDInfo661;
USHORT SiS_VBType;
USHORT SiS_VBExtInfo;
USHORT SiS_HiVision;
USHORT SiS_YPbPr;
USHORT SiS_SelectCRT2Rate;
USHORT SiS_SetFlag;
USHORT SiS_RVBHCFACT;
......@@ -254,11 +340,13 @@ typedef struct _SiS_Private
USHORT SiS_DDC_Port;
USHORT SiS_DDC_Index;
USHORT SiS_DDC_Data;
USHORT SiS_DDC_NData;
USHORT SiS_DDC_Clk;
USHORT SiS_DDC_DataShift;
USHORT SiS_DDC_NClk;
USHORT SiS_DDC_DeviceAddr;
USHORT SiS_DDC_ReadAddr;
USHORT SiS_DDC_SecAddr;
BOOLEAN SiS_SensibleSR11;
USHORT SiS_Panel800x600;
USHORT SiS_Panel1024x768;
USHORT SiS_Panel1280x1024;
......@@ -270,22 +358,24 @@ typedef struct _SiS_Private
USHORT SiS_Panel1280x768;
USHORT SiS_Panel1024x600;
USHORT SiS_Panel640x480;
USHORT SiS_Panel640x480_2;
USHORT SiS_Panel640x480_3;
USHORT SiS_Panel1152x864;
USHORT SiS_PanelCustom;
USHORT SiS_PanelBarco1366;
USHORT SiS_PanelMax;
USHORT SiS_PanelMinLVDS;
USHORT SiS_PanelMin301;
USHORT SiS_ChrontelInit;
/* Pointers: */
const SiS_StStruct *SiS_SModeIDTable;
const SiS_StandTableStruct *SiS_StandTable;
SiS_StandTableStruct *SiS_StandTable;
const SiS_ExtStruct *SiS_EModeIDTable;
const SiS_Ext2Struct *SiS_RefIndex;
const SiS_VBModeStruct *SiS_VBModeIDTable;
const SiS_CRT1TableStruct *SiS_CRT1Table;
const SiS_MCLKDataStruct *SiS_MCLKData_0;
const SiS_MCLKDataStruct *SiS_MCLKData_1;
const SiS_ECLKDataStruct *SiS_ECLKData;
const SiS_VCLKDataStruct *SiS_VCLKData;
const SiS_VBVCLKDataStruct *SiS_VBVCLKData;
const SiS_StResInfoStruct *SiS_StResInfo;
......@@ -316,7 +406,7 @@ typedef struct _SiS_Private
const USHORT *pSiS_RGBSenseData;
const USHORT *pSiS_VideoSenseData;
const USHORT *pSiS_YCSenseData;
const USHORT *pSiS_RGBSenseData2; /*301b*/
const USHORT *pSiS_RGBSenseData2;
const USHORT *pSiS_VideoSenseData2;
const USHORT *pSiS_YCSenseData2;
#endif
......@@ -329,6 +419,8 @@ typedef struct _SiS_Private
const UCHAR *SiS_PALMPhase2;
const UCHAR *SiS_PALNPhase2;
const UCHAR *SiS_SpecialPhase;
const UCHAR *SiS_SpecialPhaseM;
const UCHAR *SiS_SpecialPhaseJ;
const SiS_LCDDataStruct *SiS_StLCD1024x768Data;
const SiS_LCDDataStruct *SiS_ExtLCD1024x768Data;
const SiS_LCDDataStruct *SiS_St2LCD1024x768Data;
......@@ -340,26 +432,38 @@ typedef struct _SiS_Private
const SiS_LCDDataStruct *SiS_LCD1280x960Data;
const SiS_LCDDataStruct *SiS_NoScaleData1400x1050;
const SiS_LCDDataStruct *SiS_NoScaleData1600x1200;
const SiS_LCDDataStruct *SiS_NoScaleData1280x768;
const SiS_LCDDataStruct *SiS_StLCD1400x1050Data;
const SiS_LCDDataStruct *SiS_StLCD1600x1200Data;
const SiS_LCDDataStruct *SiS_StLCD1280x768Data;
const SiS_LCDDataStruct *SiS_ExtLCD1400x1050Data;
const SiS_LCDDataStruct *SiS_ExtLCD1600x1200Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x768Data;
const SiS_LCDDataStruct *SiS_NoScaleData;
const SiS_TVDataStruct *SiS_StPALData;
const SiS_TVDataStruct *SiS_ExtPALData;
const SiS_TVDataStruct *SiS_StNTSCData;
const SiS_TVDataStruct *SiS_ExtNTSCData;
/* const SiS_TVDataStruct *SiS_St1HiTVData; */
const SiS_TVDataStruct *SiS_St1HiTVData;
const SiS_TVDataStruct *SiS_St2HiTVData;
const SiS_TVDataStruct *SiS_ExtHiTVData;
const SiS_TVDataStruct *SiS_St525iData;
const SiS_TVDataStruct *SiS_St525pData;
const SiS_TVDataStruct *SiS_St750pData;
const SiS_TVDataStruct *SiS_Ext525iData;
const SiS_TVDataStruct *SiS_Ext525pData;
const SiS_TVDataStruct *SiS_Ext750pData;
const UCHAR *SiS_NTSCTiming;
const UCHAR *SiS_PALTiming;
const UCHAR *SiS_HiTVExtTiming;
const UCHAR *SiS_HiTVSt1Timing;
const UCHAR *SiS_HiTVSt2Timing;
const UCHAR *SiS_HiTVTextTiming;
const UCHAR *SiS_HiTVGroup3Data;
const UCHAR *SiS_HiTVGroup3Simu;
#if 0
const UCHAR *SiS_HiTVTextTiming;
const UCHAR *SiS_HiTVGroup3Text;
#endif
const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
const SiS_LVDSDataStruct *SiS_LVDS800x600Data_1;
......@@ -381,12 +485,23 @@ typedef struct _SiS_Private
const SiS_LVDSDataStruct *SiS_LVDS1152x768Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1152x768Data_2;
const SiS_LVDSDataStruct *SiS_LVDS640x480Data_1;
const SiS_LVDSDataStruct *SiS_LVDS640x480Data_2;
const SiS_LVDSDataStruct *SiS_LVDS320x480Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1024x768Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1024x768Data_2;
const SiS_LVDSDataStruct *SiS_LCDA1280x1024Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1280x1024Data_2;
const SiS_LVDSDataStruct *SiS_LCDA1400x1050Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1400x1050Data_2;
const SiS_LVDSDataStruct *SiS_LCDA1600x1200Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1600x1200Data_2;
const SiS_LVDSDataStruct *SiS_LVDSXXXxXXXData_1;
const SiS_LVDSDataStruct *SiS_LVDSBARCO1366Data_1;
const SiS_LVDSDataStruct *SiS_LVDSBARCO1366Data_2;
const SiS_LVDSDataStruct *SiS_LVDSBARCO1024Data_1;
const SiS_LVDSDataStruct *SiS_LVDSBARCO1024Data_2;
const SiS_LVDSDataStruct *SiS_LVDS848x480Data_1;
const SiS_LVDSDataStruct *SiS_LVDS848x480Data_2;
const SiS_LVDSDataStruct *SiS_CHTVUNTSCData;
const SiS_LVDSDataStruct *SiS_CHTVONTSCData;
const SiS_LVDSDataStruct *SiS_CHTVUPALData;
......@@ -478,6 +593,12 @@ typedef struct _SiS_Private
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11600x1200_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_3;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_3_H;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UNTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1ONTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UPAL;
......@@ -486,28 +607,23 @@ typedef struct _SiS_Private
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1320x480_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_2_H;
/* TW: New for 650/301LV */
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_1;
......@@ -539,6 +655,9 @@ typedef struct _SiS_Private
const UCHAR *SiS_CHTVVCLKUPALN;
const UCHAR *SiS_CHTVVCLKOPALN;
const UCHAR *SiS_CHTVVCLKSOPAL;
USHORT PanelXRes;
USHORT PanelYRes;
BOOLEAN UseCustomMode;
BOOLEAN CRT1UsesCustomMode;
......@@ -560,10 +679,12 @@ typedef struct _SiS_Private
UCHAR CSR2B;
UCHAR CSR2C;
USHORT CSRClock;
USHORT CSRClock_CRT1;
USHORT CModeFlag;
USHORT CModeFlag_CRT1;
USHORT CInfoFlag;
BOOLEAN SiS_CHPALM;
BOOLEAN SiS_CHPALN;
int LVDSHL;
BOOLEAN Backup;
UCHAR Backup_Mode;
......@@ -578,7 +699,22 @@ typedef struct _SiS_Private
UCHAR Backup_1c;
UCHAR Backup_1d;
int UsePanelScaler;
int UsePanelScaler;
USHORT CP_Vendor, CP_Product;
BOOLEAN CP_HaveCustomData;
int CP_PreferredX, CP_PreferredY;
int CP_MaxX, CP_MaxY, CP_MaxClock;
BOOLEAN CP_Supports64048075;
int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */
int CP_HTotal[7], CP_VTotal[7];
int CP_HSyncStart[7], CP_VSyncStart[7];
int CP_HSyncEnd[7], CP_VSyncEnd[7];
int CP_HBlankStart[7], CP_VBlankStart[7];
int CP_HBlankEnd[7], CP_VBlankEnd[7];
int CP_Clock[7];
BOOLEAN CP_DataValid[7];
BOOLEAN CP_HSync_P[7], CP_VSync_P[7], CP_SyncValid[7];
} SiS_Private;
#endif
......
/*
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the named License,
* or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
*/
#ifndef _LINUX_SISFB
#define _LINUX_SISFB
#include <linux/spinlock.h>
#include <asm/ioctl.h>
#include <asm/types.h>
#define DISPTYPE_CRT1 0x00000008L
#define DISPTYPE_CRT2 0x00000004L
#define DISPTYPE_LCD 0x00000002L
#define DISPTYPE_TV 0x00000001L
#define DISPTYPE_DISP1 DISPTYPE_CRT1
#define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV)
#define DISPMODE_SINGLE 0x00000020L
#define DISPMODE_MIRROR 0x00000010L
#define DISPMODE_DUALVIEW 0x00000040L
#define HASVB_NONE 0x00
#define HASVB_301 0x01
#define HASVB_LVDS 0x02
#define HASVB_TRUMPION 0x04
#define HASVB_LVDS_CHRONTEL 0x10
#define HASVB_302 0x20
#define HASVB_303 0x40
#define HASVB_CHRONTEL 0x80
/* TW: *Never* change the order of the following enum */
/**********************************************/
/* PUBLIC */
/**********************************************/
/* vbflags */
#define CRT2_DEFAULT 0x00000001
#define CRT2_LCD 0x00000002 /* TW: Never change the order of the CRT2_XXX entries */
#define CRT2_TV 0x00000004 /* (see SISCycleCRT2Type()) */
#define CRT2_VGA 0x00000008
#define TV_NTSC 0x00000010
#define TV_PAL 0x00000020
#define TV_HIVISION 0x00000040
#define TV_YPBPR 0x00000080
#define TV_AVIDEO 0x00000100
#define TV_SVIDEO 0x00000200
#define TV_SCART 0x00000400
#define VB_CONEXANT 0x00000800
#define TV_PALM 0x00001000
#define TV_PALN 0x00002000
#define TV_NTSCJ 0x00001000
#define VB_302ELV 0x00004000
#define TV_CHSCART 0x00008000
#define TV_CHYPBPR525I 0x00010000
#define CRT1_VGA 0x00000000
#define CRT1_LCDA 0x00020000
#define VGA2_CONNECTED 0x00040000
#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */
#define VB_301 0x00100000 /* Video bridge type */
#define VB_301B 0x00200000
#define VB_302B 0x00400000
#define VB_30xBDH 0x00800000 /* 30xB DH version (w/o LCD support) */
#define VB_LVDS 0x01000000
#define VB_CHRONTEL 0x02000000
#define VB_301LV 0x04000000
#define VB_302LV 0x08000000
#define VB_301C 0x10000000
#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */
#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */
/* Aliases: */
#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
/* Only if TV_YPBPR is set: */
#define TV_YPBPR525I TV_NTSC
#define TV_YPBPR525P TV_PAL
#define TV_YPBPR750P TV_PALM
#define TV_YPBPR1080I TV_PALN
#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
#define VB_SISBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV)
#define VB_SISTVBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV)
#define VB_VIDEOBRIDGE (VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT)
#define VB_DISPTYPE_DISP2 CRT2_ENABLE
#define VB_DISPTYPE_CRT2 CRT2_ENABLE
#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
#define VB_DISPMODE_SINGLE VB_SINGLE_MODE
#define VB_DISPMODE_MIRROR VB_MIRROR_MODE
#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
/* *Never* change the order of the following enum */
typedef enum _SIS_CHIP_TYPE {
SIS_VGALegacy = 0,
SIS_VGALegacy = 0, /* chip_id in sisfb_info */
SIS_300,
SIS_630,
SIS_540,
SIS_730,
SIS_730,
SIS_315H,
SIS_315,
SIS_315PRO,
......@@ -39,15 +100,73 @@ typedef enum _SIS_CHIP_TYPE {
SIS_650,
SIS_740,
SIS_330,
SIS_661,
SIS_741,
SIS_660,
SIS_760,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
typedef enum _VGA_ENGINE {
UNKNOWN_VGA = 0,
SIS_300_VGA,
SIS_315_VGA,
} VGA_ENGINE;
/* Addtional IOCTLs for communication sisfb <> X driver */
/* If changing this, vgatypes.h must also be changed (for X driver) */
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO _IOR('n',0xF8,__u32)
/* ioctrl to get current vertical retrace status */
#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32)
/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
#define SISFB_GET_AUTOMAXIMIZE _IOR('n',0xFA,__u32)
#define SISFB_SET_AUTOMAXIMIZE _IOW('n',0xFA,__u32)
/* TW: Structure argument for SISFB_GET_INFO ioctl */
typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
struct _SISFB_INFO {
unsigned long sisfb_id; /* for identifying sisfb */
#ifndef SISFB_ID
#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
#endif
int chip_id; /* PCI ID of detected chip */
int memory; /* video memory in KB which sisfb manages */
int heapstart; /* heap start (= sisfb "mem" argument) in KB */
unsigned char fbvidmode; /* current sisfb mode */
unsigned char sisfb_version;
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
unsigned char sisfb_caps; /* Sisfb capabilities */
int sisfb_tqlen; /* turbo queue length (in KB) */
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */
unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */
unsigned long sisfb_vbflags;
unsigned long sisfb_currentvbflags;
int sisfb_scalelcd;
unsigned long sisfb_specialtiming;
unsigned char sisfb_haveemi;
unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
unsigned char sisfb_haveemilcd;
char reserved[213]; /* for future use */
};
/* For fb memory manager */
struct sis_memreq {
unsigned long offset;
unsigned long size;
};
/* More or less deprecated stuff follows: */
typedef enum _TVTYPE {
TVMODE_NTSC = 0,
TVMODE_PAL,
......@@ -63,19 +182,14 @@ typedef enum _TVPLUGTYPE {
TVPLUG_TOTAL
} SIS_TV_PLUG;
struct sis_memreq {
unsigned long offset;
unsigned long size;
};
struct mode_info {
int bpp;
int xres;
int yres;
int v_xres;
int v_yres;
int org_x;
int org_y;
int v_xres; /* deprecated - use var instead */
int v_yres; /* deprecated - use var instead */
int org_x; /* deprecated - use var instead */
int org_y; /* deprecated - use var instead */
unsigned int vrate;
};
......@@ -83,15 +197,30 @@ struct ap_data {
struct mode_info minfo;
unsigned long iobase;
unsigned int mem_size;
unsigned long disp_state;
unsigned long disp_state; /* deprecated */
SIS_CHIP_TYPE chip;
unsigned char hasVB;
SIS_TV_TYPE TV_type;
SIS_TV_PLUG TV_plug;
SIS_TV_TYPE TV_type; /* deprecated */
SIS_TV_PLUG TV_plug; /* deprecated */
unsigned long version;
char reserved[256];
unsigned long vbflags; /* replaces deprecated entries above */
unsigned long currentvbflags;
char reserved[248];
};
/**********************************************/
/* PRIVATE */
/**********************************************/
#ifdef __KERNEL__
#include <linux/spinlock.h>
typedef enum _VGA_ENGINE {
UNKNOWN_VGA = 0,
SIS_300_VGA,
SIS_315_VGA,
} VGA_ENGINE;
struct video_info {
int chip_id;
unsigned int video_size;
......@@ -107,26 +236,26 @@ struct video_info {
int video_cmap_len;
int video_width;
int video_height;
int video_vwidth;
int video_vheight;
int org_x;
int org_y;
int video_vwidth; /* DEPRECATED - use var instead */
int video_vheight; /* DEPRECATED - use var instead */
int org_x; /* DEPRECATED - use var instead */
int org_y; /* DEPRECATED - use var instead */
int video_linelength;
unsigned int refresh_rate;
unsigned long disp_state;
unsigned char hasVB;
unsigned char TV_type;
unsigned char TV_plug;
unsigned long disp_state; /* DEPRECATED */
unsigned char hasVB; /* DEPRECATED */
unsigned char TV_type; /* DEPRECATED */
unsigned char TV_plug; /* DEPRECATED */
SIS_CHIP_TYPE chip;
unsigned char revision_id;
unsigned short DstColor; /* TW: For 2d acceleration */
unsigned short DstColor; /* For 2d acceleration */
unsigned long SiS310_AccelDepth;
unsigned long CommandReg;
spinlock_t lockaccel;
spinlock_t lockaccel; /* Do not use outside of kernel! */
unsigned int pcibus;
unsigned int pcislot;
......@@ -137,58 +266,20 @@ struct video_info {
unsigned short subsysvendor;
unsigned short subsysdevice;
char reserved[236];
};
/* TW: Addtional IOCTL for communication sisfb <> X driver */
/* If changing this, vgatypes.h must also be changed (for X driver) */
/* TW: ioctl for identifying and giving some info (esp. memory heap start) */
/*
* NOTE! The ioctl types used to be "size_t" by mistake, but were
* really meant to be __u32. Changed to "__u32" even though that
* changes the value on 64-bit architectures, because the value
* (with a 4-byte size) is also hardwired in vgatypes.h for user
* space exports. So "__u32" is actually more compatible, duh!
*/
#define SISFB_GET_INFO _IOR('n',0xF8,__u32)
#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32)
/* TW: Structure argument for SISFB_GET_INFO ioctl */
typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
struct _SISFB_INFO {
unsigned long sisfb_id; /* for identifying sisfb */
#ifndef SISFB_ID
#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */
#endif
int chip_id; /* PCI ID of detected chip */
int memory; /* video memory in KB which sisfb manages */
int heapstart; /* heap start (= sisfb "mem" argument) in KB */
unsigned char fbvidmode; /* current sisfb mode */
unsigned char sisfb_version;
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
unsigned long vbflags; /* Replacing deprecated stuff from above */
unsigned long currentvbflags;
unsigned char sisfb_caps; /* Sisfb capabilities */
int current_bpp;
int current_width;
int current_height;
int current_htotal;
int current_vtotal;
__u32 current_pixclock;
int current_refresh_rate;
int sisfb_tqlen; /* turbo queue length (in KB) */
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */
unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */
char reserved[235]; /* for future use */
char reserved[200];
};
#ifdef __KERNEL__
extern struct video_info ivideo;
extern void sis_malloc(struct sis_memreq *req);
......
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