3 * DAC helper functions (Save/Restore, MemClk, etc)
4 * Definitions and prototypes
6 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1) Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2) Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3) All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement: "This product includes
18 * software developed by Thomas Winischhofer, Vienna, Austria."
19 * 4) The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 int SiS_compute_vclk(int Clock
, int *out_n
, int *out_dn
, int *out_div
,
36 int *out_sbit
, int *out_scale
);
37 void SISDACPreInit(ScrnInfoPtr pScrn
);
38 void SISLoadPalette(ScrnInfoPtr pScrn
, int numColors
, int *indicies
,
39 LOCO
*colors
, VisualPtr pVisual
);
40 void SiSCalcClock(ScrnInfoPtr pScrn
, int clock
, int max_VLD
,
42 void SiSIODump(ScrnInfoPtr pScrn
);
43 int SiSMemBandWidth(ScrnInfoPtr pScrn
, BOOLEAN IsForCRT2
);
44 int SiSMclk(SISPtr pSiS
);
45 void SiSRestoreBridge(ScrnInfoPtr pScrn
, SISRegPtr sisReg
);
47 extern void SiS6326SetTVReg(ScrnInfoPtr pScrn
, CARD8 index
, CARD8 data
);
48 extern unsigned char SiS6326GetTVReg(ScrnInfoPtr pScrn
, CARD8 index
);
49 extern void SiS6326SetXXReg(ScrnInfoPtr pScrn
, CARD8 index
, CARD8 data
);
50 extern unsigned char SiS6326GetXXReg(ScrnInfoPtr pScrn
, CARD8 index
);
52 extern int SiSCalcVRate(DisplayModePtr mode
);
54 /* Functions from init.c and init301.c */
55 extern void SiS_UnLockCRT2(SiS_Private
*SiS_Pr
, PSIS_HW_INFO
);
56 extern void SiS_LockCRT2(SiS_Private
*SiS_Pr
, PSIS_HW_INFO
);
57 extern void SiS_DisableBridge(SiS_Private
*SiS_Pr
, PSIS_HW_INFO
);
58 extern void SiS_EnableBridge(SiS_Private
*SiS_Pr
, PSIS_HW_INFO
);
59 extern USHORT
SiS_GetCH700x(SiS_Private
*SiS_Pr
, USHORT tempbx
);
60 extern void SiS_SetCH700x(SiS_Private
*SiS_Pr
, USHORT tempbx
);
61 extern USHORT
SiS_GetCH701x(SiS_Private
*SiS_Pr
, USHORT tempbx
);
62 extern void SiS_SetCH701x(SiS_Private
*SiS_Pr
, USHORT tempbx
);
63 extern USHORT
SiS_GetCH70xx(SiS_Private
*SiS_Pr
, USHORT tempbx
);
64 extern void SiS_SetCH70xx(SiS_Private
*SiS_Pr
, USHORT tempbx
);
65 extern void SiS_SetCH70xxANDOR(SiS_Private
*SiS_Pr
, USHORT tempax
,USHORT tempbh
);
66 extern void SiS_DDC2Delay(SiS_Private
*SiS_Pr
, USHORT delaytime
);
67 extern USHORT
SiS_ReadDDC1Bit(SiS_Private
*SiS_Pr
);
68 extern USHORT
SiS_HandleDDC(SiS_Private
*SiS_Pr
, unsigned long VBFlags
, int VGAEngine
,
69 USHORT adaptnum
, USHORT DDCdatatype
, unsigned char *buffer
);
70 extern void SiS_SetChrontelGPIO(SiS_Private
*SiS_Pr
, USHORT myvbinfo
);
71 extern void SiS_DisplayOn(SiS_Private
*SiS_Pr
);
72 extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn
, unsigned char id
);
73 extern void SiS_SetEnableDstn(SiS_Private
*SiS_Pr
, int enable
);
74 extern void SiS_SetEnableFstn(SiS_Private
*SiS_Pr
, int enable
);