Commit 3d178e97 authored by Thomas Winischhofer's avatar Thomas Winischhofer Committed by Linus Torvalds

[PATCH] sisfb update 1.7.10

attached is an update for the sisfb driver to version 1.7.10.

This update includes

- fixes for pure 64bit and 32/64bit mixed systems (add ioctl conversion;
  fix variable sizes, etc; REQUIRED for current X.org/XFree86 on 64bit
  systems, even if pure 64bit),

- fixes for 301C video bridge, (scales TV output correctly now)

- fixes for 1600x1200 and 1400x1050 LCD panels,

- many fixes for 661/741/760 (amongst others, proper LFB support for the
  760 and corrections for SiS' new BIOS data layout; would lead to display
  corruption with old driver)

- add support for many modes for LCD which were unsupported previously,

- add support for HiVision and YPbPr HDTV

- "vga=" statement now honoured properly (sisfb will set the same mode as
  the kernel did by default)

- use LCD native resolution mode if no mode is given

- a major clean up of main driver code,

- radical removal of duplicate (or nearly duplicate) code,

- switched to 2.6 module_param macros,

- enhanced communication with the X driver,

- added eventual POSTing of SiS300/305 card for non-x86 archs,

- added ability to relocate the image on the TV screen using a userland
  tool,

- added Documentation/fb/sisfb.txt (why the heck was this missing?!)

- small fix for SiS DRM driver (match 32/64bit fixes mentioned above)
  (cast the data passed to sis_free as u32)

- make driver re-entrant by avoiding static structures and variables.

As usual, heavily tested.  The mode switching code is even lab-tested by
SiS (although 100% written by me).  Please apply asap (especially since
64bit systems were not properly supported previously; as mentioned, current
X.org/XFree86 needs this update for proper communication with the
framebuffer driver on 64bit systems.  X crashes on such systems with the
old driver).
Signed-off-by: default avatarThomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8fc7813c
What is sisfb?
==============
sisfb is a framebuffer device driver for SiS (Silicon Integrated Systems)
graphics chips. Supported are:
- SiS 300 series: SiS 300/305, 540, 630(S), 730(S)
- SiS 315 series: SiS 315/H/PRO, 55x, (M)65x, 740, (M)661(F/M)X, (M)741(GX)
- SiS 330 series: SiS 330 ("Xabre"), (M)760
Why do I need a framebuffer driver?
===================================
sisfb is eg. useful if you want a high-resolution text console. Besides that,
sisfb is required to run DirectFB (which comes with an additional, dedicated
driver for the 315 series).
On the 300 series, sisfb on kernels older than 2.6.3 furthermore plays an
important role in connection with DRM/DRI: Sisfb manages the memory heap
used by DRM/DRI for 3D texture and other data. This memory management is
required for using DRI/DRM.
Kernels >= around 2.6.3 do not need sisfb any longer for DRI/DRM memory
management. The SiS DRM driver has been updated and features a memory manager
of its own (which will be used if sisfb is not compiled). So unless you want
a graphical console, you don't need sisfb on kernels >=2.6.3.
Sidenote: Since this seems to be a commonly made mistake: sisfb and vesafb
cannot be active at the same time! Do only select one of them in your kernel
configuration.
How are parameters passed to sisfb?
===================================
Well, it depends: If compiled statically into the kernel, use lilo's append
statement to add the parameters to the kernel command line. Please see lilo's
(or GRUB's) documentation for more information. If sisfb is a kernel module,
parameters are given with the modprobe (or insmod) command.
Example for sisfb as part of the static kernel: Add the following line to your
lilo.conf:
append="video=sisfb:mode:1024x768x16,mem:12288,rate:75"
Example for sisfb as a module: Start sisfb by typing
modprobe sisfb mode=1024x768x16 rate=75 mem=12288
A common mistake is that folks use a wrong parameter format when using the
driver compiled into the kernel. Please note: If compiled into the kernel,
the parameter format is video=sisfb:mode:none or video=sisfb:mode:1024x768x16
(or whatever mode you want to use, alternatively using any other format
described above or the vesa keyword instead of mode). If compiled as a module,
the parameter format reads mode=none or mode=1024x768x16 (or whatever mode you
want to use). Using a "=" for a ":" (and vice versa) is a huge difference!
Additionally: If you give more than one argument to the in-kernel sisfb, the
arguments are separated with ",". For example:
video=sisfb:mode:1024x768x16,rate:75,mem:12288
How do I use it?
================
Preface statement: This file only covers very little of the driver's
capabilities and features. Please refer to the author's and maintainer's
website at http://www.winischhofer.net/linuxsisvga.shtml for more
information. Additionally, "modinfo sisfb" gives an overview over all
supported options including some explanation.
The desired display mode can be specified using the keyword "mode" with
a parameter in one of the follwing formats:
- XxYxDepth or
- XxY-Depth or
- XxY-Depth@Rate or
- XxY
- or simply use the VESA mode number in hexadecimal or decimal.
For example: 1024x768x16, 1024x768-16@75, 1280x1024-16. If no depth is
specified, it defaults to 8. If no rate is given, it defaults to 60Hz. Depth 32
means 24bit color depth (but 32 bit framebuffer depth, which is not relevant
to the user).
Additionally, sisfb understands the keyword "vesa" followed by a VESA mode
number in decimal or hexadecimal. For example: vesa=791 or vesa=0x117. Please
use either "mode" or "vesa" but not both.
Linux 2.4 only: If no mode is given, sisfb defaults to "no mode" (mode=none) if
compiled as a module; if sisfb is statically compiled into the kernel, it
defaults to 800x600x8 unless CRT2 type is LCD, in which case the LCD's native
resolution is used. If you want to switch to a different mode, use the fbset
shell command.
Linux 2.6 only: If no mode is given, sisfb defaults to 800x600x8 unless CRT2
type is LCD, in which case it defaults to the LCD's native resolution. If
you want to switch to another mode, use the stty shell command.
You should compile in both vgacon (to boot if you remove you SiS card from
your system) and sisfb (for graphics mode). Under Linux 2.6, also "Framebuffer
console support" (fbcon) is needed for a graphical console.
You should *not* compile-in vesafb. And please do not use the "vga=" keyword
in lilo's or grub's configuration file; mode selection is done using the
"mode" or "vesa" keywords as a parameter. See above and below.
X11
===
If using XFree86 or X.org, it is recommended that you don't use the "fbdev"
driver but the dedicated "sis" X driver. The "sis" X driver and sisfb are
developed by the same person (Thomas Winischhofer) and cooperate well with
each other.
SVGALib
=======
SVGALib, if directly accessing the hardware, never restores the screen
correctly, especially on laptops or if the output devices are LCD or TV.
Therefore, use the chipset "FBDEV" in SVGALib configuration. This will make
SVGALib use the framebuffer device for mode switches and restoration.
Configuration
=============
(Some) accepted options:
off - Disable sisfb. This option is only understood if sisfb is
in-kernel, not a module.
mem:X - size of memory for the console, rest will be used for DRI/DRM. X
is in kilobytes. On 300 series, the default is 4096, 8192 or
16384 (each in kilobyte) depending on how much video ram the card
has. On 315/330 series, the default is the maximum available ram
(since DRI/DRM is not supported for these chipsets).
noaccel - do not use 2D acceleration engine. (Default: use acceleration)
noypan - disable y-panning and scroll by redrawing the entire screen.
This is much slower than y-panning. (Default: use y-panning)
vesa:X - selects startup videomode. X is number from 0 to 0x1FF and
represents the VESA mode number (can be given in decimal or
hexadecimal form, the latter prefixed with "0x").
mode:X - selects startup videomode. Please see above for the format of
"X".
Boolean options such as "noaccel" or "noypan" are to be given without a
parameter if sisfb is in-kernel (for example "video=sisfb:noypan). If
sisfb is a module, these are to be set to 1 (for example "modprobe sisfb
noypan=1").
--
Thomas Winischhofer <thomas@winischhofer.net>
May 27, 2004
......@@ -189,3 +189,5 @@ Code Seq# Include File Comments
<mailto:michael.klein@puffin.lb.shuttle.de>
0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
<mailto:aherrman@de.ibm.com>
0xF3 00-3F video/sisfb.h sisfb (in development)
<mailto:thomas@winischhofer.net>
......@@ -113,7 +113,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, fb, sizeof(fb));
DRM_DEBUG("alloc fb, size = %d, offset = %ld\n", fb.size, req.offset);
DRM_DEBUG("alloc fb, size = %d, offset = %d\n", fb.size, req.offset);
return retval;
}
......@@ -130,7 +130,7 @@ int sis_fb_free( DRM_IOCTL_ARGS )
if (!del_alloc_set(fb.context, VIDEO_TYPE, fb.free))
retval = DRM_ERR(EINVAL);
sis_free(fb.free);
sis_free((u32)fb.free);
DRM_DEBUG("free fb, offset = %lu\n", fb.free);
......
/* $XFree86$ */
/* $XdotOrg$ */
/*
* Register settings for SiS 300 series
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -52,20 +50,7 @@
*
*/
typedef struct _SiS300_StStruct
{
UCHAR St_ModeID;
USHORT St_ModeFlag;
UCHAR St_StTableIndex;
UCHAR St_CRT2CRTC;
UCHAR St_ResInfo;
UCHAR VB_StTVFlickerIndex;
UCHAR VB_StTVEdgeIndex;
UCHAR VB_StTVYFilterIndex;
UCHAR St_PDC;
} SiS300_StStruct;
static const SiS300_StStruct SiS300_SModeIDTable[] =
static const SiS_StStruct SiS300_SModeIDTable[] =
{
{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00, 0},
{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00, 0},
......@@ -89,206 +74,168 @@ static const SiS300_StStruct SiS300_SModeIDTable[] =
{0xff, 0, 0, 0, 0, 0, 0, 0, 0}
};
typedef struct _SiS300_ExtStruct
{
UCHAR Ext_ModeID;
USHORT Ext_ModeFlag;
UCHAR Ext_ModeOffset;
USHORT Ext_VESAID;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
UCHAR VB_ExtTVEdgeIndex;
UCHAR VB_ExtTVYFilterIndex;
UCHAR VB_ExtTVYFilterIndexROM661;
UCHAR REFindex;
} SiS300_ExtStruct;
static const SiS300_ExtStruct SiS300_EModeIDTable[] =
{
{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00}, /* 800x600x? */
{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08},
{0x2f,0x021b,0x03,0x0100,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10}, /* 640x400x8 */
{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00},
{0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11}, /* 720x480x8 */
{0x32,0x2a1b,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12}, /* 720x576x8 */
{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11}, /* 720x480x16 */
{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12}, /* 720x576x16 */
{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11}, /* 720x480x32 */
{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12}, /* 720x576x32 */
{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13}, /* 1024x768x? */
{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13}, /* 1024x768x8 */
{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x8 */
{0x3c,0x063b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
{0x3d,0x067d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
{0x40,0x921c,0x00,0x010d,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23}, /* 320x200x15 */
{0x41,0x921d,0x00,0x010e,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23}, /* 320x200x16 */
{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08},
{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08},
{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00}, /* 800x600x15 */
{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00}, /* 800x600x16 */
{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
{0x50,0x921b,0x00,0x0132,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24}, /* 320x240x8 */
{0x51,0xb21b,0x01,0x0133,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25}, /* 400x300x8 */
{0x52,0x921b,0x02,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26}, /* 512x384x8 */
{0x56,0x921d,0x00,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24}, /* 320x240x16 */
{0x57,0xb21d,0x01,0x0136,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25}, /* 400x300x16 */
{0x58,0x921d,0x02,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26}, /* 512x384x16 */
{0x59,0x921b,0x00,0x0138,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23}, /* 320x200x8 */
{0x5c,0x921f,0x02,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26}, /* 512x384x32 */
{0x5d,0x021d,0x03,0x0139,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10}, /* 640x400x16 */
{0x5e,0x021f,0x03,0x0000,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10}, /* 640x400x32 */
{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08},
{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00}, /* 800x600x32 */
{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
{0x66,0x06ff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
{0x6b,0x07ff,0x08,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28}, /* 2048x1536x8 - not in BIOS! */
{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28}, /* 2048x1536x16 - not in BIOS! */
{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d}, /* 800x480x8 */
{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30}, /* 1024x576x8 */
{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30}, /* 1024x576x16 */
{0x75,0x0e3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33}, /* 1280x720x16 */
{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d}, /* 800x480x32 */
{0x77,0x0a3f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30}, /* 1024x576x32 */
{0x78,0x0eff,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33}, /* 1280x720x32 */
{0x79,0x0e3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33}, /* 1280x720x8 */
{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d}, /* 800x480x16 */
{0x7c,0x0a3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29}, /* 1280x960x8 */
{0x7d,0x0a7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29}, /* 1280x960x16 */
{0x7e,0x0aff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29}, /* 1280x960x32 */
{0x20,0x0a1b,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b}, /* 1024x600 */
{0x21,0x0a3d,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
{0x22,0x0a7f,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
{0x23,0x0a1b,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c}, /* 1152x768 */
{0x24,0x0a3d,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
{0x25,0x0a7f,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
{0x29,0x0e1b,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36}, /* 1152x864 */
{0x2a,0x0e3d,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
{0x2b,0x0e7f,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
{0x39,0x2a1b,0x0d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38}, /* 848x480 */
{0x3b,0x2a3d,0x0d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38},
{0x3e,0x2a7f,0x0d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38},
{0x3f,0x2a1b,0x0d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a}, /* 856x480 */
{0x42,0x2a3d,0x0d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a},
{0x45,0x2a7f,0x0d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a},
{0x48,0x223b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c}, /* 1360x768 */
{0x4b,0x227d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
{0x4e,0x22ff,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
{0x4f,0x921f,0x00,0x0000,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23}, /* 320x200x32 */
{0x53,0x921f,0x00,0x0000,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24}, /* 320x240x32 */
{0x54,0xb21f,0x01,0x0000,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25}, /* 400x300x32 */
{0x55,0x2e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x768 */
{0x5a,0x2e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
{0x5b,0x2eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e}, /* 768x576x8 */
{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e}, /* 768x576x16 */
{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e}, /* 768x576x32 */
{0x67,0x2e3b,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f}, /* 1360x1024x8 (BARCO) */
{0x6f,0x2e7d,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f}, /* 1360x1024x16 (BARCO) */
{0x72,0x2eff,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f}, /* 1360x1024x32 (BARCO) */
{0xff,0x0000,0x00,0xffff,0, 0x00,0x00,0x00,0x00,0x00}
};
typedef struct _SiS300_Ext2Struct
{
USHORT Ext_InfoFlag;
UCHAR Ext_CRT1CRTC; /* Index in SiS300_CRT1Table */
UCHAR Ext_CRTVCLK; /* Index in VCLK array */
UCHAR Ext_CRT2CRTC; /* Index in LCD Paneltype arrays (&3f) */
UCHAR ModeID;
USHORT XRes;
USHORT YRes;
UCHAR Ext_PDC;
} SiS300_Ext2Struct;
static const SiS300_Ext2Struct SiS300_RefIndex[] =
{
{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0}, /* 00 */
{0x0467,0x0e,0x44,0x05,0x6a, 800, 600, 0}, /* 01 */
{0x0067,0x0f,0x07,0x48,0x6a, 800, 600, 0}, /* 02 - CRT1CRTC was 0x4f */
{0x0067,0x10,0x06,0x8b,0x6a, 800, 600, 0}, /* 03 */
{0x0147,0x11,0x08,0x00,0x6a, 800, 600, 0}, /* 04 */
{0x0147,0x12,0x0c,0x00,0x6a, 800, 600, 0}, /* 05 */
{0x0047,0x11,0x4e,0x00,0x6a, 800, 600, 0}, /* 06 - CRT1CRTC was 0x51 */
{0x0047,0x11,0x13,0x00,0x6a, 800, 600, 0}, /* 07 */
{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0}, /* 08 */
{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0}, /* 09 */
{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0}, /* 0a */
{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0}, /* 0b */
{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0}, /* 0c */
{0xc047,0x0a,0x08,0x00,0x2e, 640, 480, 0}, /* 0d */
{0xc047,0x0b,0x0a,0x00,0x2e, 640, 480, 0}, /* 0e */
{0xc047,0x0c,0x10,0x00,0x2e, 640, 480, 0}, /* 0f */
{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */
{0xc04f,0x31,0x01,0x06,0x31, 720, 480, 0}, /* 11 */
{0x004f,0x32,0x03,0x06,0x32, 720, 576, 0}, /* 12 */
{0x0187,0x15,0x05,0x00,0x37,1024, 768, 0}, /* 13 */
{0xc877,0x16,0x09,0x06,0x37,1024, 768, 0}, /* 14 */
{0xc067,0x17,0x0b,0x49,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */
{0x0267,0x18,0x0d,0x00,0x37,1024, 768, 0}, /* 16 */
{0x0047,0x19,0x11,0x8c,0x37,1024, 768, 0}, /* 17 - CRT1CRTC was 0x59 */
{0x0047,0x1a,0x52,0x00,0x37,1024, 768, 0}, /* 18 */
{0x0007,0x1b,0x16,0x00,0x37,1024, 768, 0}, /* 19 - CRT1CRTC was 0x5b */
{0x0387,0x1c,0x4d,0x00,0x3a,1280,1024, 0}, /* 1a - CRT1CRTC was 0x5c */
{0x0077,0x1d,0x14,0x07,0x3a,1280,1024, 0}, /* 1b */
{0x0047,0x1e,0x17,0x00,0x3a,1280,1024, 0}, /* 1c */
{0x0007,0x1f,0x98,0x00,0x3a,1280,1024, 0}, /* 1d */
{0x0007,0x20,0x59,0x00,0x3c,1600,1200, 0}, /* 1e - CRT1CRTC was 0x60 */
{0x0007,0x21,0x5a,0x00,0x3c,1600,1200, 0}, /* 1f */
{0x0007,0x22,0x1b,0x00,0x3c,1600,1200, 0}, /* 20 */
{0x0007,0x23,0x1d,0x00,0x3c,1600,1200, 0}, /* 21 - CRT1CRTC was 0x63 */
{0x0007,0x24,0x1e,0x00,0x3c,1600,1200, 0}, /* 22 */
{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0}, /* 23 */
{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0}, /* 24 */
{0x0077,0x02,0x04,0x05,0x51, 400, 300, 0}, /* 25 */
{0xc877,0x03,0x09,0x06,0x52, 512, 384, 0}, /* 26 */ /* was c077 */
{0x8207,0x25,0x1f,0x00,0x68,1920,1440, 0}, /* 27 */
{0x0007,0x26,0x20,0x00,0x6c,2048,1536, 0}, /* 28 */
{0x0067,0x27,0x14,0x08,0x6e,1280, 960, 0}, /* 29 - TW: 1280x960-60 */
{0x0027,0x45,0x3c,0x08,0x6e,1280, 960, 0}, /* 2a - TW: 1280x960-85 */
{0xc077,0x33,0x09,0x06,0x20,1024, 600, 0}, /* 2b */
{0xc077,0x34,0x0b,0x06,0x23,1152, 768, 0}, /* 2c */ /* VCLK 0x09 */
{0x0057,0x35,0x27,0x08,0x70, 800, 480, 0}, /* 2d */
{0x0047,0x36,0x37,0x08,0x70, 800, 480, 0}, /* 2e */
{0x0047,0x37,0x08,0x08,0x70, 800, 480, 0}, /* 2f */
{0x0057,0x38,0x09,0x09,0x71,1024, 576, 0}, /* 30 */
{0x0047,0x39,0x38,0x09,0x71,1024, 576, 0}, /* 31 */
{0x0047,0x3a,0x11,0x09,0x71,1024, 576, 0}, /* 32 */
{0x0057,0x3b,0x39,0x0a,0x75,1280, 720, 0}, /* 33 */
{0x0047,0x3c,0x3a,0x0a,0x75,1280, 720, 0}, /* 34 */
{0x0007,0x3d,0x3b,0x0a,0x75,1280, 720, 0}, /* 35 */
{0x0047,0x3e,0x34,0x06,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */
{0x0047,0x44,0x3a,0x06,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */
{0x00c7,0x3f,0x28,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */
{0xc067,0x40,0x3d,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz */
{0x00c7,0x41,0x28,0x00,0x3f, 856, 480, 0}, /* 3a 856x480-38Hzi */
{0xc047,0x42,0x28,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz */
{0x0067,0x43,0x3e,0x0c,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */
{0x0077,0x46,0x3f,0x08,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */
{0x004f,0x47,0x03,0x06,0x5f, 768, 576, 0}, /* 3e 768x576 */
{0x0027,0x48,0x13,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */
{0xffff, 0, 0, 0, 0, 0, 0, 0}
};
typedef struct _SiS_VBModeIDTableStruct
{
UCHAR ModeID;
UCHAR VB_TVDelayIndex;
UCHAR VB_TVFlickerIndex;
UCHAR VB_TVPhaseIndex;
UCHAR VB_TVYFilterIndex;
UCHAR VB_LCDDelayIndex;
UCHAR _VB_LCDHIndex;
UCHAR _VB_LCDVIndex;
}SiS_VBModeIDTableStruct;
static const SiS_VBModeIDTableStruct SiS300_VBModeIDTable[] =
static const SiS_ExtStruct SiS300_EModeIDTable[] =
{
{0x6a,0x2212,0x0102,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x? */
{0x2e,0x0a1b,0x0101,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1},
{0x2f,0x021b,0x0100,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x8 */
{0x30,0x2a1b,0x0103,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1},
{0x31,0x0a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x8 */
{0x32,0x2a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x8 */
{0x33,0x0a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x16 */
{0x34,0x2a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x16 */
{0x35,0x0a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x32 */
{0x36,0x2a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x32 */
{0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x? */
{0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x8 */
{0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, /* 1280x1024x8 */
{0x3c,0x063b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
{0x3d,0x067d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
{0x40,0x921c,0x010d,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x15 */
{0x41,0x921d,0x010e,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x16 */
{0x43,0x0a1c,0x0110,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1},
{0x44,0x0a1d,0x0111,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1},
{0x46,0x2a1c,0x0113,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x15 */
{0x47,0x2a1d,0x0114,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x16 */
{0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
{0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
{0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
{0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
{0x50,0x921b,0x0132,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x8 */
{0x51,0xb21b,0x0133,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x8 */
{0x52,0x921b,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x8 */
{0x56,0x921d,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x16 */
{0x57,0xb21d,0x0136,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x16 */
{0x58,0x921d,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x16 */
{0x59,0x921b,0x0138,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x8 */
{0x5c,0x921f,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x26,-1}, /* 512x384x32 */
{0x5d,0x021d,0x0139,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x16 */
{0x5e,0x021f,0x0000,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x32 */
{0x62,0x0a3f,0x013a,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1},
{0x63,0x2a3f,0x013b,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, /* 800x600x32 */
{0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
{0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
{0x66,0x06ff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
{0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
{0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
{0x6b,0x07ff,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
{0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x8 - not in BIOS! */
{0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x16 - not in BIOS! */
{0x70,0x2a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x8 */
{0x71,0x0a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x8 */
{0x74,0x0a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x16 */
{0x75,0x0e3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x16 */
{0x76,0x2a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x32 */
{0x77,0x0a3f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x32 */
{0x78,0x0eff,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x32 */
{0x79,0x0e3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x8 */
{0x7a,0x2a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x16 */
{0x7c,0x0a3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x8 */
{0x7d,0x0a7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x16 */
{0x7e,0x0aff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x32 */
{0x20,0x0a1b,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, /* 1024x600 */
{0x21,0x0a3d,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1},
{0x22,0x0a7f,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1},
{0x23,0x0a1b,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, /* 1152x768 */
{0x24,0x0a3d,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1},
{0x25,0x0a7f,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1},
{0x29,0x0e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, /* 1152x864 */
{0x2a,0x0e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1},
{0x2b,0x0e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1},
{0x39,0x2a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, /* 848x480 */
{0x3b,0x2a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1},
{0x3e,0x2a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1},
{0x3f,0x2a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, /* 856x480 */
{0x42,0x2a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1},
{0x45,0x2a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1},
{0x48,0x223b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, /* 1360x768 */
{0x4b,0x227d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1},
{0x4e,0x22ff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1},
{0x4f,0x921f,0x0000,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x32 */
{0x53,0x921f,0x0000,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x32 */
{0x54,0xb21f,0x0000,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x32 */
{0x55,0x2e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x768 */
{0x5a,0x2e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1},
{0x5b,0x2eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1},
{0x5f,0x2a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x8 */
{0x60,0x2a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x16 */
{0x61,0x2a1f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x32 */
{0x67,0x2e3b,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x8 (BARCO) */
{0x6f,0x2e7d,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x16 (BARCO) */
{0x72,0x2eff,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x32 (BARCO) */
{0xff,0x0000,0xffff,0, 0x00,0x00,0x00,0x00,0x00}
};
static const SiS_Ext2Struct SiS300_RefIndex[] =
{
{0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0}, /* 00 */
{0x0467,0x0e,0x44,0x05,0x05,0x6a, 800, 600, 0}, /* 01 */
{0x0067,0x0f,0x07,0x48,0x00,0x6a, 800, 600, 0}, /* 02 - CRT1CRTC was 0x4f */
{0x0067,0x10,0x06,0x8b,0x00,0x6a, 800, 600, 0}, /* 03 */
{0x0147,0x11,0x08,0x00,0x00,0x6a, 800, 600, 0}, /* 04 */
{0x0147,0x12,0x0c,0x00,0x00,0x6a, 800, 600, 0}, /* 05 */
{0x0047,0x11,0x4e,0x00,0x00,0x6a, 800, 600, 0}, /* 06 - CRT1CRTC was 0x51 */
{0x0047,0x11,0x13,0x00,0x00,0x6a, 800, 600, 0}, /* 07 */
{0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0}, /* 08 */
{0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0}, /* 09 */
{0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0}, /* 0a */
{0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0}, /* 0b */
{0xc047,0x09,0x05,0x00,0x00,0x2e, 640, 480, 0}, /* 0c */
{0xc047,0x0a,0x08,0x00,0x00,0x2e, 640, 480, 0}, /* 0d */
{0xc047,0x0b,0x0a,0x00,0x00,0x2e, 640, 480, 0}, /* 0e */
{0xc047,0x0c,0x10,0x00,0x00,0x2e, 640, 480, 0}, /* 0f */
{0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */
{0xc04f,0x31,0x01,0x06,0x00,0x31, 720, 480, 0}, /* 11 */
{0x004f,0x32,0x03,0x06,0x00,0x32, 720, 576, 0}, /* 12 */
{0x0187,0x15,0x05,0x00,0x00,0x37,1024, 768, 0}, /* 13 */
{0xc877,0x16,0x09,0x06,0x06,0x37,1024, 768, 0}, /* 14 */
{0xc067,0x17,0x0b,0x49,0x06,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */
{0x0267,0x18,0x0d,0x00,0x06,0x37,1024, 768, 0}, /* 16 */
{0x0047,0x19,0x11,0x8c,0x00,0x37,1024, 768, 0}, /* 17 - CRT1CRTC was 0x59 */
{0x0047,0x1a,0x52,0x00,0x00,0x37,1024, 768, 0}, /* 18 */
{0x0007,0x1b,0x16,0x00,0x00,0x37,1024, 768, 0}, /* 19 - CRT1CRTC was 0x5b */
{0x0387,0x1c,0x4d,0x00,0x00,0x3a,1280,1024, 0}, /* 1a - CRT1CRTC was 0x5c */
{0x0077,0x1d,0x14,0x07,0x00,0x3a,1280,1024, 0}, /* 1b */
{0x0047,0x1e,0x17,0x00,0x00,0x3a,1280,1024, 0}, /* 1c */
{0x0007,0x1f,0x98,0x00,0x00,0x3a,1280,1024, 0}, /* 1d */
{0x0007,0x20,0x59,0x00,0x00,0x3c,1600,1200, 0}, /* 1e - CRT1CRTC was 0x60 */
{0x0007,0x21,0x5a,0x00,0x00,0x3c,1600,1200, 0}, /* 1f */
{0x0007,0x22,0x1b,0x00,0x00,0x3c,1600,1200, 0}, /* 20 */
{0x0007,0x23,0x1d,0x00,0x00,0x3c,1600,1200, 0}, /* 21 - CRT1CRTC was 0x63 */
{0x0007,0x24,0x1e,0x00,0x00,0x3c,1600,1200, 0}, /* 22 */
{0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0}, /* 23 */
{0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0}, /* 24 */
{0x0077,0x02,0x04,0x05,0x05,0x51, 400, 300, 0}, /* 25 */
{0xc877,0x03,0x09,0x06,0x06,0x52, 512, 384, 0}, /* 26 */ /* was c077 */
{0x8207,0x25,0x1f,0x00,0x00,0x68,1920,1440, 0}, /* 27 */
{0x0007,0x26,0x20,0x00,0x00,0x6c,2048,1536, 0}, /* 28 */
{0x0067,0x27,0x14,0x08,0x0a,0x6e,1280, 960, 0}, /* 29 - 1280x960-60 */
{0x0027,0x45,0x3c,0x08,0x0a,0x6e,1280, 960, 0}, /* 2a - 1280x960-85 */
{0xc077,0x33,0x09,0x06,0x00,0x20,1024, 600, 0}, /* 2b */
{0xc077,0x34,0x0b,0x06,0x00,0x23,1152, 768, 0}, /* 2c */ /* VCLK 0x09 */
{0x0057,0x35,0x27,0x08,0x00,0x70, 800, 480, 0}, /* 2d */
{0x0047,0x36,0x37,0x08,0x00,0x70, 800, 480, 0}, /* 2e */
{0x0047,0x37,0x08,0x08,0x00,0x70, 800, 480, 0}, /* 2f */
{0x0057,0x38,0x09,0x09,0x00,0x71,1024, 576, 0}, /* 30 */
{0x0047,0x39,0x38,0x09,0x00,0x71,1024, 576, 0}, /* 31 */
{0x0047,0x3a,0x11,0x09,0x00,0x71,1024, 576, 0}, /* 32 */
{0x0057,0x3b,0x39,0x0a,0x00,0x75,1280, 720, 0}, /* 33 */
{0x0047,0x3c,0x3a,0x0a,0x00,0x75,1280, 720, 0}, /* 34 */
{0x0007,0x3d,0x3b,0x0a,0x00,0x75,1280, 720, 0}, /* 35 */
{0x0047,0x3e,0x34,0x06,0x00,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */
{0x0047,0x44,0x3a,0x06,0x00,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */
{0x00c7,0x3f,0x28,0x00,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */
{0xc067,0x40,0x3d,0x0b,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz */
{0x00c7,0x41,0x28,0x00,0x00,0x3f, 856, 480, 0}, /* 3a 856x480-38Hzi */
{0xc047,0x42,0x28,0x00,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz */
{0x0067,0x43,0x3e,0x0c,0x0b,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */
{0x0077,0x46,0x3f,0x08,0x00,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */
{0x004f,0x47,0x03,0x06,0x00,0x5f, 768, 576, 0}, /* 3e 768x576 */
{0x0027,0x48,0x13,0x08,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */
{0xffff, 0, 0, 0, 0, 0, 0, 0, 0}
};
static const SiS_VBModeStruct SiS300_VBModeIDTable[] =
{
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
......@@ -355,12 +302,7 @@ static const SiS_VBModeIDTableStruct SiS300_VBModeIDTable[] =
{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
typedef struct _SiS300_CRT1TableStruct
{
UCHAR CR[17];
} SiS300_CRT1TableStruct;
static const SiS300_CRT1TableStruct SiS300_CRT1Table[] =
static const SiS_CRT1TableStruct SiS300_CRT1Table[] =
{
#if 1
{{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x00 - 320x200 */
......@@ -625,13 +567,7 @@ static const SiS300_CRT1TableStruct SiS300_CRT1Table[] =
0x00}} /* 0x48 */
};
typedef struct _SiS300_MCLKDataStruct
{
UCHAR SR28,SR29,SR2A;
USHORT CLOCK;
} SiS300_MCLKDataStruct;
static const SiS300_MCLKDataStruct SiS300_MCLKData_630[] =
static const SiS_MCLKDataStruct SiS300_MCLKData_630[] =
{
{ 0x5a,0x64,0x80, 66},
{ 0xb3,0x45,0x80, 83},
......@@ -643,7 +579,7 @@ static const SiS300_MCLKDataStruct SiS300_MCLKData_630[] =
{ 0x37,0x61,0x80,100}
};
static const SiS300_MCLKDataStruct SiS300_MCLKData_300[] =
static const SiS_MCLKDataStruct SiS300_MCLKData_300[] =
{
{ 0x68,0x43,0x80,125},
{ 0x68,0x43,0x80,125},
......@@ -655,13 +591,7 @@ static const SiS300_MCLKDataStruct SiS300_MCLKData_300[] =
{ 0x37,0x61,0x80,100}
};
typedef struct _SiS300_VCLKDataStruct
{
UCHAR SR2B,SR2C;
USHORT CLOCK;
} SiS300_VCLKDataStruct;
static const SiS300_VCLKDataStruct SiS300_VCLKData[] =
static SiS_VCLKDataStruct SiS300_VCLKData[] =
{
{ 0x1b,0xe1, 25}, /* 0x00 */
{ 0x4e,0xe4, 28}, /* 0x01 */
......@@ -736,14 +666,7 @@ static const SiS300_VCLKDataStruct SiS300_VCLKData[] =
{ 0x37,0x61,100}, /* 0x43 */ /* 1280x960 LCD */
{ 0xe3,0x9a,106}, /* 0x44 */ /* 1360x1024 - special for Barco iQ R300 */
{ 0xe2,0x46,135}, /* 0x45 */ /* 1280x1024-75, better clock for VGA2 */
{ 0xff,0x00, 0}
};
static const UCHAR SiS300_ScreenOffset[] =
{
0x14,0x19,0x20,0x28,0x32,0x40,0x50,
0x64,0x78,0x80,0x2d,0x35,0x48,0x35,
0x55,0x30,0xff
{ 0, 0, 0} /* 0x46 custom (will be filled out) */
};
#ifndef LINUX_XF86
......@@ -789,12 +712,7 @@ static const DRAM4Type SiS300_CR40[5];
static UCHAR SiS300_CR49[2];
#endif
typedef struct _SiS300_PanelDelayTblStruct
{
UCHAR timer[2];
} SiS300_PanelDelayTblStruct;
static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
static const SiS_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
{
{{0x05,0xaa}},
{{0x05,0x14}},
......@@ -815,7 +733,7 @@ static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
};
#if 0
static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
static const SiS_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
{
{{0x05,0xaa}},
{{0x05,0x14}},
......@@ -840,28 +758,18 @@ static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
/* SIS VIDEO BRIDGE ----------------------------------------- */
/**************************************************************/
typedef struct _SiS300_LCDDataStruct
{
USHORT RVBHCMAX;
USHORT RVBHCFACT;
USHORT VGAHT;
USHORT VGAVT;
USHORT LCDHT;
USHORT LCDVT;
} SiS300_LCDDataStruct;
static const SiS300_LCDDataStruct SiS300_StLCD1024x768Data[] =
static const SiS_LCDDataStruct SiS300_St2LCD1024x768Data[] =
{
{ 66, 31, 992, 510,1320, 816},
{ 66, 31, 992, 510,1320, 816},
{ 176, 75, 900, 510,1320, 816},
{ 176, 75, 900, 510,1320, 816},
{ 66, 31, 992, 510,1320, 816},
{ 27, 16,1024, 650,1350, 832},
{ 62, 25, 800, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 104, 45, 945, 496,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 31, 18,1008, 624,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS300_LCDDataStruct SiS300_ExtLCD1024x768Data[] =
static const SiS_LCDDataStruct SiS300_ExtLCD1024x768Data[] =
{
{ 12, 5, 896, 512,1344, 806},
{ 12, 5, 896, 510,1344, 806},
......@@ -878,30 +786,19 @@ static const SiS300_LCDDataStruct SiS300_ExtLCD1024x768Data[] =
{ 1, 1,1344, 806,1344, 806}
};
static const SiS300_LCDDataStruct SiS300_St2LCD1024x768Data[] =
{
{ 62, 25, 800, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 104, 45, 945, 496,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 31, 18,1008, 624,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS300_LCDDataStruct SiS300_StLCD1280x1024Data[] =
static const SiS_LCDDataStruct SiS300_St2LCD1280x1024Data[] =
{
{ 4, 1, 880, 510,1650,1088},
{ 4, 1, 880, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 4, 1, 880, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 13, 5,1024, 675,1560,1152},
{ 16, 9,1266, 804,1688,1072},
{ 1, 1,1688,1066,1688,1066}
};
static const SiS300_LCDDataStruct SiS300_ExtLCD1280x1024Data[] =
static const SiS_LCDDataStruct SiS300_ExtLCD1280x1024Data[] =
{
{ 211, 60,1024, 501,1688,1066},
{ 211, 60,1024, 508,1688,1066},
......@@ -913,74 +810,18 @@ static const SiS300_LCDDataStruct SiS300_ExtLCD1280x1024Data[] =
{ 1, 1,1688,1066,1688,1066}
};
static const SiS300_LCDDataStruct SiS300_St2LCD1280x1024Data[] =
{
{ 22, 5, 800, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 13, 5,1024, 675,1560,1152},
{ 16, 9,1266, 804,1688,1072},
{ 1, 1,1688,1066,1688,1066}
};
static const SiS300_LCDDataStruct SiS300_NoScaleData1024x768[] =
{
{ 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}
};
static const SiS300_LCDDataStruct SiS300_NoScaleData1280x1024[] = /* TW: Fake */
{
{ 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}
};
typedef struct _SiS300_Part2PortTblStruct
{
UCHAR CR[12];
} SiS300_Part2PortTblStruct;
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
{ /* VESA Timing */
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
{ /* Non-VESA */
{{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
......@@ -991,38 +832,23 @@ static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
{{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_2[] =
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_2[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
{ /* TW: Temporary data, invalid */
static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
......@@ -1030,15 +856,7 @@ static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
/* LVDS/Chrontel -------------------------------------------- */
/**************************************************************/
typedef struct _SiS300_LVDSDataStruct
{
USHORT VGAHT;
USHORT VGAVT;
USHORT LCDHT;
USHORT LCDVT;
} SiS300_LVDSDataStruct;
static const SiS300_LVDSDataStruct SiS300_CHTVUPALData[] =
static const SiS_LVDSDataStruct SiS300_CHTVUPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1048,7 +866,7 @@ static const SiS300_LVDSDataStruct SiS300_CHTVUPALData[] =
{ 936, 836, 936, 836}
};
static const SiS300_LVDSDataStruct SiS300_CHTVOPALData[] =
static const SiS_LVDSDataStruct SiS300_CHTVOPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1058,7 +876,7 @@ static const SiS300_LVDSDataStruct SiS300_CHTVOPALData[] =
{ 960, 750, 960, 750}
};
static const SiS300_LVDSDataStruct SiS300_CHTVSOPALData[] =
static const SiS_LVDSDataStruct SiS300_CHTVSOPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1068,13 +886,8 @@ static const SiS300_LVDSDataStruct SiS300_CHTVSOPALData[] =
{ 944, 625, 944, 625}
};
typedef struct _SiS300_LVDSDesStruct
{
USHORT LCDHDES;
USHORT LCDVDES;
} SiS300_LVDSDesStruct;
static const SiS300_LVDSDesStruct SiS300_PanelType00_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType00_1[] =
{
{ 1059, 626 }, /* 2.08 */
{ 1059, 624 },
......@@ -1098,7 +911,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType00_1[] =
#endif
};
static const SiS300_LVDSDesStruct SiS300_PanelType01_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType01_1[] =
{
{ 0, 0 }, /* 2.08 */
{ 0, 0 },
......@@ -1122,7 +935,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType01_1[] =
#endif
};
static const SiS300_LVDSDesStruct SiS300_PanelType02_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType02_1[] =
{
{ 1059, 626 }, /* 2.08 */
{ 1059, 624 },
......@@ -1146,7 +959,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType02_1[] =
#endif
};
static const SiS300_LVDSDesStruct SiS300_PanelType03_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType03_1[] =
{
{ 8, 436},
{ 8, 440},
......@@ -1159,7 +972,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType03_1[] =
{1343, 794}
};
static const SiS300_LVDSDesStruct SiS300_PanelType04_1[] = /* 1280x1024 */
static const SiS_LVDSDesStruct SiS300_PanelType04_1[] = /* 1280x1024 */
{
{1343, 798},
{1343, 794},
......@@ -1172,7 +985,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_1[] = /* 1280x1024 */
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType05_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType05_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1185,7 +998,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType05_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType06_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType06_1[] = /* Clevo Trumpion 1024x768 */
{
{1343, 798},
{1343, 794},
......@@ -1198,7 +1011,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType06_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType07_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType07_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1211,7 +1024,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType07_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType08_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType08_1[] =
{
{1059, 626},
{1059, 624},
......@@ -1224,7 +1037,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType08_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType09_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType09_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1237,7 +1050,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType09_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0a_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0a_1[] =
{
{1059, 626},
{1059, 624},
......@@ -1250,7 +1063,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0a_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0b_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0b_1[] =
{
{1343, 0},
{1343, 0},
......@@ -1263,7 +1076,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0b_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0c_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0c_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1276,7 +1089,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0c_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0d_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0d_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1289,7 +1102,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0d_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0e_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0e_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1302,7 +1115,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0e_1[] =
{ 0, 0} /* 1280x960 - not applicable */
};
static const SiS300_LVDSDesStruct SiS300_PanelType0f_1[] =
static const SiS_LVDSDesStruct SiS300_PanelType0f_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1315,7 +1128,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0f_1[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType00_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType00_2[] =
{
{976, 527},
{976, 502},
......@@ -1328,7 +1141,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType00_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType01_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType01_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1341,7 +1154,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType01_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType02_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType02_2[] =
{
{976, 527},
{976, 502},
......@@ -1354,7 +1167,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType02_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType03_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType03_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1367,7 +1180,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType03_2[] =
{1152, 597}
};
static const SiS300_LVDSDesStruct SiS300_PanelType04_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType04_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1380,7 +1193,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType05_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType05_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1393,7 +1206,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType05_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType06_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType06_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1406,7 +1219,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType06_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType07_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType07_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1419,7 +1232,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType07_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType08_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType08_2[] =
{
{976, 527},
{976, 502},
......@@ -1432,7 +1245,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType08_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType09_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType09_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1445,7 +1258,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType09_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0a_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0a_2[] =
{
{976, 527},
{976, 502},
......@@ -1458,7 +1271,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0a_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0b_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0b_2[] =
{
{ 1152, 700},
{ 1152, 675},
......@@ -1471,7 +1284,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0b_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0c_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0c_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1484,7 +1297,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0c_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0d_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0d_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1497,7 +1310,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0d_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0e_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0e_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1510,7 +1323,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0e_2[] =
{ 0, 0}
};
static const SiS300_LVDSDesStruct SiS300_PanelType0f_2[] =
static const SiS_LVDSDesStruct SiS300_PanelType0f_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1523,8 +1336,36 @@ static const SiS300_LVDSDesStruct SiS300_PanelType0f_2[] =
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS300_PanelTypeNS_1[]=
{
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 805},
{ 0, 0},
{ 0, 0},
{ 0, 0}
};
static const SiS_LVDSDesStruct SiS300_PanelTypeNS_2[] =
{
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
/* Custom data for Barco iQ R200/300/400 (BIOS 2.00.07) */
static const SiS300_LVDSDesStruct SiS300_PanelType04_1a[] = /* 1280x1024 (1366x1024) */
static const SiS_LVDSDesStruct SiS300_PanelType04_1a[] = /* 1280x1024 (1366x1024) */
{
{1330, 798}, /* 320x200 */
{1330, 794},
......@@ -1537,7 +1378,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_1a[] = /* 1280x1024 (1366x
{ 0, 0} /* 1360x1024 */
};
static const SiS300_LVDSDesStruct SiS300_PanelType04_2a[] =
static const SiS_LVDSDesStruct SiS300_PanelType04_2a[] =
{
{1152, 622},
{1152, 597},
......@@ -1551,7 +1392,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_2a[] =
};
/* Custom data for Barco iQ G200/300/400 (BIOS 2.00.07) */
static const SiS300_LVDSDesStruct SiS300_PanelType04_1b[] = /* 1024x768 */
static const SiS_LVDSDesStruct SiS300_PanelType04_1b[] = /* 1024x768 */
{
{1330, 798}, /* 320x200 */
{1330, 794},
......@@ -1562,7 +1403,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_1b[] = /* 1024x768 */
{ 0, 805} /* 1024x768 / 512x384 */
};
static const SiS300_LVDSDesStruct SiS300_PanelType04_2b[] =
static const SiS_LVDSDesStruct SiS300_PanelType04_2b[] =
{
{1152, 622},
{1152, 597},
......@@ -1575,12 +1416,7 @@ static const SiS300_LVDSDesStruct SiS300_PanelType04_2b[] =
/* CRT1 CRTC for slave modes */
typedef struct _SiS300_LVDSCRT1DataStruct
{
UCHAR CR[15];
} SiS300_LVDSCRT1DataStruct;
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[] =
{
{{0x65,0x4f,0x89,0x56,0x83,0xaf,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
......@@ -1602,7 +1438,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[] =
{
{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x04,
......@@ -1624,7 +1460,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
......@@ -1649,7 +1485,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[] =
0x01}}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
......@@ -1698,7 +1534,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[] =
#endif
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[] =
{
{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
......@@ -1723,7 +1559,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x04,
......@@ -1748,7 +1584,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[] =
{
{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
0xf4,0x88,0x8f,0x73,0x20,0x00,0x06,
......@@ -1770,7 +1606,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[] =
{
{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
......@@ -1792,7 +1628,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -1817,7 +1653,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -1842,7 +1678,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -1867,7 +1703,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -1892,7 +1728,64 @@ static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[] =
0x01}}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[] =
static const SiS_LVDSCRT1DataStruct SiS300_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 SiS300_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}}
};
static const SiS_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[] =
{
{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
......@@ -1914,7 +1807,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[] =
static const SiS_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[] =
{
{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
......@@ -1936,7 +1829,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[] =
static const SiS_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -1958,7 +1851,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[] =
static const SiS_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -1980,7 +1873,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[] =
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1SOPAL[] =
static const SiS_LVDSCRT1DataStruct SiS300_CHTVCRT1SOPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -2002,12 +1895,7 @@ static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1SOPAL[] =
0x01 }}
};
typedef struct _SiS300_CHTVRegDataStruct
{
UCHAR Reg[16];
} SiS300_CHTVRegDataStruct;
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
static const SiS_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
{
{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2017,7 +1905,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
{{0x8d,0xc4,0x00,0x3b,0xfb,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 24: 800x600 NTSC 7/10 */
};
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
static const SiS_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
{
{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2027,7 +1915,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
{{0x8c,0xb4,0x00,0x32,0xf9,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 23: 800x600 NTSC 3/4 */
};
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
static const SiS_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2038,7 +1926,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
};
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
static const SiS_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2049,7 +1937,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
};
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
static const SiS_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
......
/* $XFree86$ */
/* $XdotOrg$ */
/*
* Register settings for SiS 315/330 series
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -52,20 +50,7 @@
*
*/
typedef struct _SiS310_StStruct
{
UCHAR St_ModeID;
USHORT St_ModeFlag;
UCHAR St_StTableIndex;
UCHAR St_CRT2CRTC;
UCHAR St_ResInfo;
UCHAR VB_StTVFlickerIndex;
UCHAR VB_StTVEdgeIndex;
UCHAR VB_StTVYFilterIndex;
UCHAR St_PDC;
} SiS310_StStruct;
static const SiS310_StStruct SiS310_SModeIDTable[]=
static const SiS_StStruct SiS310_SModeIDTable[]=
{
{0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00, 0x40},
{0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00, 0x40},
......@@ -89,207 +74,192 @@ static const SiS310_StStruct SiS310_SModeIDTable[]=
{0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00, 0x40}
};
typedef struct _SiS310_ExtStruct
{
UCHAR Ext_ModeID;
USHORT Ext_ModeFlag;
UCHAR Ext_ModeOffset;
USHORT Ext_VESAID;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
UCHAR VB_ExtTVEdgeIndex;
UCHAR VB_ExtTVYFilterIndex;
UCHAR VB_ExtTVYFilterIndexROM661;
UCHAR REFindex;
} SiS310_ExtStruct;
static const SiS310_ExtStruct SiS310_EModeIDTable[]=
{
{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00}, /* 800x600x? */
{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08}, /* 640x480x8 */
{0x2f,0x0a1b,0x03,0x0100,SIS_RI_640x400, 0x00,0x00,0x05,0x05,0x10}, /* 640x400x8 */
{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00}, /* 800x600x8 */
{0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11}, /* 720x480x8 */
{0x32,0x0a1b,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12}, /* 720x576x8 */
{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11}, /* 720x480x16 */
{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12}, /* 720x576x16 */
{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11}, /* 720x480x32 */
{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12}, /* 720x576x32 */
{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x? */
{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x8 */
{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x8 */
{0x3c,0x0e3b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x8 */
{0x3d,0x0e7d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x16 */
{0x40,0x9a1c,0x00,0x010d,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25}, /* 320x200x15 */
{0x41,0x9a1d,0x00,0x010e,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25}, /* 320x200x16 */
{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08},
{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08}, /* 640x480x16 */
{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00},
{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00}, /* 800x600x16 */
{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13},
{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x16 */
{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x16 */
{0x50,0x9a1b,0x00,0x0132,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26}, /* 320x240x8 */
{0x51,0xba1b,0x01,0x0133,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27}, /* 400x300x8 */
{0x52,0xba1b,0x02,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28}, /* 512x384x8 */
{0x56,0x9a1d,0x00,0x0135,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26}, /* 320x240x16 */
{0x57,0xba1d,0x01,0x0136,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27}, /* 400x300x16 */
{0x58,0xba1d,0x02,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28}, /* 512x384x16 */
{0x59,0x9a1b,0x00,0x0138,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25}, /* 320x200x8 */
{0x5a,0x021b,0x00,0x0138,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f}, /* 320x240x8 fstn */
{0x5b,0x0a1d,0x00,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f}, /* 320x240x16 fstn */
{0x5c,0xba1f,0x02,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28}, /* 512x384x32 */
{0x5d,0x0a1d,0x03,0x0139,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10},
{0x5e,0x0a1f,0x03,0x0000,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10}, /* 640x400x32 */
{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08}, /* 640x480x32 */
{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00}, /* 800x600x32 */
{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x32 */
{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x32 */
{0x66,0x0eff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x32 */
{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x8 */
{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x16 */
{0x6b,0x07ff,0x08,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x32 */
{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x8 */
{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x16 */
{0x6e,0x07ff,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x32 */
{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34}, /* 800x480x8 */
{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x8 */
{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x16 */
{0x75,0x0a3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x16 */
{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34}, /* 800x480x32 */
{0x77,0x0a1f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x32 */
{0x78,0x0a3f,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x32 */
{0x79,0x0a3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x8 */
{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34}, /* 800x480x16 */
{0x7c,0x0e3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x8 */
{0x7d,0x0e7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x16 */
{0x7e,0x0eff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x32 */
{0x23,0x0e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x8 */
{0x24,0x0e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x16 */
{0x25,0x0eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x32 */
{0x26,0x0e3b,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x8 */
{0x27,0x0e7d,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x16 */
{0x28,0x0eff,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x32*/
{0x29,0x0e1b,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43}, /* 1152x864 */
{0x2a,0x0e3d,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
{0x2b,0x0e7f,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
{0x39,0x2a1b,0x0b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45}, /* 848x480 */
{0x3b,0x2a3d,0x0b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45},
{0x3e,0x2a7f,0x0b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45},
{0x3f,0x2a1b,0x0b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47}, /* 856x480 */
{0x42,0x2a3d,0x0b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47},
{0x45,0x2a7f,0x0b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47},
{0x48,0x2a1b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49}, /* 1360x768 */
{0x4b,0x2a3d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
{0x4e,0x2a7f,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
{0x4f,0x9a1f,0x00,0x0000,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25}, /* 320x200x32 */
{0x53,0x9a1f,0x00,0x0000,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26}, /* 320x240x32 */
{0x54,0xba1f,0x01,0x0000,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27}, /* 400x300x32 */
{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a}, /* 768x576x8 */
{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a}, /* 768x576x16 */
{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a}, /* 768x576x32 */
{0xff,0x0000,0x00,0x0000,0, 0x00,0x00,0x00,0x00,0x00}
};
typedef struct _SiS310_Ext2Struct
{
USHORT Ext_InfoFlag;
UCHAR Ext_CRT1CRTC;
UCHAR Ext_CRTVCLK;
UCHAR Ext_CRT2CRTC;
UCHAR ModeID;
USHORT XRes;
USHORT YRes;
UCHAR Ext_PDC;
} SiS310_Ext2Struct;
static const SiS310_Ext2Struct SiS310_RefIndex[]=
{
{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
{0x0067,0x0e,0x04,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
{0x0067,0x0f,0x08,0x48,0x6a, 800, 600, 0x40}, /* 0x2 */
{0x0067,0x10,0x07,0x8b,0x6a, 800, 600, 0x40}, /* 0x3 */
{0x0047,0x11,0x0a,0x00,0x6a, 800, 600, 0x40}, /* 0x4 */
{0x0047,0x12,0x0d,0x00,0x6a, 800, 600, 0x40}, /* 0x5 */
{0x0047,0x13,0x13,0x00,0x6a, 800, 600, 0x20}, /* 0x6 */
{0x0107,0x14,0x1c,0x00,0x6a, 800, 600, 0x20}, /* 0x7 */
{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0x40}, /* 0xa */
{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0x40}, /* 0xb */
{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0x40}, /* 0xc */
{0xc047,0x0a,0x09,0x00,0x2e, 640, 480, 0x40}, /* 0xd */
{0xc047,0x0b,0x0e,0x00,0x2e, 640, 480, 0x40}, /* 0xe */
{0xc047,0x0c,0x15,0x00,0x2e, 640, 480, 0x40}, /* 0xf */
{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
{0xc04f,0x3c,0x01,0x06,0x31, 720, 480, 0x30}, /* 0x11 */
{0x004f,0x3d,0x03,0x06,0x32, 720, 576, 0x30}, /* 0x12 */
{0x0087,0x15,0x06,0x00,0x37,1024, 768, 0x30}, /* 0x13 */
{0xc877,0x16,0x0b,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
{0xc067,0x17,0x0f,0x49,0x37,1024, 768, 0x20}, /* 0x15 */
{0x0067,0x18,0x11,0x00,0x37,1024, 768, 0x20}, /* 0x16 */
{0x0047,0x19,0x16,0x8c,0x37,1024, 768, 0x20}, /* 0x17 */
{0x0107,0x1a,0x1b,0x00,0x37,1024, 768, 0x10}, /* 0x18 */
{0x0107,0x1b,0x1f,0x00,0x37,1024, 768, 0x10}, /* 0x19 */
{0x0087,0x1c,0x11,0x00,0x3a,1280,1024, 0x30}, /* 0x1a */
{0x0137,0x1d,0x19,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
{0x0107,0x1e,0x1e,0x00,0x3a,1280,1024, 0x00}, /* 0x1c */
{0x0207,0x1f,0x20,0x00,0x3a,1280,1024, 0x00}, /* 0x1d */
{0x0227,0x20,0x21,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
{0x0407,0x21,0x22,0x00,0x3c,1600,1200, 0x00}, /* 0x1f */
{0x0407,0x22,0x23,0x00,0x3c,1600,1200, 0x00}, /* 0x20 */
{0x0407,0x23,0x25,0x00,0x3c,1600,1200, 0x00}, /* 0x21 */
{0x0007,0x24,0x26,0x00,0x3c,1600,1200, 0x00}, /* 0x22 */
{0x0007,0x25,0x2c,0x00,0x3c,1600,1200, 0x00}, /* 0x23 */
{0x0007,0x26,0x34,0x00,0x3c,1600,1200, 0x00}, /* 0x24 */
{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
{0x007f,0x02,0x04,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
{0xc077,0x03,0x0b,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
{0x8007,0x27,0x27,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
{0x4007,0x28,0x29,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
{0x4007,0x29,0x2e,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
{0x4007,0x2a,0x30,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
{0x4007,0x2b,0x35,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
{0x4005,0x2c,0x39,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
{0x4007,0x2d,0x2b,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
{0x4007,0x2e,0x31,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
{0x4007,0x2f,0x33,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
{0x4007,0x30,0x37,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
{0x4005,0x31,0x38,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
{0x0057,0x32,0x40,0x08,0x70, 800, 480, 0x30}, /* 0x34 */
{0x0047,0x33,0x07,0x08,0x70, 800, 480, 0x30}, /* 0x35 */
{0x0047,0x34,0x0a,0x08,0x70, 800, 480, 0x30}, /* 0x36 */
{0x0057,0x35,0x0b,0x09,0x71,1024, 576, 0x30}, /* 0x37 */
{0x0047,0x36,0x11,0x09,0x71,1024, 576, 0x30}, /* 0x38 */
{0x0047,0x37,0x16,0x09,0x71,1024, 576, 0x30}, /* 0x39 */
{0x0117,0x38,0x19,0x0a,0x75,1280, 720, 0x30}, /* 0x3a */
{0x0107,0x39,0x1e,0x0a,0x75,1280, 720, 0x30}, /* 0x3b */
{0x0207,0x3a,0x20,0x0a,0x75,1280, 720, 0x30}, /* 0x3c */
{0x0127,0x3b,0x19,0x08,0x7c,1280, 960, 0x30}, /* 0x3d */
{0x0227,0x4c,0x59,0x08,0x7c,1280, 960, 0x20}, /* 0x3e */
{0xc07f,0x4e,0x00,0x06,0x5a, 320, 240, 0x30}, /* 0x3f */ /* FSTN 320x240 */
{0x0077,0x42,0x5b,0x08,0x23,1280, 768, 0x30}, /* 0x40 */ /* TW: 0x5b was 0x12 */
{0x0127,0x43,0x4d,0x08,0x26,1400,1050, 0x30}, /* 0x41 */
{0x0207,0x4b,0x5a,0x08,0x26,1400,1050, 0x30}, /* 0x42 Non-BIOS, new */
{0x0107,0x44,0x19,0x00,0x29,1152, 864, 0x30}, /* 0x43 Non-BIOS, new */
{0x0107,0x4a,0x1e,0x00,0x29,1152, 864, 0x30}, /* 0x44 Non-BIOS, new */
{0x0087,0x45,0x57,0x00,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi - Non-BIOS, new */
{0xc067,0x46,0x55,0x0b,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz - Non-BIOS, new */
{0x0087,0x47,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi - Non-BIOS, new */
{0xc047,0x48,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz - Non-BIOS, new */
{0x0067,0x49,0x58,0x0c,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz - Non-BIOS, new */
{0x004f,0x4d,0x03,0x06,0x5f, 768, 576, 0x30}, /* 0x4a 768x576 */
{0xffff,0x00,0x00,0x00,0x00, 0, 0, 0}
};
typedef struct _SiS310_CRT1TableStruct
{
UCHAR CR[17];
} SiS310_CRT1TableStruct;
static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
static const SiS_ExtStruct SiS310_EModeIDTable[]=
{
{0x6a,0x2212,0x0102,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x? */
{0x2e,0x0a1b,0x0101,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x8 */
{0x2f,0x0a1b,0x0100,SIS_RI_640x400, 0x00,0x00,0x05,0x05,0x10, 0}, /* 640x400x8 */
{0x30,0x2a1b,0x0103,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x8 */
{0x31,0x4a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x8 */
{0x32,0x4a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x8 */
{0x33,0x4a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x16 */
{0x34,0x6a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x16 */
{0x35,0x4a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x32 */
{0x36,0x6a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x32 */
{0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x? */
{0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x8 */
{0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x8 */
{0x3c,0x0e3b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x8 */
{0x3d,0x0e7d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x16 */
{0x40,0x9a1c,0x010d,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x15 */
{0x41,0x9a1d,0x010e,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x16 */
{0x43,0x0a1c,0x0110,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2},
{0x44,0x0a1d,0x0111,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x16 */
{0x46,0x2a1c,0x0113,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3},
{0x47,0x2a1d,0x0114,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x16 */
{0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13, 4},
{0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x16 */
{0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8},
{0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x16 */
{0x50,0x9a1b,0x0132,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x8 */
{0x51,0xba1b,0x0133,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x8 */
{0x52,0xba1b,0x0134,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x8 */
{0x56,0x9a1d,0x0135,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x16 */
{0x57,0xba1d,0x0136,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x16 */
{0x58,0xba1d,0x0137,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x16 */
{0x59,0x9a1b,0x0138,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x8 */
{0x5a,0x021b,0x0138,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x8 fstn */
{0x5b,0x0a1d,0x0135,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x16 fstn */
{0x5c,0xba1f,0x0000,SIS_RI_512x384, 0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x32 */
{0x5d,0x0a1d,0x0139,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10, 0},
{0x5e,0x0a1f,0x0000,SIS_RI_640x400, 0x00,0x00,0x05,0x07,0x10, 0}, /* 640x400x32 */
{0x62,0x0a3f,0x013a,SIS_RI_640x480, 0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x32 */
{0x63,0x2a3f,0x013b,SIS_RI_800x600, 0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x32 */
{0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x32 */
{0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x32 */
{0x66,0x0eff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x32 */
{0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x8 */
{0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x16 */
{0x6b,0x07ff,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x32 */
{0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x8 */
{0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x16 */
{0x6e,0x07ff,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x32 */
{0x70,0x6a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x8 */
{0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x8 */
{0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x16 */
{0x75,0x0a3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x16 */
{0x76,0x6a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x32 */
{0x77,0x4a1f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x32 */
{0x78,0x0a3f,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x32 */
{0x79,0x0a3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x8 */
{0x7a,0x6a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x16 */
{0x7c,0x0e3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x8 */
{0x7d,0x0e7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x16 */
{0x7e,0x0eff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x32 */
{0x23,0x0e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x8 */
{0x24,0x0e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x16 */
{0x25,0x0eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x32 */
{0x26,0x0e3b,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x8 */
{0x27,0x0e7d,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x16 */
{0x28,0x0eff,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x32*/
{0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1}, /* 1152x864 */
{0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
{0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
{0x39,0x6a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45,-1}, /* 848x480 */
{0x3b,0x6a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45,-1},
{0x3e,0x6a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x45,-1},
{0x3f,0x6a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47,-1}, /* 856x480 */
{0x42,0x6a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47,-1},
{0x45,0x6a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x47,-1},
{0x48,0x6a3b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1}, /* 1360x768 */
{0x4b,0x6a7d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
{0x4e,0x6aff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
{0x4f,0x9a1f,0x0000,SIS_RI_320x200, 0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x32 */
{0x53,0x9a1f,0x0000,SIS_RI_320x240, 0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x32 */
{0x54,0xba1f,0x0000,SIS_RI_400x300, 0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x32 */
{0x5f,0x6a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a,-1}, /* 768x576 */
{0x60,0x6a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a,-1},
{0x61,0x6a3f,0x0000,SIS_RI_768x576, 0x00,0x00,0x06,0x06,0x4a,-1},
{0x14,0x0e3b,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7}, /* 1280x800 */
{0x15,0x0e7d,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
{0x16,0x0eff,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
{0x17,0x0e3b,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9}, /* 1680x1050 */
{0x18,0x0e7d,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
{0x19,0x0eff,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
{0x2c,0x267b,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1}, /* 1920x1080(i) */
{0x2d,0x26fd,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1},
{0x73,0x27ff,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1},
{0x1d,0x6a1b,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x4e,-1}, /* 960x540 */
{0x1e,0x6a3d,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x4e,-1},
{0x1f,0x6a7f,0x0000,SIS_RI_960x540, 0x00,0x00,0x00,0x00,0x4e,-1},
{0xff,0x0000,0x0000,0, 0x00,0x00,0x00,0x00,0x00,-1}
};
static const SiS_Ext2Struct SiS310_RefIndex[]=
{
{0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
{0x0067,0x0e,0x04,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
{0x0067,0x0f,0x08,0x48,0x05,0x6a, 800, 600, 0x40}, /* 0x2 */
{0x0067,0x10,0x07,0x8b,0x05,0x6a, 800, 600, 0x40}, /* 0x3 */
{0x0047,0x11,0x0a,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x4 */
{0x0047,0x12,0x0d,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x5 */
{0x0047,0x13,0x13,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x6 */
{0x0107,0x14,0x1c,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x7 */
{0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
{0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
{0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0x40}, /* 0xa */
{0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0x40}, /* 0xb */
{0xc047,0x09,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xc */
{0xc047,0x0a,0x09,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xd */
{0xc047,0x0b,0x0e,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xe */
{0xc047,0x0c,0x15,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xf */
{0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
{0xc06f,0x3c,0x01,0x06,0x13,0x31, 720, 480, 0x30}, /* 0x11 */
{0x006f,0x3d,0x03,0x06,0x14,0x32, 720, 576, 0x30}, /* 0x12 */
{0x0087,0x15,0x06,0x00,0x06,0x37,1024, 768, 0x30}, /* 0x13 */
{0xc877,0x16,0x0b,0x06,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
{0xc067,0x17,0x0f,0x49,0x06,0x37,1024, 768, 0x20}, /* 0x15 */
{0x0067,0x18,0x11,0x00,0x06,0x37,1024, 768, 0x20}, /* 0x16 */
{0x0047,0x19,0x16,0x8c,0x06,0x37,1024, 768, 0x20}, /* 0x17 */
{0x0107,0x1a,0x1b,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x18 */
{0x0107,0x1b,0x1f,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x19 */
{0x0087,0x1c,0x11,0x00,0x07,0x3a,1280,1024, 0x30}, /* 0x1a */
{0x0137,0x1d,0x19,0x07,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
{0x0107,0x1e,0x1e,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1c */
{0x0207,0x1f,0x20,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1d */
{0x0227,0x20,0x21,0x09,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
{0x0407,0x21,0x22,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x1f */
{0x0407,0x22,0x23,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x20 */
{0x0407,0x23,0x25,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x21 */
{0x0007,0x24,0x26,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x22 */
{0x0007,0x25,0x2c,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x23 */
{0x0007,0x26,0x34,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x24 */
{0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
{0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
{0x007f,0x02,0x04,0x05,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
{0xc077,0x03,0x0b,0x06,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
{0x8007,0x27,0x27,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
{0x4007,0x28,0x29,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
{0x4007,0x29,0x2e,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
{0x4007,0x2a,0x30,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
{0x4007,0x2b,0x35,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
{0x4005,0x2c,0x39,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
{0x4007,0x2d,0x2b,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
{0x4007,0x2e,0x31,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
{0x4007,0x2f,0x33,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
{0x4007,0x30,0x37,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
{0x4005,0x31,0x38,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
{0x0077,0x32,0x40,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x34 */
{0x0047,0x33,0x07,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x35 */
{0x0047,0x34,0x0a,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x36 */
{0x0077,0x35,0x0b,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x37 */
{0x0047,0x36,0x11,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x38 */
{0x0047,0x37,0x16,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x39 */
{0x1137,0x38,0x19,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3a */
{0x1107,0x39,0x1e,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3b */
{0x1307,0x3a,0x20,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3c */
{0x0127,0x3b,0x19,0x08,0x0a,0x7c,1280, 960, 0x30}, /* 0x3d */
{0x0227,0x4c,0x59,0x08,0x0a,0x7c,1280, 960, 0x20}, /* 0x3e */
{0xc07f,0x4e,0x00,0x06,0x04,0x5a, 320, 240, 0x30}, /* 0x3f */ /* FSTN 320x240 */
{0x0077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30}, /* 0x40 */ /* 0x5b was 0x12 */
{0x0127,0x43,0x4d,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x41 */
{0x0207,0x4b,0x5a,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x42 1400x1050-75Hz */
{0x0127,0x44,0x19,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x43 1152x864-75Hz */
{0x0127,0x4a,0x1e,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x44 1152x864-85Hz */
{0x0087,0x45,0x57,0x00,0x16,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi */
{0xc067,0x46,0x55,0x0b,0x16,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz */
{0x0087,0x47,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi */
{0xc067,0x48,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz */
{0x0067,0x49,0x58,0x0c,0x1b,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz */
{0x006f,0x4d,0x03,0x06,0x15,0x5f, 768, 576, 0x30}, /* 0x4a 768x576-56Hz */
{0x0067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30}, /* 0x4b 1280x800-60Hz */
{0x0067,0x50,0x5d,0x0c,0x0e,0x17,1680,1050, 0x30}, /* 0x4c 1680x1050-60Hz */
{0x0087,0x51,0x69,0x00,0x00,0x2c,1920,1080, 0x30}, /* 0x4d 1920x1080 60Hzi */
{0x0067,0x52,0x6a,0x00,0x1c,0x1d, 960, 540, 0x30}, /* 0x4e 960x540 60Hz */
{0xffff,0x00,0x00,0x00,0x00,0x00, 0, 0, 0}
};
static const SiS_CRT1TableStruct SiS310_CRT1Table[]=
{
{{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
......@@ -310,7 +280,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
{{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
0x00}}, /* 0x5 */
#endif
#endif
{{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e, /* 0x05 - corrected 640x480-60 */
0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
0x00}},
......@@ -329,16 +299,16 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,
0x00}}, /* 0x8 */
{{0x65,0x4f,0x4f,0x89,0x58,0x80,0xfb,0x1f,
0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05, /* TW: Corrected VBE */
0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05, /* Corrected VBE */
0x61}}, /* 0x9 */
{{0x65,0x4f,0x4f,0x89,0x58,0x80,0x01,0x3e,
0xe0,0x83,0xdf,0xdf,0x02,0x00,0x00,0x05,
0x61}}, /* 0xa */
{{0x67,0x4f,0x4f,0x8b,0x58,0x81,0x0d,0x3e,
0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05, /* TW: Corrected VBE */
0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05, /* Corrected VBE */
0x61}}, /* 0xb */
{{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f,
0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01, /* TW: Corrected VDE, VBE */
0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01, /* Corrected VDE, VBE */
0x00}}, /* 0xc */
{{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05,
......@@ -466,7 +436,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
{{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
0x01}}, /* 0x36 */
{{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1, /* TW: 95 was 15 - illegal HBE! */
{{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1, /* 95 was 15 - illegal HBE! */
0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
0x01}}, /* 0x37 */
{{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
......@@ -498,7 +468,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
{{0x81,0x6a,0x6a,0x85,0x70,0x00,0x0f,0x3e,
0xeb,0x8e,0xdf,0xdf,0x10,0x00,0x00,0x02,
0x00}}, /* 0x3f */
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1, /* TW: The following from 650/LVDS BIOS */
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,
0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
0x01}}, /* 0x40 */
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
......@@ -510,31 +480,31 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
{{0xe6,0xae,0xae,0x8a,0xbd,0x90,0x3d,0x10,
0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x00,0x03,
0x00}}, /* 0x43 */
{{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* New, 1152x864-75, not in BIOS */
{{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* 1152x864-75 */
0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
0x01}}, /* 0x44 */
{{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* New, 848x480-38i, not in BIOS */
{{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* 848x480-38i */
0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
0x00}}, /* 0x45 */
{{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* New, 848x480-60, not in BIOS */
{{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* 848x480-60 */
0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
0x00}}, /* 0x46 */
{{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* New, 856x480-38i, not in BIOS */
{{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* 856x480-38i */
0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
0x00}}, /* 0x47 */
{{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* New, 856x480-60, not in BIOS */
{{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* 856x480-60 */
0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
0x00}}, /* 0x48 */
{{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* New, 1360x768-60, not in BIOS */
{{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* 1360x768-60 */
0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
0x01}}, /* 0x49 */
{{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* New, 1152x864-84, not in any BIOS */
{{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* 1152x864-84 */
0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
0x01}}, /* 0x4a */
{{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* New, 1400x1050-75, not in any BIOS */
{{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* 1400x1050-75 */
0x1b,0x87,0x19,0x1a,0x41,0x0f,0x00,0x03,
0x00}}, /* 0x4b */
{{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* New, 1280x960-85, not in any BIOS */
{{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* 1280x960-85 */
0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
0x01}}, /* 0x4c */
{{0x7b,0x5f,0x63,0x9f,0x6a,0x93,0x6f,0xf0, /* 768x576 */
......@@ -542,16 +512,22 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
0x01}}, /* 0x4d */
{{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, /* FSTN 320x480, TEMP - possibly invalid */
0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
0x00}} /* 0x4e */
};
typedef struct _SiS310_MCLKDataStruct
{
UCHAR SR28,SR29,SR2A;
USHORT CLOCK;
} SiS310_MCLKDataStruct;
static const SiS310_MCLKDataStruct SiS310_MCLKData_0_315[] =
0x00}}, /* 0x4e */
{{0xcd,0x9f,0x9f,0x91,0xab,0x1c,0x3a,0xff, /* 1280x800-60 */
0x20,0x83,0x1f,0x1f,0x3b,0x10,0x00,0x07,
0x21}}, /* 0x4f */
{{0x15,0xd1,0xd1,0x99,0xe2,0x19,0x3d,0x10, /* 1680x1050-60 */
0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x01,0x0c,
0x20}}, /* 0x50 */
{{0x0e,0xef,0xef,0x92,0xfe,0x03,0x30,0xf0, /* 1920x1080-60i */
0x1e,0x83,0x1b,0x1c,0x31,0x00,0x01,0x00,
0x61}}, /* 0x51 */
{{0x85,0x77,0x77,0x89,0x7d,0x01,0x31,0xf0, /* 960x540-60 */
0x1e,0x84,0x1b,0x1c,0x32,0x00,0x00,0x02,
0x41}} /* 0x52 */
};
static const SiS_MCLKDataStruct SiS310_MCLKData_0_315[] =
{
{ 0x3b,0x22,0x01,143},
{ 0x5c,0x23,0x01,166},
......@@ -563,7 +539,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_315[] =
{ 0x5c,0x23,0x01,166}
};
static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =
static const SiS_MCLKDataStruct SiS310_MCLKData_0_650[] =
{
{ 0x5a,0x64,0x82, 66},
{ 0xb3,0x45,0x82, 83},
......@@ -575,7 +551,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =
{ 0x37,0x22,0x82,133}
};
static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =
static const SiS_MCLKDataStruct SiS310_MCLKData_0_330[] =
{
{ 0x5c,0x23,0x01,166},
{ 0x5c,0x23,0x01,166},
......@@ -587,7 +563,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =
{ 0x79,0x06,0x01,250}
};
static const SiS310_MCLKDataStruct SiS310_MCLKData_0_660[] = /* TODO */
static const SiS_MCLKDataStruct SiS310_MCLKData_0_660[] =
{
{ 0x5c,0x23,0x82,166},
{ 0x5c,0x23,0x82,166},
......@@ -599,7 +575,19 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_660[] = /* TODO */
{ 0x37,0x21,0x82,200}
};
static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =
static const SiS_MCLKDataStruct SiS310_MCLKData_0_760[] =
{
{ 0x37,0x22,0x82,133},
{ 0x5c,0x23,0x82,166},
{ 0x65,0x23,0x82,183},
{ 0x7c,0x08,0x82,200},
{ 0x29,0x21,0x82,150},
{ 0x5c,0x23,0x82,166},
{ 0x65,0x23,0x82,183},
{ 0x37,0x21,0x82,200}
};
static const SiS_MCLKDataStruct SiS310_MCLKData_1[] = /* ECLK */
{
{ 0x29,0x21,0x82,150},
{ 0x5c,0x23,0x82,166},
......@@ -611,13 +599,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =
{ 0x37,0x22,0x82,133}
};
typedef struct _SiS310_VCLKDataStruct
{
UCHAR SR2B,SR2C;
USHORT CLOCK;
} SiS310_VCLKDataStruct;
static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
static SiS_VCLKDataStruct SiS310_VCLKData[]=
{
{ 0x1b,0xe1, 25}, /* 0x00 */
{ 0x4e,0xe4, 28}, /* 0x01 */
......@@ -630,7 +612,7 @@ static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
{ 0x53,0xe2, 50}, /* 0x08 */
{ 0x74,0x67, 52}, /* 0x09 */
{ 0x6d,0x66, 56}, /* 0x0a */
{ 0x5a,0x64, 65}, /* 0x0b */ /* TW: was 6c c3 - WRONG */
{ 0x5a,0x64, 65}, /* 0x0b */ /* was 6c c3 - WRONG */
{ 0x46,0x44, 67}, /* 0x0c */
{ 0xb1,0x46, 68}, /* 0x0d */
{ 0xd3,0x4a, 72}, /* 0x0e */
......@@ -677,49 +659,58 @@ static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
{ 0xea,0x08,340}, /* 0x37 */
{ 0xe8,0x07,376}, /* 0x38 */
{ 0xde,0x06,389}, /* 0x39 */
{ 0x52,0x2a, 54}, /* 0x3a */ /* 301 TV */
{ 0x52,0x6a, 27}, /* 0x3b */ /* 301 TV */
{ 0x62,0x24, 70}, /* 0x3c */ /* 301 TV */
{ 0x62,0x64, 70}, /* 0x3d */ /* 301 TV */
{ 0xa8,0x4c, 30}, /* 0x3e */ /* 301 TV */
{ 0x20,0x26, 33}, /* 0x3f */ /* 301 TV */
{ 0x52,0x2a, 54}, /* 0x3a 301 TV */
{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
{ 0x62,0x24, 70}, /* 0x3c 301 TV */
{ 0x62,0x64, 70}, /* 0x3d 301 TV */
{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
{ 0x20,0x26, 33}, /* 0x3f 301 TV */
{ 0x31,0xc2, 39}, /* 0x40 */
{ 0x60,0x36, 30}, /* 0x41 */ /* Chrontel */
{ 0x40,0x4a, 28}, /* 0x42 */ /* Chrontel */
{ 0x9f,0x46, 44}, /* 0x43 */ /* Chrontel */
{ 0x60,0x36, 30}, /* 0x41 Chrontel */
{ 0x40,0x4a, 28}, /* 0x42 Chrontel */
{ 0x9f,0x46, 44}, /* 0x43 Chrontel */
{ 0x97,0x2c, 26}, /* 0x44 */
{ 0x44,0xe4, 25}, /* 0x45 */ /* Chrontel */
{ 0x7e,0x32, 47}, /* 0x46 */ /* Chrontel */
{ 0x8a,0x24, 31}, /* 0x47 */ /* Chrontel */
{ 0x97,0x2c, 26}, /* 0x48 */ /* Chrontel */
{ 0x44,0xe4, 25}, /* 0x45 Chrontel */
{ 0x7e,0x32, 47}, /* 0x46 Chrontel */
{ 0x8a,0x24, 31}, /* 0x47 Chrontel */
{ 0x97,0x2c, 26}, /* 0x48 Chrontel */
{ 0xce,0x3c, 39}, /* 0x49 */
{ 0x52,0x4a, 36}, /* 0x4a */ /* Chrontel */
{ 0x52,0x4a, 36}, /* 0x4a Chrontel */
{ 0x34,0x61, 95}, /* 0x4b */
{ 0x78,0x27,108}, /* 0x4c - was 102 */
{ 0x66,0x43,123}, /* 0x4d */ /* Modes 0x26-0x28 (1400x1050) */
{ 0x66,0x43,123}, /* 0x4d Modes 0x26-0x28 (1400x1050) */
{ 0x41,0x4e, 21}, /* 0x4e */
{ 0xa1,0x4a, 29}, /* 0x4f */ /* Chrontel */
{ 0xa1,0x4a, 29}, /* 0x4f Chrontel */
{ 0x19,0x42, 42}, /* 0x50 */
{ 0x54,0x46, 58}, /* 0x51 */ /* Chrontel */
{ 0x54,0x46, 58}, /* 0x51 Chrontel */
{ 0x25,0x42, 61}, /* 0x52 */
{ 0x44,0x44, 66}, /* 0x53 */ /* Chrontel */
{ 0x3a,0x62, 70}, /* 0x54 */ /* Chrontel */
{ 0x62,0xc6, 34}, /* 0x55 - added for 848x480-60 (not in any BIOS) */
{ 0x6a,0xc6, 37}, /* 0x56 - added for 848x480-75 (not in any BIOS) - TEMP */
{ 0xbf,0xc8, 35}, /* 0x57 - added for 856x480-38i,60 (not in any BIOS) */
{ 0x30,0x23, 88}, /* 0x58 - added for 1360x768-62 (is 60Hz!) (not in any BIOS) */
{ 0x52,0x07,149}, /* 0x59 - added for 1280x960-85 (Not in any BIOS) */
{ 0x56,0x07,156}, /* 0x5a - added for 1400x1050-75 */
{ 0x70,0x29, 81} /* 0x5b - added for 1280x768 LCD */
};
typedef struct _SiS310_VBVCLKDataStruct
{
UCHAR Part4_A,Part4_B;
USHORT CLOCK;
} SiS310_VBVCLKDataStruct;
static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0x44,0x44, 66}, /* 0x53 Chrontel */
{ 0x3a,0x62, 70}, /* 0x54 Chrontel */
{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP */
{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */
{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) */
{ 0x52,0x07,149}, /* 0x59 1280x960-85 */
{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
{ 0x45,0x25, 83}, /* 0x5c 1280x800 */
{ 0x70,0x0a,147}, /* 0x5d 1680x1050 */
{ 0x70,0x24,162}, /* 0x5e 1600x1200 */
{ 0x5a,0x64, 65}, /* 0x5f 1280x720 - temp */
{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
{ 0, 0, 0}, /* 0x62 - custom (will be filled out at run-time) */
{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced */
{ 0x7c,0x6b, 38} /* 0x6a 960x540@60 */
};
static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
{
{ 0x1b,0xe1, 25}, /* 0x00 */
{ 0x4e,0xe4, 28}, /* 0x01 */
......@@ -732,7 +723,7 @@ static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0x53,0x47, 50}, /* 0x08 */
{ 0x74,0x67, 52}, /* 0x09 */
{ 0x6d,0x66, 56}, /* 0x0a */
{ 0x35,0x62, 65}, /* 0x0b */ /* Was 0x5a,0x64 - 650/LVDS+301 bios: 35,62 */
{ 0x35,0x62, 65}, /* 0x0b */ /* Was 0x5a,0x64 - 650/LVDS+301: 35,62 */
{ 0x46,0x44, 67}, /* 0x0c */
{ 0xb1,0x46, 68}, /* 0x0d */
{ 0xd3,0x4a, 72}, /* 0x0e */
......@@ -785,47 +776,55 @@ static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0xea,0x08,340}, /* 0x37 */
{ 0xe8,0x07,376}, /* 0x38 */
{ 0xde,0x06,389}, /* 0x39 */
{ 0x52,0x2a, 54}, /* 0x3a */ /* 301 TV */
{ 0x52,0x6a, 27}, /* 0x3b */ /* 301 TV */
{ 0x62,0x24, 70}, /* 0x3c */ /* 301 TV */
{ 0x62,0x64, 70}, /* 0x3d */ /* 301 TV */
{ 0xa8,0x4c, 30}, /* 0x3e */ /* 301 TV */
{ 0x20,0x26, 33}, /* 0x3f */ /* 301 TV */
{ 0x52,0x2a, 54}, /* 0x3a 301 TV - start */
{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
{ 0x62,0x24, 70}, /* 0x3c 301 TV */
{ 0x62,0x64, 70}, /* 0x3d 301 TV */
{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
{ 0x20,0x26, 33}, /* 0x3f 301 TV */
{ 0x31,0xc2, 39}, /* 0x40 */
{ 0x2e,0x48, 25}, /* 0x41 */ /* Replacement for LCD on 315 for index 0 */
{ 0x24,0x46, 25}, /* 0x42 */ /* Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
{ 0x26,0x64, 28}, /* 0x43 */ /* Replacement for LCD on 315 for index 1 */
{ 0x37,0x64, 40}, /* 0x44 */ /* Replacement for LCD on 315 for index 4 */
{ 0xa1,0x42,108}, /* 0x45 */ /* 1280x960 LCD */
{ 0x37,0x61,100}, /* 0x46 */ /* 1280x960 LCD */
{ 0x2e,0x48, 25}, /* 0x41 Replacement for LCD on 315 for index 0 */
{ 0x24,0x46, 25}, /* 0x42 Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
{ 0x26,0x64, 28}, /* 0x43 Replacement for LCD on 315 for index 1 */
{ 0x37,0x64, 40}, /* 0x44 Replacement for LCD on 315 for index 4 */
{ 0xa1,0x42,108}, /* 0x45 1280x960 LCD */
{ 0x37,0x61,100}, /* 0x46 1280x960 LCD */
{ 0x78,0x27,108}, /* 0x47 */
{ 0x97,0x2c, 26}, /* 0x48 */ /* UNUSED - Entries from here new, not in any BIOS */
{ 0xce,0x3c, 39}, /* 0x49 */ /* UNUSED */
{ 0x52,0x4a, 36}, /* 0x4a */ /* UNUSED */
{ 0x34,0x61, 95}, /* 0x4b */ /* UNUSED */
{ 0x78,0x27,108}, /* 0x4c */ /* UNUSED */
{ 0x66,0x43,123}, /* 0x4d */ /* 1400x1050-60 */
{ 0x41,0x4e, 21}, /* 0x4e */ /* UNUSED */
{ 0xa1,0x4a, 29}, /* 0x4f */ /* UNUSED */
{ 0x19,0x42, 42}, /* 0x50 */ /* UNUSED */
{ 0x54,0x46, 58}, /* 0x51 */ /* UNUSED */
{ 0x25,0x42, 61}, /* 0x52 */ /* UNUSED */
{ 0x44,0x44, 66}, /* 0x53 */ /* UNUSED */
{ 0x3a,0x62, 70}, /* 0x54 */ /* UNUSED */
{ 0x62,0xc6, 34}, /* 0x55 */ /* 848x480-60 */
{ 0x6a,0xc6, 37}, /* 0x56 */ /* 848x480-75 - TEMP, UNUSED */
{ 0xbf,0xc8, 35}, /* 0x57 */ /* 856x480-38i,60 */
{ 0x30,0x23, 88}, /* 0x58 */ /* 1360x768-62 (is 60Hz!) TEMP, UNUSED */
{ 0x52,0x07,149}, /* 0x59 */ /* 1280x960-85 */
{ 0x56,0x07,156}, /* 0x5a */ /* 1400x1050-75 */
{ 0x70,0x29, 81} /* 0x5b */ /* 1280x768 LCD */
};
static const UCHAR SiS310_ScreenOffset[] =
{
0x14,0x19,0x20,0x28,0x32,0x40,0x50,0x64,
0x78,0x80,0x2d,0x35,0x57,0x48,0x55,0x30,
0xff
{ 0x97,0x2c, 26}, /* 0x48 UNUSED */
{ 0xce,0x3c, 39}, /* 0x49 UNUSED */
{ 0x52,0x4a, 36}, /* 0x4a UNUSED */
{ 0x34,0x61, 95}, /* 0x4b UNUSED */
{ 0x78,0x27,108}, /* 0x4c UNUSED */
{ 0x66,0x43,123}, /* 0x4d 1400x1050-60 */
{ 0x41,0x4e, 21}, /* 0x4e UNUSED */
{ 0xa1,0x4a, 29}, /* 0x4f UNUSED */
{ 0x19,0x42, 42}, /* 0x50 UNUSED */
{ 0x54,0x46, 58}, /* 0x51 UNUSED */
{ 0x25,0x42, 61}, /* 0x52 UNUSED */
{ 0x44,0x44, 66}, /* 0x53 UNUSED */
{ 0x3a,0x62, 70}, /* 0x54 UNUSED */
{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP, UNUSED */
{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */
{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) TEMP, UNUSED */
{ 0x52,0x07,149}, /* 0x59 1280x960-85 */
{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
{ 0x45,0x25, 83}, /* 0x5c 1280x800 LCD - (was 0x9c,0x62, 69 - wrong?) */
{ 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */
{ 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */
{ 0x52,0x27, 75}, /* 0x5f 1280x720 LCD TMDS + HDTV (correct) */
{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
{ 0, 0, 0}, /* 0x62 - custom (will be filled out at run-time) */
{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced (UNUSED) */
{ 0x7c,0x6b, 38} /* 0x6a 960x540@60 */
};
static const DRAM4Type SiS310_SR15[8] = {
......@@ -873,12 +872,7 @@ static const USHORT SiS310_VideoSenseData2 = 0x0174;
static const USHORT SiS310_YCSenseData2 = 0x016b;
#endif
typedef struct _SiS310_PanelDelayTblStruct
{
UCHAR timer[2];
} SiS310_PanelDelayTblStruct;
static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
static const SiS_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
{
{{0x10,0x40}},
{{0x10,0x40}},
......@@ -898,7 +892,7 @@ static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
{{0x10,0x40}}
};
static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
static const SiS_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
{
{{0x28,0xc8}},
{{0x28,0xc8}},
......@@ -922,28 +916,18 @@ static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
/* SIS VIDEO BRIDGE ----------------------------------------- */
/**************************************************************/
typedef struct _SiS310_LCDDataStruct
{
USHORT RVBHCMAX;
USHORT RVBHCFACT;
USHORT VGAHT;
USHORT VGAVT;
USHORT LCDHT;
USHORT LCDVT;
} SiS310_LCDDataStruct;
static const SiS310_LCDDataStruct SiS310_StLCD1024x768Data[]=
static const SiS_LCDDataStruct SiS310_St2LCD1024x768Data[] =
{
{ 62, 25, 800, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 104, 45, 945, 496,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 31, 18,1008, 624,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS310_LCDDataStruct SiS310_ExtLCD1024x768Data[] =
static const SiS_LCDDataStruct SiS310_ExtLCD1024x768Data[] =
{
{ 42, 25,1536, 419,1344, 806},
{ 48, 25,1536, 369,1344, 806},
......@@ -951,28 +935,10 @@ static const SiS310_LCDDataStruct SiS310_ExtLCD1024x768Data[] =
{ 48, 25,1536, 369,1344, 806},
{ 12, 5, 896, 500,1344, 806},
{ 42, 25,1024, 625,1344, 806},
{ 1, 1,1344, 806,1344, 806},
{ 12, 5, 896, 500,1344, 806},
{ 42, 25,1024, 625,1344, 806},
{ 1, 1,1344, 806,1344, 806},
{ 12, 5, 896, 500,1344, 806},
{ 42, 25,1024, 625,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS310_LCDDataStruct SiS310_St2LCD1024x768Data[] =
{
{ 62, 25, 800, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 104, 45, 945, 496,1344, 806},
{ 62, 25, 800, 546,1344, 806},
{ 31, 18,1008, 624,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS310_LCDDataStruct SiS310_StLCD1280x1024Data[] =
static const SiS_LCDDataStruct SiS310_St2LCD1280x1024Data[] =
{
{ 22, 5, 800, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
......@@ -984,7 +950,7 @@ static const SiS310_LCDDataStruct SiS310_StLCD1280x1024Data[] =
{ 1, 1,1688,1066,1688,1066}
};
static const SiS310_LCDDataStruct SiS310_ExtLCD1280x1024Data[] =
static const SiS_LCDDataStruct SiS310_ExtLCD1280x1024Data[] =
{
{ 211, 60,1024, 501,1688,1066},
{ 211, 60,1024, 508,1688,1066},
......@@ -993,53 +959,10 @@ static const SiS310_LCDDataStruct SiS310_ExtLCD1280x1024Data[] =
{ 211, 60,1024, 500,1688,1066},
{ 211, 75,1024, 625,1688,1066},
{ 211, 120,1280, 798,1688,1066},
{ 1, 1,1688,1066,1688,1066},
{ 1, 1,1800,1000,1688,1066} /* 1280x960 - does not work, use panel scaler instead */
};
static const SiS310_LCDDataStruct SiS310_St2LCD1280x1024Data[] =
{
{ 22, 5, 800, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 176, 45, 900, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
{ 13, 5,1024, 675,1560,1152},
{ 16, 9,1266, 804,1688,1072},
{ 1, 1,1688,1066,1688,1066}
};
static const SiS310_LCDDataStruct SiS310_NoScaleData1024x768[] =
{
{ 1, 1,1344, 806,1344, 806},
{ 1, 1,1344, 806,1344, 806},
{ 1, 1,1344, 806,1344, 806},
{ 1, 1,1344, 806,1344, 806}, /* 640x400 - does not work */
{ 1, 1,1344, 806,1344, 806}, /* 640x480 - does not work */
{ 1, 1,1344, 806,1344, 806},
{ 1, 1,1344, 806,1344, 806},
{ 1, 1,1344, 806,1344, 806}
};
static const SiS310_LCDDataStruct SiS310_NoScaleData1280x1024[] =
{
{ 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}
};
typedef struct _SiS310_Part2PortTblStruct
{
UCHAR CR[12];
} SiS310_Part2PortTblStruct;
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
static const SiS_Part2PortTblStruct SiS310_CRT2Part2_1024x768_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}},
......@@ -1047,646 +970,37 @@ static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
{{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}}
{{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_2[] =
{
{{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}}, /* others */
/* 0x36,0x13,0x02,0x25,0xff,0x03,0x45,0x09,0x07,0xf9,0x00,0x24 my */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
/* *** LCDA *** */
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_3[] =
{
#if 1 /* Data from 650/301LVx 1.10.6s and others */
{{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,0x24,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,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,0x13,0xc9,0x25,0xff,0xf9,0x45,0x09,0x07,0xf9,0x09,0x24}}
#if 0
static const SiS_LVDSDataStruct SiS_LCDA1600x1200Data_1[]=
{ /* Clevo, 651+301C */
{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},
#if 0
{2048,1250, 2048,1250} /* this should be correct */
#endif
#if 0 /* Data from my 301LV */
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}}, /* TEST */
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
{{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}}
#if 1
{2160,1250, 2048,1250} /* ? */
#endif
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_1[] =
{ /* Acer; BIOS data invalid, last row taken from _3 */
{{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,0x02,0x25,0xFF,0x03,0x45,0x09,0x07,0xF9,0x00,0x24}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_2[] =
{ /* Acer */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
/* 1 2 4 5 6 1c 1d 1f 20 21 23 25 */
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_3[] =
{ /* Acer */
{{0x31,0x1B,0xC4,0xDA,0xB0,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x34,0x1B,0x9F,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x3E,0x1B,0xCF,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
{{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_1[] =
{
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_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 SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_3[] =
{
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
{{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_1[] =
{
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_2[] =
{
{{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x3A,0x1B,0x54,0x7A,0x48,0x80,0x24,0x52,0x30,0xA3,0x3A,0x02}},
{{0x36,0x1B,0x90,0xB6,0x84,0xA8,0x24,0x7A,0x30,0xCB,0x62,0x02}},
{{0x3A,0x1C,0xE4,0x0A,0xD8,0xE0,0x24,0xB2,0x30,0x03,0x9A,0x02}},
{{0x4A,0x24,0x64,0x8A,0x58,0x20,0x34,0xF2,0x30,0x43,0xDA,0x52}},
{{0x47,0x24,0x71,0x97,0x65,0x3E,0x34,0x10,0x40,0x61,0xF8,0x02}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
};
static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_3[] =
{
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
{{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
};
/* CRT1 CRTC for LCDA */
typedef struct _SiS310_LCDACRT1DataStruct
{
UCHAR CR[17];
}SiS310_LCDACRT1DataStruct;
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11024x768_1[]=
{
{{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
0x00}},
{{0x73,0x4f,0x4f,0x97,0x59,0x84,0x04,0x3e,
0xE2,0x89,0xdf,0xdf,0x05,0x00,0x00,0x05,
0x00}},
{{0x87,0x63,0x63,0x8B,0x6D,0x18,0x7c,0xf0,
0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x06,
0x01}},
{{0xA3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11024x768_1_H[]=
{
{{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
0x00}},
{{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x04,0x3e,
0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
0x00}},
{{0x55,0x31,0x31,0x99,0x3b,0x06,0x7c,0xf0,
0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x01,
0x01}},
{{0x63,0x3F,0x3F,0x87,0x49,0x94,0x24,0xF5,
0x02,0x89,0xFF,0xFF,0x25,0x10,0x00,0x01,
0x01}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11024x768_2[]=
{
{{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
0x00}},
{{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
0x01}},
{{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xb3,
0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x06,
0x01}},
{{0xa3,0x63,0x63,0x98,0x78,0x19,0x24,0xf1,
0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
0x01}},
{{0xa3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
0x01}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11024x768_2_H[]=
{
{{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
0x00 }},
{{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xb3,
0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x01,
0x01 }},
{{0x71,0x31,0x31,0x98,0x46,0x17,0x24,0xf1,
0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
0x01 }},
{{0x63,0x3f,0x3f,0x87,0x4c,0x97,0x24,0xf5,
0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
0x01 }}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11280x1024_1[]=
{ /* Acer */
{{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
0x00}},
{{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x08,0x3e,
0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
0x00}},
{{0x92,0x63,0x63,0x96,0x6c,0x18,0x80,0xf0,
0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
0x01}},
{{0xae,0x7f,0x7f,0x92,0x88,0x94,0x28,0xf5,
0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
0x01}},
{{0xce,0x9f,0x9f,0x92,0xa8,0x14,0x28,0x5a,
0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
0x01}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11280x1024_1_H[]=
{ /* Acer */
{{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
0x00}},
{{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
0x00}},
{{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
0x00}},
{{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
0x01}},
{{0x56,0x27,0x27,0x9a,0x31,0x1c,0x08,0x3e,
0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
0x00}},
{{0x60,0x31,0x31,0x84,0x3a,0x86,0x80,0xf0,
0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
0x01}},
{{0x6e,0x3f,0x3f,0x92,0x48,0x94,0x28,0xf5,
0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
0x01}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11280x1024_2[]=
{ /* Illegal data in BIOS (Acer, Compaq) */
{{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 SiS310_LCDACRT1DataStruct SiS310_LCDACRT11280x1024_2_H[]=
{ /* Illegal data in BIOS (Acer, Compaq) */
{{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
0x00 }},
{{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
0x00 }},
{{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
0x00 }},
{{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
0x00 }},
{{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x01,
0x00 }},
{{0x4f,0x31,0x31,0x93,0x3e,0x86,0x24,0xf1,
0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x01,
0x01 }},
{{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
0x01 }}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11400x1050_1[]=
{
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0xee,0x1f,
0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
0x00}},
{{0x83,0x63,0x63,0x87,0x68,0x16,0x66,0xf0,
0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x06,
0x01}},
{{0x9f,0x7f,0x7f,0x83,0x84,0x92,0x0e,0xf5,
0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x02,
0x01}},
{{0xbf,0x9f,0x9f,0x83,0xa4,0x12,0x0e,0x5a,
0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x07,
0x01}},
{{0xce,0xae,0xae,0x92,0xb3,0x01,0x28,0x10,
0x1a,0x80,0x19,0x19,0x29,0x0f,0x00,0x03,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11400x1050_1_H[]=
{
{{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x47,0x27,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
0x92,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
0x00}},
{{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
0x00}},
{{0x47,0x27,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
0x00}},
{{0x51,0x31,0x31,0x95,0x36,0x04,0x66,0xf0,
0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x01,
0x01}},
{{0x5f,0x3f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x01,
0x01}},
{{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x05,
0x01}},
{{0x76,0x56,0x56,0x9a,0x5b,0x89,0x28,0x10,
0x1c,0x80,0x19,0x19,0x29,0x0b,0x00,0x05,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11400x1050_2[]=
{
{{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
0x00}},
{{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
0x01}},
{{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
0x00}},
{{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
0x00}},
{{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9e,
0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x03,
0x00}},
{{0xce,0x63,0x63,0x92,0x96,0x04,0x28,0xd4,
0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x07,
0x01}},
{{0xce,0x7f,0x7f,0x92,0xa4,0x12,0x28,0xd4,
0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x07,
0x01}},
{{0xce,0x9f,0x9f,0x92,0xb4,0x02,0x28,0x5a,
0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x03,
0x01}},
{{0xce,0xae,0xae,0x92,0xbc,0x0a,0x28,0x10,
0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x03,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11400x1050_2_H[]=
{
{{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
0x00}},
{{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
0x00}},
{{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
0x00}},
{{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
0x00}},
{{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9e,
0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x06,
0x00}},
{{0x9c,0x31,0x31,0x80,0x64,0x92,0x28,0xd4,
0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x06,
0x01}},
{{0x8e,0x3f,0x3f,0x92,0x64,0x12,0x28,0xd4,
0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x06,
0x01}},
{{0x7e,0x4f,0x4f,0x82,0x64,0x12,0x28,0x5a,
0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x06,
0x01}},
{{0x76,0x56,0x56,0x9a,0x64,0x92,0x28,0x10,
0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x05,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11600x1200_1[]=
{
{{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
0x00}},
{{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
0x00}},
{{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
0x00}},
{{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
0x00}},
{{0x83,0x4F,0x4F,0x87,0x51,0x09,0x10,0x3E,
0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x06,
0x00}},
{{0x97,0x63,0x63,0x9B,0x65,0x1D,0x88,0xF0,
0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x06,
0x01}},
{{0xB3,0x7F,0x7F,0x97,0x81,0x99,0x30,0xF5,
0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x02,
0x01}},
{{0xD3,0x9F,0x9F,0x97,0xA1,0x19,0x30,0x5A,
0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x07,
0x01}},
{{0xE2,0xAE,0xAE,0x86,0xB0,0x88,0x4A,0x10,
0x1A,0x8E,0x19,0x19,0x4B,0x2F,0x00,0x03,
0x00}},
{{0xFB,0xC7,0xC7,0x9F,0xC9,0x81,0xE0,0x10,
0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x07,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11600x1200_1_H[]=
{
{{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
0x00}},
{{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
0x00}},
{{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
0x00}},
{{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
0x00}},
{{0x69,0x27,0x27,0x8D,0x30,0x88,0x10,0x3E,
0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x01,
0x00}},
{{0x73,0x31,0x31,0x97,0x3A,0x92,0x88,0xF0,
0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x01,
0x01}},
{{0x81,0x3F,0x3F,0x85,0x48,0x00,0x30,0xF5,
0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x06,
0x01}},
{{0x91,0x4F,0x4F,0x95,0x58,0x10,0x30,0x5A,
0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x06,
0x01}},
{{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
0x01}},
{{0xA5,0x63,0x63,0x89,0x6C,0x84,0xE0,0x10,
0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x02,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11600x1200_2[]=
{
{{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
0x00}},
{{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
0x00}},
{{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
0x00}},
{{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
0x00}},
{{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x01,0x04,
0x00}},
{{0x09,0x63,0x63,0x8D,0xAD,0x05,0xE0,0xD4,
0x9B,0x8F,0x57,0x57,0xE1,0x21,0x01,0x00,
0x01}},
{{0x09,0x7F,0x7F,0x8D,0xBB,0x13,0xE0,0xD4,
0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x01,0x00,
0x01}},
{{0x09,0x9F,0x9F,0x8D,0xCB,0x03,0xE0,0x5A,
0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x01,0x04,
0x01}},
{{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
0x01}},
{{0x09,0xC7,0xC7,0x8D,0xDF,0x17,0xE0,0x10,
0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x01,0x04,
0x00}}
};
static const SiS310_LCDACRT1DataStruct SiS310_LCDACRT11600x1200_2_H[]=
{
{{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
0x00}},
{{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
0x00}},
{{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
0x00}},
{{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
0x00}},
{{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x00,0x03,
0x00}},
{{0xD7,0x31,0x31,0x9B,0x7B,0x13,0xE0,0xD4,
0x9B,0x8F,0x57,0x57,0xE1,0x21,0x00,0x03,
0x01}},
{{0xC9,0x3F,0x3F,0x8D,0x7B,0x13,0xE0,0xD4,
0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x00,0x03,
0x01}},
{{0xB9,0x4F,0x4F,0x9D,0x7B,0x93,0xE0,0x5A,
0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x00,0x02,
0x01}},
{{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
0x01}},
{{0xA5,0x63,0x63,0x89,0x7B,0x93,0xE0,0x10,
0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x00,0x02,
0x00}}
};
#endif
/**************************************************************/
/* LVDS, CHRONTEL ------------------------------------------- */
/**************************************************************/
typedef struct _SiS310_LVDSDataStruct
{
USHORT VGAHT;
USHORT VGAVT;
USHORT LCDHT;
USHORT LCDVT;
} SiS310_LVDSDataStruct;
static const SiS310_LVDSDataStruct SiS310_CHTVUPALData[]=
static const SiS_LVDSDataStruct SiS310_CHTVUPALData[]=
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1697,7 +1011,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVUPALData[]=
{1400,1000,1400,1000}
};
static const SiS310_LVDSDataStruct SiS310_CHTVOPALData[]=
static const SiS_LVDSDataStruct SiS310_CHTVOPALData[]=
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1708,7 +1022,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVOPALData[]=
{1400, 875,1400, 875}
};
static const SiS310_LVDSDataStruct SiS310_CHTVUPALMData[]=
static const SiS_LVDSDataStruct SiS310_CHTVUPALMData[]=
{
{ 840, 600, 840, 600},
{ 840, 600, 840, 600},
......@@ -1719,7 +1033,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVUPALMData[]=
{1160, 945,1160, 945}
};
static const SiS310_LVDSDataStruct SiS310_CHTVOPALMData[]=
static const SiS_LVDSDataStruct SiS310_CHTVOPALMData[]=
{
{ 840, 525, 840, 525},
{ 840, 525, 840, 525},
......@@ -1730,7 +1044,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVOPALMData[]=
{1160, 840,1160, 840}
};
static const SiS310_LVDSDataStruct SiS310_CHTVUPALNData[]=
static const SiS_LVDSDataStruct SiS310_CHTVUPALNData[]=
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1741,7 +1055,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVUPALNData[]=
{1400,1000,1400,1000}
};
static const SiS310_LVDSDataStruct SiS310_CHTVOPALNData[]=
static const SiS_LVDSDataStruct SiS310_CHTVOPALNData[]=
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1752,7 +1066,7 @@ static const SiS310_LVDSDataStruct SiS310_CHTVOPALNData[]=
{1400, 875,1400, 875}
};
static const SiS310_LVDSDataStruct SiS310_CHTVSOPALData[]= /* TW: (super overscan - no effect on 7019) */
static const SiS_LVDSDataStruct SiS310_CHTVSOPALData[]= /* (super overscan - no effect on 7019) */
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1763,13 +1077,8 @@ static const SiS310_LVDSDataStruct SiS310_CHTVSOPALData[]= /* TW: (super over
{1400, 875,1400, 875}
};
typedef struct _SiS310_LVDSDesStruct
{
USHORT LCDHDES;
USHORT LCDVDES;
} SiS310_LVDSDesStruct;
static const SiS310_LVDSDesStruct SiS310_PanelType00_1[]= /* 800x600 */
static const SiS_LVDSDesStruct SiS310_PanelType00_1[]= /* 800x600 */
{
{ 0, 0},
{ 0, 0},
......@@ -1782,7 +1091,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType00_1[]= /* 800x600 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType01_1[]= /* 1024x768 */
static const SiS_LVDSDesStruct SiS310_PanelType01_1[]= /* 1024x768 */
{
{ 0, 0},
{ 0, 0},
......@@ -1795,7 +1104,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType01_1[]= /* 1024x768 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType02_1[]= /* 1280x1024 */
static const SiS_LVDSDesStruct SiS310_PanelType02_1[]= /* 1280x1024 */
{
{ 0, 0},
{ 0, 0},
......@@ -1810,7 +1119,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType02_1[]= /* 1280x1024 */
};
static const SiS310_LVDSDesStruct SiS310_PanelType03_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType03_1[]=
{
{ 0, 0},
{ 0, 0},
......@@ -1823,7 +1132,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType03_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType04_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType04_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1836,7 +1145,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType04_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType05_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType05_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1849,7 +1158,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType05_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType06_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType06_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1862,7 +1171,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType06_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType07_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType07_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1875,7 +1184,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType07_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType08_1[]= /* 1400x1050 */
static const SiS_LVDSDesStruct SiS310_PanelType08_1[]= /* 1400x1050 */
{
{ 0, 0},
{ 0, 0},
......@@ -1890,7 +1199,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType08_1[]= /* 1400x1050 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType09_1[]= /* 1280x768 */
static const SiS_LVDSDesStruct SiS310_PanelType09_1[]= /* 1280x768 */
{
{ 0, 0},
{ 0, 0},
......@@ -1905,7 +1214,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType09_1[]= /* 1280x768 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0a_1[]= /* 1600x1200 */
static const SiS_LVDSDesStruct SiS310_PanelType0a_1[]= /* 1600x1200 */
{
{ 0, 0},
{ 0, 0},
......@@ -1920,7 +1229,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0a_1[]= /* 1600x1200 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0b_1[]= /* 640x480_2 */
static const SiS_LVDSDesStruct SiS310_PanelType0b_1[]= /* 640x480_2 */
{
{ 0, 524},
{ 0, 524},
......@@ -1932,7 +1241,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0b_1[]= /* 640x480_2 */
{ 0, 524}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0c_1[]= /* 640x480_3 */
static const SiS_LVDSDesStruct SiS310_PanelType0c_1[]= /* 640x480_3 */
{
{ 0, 524},
{ 0, 524},
......@@ -1944,7 +1253,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0c_1[]= /* 640x480_3 */
{ 0, 524}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0d_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType0d_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1957,7 +1266,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0d_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0e_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType0e_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1970,7 +1279,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0e_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0f_1[]=
static const SiS_LVDSDesStruct SiS310_PanelType0f_1[]=
{
{1343, 798},
{1343, 794},
......@@ -1983,7 +1292,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0f_1[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType00_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType00_2[]=
{
{980, 528},
{980, 503},
......@@ -1996,7 +1305,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType00_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType01_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType01_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2009,7 +1318,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType01_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType02_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType02_2[]=
{
{1368, 754},
{1368, 729},
......@@ -2024,7 +1333,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType02_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType03_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType03_2[]=
{
{ 0, 0},
{ 0, 0},
......@@ -2035,7 +1344,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType03_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType04_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType04_2[]=
{
{ 0, 0},
{ 0, 0},
......@@ -2048,7 +1357,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType04_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType05_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType05_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2061,7 +1370,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType05_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType06_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType06_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2074,7 +1383,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType06_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType07_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType07_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2087,7 +1396,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType07_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType08_2[]= /* 1400x1050 */
static const SiS_LVDSDesStruct SiS310_PanelType08_2[]= /* 1400x1050 */
{
{1308, 741},
{1308, 716},
......@@ -2102,7 +1411,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType08_2[]= /* 1400x1050 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType09_2[]= /* 1280x768 */
static const SiS_LVDSDesStruct SiS310_PanelType09_2[]= /* 1280x768 */
{
{1083, 622},
{1083, 597},
......@@ -2115,7 +1424,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType09_2[]= /* 1280x768 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0a_2[]= /* 1600x1200 */
static const SiS_LVDSDesStruct SiS310_PanelType0a_2[]= /* 1600x1200 */
{
{1568, 920},
{1568, 895},
......@@ -2141,7 +1450,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0a_2[]= /* 1600x1200 */
#endif
};
static const SiS310_LVDSDesStruct SiS310_PanelType0b_2[]= /* 640x480_2 */
static const SiS_LVDSDesStruct SiS310_PanelType0b_2[]= /* 640x480_2 */
{
{1152, 622},
{1152, 597},
......@@ -2154,7 +1463,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0b_2[]= /* 640x480_2 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0c_2[]= /* 640x480_3 */
static const SiS_LVDSDesStruct SiS310_PanelType0c_2[]= /* 640x480_3 */
{
{1152, 622},
{1152, 597},
......@@ -2167,7 +1476,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0c_2[]= /* 640x480_3 */
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0d_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType0d_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2180,7 +1489,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0d_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0e_2[]=
static const SiS_LVDSDesStruct SiS310_PanelType0e_2[]=
{
{1152, 622},
{1152, 597},
......@@ -2193,7 +1502,7 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0e_2[]=
{ 0, 0}
};
static const SiS310_LVDSDesStruct SiS310_PanelType0f_2[] =
static const SiS_LVDSDesStruct SiS310_PanelType0f_2[] =
{
{1152, 622},
{1152, 597},
......@@ -2206,14 +1515,37 @@ static const SiS310_LVDSDesStruct SiS310_PanelType0f_2[] =
{ 0, 0}
};
/* CRT1 CRTC for SlaveModes and LCDA */
static const SiS_LVDSDesStruct SiS310_PanelTypeNS_1[]=
{
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 8, 0},
{ 0, 0},
{ 0, 0},
{ 0, 0},
{ 0, 806},
{ 0, 0}
};
typedef struct _SiS310_LVDSCRT1DataStruct
static const SiS_LVDSDesStruct SiS310_PanelTypeNS_2[] =
{
UCHAR CR[15];
} SiS310_LVDSCRT1DataStruct;
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0},
{ 0 , 0}
};
/* CRT1 CRTC for SlaveModes and LCDA */
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1[] =
{
{{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
......@@ -2235,7 +1567,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1_H[] =
{
{{0x43,0x27,0x87,0x2d,0x1d,0xaa,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
......@@ -2257,7 +1589,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_1_H[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2[]=
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2[]=
{
{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
......@@ -2279,7 +1611,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2[]=
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2_H[] =
{
{{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
......@@ -2301,7 +1633,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT1800x600_2_H[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1[] =
{
{{0x73,0x4f,0x97,0x53,0x84,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
......@@ -2326,7 +1658,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1_H[] =
{
{{0x4b,0x27,0x8f,0x2b,0x1c,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
......@@ -2351,7 +1683,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_1_H[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x57,0x8e,0x8f,0x25,0x30,0x00,0x06,
......@@ -2376,7 +1708,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2_H[] =
{
{{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
......@@ -2401,7 +1733,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11024x768_2_H[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1[] =
{
{{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
......@@ -2429,7 +1761,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1_H[] =
{
{{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
......@@ -2454,7 +1786,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_1_H[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2[] =
{
{{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x02,
......@@ -2482,7 +1814,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2_H[] =
{
{{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x06,
......@@ -2507,7 +1839,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11280x1024_2_H[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1[] =
{
{{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
......@@ -2567,7 +1899,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1_H[] =
{
{{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
......@@ -2627,7 +1959,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_1_H[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2[] =
{
{{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x02,
......@@ -2687,7 +2019,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2_H[] =
{
{{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x06,
......@@ -2747,7 +2079,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11400x1050_2_H[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1[] =
{
{{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
......@@ -2813,7 +2145,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1_H[] =
{
{{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
......@@ -2879,7 +2211,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_1_H[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2[] =
{
{{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
......@@ -2945,7 +2277,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2[] =
#endif
};
static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2_H[] =
static const SiS_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2_H[] =
{
{{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
......@@ -3011,9 +2343,66 @@ static const SiS310_LVDSCRT1DataStruct SiS310_LVDSCRT11600x1200_2_H[] =
#endif
};
static const SiS_LVDSCRT1DataStruct SiS310_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 SiS310_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}}
};
/* CRT1 CRTC for Chrontel TV slave modes */
static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1UNTSC[] =
static const SiS_LVDSCRT1DataStruct SiS310_CHTVCRT1UNTSC[] =
{
{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
......@@ -3038,7 +2427,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1UNTSC[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1ONTSC[] =
static const SiS_LVDSCRT1DataStruct SiS310_CHTVCRT1ONTSC[] =
{
{{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
......@@ -3063,7 +2452,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1ONTSC[] =
0x01 }}
};
static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1UPAL[] =
static const SiS_LVDSCRT1DataStruct SiS310_CHTVCRT1UPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -3088,7 +2477,7 @@ static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1UPAL[] =
0x01}}
};
static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1OPAL[] =
static const SiS_LVDSCRT1DataStruct SiS310_CHTVCRT1OPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -3113,12 +2502,8 @@ static const SiS310_LVDSCRT1DataStruct SiS310_CHTVCRT1OPAL[] =
0x01 }}
};
typedef struct _SiS310_CHTVRegDataStruct
{
UCHAR Reg[16];
} SiS310_CHTVRegDataStruct;
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
{
{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3138,7 +2523,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
for PAL-M and PAL-N all above is corrected.
*/
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
{
{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3149,7 +2534,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
{{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}}
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
{
{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3160,7 +2545,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
{{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}}
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
{
{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3171,7 +2556,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
{{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
{
{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3187,7 +2572,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
#endif
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
{
{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
{{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
......@@ -3203,7 +2588,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
#endif
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
{
{{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
{{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
......@@ -3219,7 +2604,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
#endif
};
static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
{
{{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
{{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* $XFree86$ */
/* $XdotOrg$ */
/*
* Data and prototypes for init.c
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -101,6 +99,7 @@ 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_960x540[] = {0x1d, 0x1e, 0x00, 0x1f}; /* 315 series only */
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 */
......@@ -111,10 +110,13 @@ 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_1280x800[] = {0x14, 0x15, 0x00, 0x16};
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_1680x1050[] = {0x17, 0x18, 0x00, 0x19}; /* 315 series only */
const USHORT ModeIndex_1600x1200[] = {0x3c, 0x3d, 0x00, 0x66};
const USHORT ModeIndex_1920x1080[] = {0x2c, 0x2d, 0x00, 0x73}; /* 315 series only */
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};
......@@ -253,9 +255,14 @@ static const SiS_ModeResInfoStruct SiS_ModeResInfo[] =
{ 1024, 600, 8,16}, /* 0x19 */
{ 1152, 768, 8,16}, /* 0x1a */
{ 768, 576, 8,16}, /* 0x1b */
{ 1360,1024, 8,16} /* 0x1c */
{ 1360,1024, 8,16}, /* 0x1c */
{ 1680,1050, 8,16}, /* 0x1d */
{ 1280, 800, 8,16}, /* 0x1e */
{ 1920,1080, 8,16}, /* 0x1f */
{ 960, 540, 8,16} /* 0x20 */
};
#if defined(SIS300) || defined(SIS315H)
static SiS_StandTableStruct SiS_StandTable[]=
{
/* 0x00: MD_0_200 */
......@@ -694,6 +701,7 @@ static SiS_StandTableStruct SiS_StandTable[]=
0xff}
}
};
#endif
/**************************************************************/
/* SIS VIDEO BRIDGE ----------------------------------------- */
......@@ -839,7 +847,8 @@ static const SiS_TVDataStruct SiS_ExtPALData[] =
{ 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) */
{ 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20}, /* 1024x768 (for NTSC equ) */
{ 9, 4, 848, 528,1270, 530, 0, 0, 50,0xf5,0xfb,0x1b,0x2a} /* 720x480 test */
};
static const SiS_TVDataStruct SiS_StNTSCData[] =
......@@ -921,6 +930,22 @@ static const SiS_TVDataStruct SiS_St750pData[] =
static const SiS_TVDataStruct SiS_Ext750pData[] =
{
#if 1
{ 143, 65, 0x35a,0x1bb,0x4f6,0x1b8,0x0ab, 0, 0x0ab, 0x00,0x00,0x00,0x00},
{ 88, 35, 0x35a,0x189,0x4f6,0x1b8,0x0ab, 0, 0x0ab, 0x00,0x00,0x00,0x00},
{ 18, 5, 0x339,0x1ae,0x500,0x2d0,0x05c, 0, 0x05c, 0x00,0x00,0x00,0x00},
{ 143, 70, 0x39c,0x189,0x4f6,0x1b8,0x05c, 0, 0x05c, 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 */
#if 0
{ 2, 1, 0x35a,0x1f7,0x4f6,0x1e0, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */
#endif
{ 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 720x480 test WORKS */
{ 68, 64, 0x55f,0x346,0x500,0x2a8,0x27e, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */
{ 5, 2, 0x3a7,0x226,0x500,0x2a8, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x576 */
{ 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 WORKS */
#endif
#if 0
{ 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},
......@@ -929,63 +954,105 @@ static const SiS_TVDataStruct SiS_Ext750pData[] =
{ 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 */
{ 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 */
#endif
#if 0
{ 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* TEST (0.93) BAD */
{ 17, 6, 0x339,0x203,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00},
{ 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00},
{ 17, 6, 0x339,0x203,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00},
{ 85, 46, 0x3f4,0x27b,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */
{ 17, 16, 0x55f,0x323,0x460,0x2a8,0x2b6, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */
{ 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */
{ 187, 74, 0x39d,0x203,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */
{ 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00} /* 1280x720 */
#endif
};
static const SiS_LCDDataStruct SiS_LCD1280x960Data[] =
static const SiS_LCDDataStruct SiS_LCD1280x720Data[] =
{
{ 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}
{ 14, 5, 864, 432, 1344, 806 }, /* 640x400 */
{ 16, 5, 864, 378, 1344, 806 },
{ 14, 5, 864, 432, 1344, 806 },
{ 16, 5, 864, 378, 1344, 806 },
{ 24, 11, 924, 523, 1344, 806 }, /* 640x480 */
{ 7, 5, 1152, 664, 1344, 806 }, /* 800x600 */
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1344, 806, 1344, 806 } /* 1280x720 */
};
/* 1280x768 panel data from Fujitsu 7911 (VL-17WDX8).
* Other 1280x768 panels (with clock != 81000, HTxVT != 1688x802)
* will be treated as custom panels.
/* About 1280x768: For TMDS, Panel_1280x768 will only be set if
* the panel is a Fujitsu 7911 (VL-17WDX8) (with clock 81, 1688x802)
* Other TMDS panels of this resolution will be treated as custom.
* For LVDS, we know two types. Data follows:
*/
static const SiS_LCDDataStruct SiS_StLCD1280x768Data[] =
static const SiS_LCDDataStruct SiS_StLCD1280x768_2Data[] =
{
{ 64, 21, 858, 434, 1408, 806 }, /* 640x400 */
{ 32, 9, 858, 372, 1408, 806 },
{ 64, 21, 858, 434, 1408, 806 },
{ 32, 9, 858, 372, 1408, 806 },
{ 143, 68, 1024, 527, 1408, 806 }, /* 640x480 */
{ 64, 51, 1364, 663, 1408, 806 }, /* 800x600 */
{ 88, 81, 1296, 806, 1408, 806 }, /* 1024x768 */
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */
};
static const SiS_LCDDataStruct SiS_ExtLCD1280x768_2Data[] =
{
{ 64, 25, 1056, 422, 1408, 806 }, /*, 664 */
{ 128, 39, 884, 396, 1408, 806 }, /*, 640 */
{ 64, 25, 1056, 422, 1408, 806 }, /*, 664 */
{ 128, 39, 884, 396, 1408, 806 }, /*, 640 */
{ 32, 15, 1056, 513, 1408, 806 }, /*, 664 */
{ 176, 125, 1280, 640, 1408, 806 }, /*, 768 */
{ 88, 81, 1296, 806, 1408, 806 },
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1408, 806, 1408, 806 }
};
static const SiS_LCDDataStruct SiS_LCD1280x768_3Data[] =
{
{ 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 */
{ 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */
{ 128, 39, 884, 396, 1408, 806 }, /* ,640 */
{ 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */
{ 128, 39, 884, 396, 1408, 806 }, /* ,640 */
{ 32, 15, 1056, 513, 1408, 806 }, /* ,664 */ /* 640x480 */
{ 176, 125, 1280, 640, 1408, 806 }, /* ,768 */ /* 800x600 */
{ 64, 61, 1342, 806, 1408, 806 }, /* 1024x768 */
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */
};
static const SiS_LCDDataStruct SiS_ExtLCD1280x768Data[] =
static const SiS_LCDDataStruct SiS_LCD1280x800Data[] =
{
{ 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 */
{ 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */
{ 128, 49, 1232, 361, 1408, 816 },
{ 128, 51, 1122, 412, 1408, 816 },
{ 128, 49, 1232, 361, 1408, 816 },
{ 8, 3, 880, 491, 1408, 816 }, /* 640x480 */
{ 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */
{ 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1408, 816, 1408, 816 } /* 1280x800 */
};
static const SiS_LCDDataStruct SiS_NoScaleData1280x768[] =
static const SiS_LCDDataStruct SiS_LCD1280x960Data[] =
{
{ 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}
{ 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 }
};
static const SiS_LCDDataStruct SiS_StLCD1400x1050Data[] =
......@@ -1003,28 +1070,37 @@ static const SiS_LCDDataStruct SiS_StLCD1400x1050Data[] =
static const SiS_LCDDataStruct SiS_ExtLCD1400x1050Data[] =
{
{ 211, 100, 2100, 408, 1688, 1066 },
/* { 211, 60, 1260, 410, 1688, 1066 }, 640x400 (6330) */
{ 211, 100, 2100, 408, 1688, 1066 }, /* 640x400 (6325) WORKS */
{ 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 }
/* { 211, 80, 1400, 490, 1688, 1066 }, 640x480 (6330) */
{ 211, 48, 840, 488, 1688, 1066 }, /* 640x480 (6325) WORKS */
/* { 211, 117, 1638, 613, 1688, 1066 }, 800x600 (6330) */
{ 211, 72, 1008, 609, 1688, 1066 }, /* 800x600 (6325) WORKS */
{ 211, 128, 1400, 776, 1688, 1066 }, /* 1024x768 */
{ 211, 205, 1680, 1041, 1688, 1066 }, /* 1280x1024 - not used (always unscaled) */
{ 1, 1, 1688, 1066, 1688, 1066 }, /* 1400x1050 */
{ 0, 0, 0, 0, 0, 0 }, /* kludge */
{ 211, 120, 1400, 730, 1688, 1066 } /* 1280x720 */
};
static const SiS_LCDDataStruct SiS_LCD1680x1050Data[] =
{
{ 95, 24, 1260, 410, 1900, 1066 }, /* 0 640x400 */
{ 10, 3, 1710, 362, 1900, 1066 },
{ 95, 24, 1260, 410, 1900, 1066 },
{ 10, 3, 1710, 362, 1900, 1066 },
{ 95, 32, 1400, 490, 1900, 1066 }, /* 4 640x480 */
{ 95, 42, 1470, 610, 1900, 1066 }, /* 5 800x600 */
{ 95, 64, 1750, 784, 1900, 1066 }, /* 6 1024x768 */
{ 95, 94, 1900, 1055, 1900, 1066 }, /* 7 1280x1024 */
{ 41, 31, 1900, 806, 1900, 1066 }, /* 8 1280x768 */
{ 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch */
{ 13, 9, 1900, 739, 1900, 1066 }, /* 10 1280x720 */
{ 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch */
{ 1, 1, 1900, 1066, 1900, 1066 } /* 12 1680x1050 */
};
static const SiS_LCDDataStruct SiS_StLCD1600x1200Data[] =
......@@ -1037,440 +1113,59 @@ static const SiS_LCDDataStruct SiS_StLCD1600x1200Data[] =
{ 4, 1,1080, 625, 2160, 1250 },
{ 5, 2,1350, 800, 2160, 1250 },
{135,88,1600,1100, 2160, 1250 },
{135,88,1600,1100, 2160, 1250 },
{72, 49,1680,1092, 2160, 1250 },
{ 1, 1,2160,1250, 2160, 1250 }
};
static const SiS_LCDDataStruct SiS_ExtLCD1600x1200Data[] =
{
{27, 4, 800, 500, 2160, 1250 },
{72,11, 990, 422, 2160, 1250 }, /* 640x400 (6330) WORKS */
/* {27, 4, 800, 500, 2160, 1250 }, 640x400 (6235) */
{27, 4, 800, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{ 6, 1, 900, 500, 2160, 1250 },
{27, 1, 800, 500, 2160, 1250 },
{45, 8, 960, 505, 2160, 1250 }, /* 640x480 (6330) WORKS */
/* {27, 1, 800, 500, 2160, 1250 }, 640x480 (6325) */
{ 4, 1,1080, 625, 2160, 1250 },
{ 5, 2,1350, 800, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 }, /* 1280x1024 */
{72,49,1680,1092, 2160, 1250 }, /* 1400x1050 (6330, was not supported on 6325) */
{ 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 }, /* 0x00: 320x200, 640x400 */
{ 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
};
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
};
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
};
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}}
{ 1, 1, 800, 525, 800, 525 }, /* 0x04: 320x240, 640x480 */
{ 1, 1,1056, 628,1056, 628 }, /* 0x05: 400x300, 800x600 */
{ 1, 1,1344, 806,1344, 806 }, /* 0x06: 512x384, 1024x768 */
{ 1, 1,1688,1066,1688,1066 }, /* 0x07: 1280x1024 */
{ 1, 1,1688, 802,1688, 802 }, /* 0x08: 1280x768: Fujitsu, TMDS only */
{ 1, 1,2160,1250,2160,1250 }, /* 0x09: 1600x1200 */
{ 1, 1,1800,1000,1800,1000 }, /* 0x0a: 1280x960 */
{ 1, 1,1688,1066,1688,1066 }, /* 0x0b: 1400x1050 */
{ 1, 1,1650, 750,1650, 750 }, /* 0x0c: 1280x720 (TMDS, projector) */
{ 1, 1,1656, 841,1656, 841 }, /* 0x0d: 1280x800 (was: 1408, 816) */
{ 1, 1,1900,1066,1900,1066 }, /* 0x0e: 1680x1050 (LVDS) */
{ 1, 1,1408, 806,1408, 806 }, /* 0x0f: 1280x768_2 */
{ 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 */
{ 1, 1,1688, 802,1688, 802 }, /* 0x11: 1280x768: Std, TMDS only */
{ 1, 1,1344, 806,1344, 806 }, /* 0x12: 1280x720 (LVDS) */
{ 1, 1, 896, 497, 896, 497 }, /* 0x13: 720x480 */
{ 1, 1, 912, 597, 912, 597 }, /* 0x14: 720x576 */
{ 1, 1, 912, 597, 912, 597 }, /* 0x15: 768x576 */
{ 1, 1,1056, 497,1056, 497 }, /* 0x16: 848x480 */
{ 1, 1,1064, 497,1064, 497 }, /* 0x17: 856x480 */
{ 1, 1,1056, 497,1056, 497 }, /* 0x18: 800x480 */
{ 1, 1,1328, 739,1328, 739 }, /* 0x19: 1024x576 */
{ 1, 1,1680, 892,1680, 892 }, /* 0x1a: 1152x864 */
{ 1, 1,1808, 808,1808, 808 }, /* 0x1b: 1360x768 */
{ 1, 1,1104, 563,1104, 563 } /* 0x1c: 960x540 */
};
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 ----------------------------------------------------- */
......@@ -1521,9 +1216,7 @@ static const SiS_LVDSDataStruct SiS_LVDS800x600Data_1[]=
{ 848, 389,1060, 629},
{ 848, 518,1060, 629},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{ 800, 449,1000, 644},
{ 800, 525,1000, 635}
{1056, 628,1056, 628}
};
static const SiS_LVDSDataStruct SiS_LVDS800x600Data_2[]=
......@@ -1534,9 +1227,7 @@ static const SiS_LVDSDataStruct SiS_LVDS800x600Data_2[]=
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{ 800, 449,1000, 644},
{ 800, 525,1000, 635}
{1056, 628,1056, 628}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_1[]=
......@@ -1548,8 +1239,6 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_1[]=
{ 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[]=
......@@ -1561,11 +1250,8 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_2[]=
{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},
......@@ -1716,9 +1402,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_1[] =
{ 840, 560,1344, 800},
{ 840, 689,1344, 800},
{1050, 800,1344, 800},
{1344, 800,1344, 800},
{ 800, 449,1280, 789},
{ 800, 525,1280, 785}
{1344, 800,1344, 800}
};
static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_2[] =
......@@ -1729,9 +1413,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_2[] =
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
{1344, 800,1344, 800}
};
static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_1[] =
......@@ -1742,9 +1424,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_1[] =
{ 840, 409,1344, 806},
{ 840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
{1344, 806,1344, 806}
};
static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_2[] =
......@@ -1755,9 +1435,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_2[] =
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{ 800, 449,1280, 801},
{ 800, 525,1280, 813}
{1344, 806,1344, 806}
};
/* Pass 1:1 data */
......@@ -1770,7 +1448,7 @@ static const SiS_LVDSDataStruct SiS_LVDSXXXxXXXData_1[]=
{ 800, 525, 800, 525}, /* 640x480 */
{1056, 628, 1056, 628}, /* 800x600 */
{1344, 806, 1344, 806}, /* 1024x768 */
{1344,1066, 1344,1066}, /* 1280x1024 */ /* INSERTED ! */
{1688,1066, 1688,1066}, /* 1280x1024 */ /* INSERTED ! */
{1688, 806, 1688, 806}, /* 1280x768 */
/* No other panels ! */
};
......@@ -1885,36 +1563,6 @@ static const SiS_LVDSDataStruct SiS_CHTVONTSCData[]=
{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[]=
......@@ -2453,63 +2101,6 @@ static const SiS_LVDSCRT1DataStruct SiS_LVDSCRT11280x768_2_H[] =
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 --------------------------------------------------- */
/**************************************************************/
......@@ -2770,7 +2361,8 @@ static const SiS_PlasmaTables SiS_PlasmaTable[] = {
{ 0x0000 }
};
USHORT SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
USHORT SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight);
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);
......@@ -2791,6 +2383,7 @@ 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);
BOOLEAN SiSDetermineROMLayout661(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);
......@@ -2801,6 +2394,7 @@ 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);
void SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr,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,
......@@ -2821,10 +2415,7 @@ 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_INFO HwInfo,
unsigned char modeno, unsigned char rateindex,
ULONG *left_margin, ULONG *right_margin,
ULONG *upper_margin, ULONG *lower_margin,
ULONG *hsync_len, ULONG *vsync_len,
ULONG *sync, ULONG *vmode);
struct fb_var_screeninfo *var);
BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
#endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* $XFree86$ */
/* $XdotOrg$ */
/*
* Data and prototypes for init301.c
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -91,29 +89,41 @@ const UCHAR SiS_YPbPrTable[3][64] = {
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,
0x03,0x0a,0x65,0x9d /*0x8d*/,0x08,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53 /*0x50*/,
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,
0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4c /*0x4f*/,0x13,
0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8,
0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40,
0x51,0x5e,0x60,0x57 /*0x49*/,0x7b /*0x7d*/,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4b,
0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00
},
{
#if 1
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,
0xed,0x50,0x70,0x9f,0x16,0x59,0x21 /*0x2b*/,0x13,
0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40,
0x4b,0x4b,0x65 /*0x6f*/,0x2f,0x63,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27,
0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
#endif
#if 0
0x2a,0x14,0xe8,0x09,0x09,0xed,0x0c,0x0c, /* TEST (0.93) - BAD */
0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
0xed,0x50,0x70,0x9e,0x16,0x57,0x6c,0x13,
0x27,0x0b,0x27,0xfb,0x30,0x27,0x15,0xb0,
0x3b,0xdb,0x61,0x24,0x78,0x92,0x0f,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0x14,0x6f,
0x00,0x52,0xbb,0x00,0xd5,0xf7,0xa2,0x00
#endif
}
};
......@@ -139,7 +149,7 @@ const UCHAR SiS_HiTVGroup3_2[] = {
0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
};
/* 301C / 302ELV (?) extended Part2 TV registers */
/* 301C / 302ELV extended Part2 TV registers */
static const UCHAR SiS_Part2CLVX_1[] = {
0x00,0x00,
......@@ -208,28 +218,84 @@ 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,
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,
};
#ifdef SIS315H
/* 661 et al LCD data structure */
/* 661 et al LCD data structure (0.94.0) */
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,
/* type|CR37| HDE | VDE | HT | VT | hss | hse */
0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88,
0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04,
/* | vss | vse |clck| clock |CRT2DataP|CRT2DataP|idx */
/* VESA non-VESA noscale */
/* 1280x1024 */
0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70,
0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08,
/* 1400x1050 */
0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38,
0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09,
/* 1600x1200 */
0x0B,0xC0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0,
0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0B,
/* 1280x768 */
0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x05,0x26,0x03,0x10,0x00,0x40,
0x00,0x03,0x00,0x06,0x00,0x44,0x63,0x46,0x00,0x00,0x00,0x00,0x06,
/* 1280x720 */
0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x02,
0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05,
/* 1280x800 */
0x0C,0xE0,0x00,0x05,0x20,0x03,0x80,0x05,0x30,0x03,0x10,0x00,0x40,
0x00,0x04,0x00,0x03,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x07,
/* 1680x1050 */
0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C,
0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06,
/* 1280x768 (not in 0.93) */
0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x06,0x1E,0x03,0x40,0x00,0x80,
0x00,0x03,0x00,0x07,0x00,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x06
};
#endif
#ifdef SIS300
static UCHAR SiS300_TrumpionData[7][80] = {
{ 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23,
0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05,
0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02,
0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23,
0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05,
0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
{ 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }
};
#endif
......@@ -271,46 +337,51 @@ 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 */
#ifdef SIS300
void SiS_SetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx);
USHORT SiS_GetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx);
static BOOLEAN SiS_SetTrumpionBlock(SiS_Private *SiS_Pr, UCHAR *dataptr);
#endif
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);
void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
USHORT SiS_SetSCLKLow(SiS_Private *SiS_Pr);
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_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);
void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
USHORT SiS_SetSCLKLow(SiS_Private *SiS_Pr);
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_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);
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);
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_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);
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_INFO HwInfo,
USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTabindex);
void SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
USHORT ModeNo, USHORT ModeIdIndex,USHORT RefTableIndex);
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
extern void SiS_SetReg(SISIOADDRESS, USHORT, USHORT);
......@@ -338,5 +409,6 @@ extern USHORT SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdInd
extern void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO,USHORT ModeNo,
USHORT ModeIdIndex);
extern void SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
#endif
/* $XFree86$ */
/* $XdotOrg$ */
/*
* Global definitions for init.c and init301.c
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -72,6 +70,8 @@
#define IS_SIS650740660 (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
#define IS_SIS550650740660 (IS_SIS550 || IS_SIS650740660)
#define SISGETROMW(x) (ROMAddr[(x)] | (ROMAddr[(x)+1] << 8))
/* SiS_VBType */
#define VB_SIS301 0x0001
#define VB_SIS301B 0x0002
......@@ -85,6 +85,8 @@
#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 VB_SISTMDS (VB_SIS301 | VB_SIS301B302B)
#define VB_SISLVDS VB_SIS301LV302LV
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
......@@ -137,6 +139,7 @@
#define CRT2Mode 0x0800
#define HalfDCLK 0x1000
#define NoSupportSimuTV 0x2000
#define NoSupportLCDScale 0x4000 /* TMDS: No scaling possible (no matter what panel) */
#define DoubleScanMode 0x8000
/* Infoflag */
......@@ -145,7 +148,7 @@
#define SupportCHTV 0x0800
#define Support64048060Hz 0x0800 /* Special for 640x480 LCD */
#define SupportHiVision 0x0010
#define SupportYPbPr 0x1000 /* TODO */
#define SupportYPbPr750p 0x1000
#define SupportLCD 0x0020
#define SupportRAMDAC2 0x0040 /* All (<= 100Mhz) */
#define SupportRAMDAC2_135 0x0100 /* All except DH (<= 135Mhz) */
......@@ -174,19 +177,22 @@
#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 TVSetYPbPr525i 0x0020 /* new 0x10 */
#define TVSetYPbPr525p 0x0040 /* new 0x20 */
#define TVSetYPbPr750p 0x0080 /* new 0x40 */
#define TVSetHiVision 0x0100 /* new 0x80; = 1080i, software-wise identical */
#define TVSetTVSimuMode 0x0200 /* new 0x200, prev. 0x800 */
#define TVRPLLDIV2XO 0x0400 /* prev 0x1000 */
#define TVSetNTSC1024 0x0800 /* new 0x100, prev. 0x2000 */
#define TVAspect43 0x2000
#define TVAspect169 0x4000
#define TVAspect43LB 0x8000
/* YPbPr flag (>=315, <661; converted to TVMode) */
#define YPbPr525p 0x0001
#define YPbPr750p 0x0002
#define YPbPr525i 0x0004
#define YPbPrHiVision 0x0008
#define YPbPrModeMask (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision)
/* SysFlags (to identify special versions) */
......@@ -198,6 +204,7 @@
#define SF_IsM661 0x0020
#define SF_IsM741 0x0040
#define SF_IsM760 0x0080
#define SF_760LFB 0x8000 /* 760: We have LFB */
/* CR32 (Newer 630, and 315 series)
......@@ -269,7 +276,7 @@
#define LCDRGB18Bit 0x0001
#define LCDNonExpanding 0x0010
#define LCDSync 0x0020
#define LCDPass11 0x0100
#define LCDPass11 0x0100 /* 0: center screen, 1: Pass 1:1 data */
#define LCDDualLink 0x0200
#define DontExpandLCD LCDNonExpanding
......@@ -305,7 +312,7 @@
#define EnablePALMN 0x40 /* Romflag: 1 = Allow PALM/PALN */
/* CR39 (650 only) */
#define LCDPass1_1 0x01 /* LVDS only; set by driver to pass 1:1 data to LVDS output */
#define LCDPass1_1 0x01 /* 0: center screen, 1: pass 1:1 data output */
#define Enable302LV_DualLink 0x04 /* 302LV only; enable dual link */
/* CR39 (661 and later)
......@@ -348,7 +355,7 @@
#define Panel300_1024x600 0x06
#define Panel300_1152x768 0x07
#define Panel300_1280x768 0x0a
#define Panel300_320x480 0x0e /* fstn - TW: This is fake, can be any */
#define Panel300_320x480 0x0e /* fstn - This is fake, can be any */
#define Panel300_Custom 0x0f
#define Panel300_Barco1366 0x10
......@@ -368,8 +375,24 @@
#define Panel310_320x480 0x0e /* fstn - TW: This is fake, can be any */
#define Panel310_Custom 0x0f
#define Panel661_800x600 0x01
#define Panel661_1024x768 0x02
#define Panel661_1280x1024 0x03
#define Panel661_640x480 0x04
#define Panel661_1024x600 0x05
#define Panel661_1152x864 0x06
#define Panel661_1280x960 0x07
#define Panel661_1152x768 0x08
#define Panel661_1400x1050 0x09
#define Panel661_1280x768 0x0a
#define Panel661_1600x1200 0x0b
#define Panel661_1280x800 0x0c
#define Panel661_1680x1050 0x0d
#define Panel661_1280x720 0x0e
#define Panel661_Custom 0x0f
#define Panel_800x600 0x01 /* Unified values */
#define Panel_1024x768 0x02
#define Panel_1024x768 0x02 /* MUST match BIOS values from 0-e */
#define Panel_1280x1024 0x03
#define Panel_640x480 0x04
#define Panel_1024x600 0x05
......@@ -377,16 +400,19 @@
#define Panel_1280x960 0x07
#define Panel_1152x768 0x08 /* LVDS only */
#define Panel_1400x1050 0x09
#define Panel_1280x768 0x0a /* LVDS only */
#define Panel_1280x768 0x0a /* 30xB/C and LVDS only (BIOS: all) */
#define Panel_1600x1200 0x0b
#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 */
#define Panel_1280x800 0x0c /* 661etc */
#define Panel_1680x1050 0x0d /* 661etc */
#define Panel_1280x720 0x0e /* 661etc */
#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection */
#define Panel_320x480 0x10 /* SiS 550 fstn - TW: This is fake, can be any */
#define Panel_Barco1366 0x11
#define Panel_848x480 0x12
#define Panel_640x480_2 0x13 /* SiS 550 */
#define Panel_640x480_3 0x14 /* SiS 550 */
#define Panel_1280x768_2 0x15 /* 30xLV */
#define Panel_1280x768_3 0x16 /* 30xLV */
/* Index in ModeResInfo table */
#define SIS_RI_320x200 0
......@@ -411,13 +437,17 @@
#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_1152x864 22 /* Up to here 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
#define SIS_RI_1680x1050 29
#define SIS_RI_1280x800 30
#define SIS_RI_1920x1080 31
#define SIS_RI_960x540 32
/* CR5F */
#define IsM650 0x80
......@@ -445,14 +475,32 @@
#define VCLK108_3_300 0x42 /* Index in VCLKData table (300) */
#define VCLK100_300 0x43 /* Index in VCLKData table (300) */
#define VCLK34_300 0x3d /* Index in VCLKData table (300) */
#define VCLK_CUSTOM_300 0x46
#define 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 VCLK162_315 0x5e /* 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 VCLK34_315 0x55
#define VCLK68_315 0x0d
#define VCLK69_315 0x5c /* deprecated ! Index in VBVCLKData table (315) */
#define VCLK83_315 0x5c /* Index in VBVCLKData table (315) */
#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */
#define VCLK_1280x720 0x5f
#define VCLK_1280x768_2 0x60
#define VCLK_1280x768_3 0x61
#define VCLK_CUSTOM_315 0x62
#define VCLK_1280x720_2 0x63
#define VCLK_720x480 0x67
#define VCLK_720x576 0x68
#define VCLK_768x576 0x68
#define VCLK_848x480 0x65
#define VCLK_856x480 0x66
#define VCLK_800x480 0x65
#define VCLK_1024x576 0x51
#define VCLK_1152x864 0x64
#define VCLK_1360x768 0x58
#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) */
......@@ -462,7 +510,7 @@
#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 YPbPr750pVCLK 0x25 /* Index relative to TVCLKBASE; was 0x0f NOT relative */
/* ------------------------------ */
......@@ -563,7 +611,7 @@
/*
=============================================================
for 315 series
for 315 series (old data layout)
=============================================================
*/
#define SoftDRAMType 0x80
......
/* $XFree86$ */
/* $XdotOrg$ */
/*
* OEM Data for 300 series
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......
/* $XFree86$ */
/* $XdotOrg$ */
/*
* OEM Data for 315/330 series
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -91,7 +89,7 @@ static const UCHAR SiS310_LCDDelayCompensation_650301LV[] = /* 650 + 30xLV *
0x02,0x02,0x02
};
static const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
static const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
{
0x33,0x33,0x33, /* 800x600 (guessed) - new: PanelType, not PanelRes ! */
0x33,0x33,0x33, /* 1024x768 */
......@@ -110,7 +108,7 @@ static const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV
0x33,0x33,0x33
};
static 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 */
......@@ -129,7 +127,7 @@ static const UCHAR SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV
0x33,0x33,0x33
};
static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB,LV */
static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB */
{
0x01,0x01,0x01, /* 800x600 */
0x0C,0x0C,0x0C, /* 1024x768 */
......@@ -148,6 +146,25 @@ static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB,LV */
0x02,0x02,0x02
};
static const UCHAR SiS310_LCDDelayCompensation_3xx301LV[] = /* 315+30xLV */
{
0x01,0x01,0x01, /* 800x600 */
0x04,0x04,0x04, /* 1024x768 (A531/BIOS 1.14.05f: 4 - works with 6 */
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 */
......@@ -169,13 +186,6 @@ static const UCHAR SiS310_TVDelayCompensation_740301B[] = /* 740 + 30xB (30xLV?)
0x05,0x05
};
static const UCHAR SiS310_TVDelayCompensation_LVDS[] = /* LVDS */
{
0x0a,0x0a,
0x0a,0x0a,
0x0a,0x0a
};
static const UCHAR SiS310_TVDelayCompensation_651301LV[] = /* M650, 651, 301LV */
{
0x33,0x33,
......@@ -210,6 +220,13 @@ static const UCHAR SiS_TVDelay661_301B[] = /* 661, 301B et al */
0x44,0x44
};
static const UCHAR SiS310_TVDelayCompensation_LVDS[] = /* LVDS */
{
0x0a,0x0a,
0x0a,0x0a,
0x0a,0x0a
};
static const UCHAR SiS310_TVAntiFlick1[6][2] =
{
{0x4,0x0},
......@@ -412,141 +429,6 @@ static const SiS_LCDDataStruct SiS310_ExtCompaq1280x1024Data[] =
{ 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[] =
......@@ -562,52 +444,6 @@ static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Asus1024x768_3[] =
{{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 },
};
/* $XFree86$ */
/* $XdotOrg$ */
/*
* OS depending defines
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -54,95 +52,77 @@
*/
/* 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
#endif
#ifdef LINUX_XF86 /* ----------------------------- */
#define SIS300
#define SIS315H
#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
/**********************************************************************/
#ifdef OutPortByte
#undef OutPortByte
#endif /* OutPortByte */
#endif
#ifdef OutPortWord
#undef OutPortWord
#endif /* OutPortWord */
#endif
#ifdef OutPortLong
#undef OutPortLong
#endif /* OutPortLong */
#endif
#ifdef InPortByte
#undef InPortByte
#endif /* InPortByte */
#endif
#ifdef InPortWord
#undef InPortWord
#endif /* InPortWord */
#endif
#ifdef InPortLong
#undef InPortLong
#endif /* InPortLong */
#endif
/**********************************************************************/
/* LINUX XF86 */
/* LINUX KERNEL */
/**********************************************************************/
#ifdef LINUX_XF86
#define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v))
#define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v))
#define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v))
#define InPortByte(p) inb((CARD16)(p))
#define InPortWord(p) inw((CARD16)(p))
#define InPortLong(p) inl((CARD16)(p))
#ifdef LINUX_KERNEL
#include <linux/config.h>
#ifdef CONFIG_FB_SIS_300
#define SIS300
#endif
#ifdef CONFIG_FB_SIS_315
#define SIS315H
#endif
#if !defined(SIS300) && !defined(SIS315H)
#warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set
#warning sisfb will not work!
#endif
#define OutPortByte(p,v) outb((u8)(v),(SISIOADDRESS)(p))
#define OutPortWord(p,v) outw((u16)(v),(SISIOADDRESS)(p))
#define OutPortLong(p,v) outl((u32)(v),(SISIOADDRESS)(p))
#define InPortByte(p) inb((SISIOADDRESS)(p))
#define InPortWord(p) inw((SISIOADDRESS)(p))
#define InPortLong(p) inl((SISIOADDRESS)(p))
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize)
#endif
/**********************************************************************/
/* LINUX KERNEL */
/* XFree86, X.org */
/**********************************************************************/
#ifdef LINUX_KERNEL
#define OutPortByte(p,v) outb((u8)(v),(u16)(p))
#define OutPortWord(p,v) outw((u16)(v),(u16)(p))
#define OutPortLong(p,v) outl((u32)(v),(u16)(p))
#define InPortByte(p) inb((u16)(p))
#define InPortWord(p) inw((u16)(p))
#define InPortLong(p) inl((u16)(p))
#ifdef LINUX_XF86
#define SIS300
#define SIS315H
#define OutPortByte(p,v) outb((IOADDRESS)(p),(CARD8)(v))
#define OutPortWord(p,v) outw((IOADDRESS)(p),(CARD16)(v))
#define OutPortLong(p,v) outl((IOADDRESS)(p),(CARD32)(v))
#define InPortByte(p) inb((IOADDRESS)(p))
#define InPortWord(p) inw((IOADDRESS)(p))
#define InPortLong(p) inl((IOADDRESS)(p))
#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
#endif
/*
* SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
* frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3
*
* 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 _SIS_H
#define _SIS_H
#if 1
#define TWDEBUG(x)
#include <linux/config.h>
#include <linux/version.h>
#include "osdef.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#include <video/sisfb.h>
#else
#include <linux/sisfb.h>
#endif
#include "vgatypes.h"
#include "vstruct.h"
#define VER_MAJOR 1
#define VER_MINOR 7
#define VER_LEVEL 12
#undef SIS_CONFIG_COMPAT
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#include <linux/spinlock.h>
#ifdef CONFIG_COMPAT
#include <linux/ioctl32.h>
#define SIS_CONFIG_COMPAT
#endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)
#ifdef __x86_64__
/* Shouldn't we check for CONFIG_IA32_EMULATION here? */
#include <asm/ioctl32.h>
#define SIS_CONFIG_COMPAT
#endif
#endif
#undef SISFBDEBUG
#ifdef SISFBDEBUG
#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
#define TWDEBUG(x) printk(KERN_INFO x "\n");
#else
#define DPRINTK(fmt, args...)
#define TWDEBUG(x)
#endif
#define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
/* To be included in pci_ids.h */
#ifndef PCI_DEVICE_ID_SI_650_VGA
#define PCI_DEVICE_ID_SI_650_VGA 0x6325
#endif
#ifndef PCI_DEVICE_ID_SI_650
#define PCI_DEVICE_ID_SI_650 0x0650
#endif
#ifndef PCI_DEVICE_ID_SI_651
#define PCI_DEVICE_ID_SI_651 0x0651
#endif
#ifndef PCI_DEVICE_ID_SI_740
#define PCI_DEVICE_ID_SI_740 0x0740
#endif
#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_661
#define PCI_DEVICE_ID_SI_661 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, 65x, 740, 661, 741 */
#endif
#ifndef FB_ACCEL_SIS_XABRE
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre"), 760 */
#endif
#define MAX_ROM_SCAN 0x10000
/* ivideo->caps */
#define HW_CURSOR_CAP 0x80
#define TURBO_QUEUE_CAP 0x40
#define AGP_CMD_QUEUE_CAP 0x20
#define VM_CMD_QUEUE_CAP 0x10
#define MMIO_CMD_QUEUE_CAP 0x08
/* For 300 series */
#define TURBO_QUEUE_AREA_SIZE 0x80000 /* 512K */
#define HW_CURSOR_AREA_SIZE_300 0x1000 /* 4K */
/* For 315/Xabre series */
#define COMMAND_QUEUE_AREA_SIZE 0x80000 /* 512K */
#define COMMAND_QUEUE_THRESHOLD 0x1F
#define HW_CURSOR_AREA_SIZE_315 0x4000 /* 16K */
#define SIS_OH_ALLOC_SIZE 4000
#define SENTINEL 0x7fffffff
#define SEQ_ADR 0x14
#define SEQ_DATA 0x15
#define DAC_ADR 0x18
#define DAC_DATA 0x19
#define CRTC_ADR 0x24
#define CRTC_DATA 0x25
#define DAC2_ADR (0x16-0x30)
#define DAC2_DATA (0x17-0x30)
#define VB_PART1_ADR (0x04-0x30)
#define VB_PART1_DATA (0x05-0x30)
#define VB_PART2_ADR (0x10-0x30)
#define VB_PART2_DATA (0x11-0x30)
#define VB_PART3_ADR (0x12-0x30)
#define VB_PART3_DATA (0x13-0x30)
#define VB_PART4_ADR (0x14-0x30)
#define VB_PART4_DATA (0x15-0x30)
#define SISSR ivideo->SiS_Pr.SiS_P3c4
#define SISCR ivideo->SiS_Pr.SiS_P3d4
#define SISDACA ivideo->SiS_Pr.SiS_P3c8
#define SISDACD ivideo->SiS_Pr.SiS_P3c9
#define SISPART1 ivideo->SiS_Pr.SiS_Part1Port
#define SISPART2 ivideo->SiS_Pr.SiS_Part2Port
#define SISPART3 ivideo->SiS_Pr.SiS_Part3Port
#define SISPART4 ivideo->SiS_Pr.SiS_Part4Port
#define SISPART5 ivideo->SiS_Pr.SiS_Part5Port
#define SISDAC2A SISPART5
#define SISDAC2D (SISPART5 + 1)
#define SISMISCR (ivideo->SiS_Pr.RelIO + 0x1c)
#define SISMISCW ivideo->SiS_Pr.SiS_P3c2
#define SISINPSTAT (ivideo->SiS_Pr.RelIO + 0x2a)
#define SISPEL ivideo->SiS_Pr.SiS_P3c6
#define IND_SIS_PASSWORD 0x05 /* SRs */
#define IND_SIS_COLOR_MODE 0x06
#define IND_SIS_RAMDAC_CONTROL 0x07
#define IND_SIS_DRAM_SIZE 0x14
#define IND_SIS_MODULE_ENABLE 0x1E
#define IND_SIS_PCI_ADDRESS_SET 0x20
#define IND_SIS_TURBOQUEUE_ADR 0x26
#define IND_SIS_TURBOQUEUE_SET 0x27
#define IND_SIS_POWER_ON_TRAP 0x38
#define IND_SIS_POWER_ON_TRAP2 0x39
#define IND_SIS_CMDQUEUE_SET 0x26
#define IND_SIS_CMDQUEUE_THRESHOLD 0x27
#define IND_SIS_AGP_IO_PAD 0x48
#define SIS_CRT2_WENABLE_300 0x24 /* Part1 */
#define SIS_CRT2_WENABLE_315 0x2F
#define SIS_PASSWORD 0x86 /* SR05 */
#define SIS_INTERLACED_MODE 0x20 /* SR06 */
#define SIS_8BPP_COLOR_MODE 0x0
#define SIS_15BPP_COLOR_MODE 0x1
#define SIS_16BPP_COLOR_MODE 0x2
#define SIS_32BPP_COLOR_MODE 0x4
#define SIS_ENABLE_2D 0x40 /* SR1E */
#define SIS_MEM_MAP_IO_ENABLE 0x01 /* SR20 */
#define SIS_PCI_ADDR_ENABLE 0x80
#define SIS_AGP_CMDQUEUE_ENABLE 0x80 /* 315/330 series SR26 */
#define SIS_VRAM_CMDQUEUE_ENABLE 0x40
#define SIS_MMIO_CMD_ENABLE 0x20
#define SIS_CMD_QUEUE_SIZE_512k 0x00
#define SIS_CMD_QUEUE_SIZE_1M 0x04
#define SIS_CMD_QUEUE_SIZE_2M 0x08
#define SIS_CMD_QUEUE_SIZE_4M 0x0C
#define SIS_CMD_QUEUE_RESET 0x01
#define SIS_CMD_AUTO_CORR 0x02
#define SIS_SIMULTANEOUS_VIEW_ENABLE 0x01 /* CR30 */
#define SIS_MODE_SELECT_CRT2 0x02
#define SIS_VB_OUTPUT_COMPOSITE 0x04
#define SIS_VB_OUTPUT_SVIDEO 0x08
#define SIS_VB_OUTPUT_SCART 0x10
#define SIS_VB_OUTPUT_LCD 0x20
#define SIS_VB_OUTPUT_CRT2 0x40
#define SIS_VB_OUTPUT_HIVISION 0x80
#define SIS_VB_OUTPUT_DISABLE 0x20 /* CR31 */
#define SIS_DRIVER_MODE 0x40
#define SIS_VB_COMPOSITE 0x01 /* CR32 */
#define SIS_VB_SVIDEO 0x02
#define SIS_VB_SCART 0x04
#define SIS_VB_LCD 0x08
#define SIS_VB_CRT2 0x10
#define SIS_CRT1 0x20
#define SIS_VB_HIVISION 0x40
#define SIS_VB_YPBPR 0x80
#define SIS_VB_TV (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
SIS_VB_SCART | SIS_VB_HIVISION | SIS_VB_YPBPR)
#define SIS_EXTERNAL_CHIP_MASK 0x0E /* CR37 (< SiS 660) */
#define SIS_EXTERNAL_CHIP_SIS301 0x01 /* in CR37 << 1 ! */
#define SIS_EXTERNAL_CHIP_LVDS 0x02
#define SIS_EXTERNAL_CHIP_TRUMPION 0x03
#define SIS_EXTERNAL_CHIP_LVDS_CHRONTEL 0x04
#define SIS_EXTERNAL_CHIP_CHRONTEL 0x05
#define SIS310_EXTERNAL_CHIP_LVDS 0x02
#define SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL 0x03
#define SIS_AGP_2X 0x20 /* CR48 */
#define HW_DEVICE_EXTENSION SIS_HW_INFO
#define PHW_DEVICE_EXTENSION PSIS_HW_INFO
/* Useful macros */
#define inSISREG(base) inb(base)
#define outSISREG(base,val) outb(val,base)
#define orSISREG(base,val) do { \
u8 __Temp = inb(base); \
outSISREG(base, __Temp | (val)); \
} while (0)
#define andSISREG(base,val) do { \
u8 __Temp = inb(base); \
outSISREG(base, __Temp & (val)); \
} while (0)
#define inSISIDXREG(base,idx,var) do { \
outb(idx,base); var=inb((base)+1); \
} while (0)
#define outSISIDXREG(base,idx,val) do { \
outb(idx,base); outb((val),(base)+1); \
} while (0)
#define orSISIDXREG(base,idx,val) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)|(val); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define andSISIDXREG(base,idx,and) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)&(and); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define setSISIDXREG(base,idx,and,or) do { \
u8 __Temp; \
outb(idx,base); \
__Temp = (inb((base)+1)&(and))|(or); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
/* MMIO access macros */
#define MMIO_IN8(base, offset) readb((base+offset))
#define MMIO_IN16(base, offset) readw((base+offset))
#define MMIO_IN32(base, offset) readl((base+offset))
#define MMIO_OUT8(base, offset, val) writeb(((u8)(val)), (base+offset))
#define MMIO_OUT16(base, offset, val) writew(((u16)(val)), (base+offset))
#define MMIO_OUT32(base, offset, val) writel(((u32)(val)), (base+offset))
/* Queue control MMIO registers */
#define Q_BASE_ADDR 0x85C0 /* Base address of software queue */
#define Q_WRITE_PTR 0x85C4 /* Current write pointer */
#define Q_READ_PTR 0x85C8 /* Current read pointer */
#define Q_STATUS 0x85CC /* queue status */
#define MMIO_QUEUE_PHYBASE Q_BASE_ADDR
#define MMIO_QUEUE_WRITEPORT Q_WRITE_PTR
#define MMIO_QUEUE_READPORT Q_READ_PTR
enum _SIS_CMDTYPE {
MMIO_CMD = 0,
AGP_CMD_QUEUE,
VM_CMD_QUEUE,
};
typedef unsigned int SIS_CMDTYPE;
/* Our "par" */
struct sis_video_info {
int cardnumber;
struct fb_info *memyselfandi;
SIS_HW_INFO sishw_ext;
SiS_Private SiS_Pr;
sisfb_info sisfbinfo; /* For ioctl SISFB_GET_INFO */
struct fb_var_screeninfo default_var;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
struct fb_fix_screeninfo sisfb_fix;
u32 pseudo_palette[17];
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
struct display sis_disp;
struct display_switch sisfb_sw;
struct {
u16 red, green, blue, pad;
} sis_palette[256];
union {
#ifdef FBCON_HAS_CFB16
u16 cfb16[16];
#endif
#ifdef FBCON_HAS_CFB32
u32 cfb32[16];
#endif
} sis_fbcon_cmap;
#endif
struct sisfb_monitor {
u16 hmin;
u16 hmax;
u16 vmin;
u16 vmax;
u32 dclockmax;
u8 feature;
BOOLEAN datavalid;
} sisfb_thismonitor;
int chip_id;
char myid[40];
struct pci_dev *nbridge;
int mni; /* Mode number index */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
int currcon;
#endif
unsigned long video_size;
unsigned long video_base;
unsigned long mmio_size;
unsigned long mmio_base;
unsigned long vga_base;
unsigned long video_vbase;
unsigned long mmio_vbase;
char * bios_vbase;
char * bios_abase;
int mtrr;
u32 sisfb_mem;
u32 sisfb_parm_mem;
int sisfb_accel;
int sisfb_ypan;
int sisfb_max;
int sisfb_userom;
int sisfb_useoem;
int sisfb_mode_idx;
int sisfb_parm_rate;
int sisfb_crt1off;
int sisfb_forcecrt1;
int sisfb_crt2type;
int sisfb_crt2flags;
int sisfb_dstn;
int sisfb_fstn;
int sisfb_tvplug;
int sisfb_tvstd;
int sisfb_filter;
int sisfb_nocrt2rate;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
int sisfb_inverse;
#endif
u32 heapstart; /* offset */
unsigned long sisfb_heap_start; /* address */
unsigned long sisfb_heap_end; /* address */
u32 sisfb_heap_size;
int havenoheap;
#if 0
SIS_HEAP sisfb_heap;
#endif
int video_bpp;
int video_cmap_len;
int video_width;
int video_height;
unsigned int refresh_rate;
unsigned int chip;
u8 revision_id;
int video_linelength; /* real pitch */
int scrnpitchCRT1; /* pitch regarding interlace */
u16 DstColor; /* For 2d acceleration */
u32 SiS310_AccelDepth;
u32 CommandReg;
int cmdqueuelength;
spinlock_t lockaccel; /* Do not use outside of kernel! */
unsigned int pcibus;
unsigned int pcislot;
unsigned int pcifunc;
int accel;
u16 subsysvendor;
u16 subsysdevice;
u32 vbflags; /* Replacing deprecated stuff from above */
u32 currentvbflags;
int lcdxres, lcdyres;
int lcddefmodeidx, tvdefmodeidx, defmodeidx;
int current_bpp;
int current_width;
int current_height;
int current_htotal;
int current_vtotal;
int current_linelength;
__u32 current_pixclock;
int current_refresh_rate;
u8 mode_no;
u8 rate_idx;
int modechanged;
unsigned char modeprechange;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
u8 sisfb_lastrates[128];
#endif
int newrom;
int registered;
#ifdef SIS_CONFIG_COMPAT
int ioctl32registered;
int ioctl32vblankregistered;
#endif
int sisvga_engine;
int hwcursor_size;
int CRT2_write_enable;
u8 caps;
u8 detectedpdc;
u8 detectedpdca;
u8 detectedlcda;
unsigned long hwcursor_vbase;
int chronteltype;
int tvxpos, tvypos;
u8 p2_1f,p2_20,p2_2b,p2_42,p2_43,p2_01,p2_02;
int tvx, tvy;
u8 sisfblocked;
struct sis_video_info *next;
};
typedef struct _SIS_OH {
struct _SIS_OH *poh_next;
struct _SIS_OH *poh_prev;
u32 offset;
u32 size;
} SIS_OH;
typedef struct _SIS_OHALLOC {
struct _SIS_OHALLOC *poha_next;
SIS_OH aoh[1];
} SIS_OHALLOC;
typedef struct _SIS_HEAP {
SIS_OH oh_free;
SIS_OH oh_used;
SIS_OH *poh_freelist;
SIS_OHALLOC *poha_chain;
u32 max_freesize;
struct sis_video_info *vinfo;
} SIS_HEAP;
#endif
......@@ -18,9 +18,7 @@
* 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
* Based on the XFree86/X.org driver which is
* Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>
......@@ -33,36 +31,16 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/console.h>
#include <linux/selection.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/vt_kern.h>
#include <linux/capability.h>
#include <linux/fs.h>
#include <linux/agp_backend.h>
#include <linux/types.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/sisfb.h>
#else
#include <video/sisfb.h>
#endif
#include <asm/io.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <video/fbcon.h>
#include <video/fbcon-cfb8.h>
......@@ -71,17 +49,10 @@
#include <video/fbcon-cfb32.h>
#endif
#include "osdef.h"
#include "vgatypes.h"
#include "vstruct.h"
#include "sis_accel.h"
#include "sis.h"
#include "sis_accel.h"
extern struct video_info ivideo;
extern VGA_ENGINE sisvga_engine;
extern int sisfb_accel;
static const int sisALUConv[] =
static const u8 sisALUConv[] =
{
0x00, /* dest = 0; 0, GXclear, 0 */
0x88, /* dest &= src; DSa, GXand, 0x1 */
......@@ -101,7 +72,7 @@ static const int sisALUConv[] =
0xFF, /* dest = 0xFF; 1, GXset, 0xF */
};
/* same ROP but with Pattern as Source */
static const int sisPatALUConv[] =
static const u8 sisPatALUConv[] =
{
0x00, /* dest = 0; 0, GXclear, 0 */
0xA0, /* dest &= src; DPa, GXand, 0x1 */
......@@ -122,26 +93,26 @@ static const int sisPatALUConv[] =
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
static const unsigned char myrops[] = {
static const int myrops[] = {
3, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
};
};
#endif
/* 300 series ----------------------------------------------------- */
#ifdef CONFIG_FB_SIS_300
static void
SiS300Sync(void)
SiS300Sync(struct sis_video_info *ivideo)
{
SiS300Idle
}
static void
SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
unsigned int planemask, int trans_color)
SiS300SetupForScreenToScreenCopy(struct sis_video_info *ivideo, int xdir, int ydir,
int rop, int trans_color)
{
SiS300SetupDSTColorDepth(ivideo.DstColor);
SiS300SetupSRCPitch(ivideo.video_linelength)
SiS300SetupDSTRect(ivideo.video_linelength, -1)
SiS300SetupDSTColorDepth(ivideo->DstColor);
SiS300SetupSRCPitch(ivideo->video_linelength)
SiS300SetupDSTRect(ivideo->video_linelength, 0xffff)
if(trans_color != -1) {
SiS300SetupROP(0x0A)
......@@ -159,29 +130,28 @@ SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
}
static void
SiS300SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
int width, int height)
SiS300SubsequentScreenToScreenCopy(struct sis_video_info *ivideo, int src_x,
int src_y, int dst_x, int dst_y, int width, int height)
{
long srcbase, dstbase;
u32 srcbase = 0, dstbase = 0;
srcbase = dstbase = 0;
if (src_y >= 2048) {
srcbase = ivideo.video_linelength * src_y;
if(src_y >= 2048) {
srcbase = ivideo->video_linelength * src_y;
src_y = 0;
}
if (dst_y >= 2048) {
dstbase = ivideo.video_linelength * dst_y;
if(dst_y >= 2048) {
dstbase = ivideo->video_linelength * dst_y;
dst_y = 0;
}
SiS300SetupSRCBase(srcbase);
SiS300SetupDSTBase(dstbase);
if(!(ivideo.CommandReg & X_INC)) {
if(!(ivideo->CommandReg & X_INC)) {
src_x += width-1;
dst_x += width-1;
}
if(!(ivideo.CommandReg & Y_INC)) {
if(!(ivideo->CommandReg & Y_INC)) {
src_y += height-1;
dst_y += height-1;
}
......@@ -192,23 +162,22 @@ SiS300SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
}
static void
SiS300SetupForSolidFill(int color, int rop, unsigned int planemask)
SiS300SetupForSolidFill(struct sis_video_info *ivideo, u32 color, int rop)
{
SiS300SetupPATFG(color)
SiS300SetupDSTRect(ivideo.video_linelength, -1)
SiS300SetupDSTColorDepth(ivideo.DstColor);
SiS300SetupDSTRect(ivideo->video_linelength, 0xffff)
SiS300SetupDSTColorDepth(ivideo->DstColor);
SiS300SetupROP(sisPatALUConv[rop])
SiS300SetupCMDFlag(PATFG)
}
static void
SiS300SubsequentSolidFillRect(int x, int y, int w, int h)
SiS300SubsequentSolidFillRect(struct sis_video_info *ivideo, int x, int y, int w, int h)
{
long dstbase;
u32 dstbase = 0;
dstbase = 0;
if(y >= 2048) {
dstbase = ivideo.video_linelength * y;
dstbase = ivideo->video_linelength * y;
y = 0;
}
SiS300SetupDSTBase(dstbase)
......@@ -223,19 +192,18 @@ SiS300SubsequentSolidFillRect(int x, int y, int w, int h)
#ifdef CONFIG_FB_SIS_315
static void
SiS310Sync(void)
SiS310Sync(struct sis_video_info *ivideo)
{
SiS310Idle
}
static void
SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
unsigned int planemask, int trans_color)
SiS310SetupForScreenToScreenCopy(struct sis_video_info *ivideo, int rop, int trans_color)
{
SiS310SetupDSTColorDepth(ivideo.DstColor);
SiS310SetupSRCPitch(ivideo.video_linelength)
SiS310SetupDSTRect(ivideo.video_linelength, -1)
if (trans_color != -1) {
SiS310SetupDSTColorDepth(ivideo->DstColor);
SiS310SetupSRCPitch(ivideo->video_linelength)
SiS310SetupDSTRect(ivideo->video_linelength, 0xffff)
if(trans_color != -1) {
SiS310SetupROP(0x0A)
SiS310SetupSRCTrans(trans_color)
SiS310SetupCMDFlag(TRANSPARENT_BITBLT)
......@@ -244,20 +212,17 @@ SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
/* Set command - not needed, both 0 */
/* SiSSetupCMDFlag(BITBLT | SRCVIDEO) */
}
SiS310SetupCMDFlag(ivideo.SiS310_AccelDepth)
SiS310SetupCMDFlag(ivideo->SiS310_AccelDepth)
/* The 315 series is smart enough to know the direction */
}
static void
SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
int width, int height)
SiS310SubsequentScreenToScreenCopy(struct sis_video_info *ivideo, int src_x, int src_y,
int dst_x, int dst_y, int width, int height)
{
long srcbase, dstbase;
int mymin, mymax;
srcbase = dstbase = 0;
mymin = min(src_y, dst_y);
mymax = max(src_y, dst_y);
u32 srcbase = 0, dstbase = 0;
int mymin = min(src_y, dst_y);
int mymax = max(src_y, dst_y);
/* Although the chip knows the direction to use
* if the source and destination areas overlap,
......@@ -271,18 +236,18 @@ SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
*/
if((mymax - mymin) < height) {
if((src_y >= 2048) || (dst_y >= 2048)) {
srcbase = ivideo.video_linelength * mymin;
dstbase = ivideo.video_linelength * mymin;
srcbase = ivideo->video_linelength * mymin;
dstbase = ivideo->video_linelength * mymin;
src_y -= mymin;
dst_y -= mymin;
}
} else {
if(src_y >= 2048) {
srcbase = ivideo.video_linelength * src_y;
srcbase = ivideo->video_linelength * src_y;
src_y = 0;
}
if(dst_y >= 2048) {
dstbase = ivideo.video_linelength * dst_y;
dstbase = ivideo->video_linelength * dst_y;
dst_y = 0;
}
}
......@@ -296,23 +261,22 @@ SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
}
static void
SiS310SetupForSolidFill(int color, int rop, unsigned int planemask)
SiS310SetupForSolidFill(struct sis_video_info *ivideo, u32 color, int rop)
{
SiS310SetupPATFG(color)
SiS310SetupDSTRect(ivideo.video_linelength, -1)
SiS310SetupDSTColorDepth(ivideo.DstColor);
SiS310SetupDSTRect(ivideo->video_linelength, 0xffff)
SiS310SetupDSTColorDepth(ivideo->DstColor);
SiS310SetupROP(sisPatALUConv[rop])
SiS310SetupCMDFlag(PATFG | ivideo.SiS310_AccelDepth)
SiS310SetupCMDFlag(PATFG | ivideo->SiS310_AccelDepth)
}
static void
SiS310SubsequentSolidFillRect(int x, int y, int w, int h)
SiS310SubsequentSolidFillRect(struct sis_video_info *ivideo, int x, int y, int w, int h)
{
long dstbase;
u32 dstbase = 0;
dstbase = 0;
if(y >= 2048) {
dstbase = ivideo.video_linelength * y;
dstbase = ivideo->video_linelength * y;
y = 0;
}
SiS310SetupDSTBase(dstbase)
......@@ -327,23 +291,23 @@ SiS310SubsequentSolidFillRect(int x, int y, int w, int h)
/* The exported routines */
int sisfb_initaccel(void)
int sisfb_initaccel(struct sis_video_info *ivideo)
{
#ifdef SISFB_USE_SPINLOCKS
spin_lock_init(&ivideo.lockaccel);
spin_lock_init(&ivideo->lockaccel);
#endif
return(0);
}
void sisfb_syncaccel(void)
void sisfb_syncaccel(struct sis_video_info *ivideo)
{
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
SiS310Sync();
SiS310Sync(ivideo);
#endif
}
}
......@@ -352,18 +316,19 @@ void sisfb_syncaccel(void)
int fbcon_sis_sync(struct fb_info *info)
{
struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
CRITFLAGS
if(!ivideo.accel)
if(!ivideo->accel)
return 0;
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
SiS310Sync();
SiS310Sync(ivideo);
#endif
}
CRITEND
......@@ -372,42 +337,53 @@ int fbcon_sis_sync(struct fb_info *info)
void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
int col=0;
struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
u32 col = 0;
u32 vxres = info->var.xres_virtual;
u32 vyres = info->var.yres_virtual;
int width, height;
CRITFLAGS
TWDEBUG("Inside sis_fillrect");
if(!rect->width || !rect->height)
return;
if(info->state != FBINFO_STATE_RUNNING) {
return;
}
if(!ivideo.accel) {
if(!ivideo->accel) {
cfb_fillrect(info, rect);
return;
}
if(!rect->width || !rect->height || rect->dx >= vxres || rect->dy >= vyres) {
return;
}
/* Clipping */
width = ((rect->dx + rect->width) > vxres) ? (vxres - rect->dx) : rect->width;
height = ((rect->dy + rect->height) > vyres) ? (vyres - rect->dy) : rect->height;
switch(info->var.bits_per_pixel) {
case 8: col = rect->color;
break;
case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
case 16:
case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
}
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
SiS300SetupForSolidFill(ivideo, col, myrops[rect->rop]);
SiS300SubsequentSolidFillRect(ivideo, rect->dx, rect->dy, width, height);
CRITEND
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
SiS310SetupForSolidFill(ivideo, col, myrops[rect->rop]);
SiS310SubsequentSolidFillRect(ivideo, rect->dx, rect->dy, width, height);
CRITEND
SiS310Sync();
SiS310Sync(ivideo);
#endif
}
......@@ -415,38 +391,58 @@ void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{
int xdir, ydir;
struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
u32 vxres = info->var.xres_virtual;
u32 vyres = info->var.yres_virtual;
int width = area->width;
int height = area->height;
CRITFLAGS
TWDEBUG("Inside sis_copyarea");
if(!ivideo.accel) {
if(info->state != FBINFO_STATE_RUNNING) {
return;
}
if(!ivideo->accel) {
cfb_copyarea(info, area);
return;
}
if(!area->width || !area->height)
if(!width || !height ||
area->sx >= vxres || area->sy >= vyres ||
area->dx >= vxres || area->dy >= vyres) {
return;
}
if(area->sx < area->dx) xdir = 0;
else xdir = 1;
if(area->sy < area->dy) ydir = 0;
else ydir = 1;
/* Clipping */
if((area->sx + width) > vxres) width = vxres - area->sx;
if((area->dx + width) > vxres) width = vxres - area->dx;
if((area->sy + height) > vyres) height = vyres - area->sy;
if((area->dy + height) > vyres) height = vyres - area->dy;
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
int xdir, ydir;
if(area->sx < area->dx) xdir = 0;
else xdir = 1;
if(area->sy < area->dy) ydir = 0;
else ydir = 1;
CRITBEGIN
SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS300SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
SiS300SetupForScreenToScreenCopy(ivideo, xdir, ydir, 3, -1);
SiS300SubsequentScreenToScreenCopy(ivideo, area->sx, area->sy, area->dx, area->dy,
width, height);
CRITEND
SiS300Sync();
SiS300Sync(ivideo);
#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);
SiS310SetupForScreenToScreenCopy(ivideo, 3, -1);
SiS310SubsequentScreenToScreenCopy(ivideo, area->sx, area->sy, area->dx, area->dy,
width, height);
CRITEND
SiS310Sync();
SiS310Sync(ivideo);
#endif
}
}
......@@ -458,11 +454,12 @@ void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
int dsty, int dstx, int height, int width)
{
int xdir, ydir;
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
CRITFLAGS
if(!ivideo.accel) {
switch(ivideo.video_bpp) {
if(!ivideo->accel) {
switch(ivideo->video_bpp) {
case 8:
#ifdef FBCON_HAS_CFB8
fbcon_cfb8_bmove(p, srcy, srcx, dsty, dstx, height, width);
......@@ -489,30 +486,28 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
width *= fontwidth(p);
height *= fontheight(p);
if(srcx < dstx) xdir = 0;
else xdir = 1;
if(srcy < dsty) ydir = 0;
else ydir = 1;
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
int xdir, ydir;
if(srcx < dstx) xdir = 0;
else xdir = 1;
if(srcy < dsty) ydir = 0;
else ydir = 1;
CRITBEGIN
SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS300SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
SiS300SetupForScreenToScreenCopy(ivideo, xdir, ydir, 3, -1);
SiS300SubsequentScreenToScreenCopy(ivideo, srcx, srcy, dstx, dsty, width, height);
CRITEND
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
SiS310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
SiS310SetupForScreenToScreenCopy(ivideo, 3, -1);
SiS310SubsequentScreenToScreenCopy(ivideo, srcx, srcy, dstx, dsty, width, height);
CRITEND
SiS310Sync();
#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
SiS310Sync(ivideo);
#endif
}
}
......@@ -520,6 +515,7 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width, int color)
{
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
CRITFLAGS
srcx *= fontwidth(p);
......@@ -527,21 +523,21 @@ static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
width *= fontwidth(p);
height *= fontheight(p);
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(color, 3, 0);
SiS300SubsequentSolidFillRect(srcx, srcy, width, height);
SiS300SetupForSolidFill(ivideo, color, 3);
SiS300SubsequentSolidFillRect(ivideo, srcx, srcy, width, height);
CRITEND
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(color, 3, 0);
SiS310SubsequentSolidFillRect(srcx, srcy, width, height);
SiS310SetupForSolidFill(ivideo, color, 3);
SiS310SubsequentSolidFillRect(ivideo, srcx, srcy, width, height);
CRITEND
SiS310Sync();
SiS310Sync(ivideo);
#endif
}
}
......@@ -549,9 +545,10 @@ static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
void fbcon_sis_clear8(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width)
{
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
u32 bgx;
if(!ivideo.accel) {
if(!ivideo->accel) {
#ifdef FBCON_HAS_CFB8
fbcon_cfb8_clear(conp, p, srcy, srcx, height, width);
#endif
......@@ -565,8 +562,10 @@ void fbcon_sis_clear8(struct vc_data *conp, struct display *p,
void fbcon_sis_clear16(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width)
{
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
u32 bgx;
if(!ivideo.accel) {
if(!ivideo->accel) {
#ifdef FBCON_HAS_CFB16
fbcon_cfb16_clear(conp, p, srcy, srcx, height, width);
#endif
......@@ -580,9 +579,10 @@ void fbcon_sis_clear16(struct vc_data *conp, struct display *p,
void fbcon_sis_clear32(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width)
{
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
u32 bgx;
if(!ivideo.accel) {
if(!ivideo->accel) {
#ifdef FBCON_HAS_CFB32
fbcon_cfb32_clear(conp, p, srcy, srcx, height, width);
#endif
......@@ -595,10 +595,11 @@ void fbcon_sis_clear32(struct vc_data *conp, struct display *p,
void fbcon_sis_revc(struct display *p, int srcx, int srcy)
{
struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
CRITFLAGS
if(!ivideo.accel) {
switch(ivideo.video_bpp) {
if(!ivideo->accel) {
switch(ivideo->video_bpp) {
case 16:
#ifdef FBCON_HAS_CFB16
fbcon_cfb16_revc(p, srcx, srcy);
......@@ -616,59 +617,59 @@ void fbcon_sis_revc(struct display *p, int srcx, int srcy)
srcx *= fontwidth(p);
srcy *= fontheight(p);
if(sisvga_engine == SIS_300_VGA) {
if(ivideo->sisvga_engine == SIS_300_VGA) {
#ifdef CONFIG_FB_SIS_300
CRITBEGIN
SiS300SetupForSolidFill(0, 0x0a, 0);
SiS300SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
SiS300SetupForSolidFill(ivideo, 0, 0x0a);
SiS300SubsequentSolidFillRect(ivideo, srcx, srcy, fontwidth(p), fontheight(p));
CRITEND
SiS300Sync();
SiS300Sync(ivideo);
#endif
} else {
#ifdef CONFIG_FB_SIS_315
CRITBEGIN
SiS310SetupForSolidFill(0, 0x0a, 0);
SiS310SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
SiS310SetupForSolidFill(ivideo, 0, 0x0a);
SiS310SubsequentSolidFillRect(ivideo, srcx, srcy, fontwidth(p), fontheight(p));
CRITEND
SiS310Sync();
SiS310Sync(ivideo);
#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
......
......@@ -36,8 +36,8 @@
#ifdef SISFB_USE_SPINLOCKS
#include <linux/spinlock.h>
#define CRITBEGIN spin_lock_irqsave(&ivideo.lockaccel), critflags);
#define CRITEND spin_unlock_irqrestore(&ivideo.lockaccel), critflags);
#define CRITBEGIN spin_lock_irqsave(&ivideo->lockaccel, critflags);
#define CRITEND spin_unlock_irqrestore(&ivideo->lockaccel, critflags);
#define CRITFLAGS unsigned long critflags;
#else
#define CRITBEGIN
......@@ -65,7 +65,6 @@
#define A3D_FUNCTION 0x00000008 /* 3D command ? */
#define CLEAR_Z_BUFFER 0x00000009 /* ? */
#define GRADIENT_FILL 0x0000000A /* Gradient fill */
#define STRETCH_BITBLT 0x0000000B /* Stretched Blit */
/* source select */
#define SRCVIDEO 0x00000000 /* source is video RAM */
......@@ -98,11 +97,6 @@
#define DSTAGP 0x02000000
#define DSTVIDEO 0x02000000
/* Line */
#define LINE_STYLE 0x00800000
#define NO_RESET_COUNTER 0x00400000
#define NO_LAST_PIXEL 0x00200000
/* Subfunctions for Color/Enhanced Color Expansion (315 only) */
#define COLOR_TO_MONO 0x00100000
#define AA_TEXT 0x00200000
......@@ -134,212 +128,142 @@
#define PATTERN_REG 0x8300 /* 384 bytes pattern buffer */
/* Line registers */
#define LINE_X0 SRC_Y
#define LINE_X1 DST_Y
#define LINE_Y0 SRC_X
#define LINE_Y1 DST_X
#define LINE_COUNT RECT_WIDTH
#define LINE_STYLE_PERIOD RECT_HEIGHT
#define LINE_STYLE_0 MONO_MASK
#define LINE_STYLE_1 0x8230
#define LINE_XN PATTERN_REG
#define LINE_YN PATTERN_REG+2
/* Transparent bitblit registers */
#define TRANS_DST_KEY_HIGH PAT_FGCOLOR
#define TRANS_DST_KEY_LOW PAT_BGCOLOR
#define TRANS_SRC_KEY_HIGH SRC_FGCOLOR
#define TRANS_SRC_KEY_LOW SRC_BGCOLOR
/* Queue */
#define Q_BASE_ADDR 0x85C0 /* Base address of software queue (?) */
#define Q_WRITE_PTR 0x85C4 /* Current write pointer (?) */
#define Q_READ_PTR 0x85C8 /* Current read pointer (?) */
#define Q_STATUS 0x85CC /* queue status */
#define MMIO_IN8(base, offset) \
*(volatile u8 *)(((u8*)(base)) + (offset))
#define MMIO_IN16(base, offset) \
*(volatile u16 *)(void *)(((u8*)(base)) + (offset))
#define MMIO_IN32(base, offset) \
*(volatile u32 *)(void *)(((u8*)(base)) + (offset))
#define MMIO_OUT8(base, offset, val) \
*(volatile u8 *)(((u8*)(base)) + (offset)) = (val)
#define MMIO_OUT16(base, offset, val) \
*(volatile u16 *)(void *)(((u8*)(base)) + (offset)) = (val)
#define MMIO_OUT32(base, offset, val) \
*(volatile u32 *)(void *)(((u8*)(base)) + (offset)) = (val)
/* Store queue length in par */
#define CmdQueLen ivideo->cmdqueuelength
/* ------------- SiS 300 series -------------- */
/* Macros to do useful things with the SIS BitBLT engine */
/* BR(16) (0x8420):
/* BR(16) (0x8240):
bit 31 2D engine: 1 is idle,
bit 30 3D engine: 1 is idle,
bit 29 Command queue: 1 is empty
bits 28:24: Current CPU driven BitBlt buffer stage bit[4:0]
bits 15:0: Current command queue length
*/
/* TW: BR(16)+2 = 0x8242 */
int CmdQueLen;
#define SiS300Idle \
{ \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, 0x8240); \
while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
CmdQueLen = MMIO_IN16(ivideo->mmio_vbase, 0x8240); \
}
/* TW: (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
/* (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
#define SiS300SetupSRCBase(base) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(0), base);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(0), base);\
CmdQueLen--;
#define SiS300SetupSRCPitch(pitch) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(1), pitch);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo->mmio_vbase, BR(1), pitch);\
CmdQueLen--;
#define SiS300SetupSRCXY(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(2), (x)<<16 | (y) );\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(2), (x)<<16 | (y) );\
CmdQueLen--;
#define SiS300SetupDSTBase(base) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(4), base);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(4), base);\
CmdQueLen--;
#define SiS300SetupDSTXY(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(3), (x)<<16 | (y) );\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(3), (x)<<16 | (y) );\
CmdQueLen--;
#define SiS300SetupDSTRect(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(5), (y)<<16 | (x) );\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(5), (y)<<16 | (x) );\
CmdQueLen--;
#define SiS300SetupDSTColorDepth(bpp) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(1)+2, bpp);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo->mmio_vbase, BR(1)+2, bpp);\
CmdQueLen--;
#define SiS300SetupRect(w,h) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(6), (h)<<16 | (w) );\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(6), (h)<<16 | (w) );\
CmdQueLen--;
#define SiS300SetupPATFG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(7), color);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(7), color);\
CmdQueLen--;
#define SiS300SetupPATBG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(8), color);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(8), color);\
CmdQueLen--;
#define SiS300SetupSRCFG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(9), color);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(9), color);\
CmdQueLen--;
#define SiS300SetupSRCBG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(10), color);\
CmdQueLen --;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(10), color);\
CmdQueLen--;
/* 0x8224 src colorkey high */
/* 0x8228 src colorkey low */
/* 0x821c dest colorkey high */
/* 0x8220 dest colorkey low */
#define SiS300SetupSRCTrans(color) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, 0x8224, color);\
MMIO_OUT32(ivideo.mmio_vbase, 0x8228, color);\
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, 0x8224, color);\
MMIO_OUT32(ivideo->mmio_vbase, 0x8228, color);\
CmdQueLen -= 2;
#define SiS300SetupDSTTrans(color) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, 0x821C, color); \
MMIO_OUT32(ivideo.mmio_vbase, 0x8220, color); \
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, 0x821C, color); \
MMIO_OUT32(ivideo->mmio_vbase, 0x8220, color); \
CmdQueLen -= 2;
#define SiS300SetupMONOPAT(p0,p1) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(11), p0);\
MMIO_OUT32(ivideo.mmio_vbase, BR(12), p1);\
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(11), p0);\
MMIO_OUT32(ivideo->mmio_vbase, BR(12), p1);\
CmdQueLen -= 2;
#define SiS300SetupClipLT(left,top) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
#define SiS300SetupClipRB(right,bottom) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
/* General */
#define SiS300SetupROP(rop) \
ivideo.CommandReg = (rop) << 8;
ivideo->CommandReg = (rop) << 8;
#define SiS300SetupCMDFlag(flags) \
ivideo.CommandReg |= (flags);
ivideo->CommandReg |= (flags);
#define SiS300DoCMD \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(15), ivideo.CommandReg); \
MMIO_OUT32(ivideo.mmio_vbase, BR(16), 0);\
CmdQueLen -= 2;
/* Line */
#define SiS300SetupX0Y0(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(2), (y)<<16 | (x) );\
CmdQueLen--;
#define SiS300SetupX1Y1(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(3), (y)<<16 | (x) );\
CmdQueLen--;
#define SiS300SetupLineCount(c) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(6), c);\
CmdQueLen--;
if(CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo->mmio_vbase, BR(15), ivideo->CommandReg); \
MMIO_OUT32(ivideo->mmio_vbase, BR(16), 0);\
CmdQueLen -= 2;
#define SiS300SetupStylePeriod(p) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(6)+2, p);\
CmdQueLen--;
#define SiS300SetupStyleLow(ls) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(11), ls);\
CmdQueLen--;
#define SiS300SetupStyleHigh(ls) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(12), ls);\
CmdQueLen--;
/* -------------- SiS 315 series --------------- */
/* -------------- SiS 315/330 series --------------- */
/* Q_STATUS:
bit 31 = 1: All engines idle and all queues empty
......@@ -353,179 +277,131 @@ int CmdQueLen;
bits 23:16: 2D counter 3
bits 15:8: 2D counter 2
bits 7:0: 2D counter 1
Where is the command queue length (current amount of commands the queue
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 = 0; \
/*CmdQueLen = ((128 * 1024) / 4) - 64; */ \
while( (MMIO_IN16(ivideo->mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
while( (MMIO_IN16(ivideo->mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
CmdQueLen = 0; \
}
#define SiS310SetupSRCBase(base) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_ADDR, base);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, SRC_ADDR, base);\
CmdQueLen--;
#define SiS310SetupSRCPitch(pitch) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, SRC_PITCH, pitch);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo->mmio_vbase, SRC_PITCH, pitch);\
CmdQueLen--;
#define SiS310SetupSRCXY(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_Y, (x)<<16 | (y) );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, SRC_Y, (x)<<16 | (y) );\
CmdQueLen--;
#define SiS310SetupDSTBase(base) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_ADDR, base);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, DST_ADDR, base);\
CmdQueLen--;
#define SiS310SetupDSTXY(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_Y, (x)<<16 | (y) );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, DST_Y, (x)<<16 | (y) );\
CmdQueLen--;
#define SiS310SetupDSTRect(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_PITCH, (y)<<16 | (x) );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, DST_PITCH, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupDSTColorDepth(bpp) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, AGP_BASE, bpp);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo->mmio_vbase, AGP_BASE, bpp);\
CmdQueLen--;
#define SiS310SetupRect(w,h) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, RECT_WIDTH, (h)<<16 | (w) );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, RECT_WIDTH, (h)<<16 | (w) );\
CmdQueLen--;
#define SiS310SetupPATFG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, PAT_FGCOLOR, color);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, PAT_FGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupPATBG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, PAT_BGCOLOR, color);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, PAT_BGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCFG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_FGCOLOR, color);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, SRC_FGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCBG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_BGCOLOR, color);\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, SRC_BGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCTrans(color) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_HIGH, color);\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_LOW, color);\
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, TRANS_SRC_KEY_HIGH, color);\
MMIO_OUT32(ivideo->mmio_vbase, TRANS_SRC_KEY_LOW, color);\
CmdQueLen -= 2;
#define SiS310SetupDSTTrans(color) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_HIGH, color); \
MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_LOW, color); \
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, TRANS_DST_KEY_HIGH, color); \
MMIO_OUT32(ivideo->mmio_vbase, TRANS_DST_KEY_LOW, color); \
CmdQueLen -= 2;
#define SiS310SetupMONOPAT(p0,p1) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK, p0);\
MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK+4, p1);\
CmdQueLen -= 2;
if(CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, MONO_MASK, p0);\
MMIO_OUT32(ivideo->mmio_vbase, MONO_MASK+4, p1);\
CmdQueLen -= 2;
#define SiS310SetupClipLT(left,top) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
#define SiS310SetupClipRB(right,bottom) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
if(CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
#define SiS310SetupROP(rop) \
ivideo.CommandReg = (rop) << 8;
ivideo->CommandReg = (rop) << 8;
#define SiS310SetupCMDFlag(flags) \
ivideo.CommandReg |= (flags);
ivideo->CommandReg |= (flags);
#define SiS310DoCMD \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, COMMAND_READY, ivideo.CommandReg); \
MMIO_OUT32(ivideo.mmio_vbase, FIRE_TRIGGER, 0); \
CmdQueLen -= 2;
#define SiS310SetupX0Y0(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_X0, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupX1Y1(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_X1, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupLineCount(c) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, LINE_COUNT, c);\
CmdQueLen--;
#define SiS310SetupStylePeriod(p) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, LINE_STYLE_PERIOD, p);\
CmdQueLen--;
#define SiS310SetupStyleLow(ls) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_0, ls);\
CmdQueLen--;
#define SiS310SetupStyleHigh(ls) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_1, ls);\
CmdQueLen--;
int sisfb_initaccel(void);
void sisfb_syncaccel(void);
extern struct video_info ivideo;
if(CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo->mmio_vbase, COMMAND_READY, ivideo->CommandReg); \
MMIO_OUT32(ivideo->mmio_vbase, FIRE_TRIGGER, 0); \
CmdQueLen -= 2;
int sisfb_initaccel(struct sis_video_info *ivideo);
void sisfb_syncaccel(struct sis_video_info *ivideo);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33)
void fbcon_sis_bmove(struct display *p, int srcy, int srcx, int dsty,
int dstx, int height, int width);
int dstx, int height, int width);
void fbcon_sis_revc(struct display *p, int srcy, int srcx);
void fbcon_sis_clear8(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
int srcx, int height, int width);
void fbcon_sis_clear16(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
int srcx, int height, int width);
void fbcon_sis_clear32(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
int srcx, int height, int width);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
extern int sisfb_accel;
void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area);
#endif
......
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
* SiS 300/305/540/630(S)/730(S)
* SiS 315(H/PRO)/55x/(M)65x/(M)661(F/M)X/740/741(GX)/330/(M)760
* frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3
*
* Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
*
......@@ -22,304 +23,15 @@
#ifndef _SISFB_MAIN
#define _SISFB_MAIN
#include "vstruct.h"
/* ------------------- Constant Definitions ------------------------- */
#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 25
#include <linux/spinlock.h>
#include "vstruct.h"
#include "sis.h"
/* To be included in pci_ids.h */
#ifndef PCI_DEVICE_ID_SI_650_VGA
#define PCI_DEVICE_ID_SI_650_VGA 0x6325
#endif
#ifndef PCI_DEVICE_ID_SI_650
#define PCI_DEVICE_ID_SI_650 0x0650
#endif
#ifndef PCI_DEVICE_ID_SI_740
#define PCI_DEVICE_ID_SI_740 0x0740
#endif
#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, 65x, 740, 661, 741 */
#endif
#ifndef FB_ACCEL_SIS_XABRE
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre"), 760 */
#endif
#define MAX_ROM_SCAN 0x10000
#define HW_CURSOR_CAP 0x80
#define TURBO_QUEUE_CAP 0x40
#define AGP_CMD_QUEUE_CAP 0x20
#define VM_CMD_QUEUE_CAP 0x10
#define MMIO_CMD_QUEUE_CAP 0x08
/* For 300 series */
#ifdef CONFIG_FB_SIS_300
#define TURBO_QUEUE_AREA_SIZE 0x80000 /* 512K */
#endif
/* For 315/Xabre series */
#ifdef CONFIG_FB_SIS_315
#define COMMAND_QUEUE_AREA_SIZE 0x80000 /* 512K */
#define COMMAND_QUEUE_THRESHOLD 0x1F
#endif
#define HW_CURSOR_AREA_SIZE_315 0x4000 /* 16K */
#define HW_CURSOR_AREA_SIZE_300 0x1000 /* 4K */
#define OH_ALLOC_SIZE 4000
#define SENTINEL 0x7fffffff
#define SEQ_ADR 0x14
#define SEQ_DATA 0x15
#define DAC_ADR 0x18
#define DAC_DATA 0x19
#define CRTC_ADR 0x24
#define CRTC_DATA 0x25
#define DAC2_ADR (0x16-0x30)
#define DAC2_DATA (0x17-0x30)
#define VB_PART1_ADR (0x04-0x30)
#define VB_PART1_DATA (0x05-0x30)
#define VB_PART2_ADR (0x10-0x30)
#define VB_PART2_DATA (0x11-0x30)
#define VB_PART3_ADR (0x12-0x30)
#define VB_PART3_DATA (0x13-0x30)
#define VB_PART4_ADR (0x14-0x30)
#define VB_PART4_DATA (0x15-0x30)
#define SISSR SiS_Pr.SiS_P3c4
#define SISCR SiS_Pr.SiS_P3d4
#define SISDACA SiS_Pr.SiS_P3c8
#define SISDACD SiS_Pr.SiS_P3c9
#define SISPART1 SiS_Pr.SiS_Part1Port
#define SISPART2 SiS_Pr.SiS_Part2Port
#define SISPART3 SiS_Pr.SiS_Part3Port
#define SISPART4 SiS_Pr.SiS_Part4Port
#define SISPART5 SiS_Pr.SiS_Part5Port
#define SISDAC2A SISPART5
#define SISDAC2D (SISPART5 + 1)
#define SISMISCR (SiS_Pr.RelIO + 0x1c)
#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
#define IND_SIS_RAMDAC_CONTROL 0x07
#define IND_SIS_DRAM_SIZE 0x14
#define IND_SIS_SCRATCH_REG_16 0x16
#define IND_SIS_SCRATCH_REG_17 0x17
#define IND_SIS_SCRATCH_REG_1A 0x1A
#define IND_SIS_MODULE_ENABLE 0x1E
#define IND_SIS_PCI_ADDRESS_SET 0x20
#define IND_SIS_TURBOQUEUE_ADR 0x26
#define IND_SIS_TURBOQUEUE_SET 0x27
#define IND_SIS_POWER_ON_TRAP 0x38
#define IND_SIS_POWER_ON_TRAP2 0x39
#define IND_SIS_CMDQUEUE_SET 0x26
#define IND_SIS_CMDQUEUE_THRESHOLD 0x27
#define IND_SIS_SCRATCH_REG_CR30 0x30 /* CRs */
#define IND_SIS_SCRATCH_REG_CR31 0x31
#define IND_SIS_SCRATCH_REG_CR32 0x32
#define IND_SIS_SCRATCH_REG_CR33 0x33
#define IND_SIS_LCD_PANEL 0x36
#define IND_SIS_SCRATCH_REG_CR37 0x37
#define IND_SIS_AGP_IO_PAD 0x48
#define IND_BRI_DRAM_STATUS 0x63 /* PCI config memory size offset */
#define MMIO_QUEUE_PHYBASE 0x85C0
#define MMIO_QUEUE_WRITEPORT 0x85C4
#define MMIO_QUEUE_READPORT 0x85C8
#define IND_SIS_CRT2_WRITE_ENABLE_300 0x24
#define IND_SIS_CRT2_WRITE_ENABLE_315 0x2F
#define SIS_PASSWORD 0x86 /* SR05 */
#define SIS_INTERLACED_MODE 0x20 /* SR06 */
#define SIS_8BPP_COLOR_MODE 0x0
#define SIS_15BPP_COLOR_MODE 0x1
#define SIS_16BPP_COLOR_MODE 0x2
#define SIS_32BPP_COLOR_MODE 0x4
#define SIS_DRAM_SIZE_MASK 0x3F /* 300/630/730 SR14 */
#define SIS_DRAM_SIZE_1MB 0x00
#define SIS_DRAM_SIZE_2MB 0x01
#define SIS_DRAM_SIZE_4MB 0x03
#define SIS_DRAM_SIZE_8MB 0x07
#define SIS_DRAM_SIZE_16MB 0x0F
#define SIS_DRAM_SIZE_32MB 0x1F
#define SIS_DRAM_SIZE_64MB 0x3F
#define SIS_DATA_BUS_MASK 0xC0
#define SIS_DATA_BUS_32 0x00
#define SIS_DATA_BUS_64 0x01
#define SIS_DATA_BUS_128 0x02
#define SIS315_DATA_BUS_MASK 0x02
#define SIS315_DATA_BUS_64 0x00
#define SIS315_DATA_BUS_128 0x01
#define SIS315_DUAL_CHANNEL_MASK 0x0C
#define SIS315_SINGLE_CHANNEL_1_RANK 0x0
#define SIS315_SINGLE_CHANNEL_2_RANK 0x1
#define SIS315_ASYM_DDR 0x02
#define SIS315_DUAL_CHANNEL_1_RANK 0x3
#define SIS_SCRATCH_REG_1A_MASK 0x10
#define SIS_ENABLE_2D 0x40 /* SR1E */
#define SIS_MEM_MAP_IO_ENABLE 0x01 /* SR20 */
#define SIS_PCI_ADDR_ENABLE 0x80
#define SIS_AGP_CMDQUEUE_ENABLE 0x80 /* 315/650/740 SR26 */
#define SIS_VRAM_CMDQUEUE_ENABLE 0x40
#define SIS_MMIO_CMD_ENABLE 0x20
#define SIS_CMD_QUEUE_SIZE_512k 0x00
#define SIS_CMD_QUEUE_SIZE_1M 0x04
#define SIS_CMD_QUEUE_SIZE_2M 0x08
#define SIS_CMD_QUEUE_SIZE_4M 0x0C
#define SIS_CMD_QUEUE_RESET 0x01
#define SIS_CMD_AUTO_CORR 0x02
#define SIS_SIMULTANEOUS_VIEW_ENABLE 0x01 /* CR30 */
#define SIS_MODE_SELECT_CRT2 0x02
#define SIS_VB_OUTPUT_COMPOSITE 0x04
#define SIS_VB_OUTPUT_SVIDEO 0x08
#define SIS_VB_OUTPUT_SCART 0x10
#define SIS_VB_OUTPUT_LCD 0x20
#define SIS_VB_OUTPUT_CRT2 0x40
#define SIS_VB_OUTPUT_HIVISION 0x80
#define SIS_VB_OUTPUT_DISABLE 0x20 /* CR31 */
#define SIS_DRIVER_MODE 0x40
#define SIS_VB_COMPOSITE 0x01 /* CR32 */
#define SIS_VB_SVIDEO 0x02
#define SIS_VB_SCART 0x04
#define SIS_VB_LCD 0x08
#define SIS_VB_CRT2 0x10
#define SIS_CRT1 0x20
#define SIS_VB_HIVISION 0x40
#define SIS_VB_DVI 0x80
#define SIS_VB_TV (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
SIS_VB_SCART | SIS_VB_HIVISION)
#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 ! */
#define SIS_EXTERNAL_CHIP_LVDS_CHRONTEL 0x04 /* in CR37 << 1 ! */
#define SIS_EXTERNAL_CHIP_CHRONTEL 0x05 /* in CR37 << 1 ! */
#define SIS310_EXTERNAL_CHIP_LVDS 0x02 /* in CR37 << 1 ! */
#define SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL 0x03 /* in CR37 << 1 ! */
#define SIS_AGP_2X 0x20 /* CR48 */
#define BRI_DRAM_SIZE_MASK 0x70 /* PCI bridge config data */
#define BRI_DRAM_SIZE_2MB 0x00
#define BRI_DRAM_SIZE_4MB 0x01
#define BRI_DRAM_SIZE_8MB 0x02
#define BRI_DRAM_SIZE_16MB 0x03
#define BRI_DRAM_SIZE_32MB 0x04
#define BRI_DRAM_SIZE_64MB 0x05
#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)
#define orSISREG(base,val) do { \
unsigned char __Temp = inb(base); \
outSISREG(base, __Temp | (val)); \
} while (0)
#define andSISREG(base,val) do { \
unsigned char __Temp = inb(base); \
outSISREG(base, __Temp & (val)); \
} while (0)
#define inSISIDXREG(base,idx,var) do { \
outb(idx,base); var=inb((base)+1); \
} while (0)
#define outSISIDXREG(base,idx,val) do { \
outb(idx,base); outb((val),(base)+1); \
} while (0)
#define orSISIDXREG(base,idx,val) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)|(val); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define andSISIDXREG(base,idx,and) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)&(and); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define setSISIDXREG(base,idx,and,or) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = (inb((base)+1)&(and))|(or); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
/* ------------------- Global Variables ----------------------------- */
/* Fbcon variables */
static struct fb_info *sis_fb_info;
#define MODE_INDEX_NONE 0 /* index for mode=none */
static struct fb_var_screeninfo default_var = {
/* Fbcon stuff */
static struct fb_var_screeninfo my_default_var = {
.xres = 0,
.yres = 0,
.xres_virtual = 0,
......@@ -346,125 +58,110 @@ static struct fb_var_screeninfo default_var = {
.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
};
/* Boot-time parameters */
static int sisfb_off = 0;
static int sisfb_parm_mem = 0;
static int sisfb_accel = -1;
static int sisfb_ypan = -1;
static int sisfb_max = -1;
static int sisfb_userom = 1;
static int sisfb_useoem = -1;
#ifdef MODULE
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static struct fb_fix_screeninfo sisfb_fix = {
.id = "SiS",
.type = FB_TYPE_PACKED_PIXELS,
.xpanstep = 0,
.ypanstep = 1,
};
static char myid[40];
static u32 pseudo_palette[17];
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static struct display sis_disp;
static struct display_switch sisfb_sw;
static struct {
u16 blue, green, red, pad;
} sis_palette[256];
static union {
#ifdef FBCON_HAS_CFB16
u16 cfb16[16];
#endif
#ifdef FBCON_HAS_CFB32
u32 cfb32[16];
static int sisfb_mode_idx = -1;
#else
static int sisfb_mode_idx = MODE_INDEX_NONE; /* Don't use a mode by default if we are a module */
#endif
} sis_fbcon_cmap;
static int sisfb_inverse = 0;
static int currcon = 0;
#else
static int sisfb_mode_idx = -1; /* Use a default mode if we are inside the kernel */
#endif
/* global flags */
static int sisfb_off = 0;
static int sisfb_parm_rate = -1;
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;
static int sisfb_parm_rate = -1;
static int sisfb_registered = 0;
static int sisfb_mem = 0;
static int sisfb_pdc = 0;
static int sisfb_ypan = -1;
static int sisfb_max = -1;
static int sisfb_nocrt2rate = 0;
static int sisfb_crt2type = -1; /* CRT2 type (for overriding autodetection) */
static int sisfb_crt2flags = 0;
static int sisfb_pdc = 0xff;
static int sisfb_pdca = 0xff;
static int sisfb_scalelcd = -1;
static int sisfb_specialtiming = CUT_NONE;
static int sisfb_lvdshl = -1;
static int sisfb_dstn = 0;
static int sisfb_fstn = 0;
static int sisfb_tvplug = -1; /* Tv plug type (for overriding autodetection) */
static int sisfb_tvstd = -1;
static int sisfb_tvxposoffset = 0;
static int sisfb_tvyposoffset = 0;
static int sisfb_filter = -1;
static int sisfb_nocrt2rate = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static int sisfb_inverse = 0;
static char sisfb_fontname[40];
#endif
#if !defined(__i386__) && !defined(__x86_64__)
static int sisfb_resetcard = 0;
static int sisfb_videoram = 0;
#endif
VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
int sisfb_accel = -1;
/* 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; /* CRT2 type (for overriding autodetection) */
int sisfb_tvplug = -1; /* Tv plug type (for overriding autodetection) */
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 hardware ("par") */
struct video_info ivideo;
/* For ioctl SISFB_GET_INFO */
sisfb_info sisfbinfo;
/* Hardware info; contains data on hardware */
SIS_HW_INFO sishw_ext;
/* List of supported chips */
static struct sisfb_chip_info {
int chip;
int vgaengine;
int mni;
int hwcursor_size;
int CRT2_write_enable;
const char *chip_name;
} sisfb_chip_info[] __devinitdata = {
{ SIS_300, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" },
{ SIS_540, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" },
{ SIS_630, SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 630" },
{ SIS_315H, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315H" },
{ SIS_315, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315" },
{ SIS_315PRO, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315PRO" },
{ SIS_550, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 55x" },
{ SIS_650, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 650" },
{ SIS_330, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 330" },
{ SIS_660, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 660" },
};
/* SiS private structure */
SiS_Private SiS_Pr;
static struct pci_device_id __devinitdata sisfb_pci_table[] = {
#ifdef CONFIG_FB_SIS_300
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
#endif
#ifdef CONFIG_FB_SIS_315
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
#endif
{ 0 }
};
/* Card parameters */
static unsigned long sisfb_mmio_size = 0;
static u8 sisfb_caps = 0;
MODULE_DEVICE_TABLE(pci, sisfb_pci_table);
typedef enum _SIS_CMDTYPE {
MMIO_CMD = 0,
AGP_CMD_QUEUE,
VM_CMD_QUEUE,
} SIS_CMDTYPE;
static struct sis_video_info *card_list = NULL;
/* List of supported chips */
static struct board {
u16 vendor, device;
const char *name;
} sisdev_list[] = {
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, "SIS 300"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, "SIS 540 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, "SIS 630/730 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H, "SIS 315H"},
{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 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}
};
/* TODO: This is not handled card-wise because the DRM
does not refer to a unique fb when calling sis_alloc
or sis_free. Therefore, this is handled globally for
now (hoping that nobody is crazy enough to run two
SiS cards at the same time).
*/
SIS_HEAP sisfb_heap;
#define MD_SIS300 1
#define MD_SIS315 2
/* Mode table */
/* NOT const - will be patched for 1280x768 mode number chaos reasons */
struct _sisbios_mode {
static const struct _sisbios_mode {
char name[15];
u8 mode_no;
u8 mode_no[2];
u16 vesa_mode_no_1; /* "SiS defined" VESA mode number */
u16 vesa_mode_no_2; /* Real VESA mode numbers */
u16 xres;
......@@ -475,190 +172,231 @@ struct _sisbios_mode {
u16 rows;
u8 chipset;
} sisbios_mode[] = {
#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},
{"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},
{"720x480x24", 0x35, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x32", 0x35, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x576x8", 0x32, 0x0000, 0x0000, 720, 576, 8, 1, 90, 36, MD_SIS300|MD_SIS315},
{"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},
/*0*/ {"none", {0xff,0xff}, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, MD_SIS300|MD_SIS315},
{"320x200x8", {0x59,0x59}, 0x0138, 0x0000, 320, 200, 8, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x200x16", {0x41,0x41}, 0x010e, 0x0000, 320, 200, 16, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x200x24", {0x4f,0x4f}, 0x0000, 0x0000, 320, 200, 32, 1, 40, 12, MD_SIS300|MD_SIS315}, /* That's for people who mix up color- and fb depth */
{"320x200x32", {0x4f,0x4f}, 0x0000, 0x0000, 320, 200, 32, 1, 40, 12, MD_SIS300|MD_SIS315},
{"320x240x8", {0x50,0x50}, 0x0132, 0x0000, 320, 240, 8, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x16", {0x56,0x56}, 0x0135, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x24", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x32", {0x53,0x53}, 0x0000, 0x0000, 320, 240, 32, 1, 40, 15, MD_SIS300|MD_SIS315},
{"320x240x8", {0x5a,0x5a}, 0x0132, 0x0000, 320, 480, 8, 1, 40, 30, MD_SIS315}, /* FSTN */
/*10*/ {"320x240x16", {0x5b,0x5b}, 0x0135, 0x0000, 320, 480, 16, 1, 40, 30, MD_SIS315}, /* FSTN */
{"400x300x8", {0x51,0x51}, 0x0133, 0x0000, 400, 300, 8, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x16", {0x57,0x57}, 0x0136, 0x0000, 400, 300, 16, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x24", {0x54,0x54}, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315},
{"400x300x32", {0x54,0x54}, 0x0000, 0x0000, 400, 300, 32, 1, 50, 18, MD_SIS300|MD_SIS315},
{"512x384x8", {0x52,0x52}, 0x0000, 0x0000, 512, 384, 8, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x16", {0x58,0x58}, 0x0000, 0x0000, 512, 384, 16, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x24", {0x5c,0x5c}, 0x0000, 0x0000, 512, 384, 32, 1, 64, 24, MD_SIS300|MD_SIS315},
{"512x384x32", {0x5c,0x5c}, 0x0000, 0x0000, 512, 384, 32, 1, 64, 24, MD_SIS300|MD_SIS315},
{"640x400x8", {0x2f,0x2f}, 0x0000, 0x0000, 640, 400, 8, 1, 80, 25, MD_SIS300|MD_SIS315},
/*20*/ {"640x400x16", {0x5d,0x5d}, 0x0000, 0x0000, 640, 400, 16, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x400x24", {0x5e,0x5e}, 0x0000, 0x0000, 640, 400, 32, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x400x32", {0x5e,0x5e}, 0x0000, 0x0000, 640, 400, 32, 1, 80, 25, MD_SIS300|MD_SIS315},
{"640x480x8", {0x2e,0x2e}, 0x0101, 0x0101, 640, 480, 8, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x16", {0x44,0x44}, 0x0111, 0x0111, 640, 480, 16, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x24", {0x62,0x62}, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x32", {0x62,0x62}, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315},
{"720x480x8", {0x31,0x31}, 0x0000, 0x0000, 720, 480, 8, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x16", {0x33,0x33}, 0x0000, 0x0000, 720, 480, 16, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x24", {0x35,0x35}, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
/*30*/ {"720x480x32", {0x35,0x35}, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x576x8", {0x32,0x32}, 0x0000, 0x0000, 720, 576, 8, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x16", {0x34,0x34}, 0x0000, 0x0000, 720, 576, 16, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x24", {0x36,0x36}, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x32", {0x36,0x36}, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"768x576x8", {0x5f,0x5f}, 0x0000, 0x0000, 768, 576, 8, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x16", {0x60,0x60}, 0x0000, 0x0000, 768, 576, 16, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x24", {0x61,0x61}, 0x0000, 0x0000, 768, 576, 32, 1, 96, 36, MD_SIS300|MD_SIS315},
{"768x576x32", {0x61,0x61}, 0x0000, 0x0000, 768, 576, 32, 1, 96, 36, MD_SIS300|MD_SIS315},
{"800x480x8", {0x70,0x70}, 0x0000, 0x0000, 800, 480, 8, 1, 100, 30, MD_SIS300|MD_SIS315},
/*40*/ {"800x480x16", {0x7a,0x7a}, 0x0000, 0x0000, 800, 480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x24", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x32", {0x76,0x76}, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
#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 },
{"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},
{"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 },
{"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},
#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},
{"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},
{"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},
{"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},
{"\0", 0x00, 0, 0, 0, 0, 0, 0, 0}
{"800x600x8", {0x30,0x30}, 0x0103, 0x0103, 800, 600, 8, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x16", {0x47,0x47}, 0x0114, 0x0114, 800, 600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x24", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x32", {0x63,0x63}, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"848x480x8", {0x39,0x39}, 0x0000, 0x0000, 848, 480, 8, 2, 106, 30, MD_SIS300|MD_SIS315},
{"848x480x16", {0x3b,0x3b}, 0x0000, 0x0000, 848, 480, 16, 2, 106, 30, MD_SIS300|MD_SIS315},
{"848x480x24", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
/*50*/ {"848x480x32", {0x3e,0x3e}, 0x0000, 0x0000, 848, 480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
{"856x480x8", {0x3f,0x3f}, 0x0000, 0x0000, 856, 480, 8, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x16", {0x42,0x42}, 0x0000, 0x0000, 856, 480, 16, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x24", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
{"856x480x32", {0x45,0x45}, 0x0000, 0x0000, 856, 480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
{"960x540x8", {0x1d,0x1d}, 0x0000, 0x0000, 960, 540, 8, 1, 120, 33, MD_SIS315},
{"960x540x16", {0x1e,0x1e}, 0x0000, 0x0000, 960, 540, 16, 1, 120, 33, MD_SIS315},
{"960x540x24", {0x1f,0x1f}, 0x0000, 0x0000, 960, 540, 32, 1, 120, 33, MD_SIS315},
{"960x540x32", {0x1f,0x1f}, 0x0000, 0x0000, 960, 540, 32, 1, 120, 33, MD_SIS315},
{"1024x576x8", {0x71,0x71}, 0x0000, 0x0000, 1024, 576, 8, 1, 128, 36, MD_SIS300|MD_SIS315},
/*60*/ {"1024x576x16", {0x74,0x74}, 0x0000, 0x0000, 1024, 576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x24", {0x77,0x77}, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x32", {0x77,0x77}, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x600x8", {0x20,0x20}, 0x0000, 0x0000, 1024, 600, 8, 1, 128, 37, MD_SIS300 },
{"1024x600x16", {0x21,0x21}, 0x0000, 0x0000, 1024, 600, 16, 1, 128, 37, MD_SIS300 },
{"1024x600x24", {0x22,0x22}, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x600x32", {0x22,0x22}, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x768x8", {0x38,0x38}, 0x0105, 0x0105, 1024, 768, 8, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x16", {0x4a,0x4a}, 0x0117, 0x0117, 1024, 768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x24", {0x64,0x64}, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
/*70*/ {"1024x768x32", {0x64,0x64}, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1152x768x8", {0x23,0x23}, 0x0000, 0x0000, 1152, 768, 8, 1, 144, 48, MD_SIS300 },
{"1152x768x16", {0x24,0x24}, 0x0000, 0x0000, 1152, 768, 16, 1, 144, 48, MD_SIS300 },
{"1152x768x24", {0x25,0x25}, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1152x768x32", {0x25,0x25}, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1152x864x8", {0x29,0x29}, 0x0000, 0x0000, 1152, 864, 8, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x16", {0x2a,0x2a}, 0x0000, 0x0000, 1152, 864, 16, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x24", {0x2b,0x2b}, 0x0000, 0x0000, 1152, 864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1152x864x32", {0x2b,0x2b}, 0x0000, 0x0000, 1152, 864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
{"1280x720x8", {0x79,0x79}, 0x0000, 0x0000, 1280, 720, 8, 1, 160, 45, MD_SIS300|MD_SIS315},
/*80*/ {"1280x720x16", {0x75,0x75}, 0x0000, 0x0000, 1280, 720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x24", {0x78,0x78}, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x32", {0x78,0x78}, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x768x8", {0x55,0x23}, 0x0000, 0x0000, 1280, 768, 8, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x16", {0x5a,0x24}, 0x0000, 0x0000, 1280, 768, 16, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x24", {0x5b,0x25}, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x768x32", {0x5b,0x25}, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
{"1280x800x8", {0x14,0x14}, 0x0000, 0x0000, 1280, 800, 8, 1, 160, 50, MD_SIS315},
{"1280x800x16", {0x15,0x15}, 0x0000, 0x0000, 1280, 800, 16, 1, 160, 50, MD_SIS315},
{"1280x800x24", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315},
/*90*/ {"1280x800x32", {0x16,0x16}, 0x0000, 0x0000, 1280, 800, 32, 1, 160, 50, MD_SIS315},
{"1280x960x8", {0x7c,0x7c}, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x16", {0x7d,0x7d}, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x24", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x32", {0x7e,0x7e}, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x1024x8", {0x3a,0x3a}, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x16", {0x4d,0x4d}, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x24", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x32", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1360x768x8", {0x48,0x48}, 0x0000, 0x0000, 1360, 768, 8, 1, 170, 48, MD_SIS300|MD_SIS315},
/*100*/ {"1360x768x16", {0x4b,0x4b}, 0x0000, 0x0000, 1360, 768, 16, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x768x24", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x768x32", {0x4e,0x4e}, 0x0000, 0x0000, 1360, 768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
{"1360x1024x8", {0x67,0x67}, 0x0000, 0x0000, 1360, 1024, 8, 1, 170, 64, MD_SIS300 },
{"1360x1024x16", {0x6f,0x6f}, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300 },
{"1360x1024x24", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 },
{"1360x1024x32", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300 },
{"1400x1050x8", {0x26,0x26}, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315},
{"1400x1050x16", {0x27,0x27}, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65, MD_SIS315},
{"1400x1050x24", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
/*110*/ {"1400x1050x32", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
{"1600x1200x8", {0x3c,0x3c}, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x16", {0x3d,0x3d}, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x24", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x32", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1680x1050x8", {0x17,0x17}, 0x0000, 0x0000, 1680, 1050, 8, 1, 210, 65, MD_SIS315},
{"1680x1050x16", {0x18,0x18}, 0x0000, 0x0000, 1680, 1050, 16, 1, 210, 65, MD_SIS315},
{"1680x1050x24", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315},
{"1680x1050x32", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65, MD_SIS315},
{"1920x1080x8", {0x2c,0x2c}, 0x0000, 0x0000, 1920, 1080, 8, 1, 240, 67, MD_SIS315},
/*120*/ {"1920x1080x16", {0x2d,0x2d}, 0x0000, 0x0000, 1920, 1080, 16, 1, 240, 67, MD_SIS315},
{"1920x1080x24", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315},
{"1920x1080x32", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67, MD_SIS315},
{"1920x1440x8", {0x68,0x68}, 0x013f, 0x0000, 1920, 1440, 8, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x16", {0x69,0x69}, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x24", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x32", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"2048x1536x8", {0x6c,0x6c}, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315},
{"2048x1536x16", {0x6d,0x6d}, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96, MD_SIS315},
{"2048x1536x24", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
/*130*/ {"2048x1536x32", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
{"\0", {0x00,0x00}, 0, 0, 0, 0, 0, 0, 0}
};
/* mode-related variables */
#ifdef MODULE
int sisfb_mode_idx = MODE_INDEX_NONE; /* Don't use a mode by default if we are a module */
#else
int sisfb_mode_idx = -1; /* Use a default mode if we are inside the kernel */
#endif
u8 sisfb_mode_no = 0;
u8 sisfb_rate_idx = 0;
#define SIS_LCD_NUMBER 17
static const struct _sis_lcd_data {
u32 lcdtype;
u16 xres;
u16 yres;
u8 default_mode_idx;
} sis_lcd_data[] = {
{ LCD_640x480, 640, 480, 23 },
{ LCD_800x600, 800, 600, 43 },
{ LCD_1024x600, 1024, 600, 63 },
{ LCD_1024x768, 1024, 768, 67 },
{ LCD_1152x768, 1152, 768, 71 },
{ LCD_1152x864, 1152, 864, 75 },
{ LCD_1280x720, 1280, 720, 79 },
{ LCD_1280x768, 1280, 768, 83 },
{ LCD_1280x800, 1280, 800, 87 },
{ LCD_1280x960, 1280, 960, 91 },
{ LCD_1280x1024, 1280, 1024, 95 },
{ LCD_1400x1050, 1400, 1050, 107 },
{ LCD_1680x1050, 1680, 1050, 115 },
{ LCD_1600x1200, 1600, 1200, 111 },
{ LCD_640x480_2, 640, 480, 23 },
{ LCD_640x480_3, 640, 480, 23 },
{ LCD_320x480, 320, 480, 9 },
};
/* CR36 evaluation */
const USHORT sis300paneltype[] =
{ 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 };
LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN,
LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN, LCD_UNKNOWN };
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_640x480_2, LCD_640x480_3, LCD_320x480, LCD_1024x768 };
LCD_640x480_2, LCD_640x480_3, LCD_UNKNOWN, LCD_UNKNOWN };
const USHORT sis661paneltype[] =
{ 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_1280x800, LCD_1680x1050, LCD_1280x720, LCD_UNKNOWN };
#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, 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 */
static const struct _sis_queuemode {
char name[6];
int type_no;
} sis_queuemode[] = {
{"AGP", AGP_CMD_QUEUE},
{"VRAM", VM_CMD_QUEUE},
{"MMIO", MMIO_CMD},
{"\0", -1}
#define FL_300 0x04
#define FL_315 0x08
static struct _sis_crt2type {
char name[32];
u32 type_no;
u32 tvplug_no;
u16 flags;
} sis_crt2type[] __initdata = {
{"NONE", 0, -1, FL_300|FL_315},
{"LCD", CRT2_LCD, -1, FL_300|FL_315},
{"TV", CRT2_TV, -1, FL_300|FL_315},
{"VGA", CRT2_VGA, -1, FL_300|FL_315},
{"SVIDEO", CRT2_TV, TV_SVIDEO, FL_300|FL_315},
{"COMPOSITE", CRT2_TV, TV_AVIDEO, FL_300|FL_315},
{"CVBS", CRT2_TV, TV_AVIDEO, FL_300|FL_315},
{"SVIDEO+COMPOSITE", CRT2_TV, TV_AVIDEO|TV_SVIDEO, FL_300|FL_315},
{"COMPOSITE+SVIDEO", CRT2_TV, TV_AVIDEO|TV_SVIDEO, FL_300|FL_315},
{"SVIDEO+CVBS", CRT2_TV, TV_AVIDEO|TV_SVIDEO, FL_300|FL_315},
{"CVBS+SVIDEO", CRT2_TV, TV_AVIDEO|TV_SVIDEO, FL_300|FL_315},
{"SCART", CRT2_TV, TV_SCART, FL_300|FL_315},
{"HIVISION", CRT2_TV, TV_HIVISION, FL_315},
{"YPBPR480I", CRT2_TV, TV_YPBPR|TV_YPBPR525I, FL_315},
{"YPBPR480P", CRT2_TV, TV_YPBPR|TV_YPBPR525P, FL_315},
{"YPBPR720P", CRT2_TV, TV_YPBPR|TV_YPBPR750P, FL_315},
{"YPBPR1080I", CRT2_TV, TV_YPBPR|TV_YPBPR1080I, FL_315},
{"DSTN", CRT2_LCD, -1, FL_315|FL_550_DSTN},
{"FSTN", CRT2_LCD, -1, FL_315|FL_550_FSTN},
{"\0", -1, -1, 0}
};
/* TV standard */
static const struct _sis_tvtype {
static struct _sis_tvtype {
char name[6];
int type_no;
} sis_tvtype[] = {
u32 type_no;
} sis_tvtype[] __initdata = {
{"PAL", TV_PAL},
{"NTSC", TV_NTSC},
{"PALM", TV_PAL|TV_PALM},
{"PALN", TV_PAL|TV_PALN},
{"NTSCJ", TV_NTSC|TV_NTSCJ},
{"\0", -1}
};
......@@ -687,6 +425,7 @@ static const struct _sis_vrate {
{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, 960, 540, 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},
......@@ -696,6 +435,7 @@ static const struct _sis_vrate {
{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, 800, 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},
......@@ -705,6 +445,8 @@ static const struct _sis_vrate {
{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, 1680, 1050, 60, TRUE},
{1, 1920, 1080, 30, 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},
......@@ -712,16 +454,6 @@ static const struct _sis_vrate {
{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;
......@@ -760,35 +492,33 @@ static const struct _sisfbddcfmodes {
{ 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;
#ifdef CONFIG_FB_SIS_300
static struct _chswtable {
u16 subsysVendor;
u16 subsysCard;
char *vendorName;
char *cardName;
} mychswtable[] = {
} mychswtable[] __devinitdata = {
{ 0x1631, 0x1002, "Mitachi", "0x1002" },
{ 0x1071, 0x7521, "Mitac" , "7521P" },
{ 0, 0, "" , "" }
};
#endif
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[] = {
static struct _customttable {
u16 chipID;
char *biosversion;
char *biosdate;
u32 bioschksum;
u16 biosFootprintAddr[5];
u8 biosFootprintData[5];
u16 pcisubsysvendor;
u16 pcisubsyscard;
char *vendorName;
char *cardName;
u32 SpecialID;
char *optionName;
} mycustomttable[] __devinitdata = {
{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
0x3240A8,
{ 0x220, 0x227, 0x228, 0x229, 0x0ee },
......@@ -917,46 +647,6 @@ static const struct _customttable {
}
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* Offscreen layout */
typedef struct _SIS_GLYINFO {
unsigned char ch;
int fontwidth;
int fontheight;
u8 gmask[72];
int ngmask;
} SIS_GLYINFO;
static char sisfb_fontname[40];
#endif
typedef struct _SIS_OH {
struct _SIS_OH *poh_next;
struct _SIS_OH *poh_prev;
unsigned long offset;
unsigned long size;
} SIS_OH;
typedef struct _SIS_OHALLOC {
struct _SIS_OHALLOC *poha_next;
SIS_OH aoh[1];
} SIS_OHALLOC;
typedef struct _SIS_HEAP {
SIS_OH oh_free;
SIS_OH oh_used;
SIS_OH *poh_freelist;
SIS_OHALLOC *poha_chain;
unsigned long max_freesize;
} SIS_HEAP;
static unsigned long sisfb_hwcursor_vbase;
static unsigned long sisfb_heap_start;
static unsigned long sisfb_heap_end;
static unsigned long sisfb_heap_size;
static SIS_HEAP sisfb_heap;
static const struct _sis_TV_filter {
u8 filter[9][4];
} sis_TV_filter[] = {
......@@ -1106,9 +796,6 @@ static const struct _sis_TV_filter {
{0xFF,0xFF,0xFF,0xFF} }}
};
static int filter = -1;
static unsigned char filter_tb;
/* ---------------------- Prototypes ------------------------- */
/* Interface used by the world */
......@@ -1119,7 +806,11 @@ int sisfb_setup(char *options);
/* Interface to the low level console driver */
int sisfb_init(void);
/* fbdev routines */
static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static int sisfb_get_fix(struct fb_fix_screeninfo *fix,
int con,
......@@ -1130,7 +821,8 @@ static int sisfb_get_var(struct fb_var_screeninfo *var,
static int sisfb_set_var(struct fb_var_screeninfo *var,
int con,
struct fb_info *info);
static void sisfb_crtc_to_var(struct fb_var_screeninfo *var);
static void sisfb_crtc_to_var(struct sis_video_info *ivideo,
struct fb_var_screeninfo *var);
static int sisfb_get_cmap(struct fb_cmap *cmap,
int kspc,
int con,
......@@ -1153,108 +845,67 @@ static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green,
struct fb_info *fb_info);
static void sisfb_do_install_cmap(int con,
struct fb_info *info);
static void sis_get_glyph(struct fb_info *info,
SIS_GLYINFO *gly);
static int sisfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
static int sisfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg, int con,
struct fb_info *info);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static int sisfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
struct fb_info *info);
static int sisfb_set_par(struct fb_info *info);
static int sisfb_blank(int blank,
struct fb_info *info);
static int sisfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
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);
extern int fbcon_sis_sync(struct fb_info *info);
static int sisfb_ioctl(struct inode *inode,
struct file *file,
unsigned int cmd,
unsigned long arg,
struct fb_info *info);
extern int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr,
PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex);
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);
#endif
static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info);
/* Internal 2D accelerator functions */
extern int sisfb_initaccel(void);
extern void sisfb_syncaccel(void);
extern int sisfb_initaccel(struct sis_video_info *ivideo);
extern void sisfb_syncaccel(struct sis_video_info *ivideo);
/* Internal general routines */
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_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags);
static u8 sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate,
int index);
static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *fb_info);
static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
struct fb_info *info);
static void sisfb_pre_setmode(void);
static void sisfb_post_setmode(void);
static char * sis_find_rom(void);
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);
static void sisfb_pre_setmode(struct sis_video_info *ivideo);
static void sisfb_post_setmode(struct sis_video_info *ivideo);
static char * sis_find_rom(struct pci_dev *pdev);
static BOOLEAN sisfb_CheckVBRetrace(struct sis_video_info *ivideo);
static BOOLEAN sisfbcheckvretracecrt2(struct sis_video_info *ivideo);
static BOOLEAN sisfbcheckvretracecrt1(struct sis_video_info *ivideo);
static BOOLEAN sisfb_bridgeisslave(struct sis_video_info *ivideo);
static void sisfb_detect_VB_connect(struct sis_video_info *ivideo);
static void sisfb_get_VB_type(struct sis_video_info *ivideo);
static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val);
static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val);
/* SiS-specific exported functions */
void sis_malloc(struct sis_memreq *req);
void sis_free(unsigned long base);
/* Internal hardware access routines */
void sisfb_set_reg4(u16 port, unsigned long data);
u32 sisfb_get_reg3(u16 port);
/* Chipset-dependent internal routines */
#ifdef CONFIG_FB_SIS_300
static int sisfb_get_dram_size_300(void);
#endif
#ifdef CONFIG_FB_SIS_315
static int sisfb_get_dram_size_315(void);
#endif
void sis_free(u32 base);
/* Internal heap routines */
static int sisfb_heap_init(void);
static int sisfb_heap_init(struct sis_video_info *ivideo);
static SIS_OH *sisfb_poh_new_node(void);
static SIS_OH *sisfb_poh_allocate(unsigned long size);
static SIS_OH *sisfb_poh_allocate(u32 size);
static void sisfb_delete_node(SIS_OH *poh);
static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh);
static SIS_OH *sisfb_poh_free(unsigned long base);
static SIS_OH *sisfb_poh_free(u32 base);
static void sisfb_free_node(SIS_OH *poh);
/* Internal routines to access PCI configuration space */
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_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);
static void SiS_Sense30x(struct sis_video_info *ivideo);
static void SiS_SenseCh(struct sis_video_info *ivideo);
/* Routines from init.c/init301.c */
extern USHORT SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
......@@ -1268,10 +919,20 @@ extern BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo, USHOR
extern void SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
extern void SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
extern BOOLEAN SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
extern int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr,
PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex);
extern int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex,
struct fb_var_screeninfo *var);
#endif
/* Chrontel TV functions */
/* Chrontel TV, DDC and DPMS 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);
......@@ -1279,13 +940,13 @@ 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,
extern USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, ULONG 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);
#endif
/* $XFree86$ */
/* $XdotOrg$ */
/*
* General type definitions for universal mode switching modules
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -121,21 +119,17 @@ typedef IOADDRESS SISIOADDRESS;
#endif
#endif
#ifndef LINUX_KERNEL /* For the linux kernel, this is defined in sisfb.h */
#ifndef SIS_CHIP_TYPE
typedef enum _SIS_CHIP_TYPE {
enum _SIS_CHIP_TYPE {
SIS_VGALegacy = 0,
#ifdef LINUX_XF86
SIS_530,
SIS_OLD,
#endif
SIS_300,
SIS_630,
SIS_730,
SIS_540,
SIS_315H, /* SiS 310 */
SIS_315,
SIS_315PRO, /* SiS 325 */
SIS_315PRO,
SIS_550,
SIS_650,
SIS_740,
......@@ -144,29 +138,13 @@ typedef enum _SIS_CHIP_TYPE {
SIS_741,
SIS_660,
SIS_760,
SIS_761,
SIS_340,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
#endif
#endif
#ifndef SIS_VB_CHIP_TYPE
typedef enum _SIS_VB_CHIP_TYPE {
VB_CHIP_Legacy = 0,
VB_CHIP_301,
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
};
#ifndef SIS_LCD_TYPE
typedef enum _SIS_LCD_TYPE {
#ifdef LINUX_KERNEL
enum _SIS_LCD_TYPE {
LCD_INVALID = 0,
LCD_800x600,
LCD_1024x768,
......@@ -176,28 +154,22 @@ typedef enum _SIS_LCD_TYPE {
LCD_1600x1200,
LCD_1920x1440,
LCD_2048x1536,
LCD_320x480, /* FSTN, DSTN */
LCD_320x480, /* FSTN */
LCD_1400x1050,
LCD_1152x864,
LCD_1152x768,
LCD_1280x768,
LCD_1024x600,
LCD_640x480_2, /* FSTN, DSTN */
LCD_640x480_3, /* FSTN, DSTN */
LCD_640x480_2, /* DSTN */
LCD_640x480_3, /* DSTN */
LCD_848x480,
LCD_1280x800,
LCD_1680x1050,
LCD_1280x720,
LCD_CUSTOM,
LCD_UNKNOWN
} SIS_LCD_TYPE;
#endif
#ifndef PSIS_DSReg
typedef struct _SIS_DSReg
{
UCHAR jIdx;
UCHAR jVal;
} SIS_DSReg, *PSIS_DSReg;
};
typedef unsigned int SIS_LCD_TYPE;
#endif
#ifndef SIS_HW_INFO
......@@ -220,97 +192,84 @@ struct _SIS_HW_INFO
/* of Linear VGA memory */
ULONG ulVideoMemorySize; /* size, in bytes, of the memory on the board */
SISIOADDRESS ulIOAddress; /* base I/O address of VGA ports (0x3B0) */
SISIOADDRESS ulIOAddress; /* base I/O address of VGA ports (0x3B0; relocated) */
UCHAR jChipType; /* Used to Identify SiS Graphics Chip */
/* defined in the data structure type */
/* "SIS_CHIP_TYPE" */
/* defined in the enum "SIS_CHIP_TYPE" (above or sisfb.h) */
UCHAR jChipRevision; /* Used to Identify SiS Graphics Chip Revision */
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 (other than */
/* SiS video bridge) */
ULONG ulCRT2LCDType; /* defined in the data structure type */
/* "SIS_LCD_TYPE" */
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 */
/* bSkipDramSizing = TRUE */
PSIS_DSReg pCR; /* restore CR registers in initial function. */
/* end data :(idx, val) = (FF, FF) */
/* Note : restore cR registers if */
/* bSkipDramSizing = TRUE */
ULONG ulCRT2LCDType; /* defined in the data structure type */
/* "SIS_LCD_TYPE" */
#endif
PSIS_QUERYSPACE pQueryVGAConfigSpace; /* Get/Set VGA Configuration */
/* space */
PSIS_QUERYSPACE pQueryNorthBridgeSpace;/* Get/Set North Bridge */
/* space */
};
#endif
/* Addtional IOCTL for communication sisfb <> X driver */
/* Addtional IOCTLs 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 */
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO 0x80046ef8 /* Wow, what a terrible hack... */
#define SISFB_GET_INFO_SIZE 0x8004f300
#define SISFB_GET_INFO 0x8000f301 /* Must be patched with result from ..._SIZE at D[29:16] */
/* deprecated ioctl number (for older versions of sisfb) */
#define SISFB_GET_INFO_OLD 0x80046ef8
/* ioctls for tv parameters (position) */
#define SISFB_SET_TVPOSOFFSET 0x4004f304
/* lock sisfb from register access */
#define SISFB_SET_LOCK 0x4004f306
/* 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 */
CARD32 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 */
CARD32 chip_id; /* PCI ID of detected chip */
CARD32 memory; /* video memory in KB which sisfb manages */
CARD32 heapstart; /* heap start (= sisfb "mem" argument) in KB */
CARD8 fbvidmode; /* current sisfb mode */
CARD8 sisfb_version;
CARD8 sisfb_revision;
CARD8 sisfb_patchlevel;
CARD8 sisfb_caps; /* sisfb's capabilities */
CARD32 sisfb_tqlen; /* turbo queue length (in KB) */
unsigned char sisfb_version;
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
CARD32 sisfb_pcibus; /* The card's PCI ID */
CARD32 sisfb_pcislot;
CARD32 sisfb_pcifunc;
unsigned char sisfb_caps; /* sisfb's capabilities */
CARD8 sisfb_lcdpdc;
int sisfb_tqlen; /* turbo queue length (in KB) */
CARD8 sisfb_lcda;
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
CARD32 sisfb_vbflags;
CARD32 sisfb_currentvbflags;
unsigned char sisfb_lcdpdc;
unsigned char sisfb_lcda;
CARD32 sisfb_scalelcd;
CARD32 sisfb_specialtiming;
unsigned long sisfb_vbflags;
unsigned long sisfb_currentvbflags;
CARD8 sisfb_haveemi;
CARD8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
CARD8 sisfb_haveemilcd;
int sisfb_scalelcd;
unsigned long sisfb_specialtiming;
CARD8 sisfb_lcdpdca;
unsigned char sisfb_haveemi;
unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
unsigned char sisfb_haveemilcd;
CARD16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
char reserved[213]; /* for future use */
CARD8 reserved[208]; /* for future use */
};
#endif
......
/* $XFree86$ */
/* $XdotOrg$ */
/*
* General structure definitions for universal mode switching modules
*
......@@ -31,13 +32,10 @@
* * 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
* * 3) The name of the author may not be used to endorse or promote products
* * derived from this software without specific prior written permission.
* *
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
......@@ -164,7 +162,6 @@ typedef struct _SiS_ExtStruct
{
UCHAR Ext_ModeID;
USHORT Ext_ModeFlag;
UCHAR Ext_ModeOffset;
USHORT Ext_VESAID;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
......@@ -172,6 +169,7 @@ typedef struct _SiS_ExtStruct
UCHAR VB_ExtTVYFilterIndex;
UCHAR VB_ExtTVYFilterIndexROM661;
UCHAR REFindex;
CHAR ROMMODEIDX661;
} SiS_ExtStruct;
typedef struct _SiS_Ext2Struct
......@@ -180,6 +178,7 @@ typedef struct _SiS_Ext2Struct
UCHAR Ext_CRT1CRTC;
UCHAR Ext_CRTVCLK;
UCHAR Ext_CRT2CRTC;
UCHAR Ext_CRT2CRTC_NS;
UCHAR ModeID;
USHORT XRes;
USHORT YRes;
......@@ -228,6 +227,8 @@ typedef struct _SiS_ModeResInfoStruct
UCHAR YChar;
} SiS_ModeResInfoStruct;
typedef UCHAR DRAM4Type[4];
/* Defines for SiS_CustomT */
......@@ -289,18 +290,21 @@ typedef struct _SiS_Private
USHORT SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
#endif
BOOLEAN SiS_UseROM;
int SiS_CHOverScan;
BOOLEAN SiS_ROMNew;
BOOLEAN SiS_NeedRomModeData;
BOOLEAN PanelSelfDetected;
int SiS_CHOverScan;
BOOLEAN SiS_CHSOverScan;
BOOLEAN SiS_ChSW;
BOOLEAN SiS_UseLCDA;
int SiS_UseOEM;
ULONG SiS_CustomT;
USHORT SiS_Backup70xx;
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;
SHORT PDC, PDCA;
UCHAR SiS_MyCR63;
USHORT SiS_CRT1Mode;
USHORT SiS_flag_clearbuffer;
......@@ -346,28 +350,13 @@ typedef struct _SiS_Private
USHORT SiS_DDC_DeviceAddr;
USHORT SiS_DDC_ReadAddr;
USHORT SiS_DDC_SecAddr;
USHORT SiS_ChrontelInit;
BOOLEAN SiS_SensibleSR11;
USHORT SiS_Panel800x600;
USHORT SiS_Panel1024x768;
USHORT SiS_Panel1280x1024;
USHORT SiS_Panel1600x1200;
USHORT SiS_Panel1280x960;
USHORT SiS_Panel1400x1050;
USHORT SiS_Panel320x480;
USHORT SiS_Panel1152x768;
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 SiS661LCD2TableSize;
USHORT SiS_PanelMinLVDS;
USHORT SiS_PanelMin301;
USHORT SiS_ChrontelInit;
const SiS_StStruct *SiS_SModeIDTable;
SiS_StandTableStruct *SiS_StandTable;
const SiS_ExtStruct *SiS_EModeIDTable;
......@@ -376,11 +365,10 @@ typedef struct _SiS_Private
const SiS_CRT1TableStruct *SiS_CRT1Table;
const SiS_MCLKDataStruct *SiS_MCLKData_0;
const SiS_MCLKDataStruct *SiS_MCLKData_1;
const SiS_VCLKDataStruct *SiS_VCLKData;
const SiS_VBVCLKDataStruct *SiS_VBVCLKData;
SiS_VCLKDataStruct *SiS_VCLKData;
SiS_VBVCLKDataStruct *SiS_VBVCLKData;
const SiS_StResInfoStruct *SiS_StResInfo;
const SiS_ModeResInfoStruct *SiS_ModeResInfo;
const UCHAR *SiS_ScreenOffset;
const UCHAR *pSiS_OutputSelect;
const UCHAR *pSiS_SoftSetting;
......@@ -410,6 +398,12 @@ typedef struct _SiS_Private
const USHORT *pSiS_VideoSenseData2;
const USHORT *pSiS_YCSenseData2;
#endif
const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
/* SiS bridge */
const UCHAR *SiS_NTSCPhase;
const UCHAR *SiS_PALPhase;
const UCHAR *SiS_NTSCPhase2;
......@@ -421,24 +415,21 @@ typedef struct _SiS_Private
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;
const SiS_LCDDataStruct *SiS_StLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_LCD1280x720Data;
const SiS_LCDDataStruct *SiS_StLCD1280x768_2Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x768_2Data;
const SiS_LCDDataStruct *SiS_LCD1280x768_3Data;
const SiS_LCDDataStruct *SiS_LCD1280x800Data;
const SiS_LCDDataStruct *SiS_LCD1280x960Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_St2LCD1280x1024Data;
const SiS_LCDDataStruct *SiS_NoScaleData1024x768;
const SiS_LCDDataStruct *SiS_NoScaleData1280x1024;
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_StLCD1600x1200Data;
const SiS_LCDDataStruct *SiS_ExtLCD1600x1200Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x768Data;
const SiS_LCDDataStruct *SiS_LCD1680x1050Data;
const SiS_LCDDataStruct *SiS_NoScaleData;
const SiS_TVDataStruct *SiS_StPALData;
const SiS_TVDataStruct *SiS_ExtPALData;
......@@ -464,8 +455,16 @@ typedef struct _SiS_Private
const UCHAR *SiS_HiTVTextTiming;
const UCHAR *SiS_HiTVGroup3Text;
#endif
const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
/* LVDS, Chrontel */
const SiS_LVDSDataStruct *SiS_LVDS800x600Data_1;
const SiS_LVDSDataStruct *SiS_LVDS800x600Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1024x768Data_1;
......@@ -487,14 +486,6 @@ typedef struct _SiS_Private
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;
......@@ -511,6 +502,7 @@ typedef struct _SiS_Private
const SiS_LVDSDataStruct *SiS_CHTVUPALNData;
const SiS_LVDSDataStruct *SiS_CHTVOPALNData;
const SiS_LVDSDataStruct *SiS_CHTVSOPALData;
const SiS_LVDSDesStruct *SiS_PanelType00_1;
const SiS_LVDSDesStruct *SiS_PanelType01_1;
const SiS_LVDSDesStruct *SiS_PanelType02_1;
......@@ -545,20 +537,11 @@ typedef struct _SiS_Private
const SiS_LVDSDesStruct *SiS_PanelType0e_2;
const SiS_LVDSDesStruct *SiS_PanelType0f_2;
const SiS_LVDSDesStruct *SiS_PanelTypeNS_2;
const SiS_LVDSDesStruct *LVDS1024x768Des_1;
const SiS_LVDSDesStruct *LVDS1280x1024Des_1;
const SiS_LVDSDesStruct *LVDS1400x1050Des_1;
const SiS_LVDSDesStruct *LVDS1600x1200Des_1;
const SiS_LVDSDesStruct *LVDS1024x768Des_2;
const SiS_LVDSDesStruct *LVDS1280x1024Des_2;
const SiS_LVDSDesStruct *LVDS1400x1050Des_2;
const SiS_LVDSDesStruct *LVDS1600x1200Des_2;
const SiS_LVDSDesStruct *SiS_CHTVUNTSCDesData;
const SiS_LVDSDesStruct *SiS_CHTVONTSCDesData;
const SiS_LVDSDesStruct *SiS_CHTVUPALDesData;
const SiS_LVDSDesStruct *SiS_CHTVOPALDesData;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_1;
......@@ -599,44 +582,13 @@ typedef struct _SiS_Private
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_3;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1640x480_3_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1320x480_1;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UNTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1ONTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UPAL;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1OPAL;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1SOPAL;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1320x480_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_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_LCDACRT11024x768_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_2;
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;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_3;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UNTSC;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_ONTSC;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPAL;
......@@ -646,6 +598,7 @@ typedef struct _SiS_Private
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPALN;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_OPALN;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_SOPAL;
const UCHAR *SiS_CHTVVCLKUNTSC;
const UCHAR *SiS_CHTVVCLKONTSC;
const UCHAR *SiS_CHTVVCLKUPAL;
......@@ -656,9 +609,13 @@ typedef struct _SiS_Private
const UCHAR *SiS_CHTVVCLKOPALN;
const UCHAR *SiS_CHTVVCLKSOPAL;
USHORT PanelXRes;
USHORT PanelYRes;
USHORT PanelXRes, PanelHT;
USHORT PanelYRes, PanelVT;
USHORT PanelHRS, PanelHRE;
USHORT PanelVRS, PanelVRE;
USHORT PanelVCLKIdx300;
USHORT PanelVCLKIdx315;
BOOLEAN UseCustomMode;
BOOLEAN CRT1UsesCustomMode;
USHORT CHDisplay;
......@@ -700,10 +657,11 @@ typedef struct _SiS_Private
UCHAR Backup_1d;
int UsePanelScaler;
int CenterScreen;
USHORT CP_Vendor, CP_Product;
BOOLEAN CP_HaveCustomData;
int CP_PreferredX, CP_PreferredY;
int CP_PreferredX, CP_PreferredY, CP_PreferredIndex;
int CP_MaxX, CP_MaxY, CP_MaxClock;
BOOLEAN CP_Supports64048075;
int CP_HDisplay[7], CP_VDisplay[7]; /* For Custom LCD panel dimensions */
......
......@@ -38,7 +38,8 @@
#define TV_AVIDEO 0x00000100
#define TV_SVIDEO 0x00000200
#define TV_SCART 0x00000400
#define VB_CONEXANT 0x00000800
#define VB_CONEXANT 0x00000800 /* 661 series only */
#define VB_TRUMPION VB_CONEXANT /* 300 series only */
#define TV_PALM 0x00001000
#define TV_PALN 0x00002000
#define TV_NTSCJ 0x00001000
......@@ -86,204 +87,112 @@
#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, /* chip_id in sisfb_info */
SIS_300,
SIS_630,
SIS_540,
SIS_730,
SIS_315H,
SIS_315,
SIS_315PRO,
SIS_550,
SIS_650,
SIS_740,
SIS_330,
SIS_661,
SIS_741,
SIS_660,
SIS_760,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
/* 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 */
/* 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 */
__u32 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 */
__u32 chip_id; /* PCI-ID of detected chip */
__u32 memory; /* video memory in KB which sisfb manages */
__u32 heapstart; /* heap start (= sisfb "mem" argument) in KB */
__u8 fbvidmode; /* current sisfb mode */
unsigned char sisfb_version;
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
__u8 sisfb_version;
__u8 sisfb_revision;
__u8 sisfb_patchlevel;
unsigned char sisfb_caps; /* Sisfb capabilities */
__u8 sisfb_caps; /* sisfb capabilities */
int sisfb_tqlen; /* turbo queue length (in KB) */
__u32 sisfb_tqlen; /* turbo queue length (in KB) */
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
__u32 sisfb_pcibus; /* The card's PCI ID */
__u32 sisfb_pcislot;
__u32 sisfb_pcifunc;
unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */
__u8 sisfb_lcdpdc; /* PanelDelayCompensation */
unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */
__u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */
unsigned long sisfb_vbflags;
unsigned long sisfb_currentvbflags;
__u32 sisfb_vbflags;
__u32 sisfb_currentvbflags;
int sisfb_scalelcd;
unsigned long sisfb_specialtiming;
__u32 sisfb_scalelcd;
__u32 sisfb_specialtiming;
unsigned char sisfb_haveemi;
unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
unsigned char sisfb_haveemilcd;
__u8 sisfb_haveemi;
__u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
__u8 sisfb_haveemilcd;
char reserved[213]; /* for future use */
};
__u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */
/* For fb memory manager */
struct sis_memreq {
unsigned long offset;
unsigned long size;
};
__u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
/* More or less deprecated stuff follows: */
typedef enum _TVTYPE {
TVMODE_NTSC = 0,
TVMODE_PAL,
TVMODE_HIVISION,
TVMODE_TOTAL
} SIS_TV_TYPE;
typedef enum _TVPLUGTYPE {
TVPLUG_Legacy = 0,
TVPLUG_COMPOSITE,
TVPLUG_SVIDEO,
TVPLUG_SCART,
TVPLUG_TOTAL
} SIS_TV_PLUG;
struct mode_info {
int bpp;
int xres;
int yres;
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;
__u8 reserved[208]; /* for future use */
};
struct ap_data {
struct mode_info minfo;
unsigned long iobase;
unsigned int mem_size;
unsigned long disp_state; /* deprecated */
SIS_CHIP_TYPE chip;
unsigned char hasVB;
SIS_TV_TYPE TV_type; /* deprecated */
SIS_TV_PLUG TV_plug; /* deprecated */
unsigned long version;
unsigned long vbflags; /* replaces deprecated entries above */
unsigned long currentvbflags;
char reserved[248];
/* 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_SIZE _IOR(0xF3,0x00,__u32)
#define SISFB_GET_INFO _IOR(0xF3,0x01,struct _SISFB_INFO)
/* ioctrl to get current vertical retrace status */
#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
/* ioctl for locking sisfb (no register access during lock) */
/* As of now, only used to avoid register access during
* the ioctls listed above.
*/
#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
/* more to come soon */
/* ioctls 0xF3 up to 0x3F reserved for sisfb */
/****************************************************************/
/* The following are deprecated and should not be used anymore: */
/****************************************************************/
/* ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
/* ioctrl to get current vertical retrace status */
#define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
/****************************************************************/
/* End of deprecated ioctl numbers */
/****************************************************************/
/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
struct sis_memreq {
__u32 offset;
__u32 size;
};
/**********************************************/
/* PRIVATE */
/* (for IN-KERNEL usage only) */
/**********************************************/
#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;
unsigned long video_base;
char * video_vbase;
unsigned long mmio_base;
char * mmio_vbase;
unsigned long vga_base;
unsigned long mtrr;
unsigned long heapstart;
int video_bpp;
int video_cmap_len;
int video_width;
int video_height;
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; /* 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; /* For 2d acceleration */
unsigned long SiS310_AccelDepth;
unsigned long CommandReg;
spinlock_t lockaccel; /* Do not use outside of kernel! */
unsigned int pcibus;
unsigned int pcislot;
unsigned int pcifunc;
int accel;
unsigned short subsysvendor;
unsigned short subsysdevice;
unsigned long vbflags; /* Replacing deprecated stuff from above */
unsigned long currentvbflags;
int current_bpp;
int current_width;
int current_height;
int current_htotal;
int current_vtotal;
__u32 current_pixclock;
int current_refresh_rate;
char reserved[200];
};
extern struct video_info ivideo;
#define UNKNOWN_VGA 0
#define SIS_300_VGA 1
#define SIS_315_VGA 2
extern void sis_malloc(struct sis_memreq *req);
extern void sis_free(unsigned long base);
extern void sis_dispinfo(struct ap_data *rec);
extern void sis_free(u32 base);
#endif
#endif
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