1 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.31 2003/09/04 15:32:44 twini Exp $ */
3 * SiS driver option evaluation
5 * Copyright 2001, 2002, 2003 by Thomas Winischhofer, Vienna, Austria
7 * Based on code by ? (included in XFree86 4.1)
9 * Permission to use, copy, modify, distribute, and sell this software and its
10 * documentation for any purpose is hereby granted without fee, provided that
11 * the above copyright notice appear in all copies and that both that
12 * copyright notice and this permission notice appear in supporting
13 * documentation, and that the name of the supplier not be used in
14 * advertising or publicity pertaining to distribution of the software without
15 * specific, written prior permission. The supplier makes no representations
16 * about the suitability of this software for any purpose. It is provided
17 * "as is" without express or implied warranty.
19 * THE SUPPLIER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
20 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
21 * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
22 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
23 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
24 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25 * PERFORMANCE OF THIS SOFTWARE.
27 * Authors: Thomas Winischhofer <thomas@winischhofer.net>
32 #include "xf86PciInfo.h"
34 #include "xf86Cursor.h"
38 extern const customttable mycustomttable
[];
43 /* OPTION_PCI_RETRY, */
48 /* OPTION_SET_MEMCLOCK, */
50 OPTION_FORCE_CRT2TYPE
,
61 OPTION_NOINTERNALMODES
,
66 OPTION_CHTVLUMABANDWIDTHCVBS
,
67 OPTION_CHTVLUMABANDWIDTHSVIDEO
,
68 OPTION_CHTVLUMAFLICKERFILTER
,
69 OPTION_CHTVCHROMABANDWIDTH
,
70 OPTION_CHTVCHROMAFLICKERFILTER
,
72 OPTION_CHTVTEXTENHANCE
,
74 OPTION_SISTVEDGEENHANCE
,
75 OPTION_SISTVANTIFLICKER
,
76 OPTION_SISTVSATURATION
,
77 OPTION_SISTVCHROMAFILTER
,
78 OPTION_SISTVLUMAFILTER
,
79 OPTION_SISTVCOLCALIBFINE
,
80 OPTION_SISTVCOLCALIBCOARSE
,
85 OPTION_SIS6326ANTIFLICKER
,
86 OPTION_SIS6326ENABLEYFILTER
,
87 OPTION_SIS6326YFILTERSTRONG
,
88 OPTION_SIS6326FORCETVPPLUG
,
89 OPTION_SIS6326FSCADJUST
,
92 OPTION_USERGBCURSORBLEND
,
93 OPTION_USERGBCURSORBLENDTH
,
96 OPTION_FORCECRT2REDETECTION
,
100 OPTION_XVDEFBRIGHTNESS
,
102 OPTION_XVDEFSATURATION
,
103 OPTION_XVDEFDISABLEGFX
,
104 OPTION_XVDEFDISABLEGFXLR
,
106 OPTION_XVUSECHROMAKEY
,
109 OPTION_XVDISABLECOLORKEY
,
110 OPTION_XVINSIDECHROMAKEY
,
111 OPTION_XVYUVCHROMAKEY
,
113 OPTION_SPECIALTIMING
,
123 OPTION_CRT2VREFRESH2
,
125 OPTION_NOSISXINERAMA
,
126 OPTION_NOSISXINERAMA2
,
128 OPTION_ENABLESISCTRL
,
141 static const OptionInfoRec SISOptions
[] = {
142 { OPTION_SW_CURSOR
, "SWcursor", OPTV_BOOLEAN
, {0}, FALSE
},
143 { OPTION_HW_CURSOR
, "HWcursor", OPTV_BOOLEAN
, {0}, FALSE
},
144 /* { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, */
145 { OPTION_NOACCEL
, "NoAccel", OPTV_BOOLEAN
, {0}, FALSE
},
146 { OPTION_TURBOQUEUE
, "TurboQueue", OPTV_BOOLEAN
, {0}, FALSE
},
147 /* { OPTION_SET_MEMCLOCK, "SetMClk", OPTV_FREQ, {0}, -1 }, */
148 { OPTION_FAST_VRAM
, "FastVram", OPTV_BOOLEAN
, {0}, FALSE
},
149 { OPTION_NOHOSTBUS
, "NoHostBus", OPTV_BOOLEAN
, {0}, FALSE
},
150 { OPTION_RENDER
, "RenderAcceleration", OPTV_BOOLEAN
, {0}, FALSE
},
151 { OPTION_FORCE_CRT2TYPE
, "ForceCRT2Type", OPTV_ANYSTR
, {0}, FALSE
},
152 { OPTION_SHADOW_FB
, "ShadowFB", OPTV_BOOLEAN
, {0}, FALSE
},
153 { OPTION_ROTATE
, "Rotate", OPTV_ANYSTR
, {0}, FALSE
},
154 { OPTION_NOXVIDEO
, "NoXvideo", OPTV_BOOLEAN
, {0}, FALSE
},
155 { OPTION_VESA
, "Vesa", OPTV_BOOLEAN
, {0}, FALSE
},
156 { OPTION_MAXXFBMEM
, "MaxXFBMem", OPTV_INTEGER
, {0}, -1 },
157 { OPTION_FORCECRT1
, "ForceCRT1", OPTV_BOOLEAN
, {0}, FALSE
},
158 { OPTION_XVONCRT2
, "XvOnCRT2", OPTV_BOOLEAN
, {0}, FALSE
},
159 { OPTION_PDC
, "PanelDelayCompensation", OPTV_INTEGER
, {0}, -1 },
160 { OPTION_TVSTANDARD
, "TVStandard", OPTV_STRING
, {0}, -1 },
161 { OPTION_USEROMDATA
, "UseROMData", OPTV_BOOLEAN
, {0}, -1 },
162 { OPTION_NOINTERNALMODES
, "NoInternalModes", OPTV_BOOLEAN
, {0}, FALSE
},
163 { OPTION_USEOEM
, "UseOEMData", OPTV_BOOLEAN
, {0}, -1 },
164 { OPTION_NOYV12
, "NoYV12", OPTV_BOOLEAN
, {0}, -1 },
165 { OPTION_CHTVTYPE
, "CHTVType", OPTV_BOOLEAN
, {0}, -1 },
166 { OPTION_CHTVOVERSCAN
, "CHTVOverscan", OPTV_BOOLEAN
, {0}, -1 },
167 { OPTION_CHTVSOVERSCAN
, "CHTVSuperOverscan", OPTV_BOOLEAN
, {0}, -1 },
168 { OPTION_CHTVLUMABANDWIDTHCVBS
, "CHTVLumaBandwidthCVBS", OPTV_INTEGER
, {0}, -1 },
169 { OPTION_CHTVLUMABANDWIDTHSVIDEO
, "CHTVLumaBandwidthSVIDEO",OPTV_INTEGER
, {0}, -1 },
170 { OPTION_CHTVLUMAFLICKERFILTER
, "CHTVLumaFlickerFilter", OPTV_INTEGER
, {0}, -1 },
171 { OPTION_CHTVCHROMABANDWIDTH
, "CHTVChromaBandwidth", OPTV_INTEGER
, {0}, -1 },
172 { OPTION_CHTVCHROMAFLICKERFILTER
, "CHTVChromaFlickerFilter",OPTV_INTEGER
, {0}, -1 },
173 { OPTION_CHTVCVBSCOLOR
, "CHTVCVBSColor", OPTV_BOOLEAN
, {0}, -1 },
174 { OPTION_CHTVTEXTENHANCE
, "CHTVTextEnhance", OPTV_INTEGER
, {0}, -1 },
175 { OPTION_CHTVCONTRAST
, "CHTVContrast", OPTV_INTEGER
, {0}, -1 },
176 { OPTION_SISTVEDGEENHANCE
, "SISTVEdgeEnhance", OPTV_INTEGER
, {0}, -1 },
177 { OPTION_SISTVANTIFLICKER
, "SISTVAntiFlicker", OPTV_STRING
, {0}, FALSE
},
178 { OPTION_SISTVSATURATION
, "SISTVSaturation", OPTV_INTEGER
, {0}, -1 },
179 { OPTION_SISTVCHROMAFILTER
, "SISTVCFilter", OPTV_BOOLEAN
, {0}, -1 },
180 { OPTION_SISTVLUMAFILTER
, "SISTVYFilter", OPTV_INTEGER
, {0}, -1 },
181 { OPTION_SISTVCOLCALIBFINE
, "SISTVColorCalibFine", OPTV_INTEGER
, {0}, -1 },
182 { OPTION_SISTVCOLCALIBCOARSE
, "SISTVColorCalibCoarse", OPTV_INTEGER
, {0}, -1 },
183 { OPTION_TVXSCALE
, "SISTVXScale", OPTV_INTEGER
, {0}, -1 },
184 { OPTION_TVYSCALE
, "SISTVYScale", OPTV_INTEGER
, {0}, -1 },
185 { OPTION_TVXPOSOFFSET
, "TVXPosOffset", OPTV_INTEGER
, {0}, -1 },
186 { OPTION_TVYPOSOFFSET
, "TVYPosOffset", OPTV_INTEGER
, {0}, -1 },
187 { OPTION_SIS6326ANTIFLICKER
, "SIS6326TVAntiFlicker", OPTV_STRING
, {0}, FALSE
},
188 { OPTION_SIS6326ENABLEYFILTER
, "SIS6326TVEnableYFilter", OPTV_BOOLEAN
, {0}, -1 },
189 { OPTION_SIS6326YFILTERSTRONG
, "SIS6326TVYFilterStrong", OPTV_BOOLEAN
, {0}, -1 },
190 { OPTION_SIS6326FORCETVPPLUG
, "SIS6326TVForcePlug", OPTV_STRING
, {0}, -1 },
191 { OPTION_SIS6326FSCADJUST
, "SIS6326FSCAdjust", OPTV_INTEGER
, {0}, -1 },
192 { OPTION_USERGBCURSOR
, "UseColorHWCursor", OPTV_BOOLEAN
, {0}, -1 },
193 { OPTION_USERGBCURSORBLEND
, "ColorHWCursorBlending", OPTV_BOOLEAN
, {0}, -1 },
194 { OPTION_USERGBCURSORBLENDTH
, "ColorHWCursorBlendThreshold", OPTV_INTEGER
, {0}, -1 },
195 { OPTION_RESTOREBYSET
, "RestoreBySetMode", OPTV_BOOLEAN
, {0}, -1 },
196 { OPTION_NODDCFORCRT2
, "NoCRT2Detection", OPTV_BOOLEAN
, {0}, -1 },
197 { OPTION_FORCECRT2REDETECTION
, "ForceCRT2ReDetection", OPTV_BOOLEAN
, {0}, -1 },
198 { OPTION_CRT1GAMMA
, "CRT1Gamma", OPTV_BOOLEAN
, {0}, -1 },
199 { OPTION_CRT2GAMMA
, "CRT2Gamma", OPTV_BOOLEAN
, {0}, -1 },
200 { OPTION_XVDEFCONTRAST
, "XvDefaultContrast", OPTV_INTEGER
, {0}, -1 },
201 { OPTION_XVDEFBRIGHTNESS
, "XvDefaultBrightness", OPTV_INTEGER
, {0}, -1 },
202 { OPTION_XVDEFHUE
, "XvDefaultHue", OPTV_INTEGER
, {0}, -1 },
203 { OPTION_XVDEFSATURATION
, "XvDefaultSaturation", OPTV_INTEGER
, {0}, -1 },
204 { OPTION_XVDEFDISABLEGFX
, "XvDefaultDisableGfx", OPTV_BOOLEAN
, {0}, -1 },
205 { OPTION_XVDEFDISABLEGFXLR
, "XvDefaultDisableGfxLR", OPTV_BOOLEAN
, {0}, -1 },
206 { OPTION_XVCHROMAMIN
, "XvChromaMin", OPTV_INTEGER
, {0}, -1 },
207 { OPTION_XVCHROMAMAX
, "XvChromaMax", OPTV_INTEGER
, {0}, -1 },
208 { OPTION_XVUSECHROMAKEY
, "XvUseChromaKey", OPTV_BOOLEAN
, {0}, -1 },
209 { OPTION_XVINSIDECHROMAKEY
, "XvInsideChromaKey", OPTV_BOOLEAN
, {0}, -1 },
210 { OPTION_XVYUVCHROMAKEY
, "XvYUVChromaKey", OPTV_BOOLEAN
, {0}, -1 },
211 { OPTION_XVDISABLECOLORKEY
, "XvDisableColorKey", OPTV_BOOLEAN
, {0}, -1 },
212 { OPTION_XVMEMCPY
, "XvUseMemcpy", OPTV_BOOLEAN
, {0}, -1 },
213 { OPTION_SCALELCD
, "ScaleLCD", OPTV_BOOLEAN
, {0}, -1 },
214 { OPTION_ENABLEHOTKEY
, "EnableHotkey", OPTV_BOOLEAN
, {0}, -1 },
215 { OPTION_SPECIALTIMING
, "SpecialTiming", OPTV_STRING
, {0}, -1 },
216 { OPTION_LVDSHL
, "LVDSHL", OPTV_INTEGER
, {0}, -1 },
217 { OPTION_ENABLESISCTRL
, "EnableSiSCtrl", OPTV_BOOLEAN
, {0}, -1 },
218 { OPTION_STOREDBRIR
, "StoredGammaBrightnessRed", OPTV_INTEGER
, {0}, -1 },
219 { OPTION_STOREDBRIG
, "StoredGammaBrightnessGreen", OPTV_INTEGER
, {0}, -1 },
220 { OPTION_STOREDBRIB
, "StoredGammaBrightnessBlue", OPTV_INTEGER
, {0}, -1 },
221 { OPTION_STOREDPBRIR
, "StoredGammaPreBrightnessRed", OPTV_INTEGER
, {0}, -1 },
222 { OPTION_STOREDPBRIG
, "StoredGammaPreBrightnessGreen", OPTV_INTEGER
, {0}, -1 },
223 { OPTION_STOREDPBRIB
, "StoredGammaPreBrightnessBlue", OPTV_INTEGER
, {0}, -1 },
225 { OPTION_MERGEDFB
, "MergedFB", OPTV_BOOLEAN
, {0}, FALSE
},
226 { OPTION_CRT2HSYNC
, "CRT2HSync", OPTV_ANYSTR
, {0}, FALSE
},
227 { OPTION_CRT2VREFRESH
, "CRT2VRefresh", OPTV_ANYSTR
, {0}, FALSE
},
228 { OPTION_CRT2POS
, "CRT2Position", OPTV_ANYSTR
, {0}, FALSE
},
229 { OPTION_METAMODES
, "MetaModes", OPTV_ANYSTR
, {0}, FALSE
},
230 { OPTION_MERGEDFB2
, "TwinView", OPTV_BOOLEAN
, {0}, FALSE
}, /* alias */
231 { OPTION_CRT2HSYNC2
, "SecondMonitorHorizSync", OPTV_ANYSTR
, {0}, FALSE
}, /* alias */
232 { OPTION_CRT2VREFRESH2
, "SecondMonitorVertRefresh", OPTV_ANYSTR
, {0}, FALSE
}, /* alias */
233 { OPTION_CRT2POS2
, "TwinViewOrientation", OPTV_ANYSTR
, {0}, FALSE
}, /* alias */
235 { OPTION_NOSISXINERAMA
, "NoMergedXinerama", OPTV_BOOLEAN
, {0}, FALSE
},
236 { OPTION_CRT2ISSCRN0
, "MergedXineramaCRT2IsScreen0", OPTV_BOOLEAN
, {0}, FALSE
},
237 { OPTION_NOSISXINERAMA2
, "NoTwinviewXineramaInfo", OPTV_BOOLEAN
, {0}, FALSE
}, /* alias */
243 { -1, NULL
, OPTV_NONE
, {0}, FALSE
}
247 SiSOptions(ScrnInfoPtr pScrn
)
249 SISPtr pSiS
= SISPTR(pScrn
);
253 static const char *mybadparm
= "\"%s\" is is not a valid parameter for option \"%s\"\n";
254 static const char *disabledstr
= "disabled";
255 static const char *enabledstr
= "enabled";
256 static const char *ilrangestr
= "Illegal %s parameter. Valid range is %d through %d\n";
258 /* Collect all of the relevant option flags (fill in pScrn->options) */
259 xf86CollectOptions(pScrn
, NULL
);
261 /* Process the options */
262 if(!(pSiS
->Options
= xalloc(sizeof(SISOptions
))))
265 memcpy(pSiS
->Options
, SISOptions
, sizeof(SISOptions
));
267 xf86ProcessOptions(pScrn
->scrnIndex
, pScrn
->options
, pSiS
->Options
);
271 pSiS
->newFastVram
= -1;
272 pSiS
->NoHostBus
= FALSE
;
273 /* pSiS->UsePCIRetry = TRUE; */
274 pSiS
->TurboQueue
= TRUE
;
276 /* TODO: Option (315 series VRAM command queue) */
277 /* But beware: sisfb does not know about this!!! */
278 pSiS
->cmdQueueSize
= 512*1024;
280 pSiS
->doRender
= TRUE
;
281 pSiS
->HWCursor
= TRUE
;
282 pSiS
->Rotate
= FALSE
;
283 pSiS
->ShadowFB
= FALSE
;
285 pSiS
->NoXvideo
= FALSE
;
287 pSiS
->forceCRT1
= -1;
290 pSiS
->XvOnCRT2
= FALSE
;
293 pSiS
->OptTVStand
= -1;
294 pSiS
->OptROMUsage
= -1;
295 pSiS
->noInternalModes
= FALSE
;
296 pSiS
->OptUseOEM
= -1;
297 pSiS
->OptTVOver
= -1;
298 pSiS
->OptTVSOver
= -1;
299 pSiS
->chtvlumabandwidthcvbs
= -1;
300 pSiS
->chtvlumabandwidthsvideo
= -1;
301 pSiS
->chtvlumaflickerfilter
= -1;
302 pSiS
->chtvchromabandwidth
= -1;
303 pSiS
->chtvchromaflickerfilter
= -1;
304 pSiS
->chtvcvbscolor
= -1;
305 pSiS
->chtvtextenhance
= -1;
306 pSiS
->chtvcontrast
= -1;
307 pSiS
->sistvedgeenhance
= -1;
308 pSiS
->sistvantiflicker
= -1;
309 pSiS
->sistvsaturation
= -1;
310 pSiS
->sistvcfilter
= -1;
311 pSiS
->sistvyfilter
= 1; /* 0 = off, 1 = default, 2-8 = filter no */
312 pSiS
->sistvcolcalibc
= 0;
313 pSiS
->sistvcolcalibf
= 0;
314 pSiS
->sis6326enableyfilter
= -1;
315 pSiS
->sis6326yfilterstrong
= -1;
316 pSiS
->sis6326tvplug
= -1;
317 pSiS
->sis6326fscadjust
= 0;
322 pSiS
->NonDefaultPAL
= -1;
324 pSiS
->restorebyset
= TRUE
;
325 pSiS
->nocrt2ddcdetection
= FALSE
;
326 pSiS
->forcecrt2redetection
= FALSE
;
327 pSiS
->ForceCRT2Type
= CRT2_DEFAULT
;
328 pSiS
->ForceTVType
= -1;
329 pSiS
->CRT1gamma
= TRUE
;
330 pSiS
->CRT2gamma
= TRUE
;
331 pSiS
->enablesisctrl
= FALSE
;
332 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
341 pSiS
->XvDefDisableGfx
= FALSE
;
342 pSiS
->XvDefDisableGfxLR
= FALSE
;
343 pSiS
->UsePanelScaler
= -1;
344 pSiS
->XvUseMemcpy
= TRUE
;
345 pSiS
->XvUseChromaKey
= FALSE
;
346 pSiS
->XvDisableColorKey
= FALSE
;
347 pSiS
->XvInsideChromaKey
= FALSE
;
348 pSiS
->XvYUVChromaKey
= FALSE
;
349 pSiS
->XvChromaMin
= 0x000101fe;
350 pSiS
->XvChromaMax
= 0x000101ff;
351 pSiS
->GammaBriR
= pSiS
->GammaBriG
= pSiS
->GammaBriB
= 1000;
352 pSiS
->GammaPBriR
= pSiS
->GammaPBriG
= pSiS
->GammaPBriB
= 1000;
353 pSiS
->HideHWCursor
= FALSE
;
354 pSiS
->HWCursorIsVisible
= FALSE
;
356 pSiS
->MergedFB
= FALSE
;
357 pSiS
->CRT2Position
= sisRightOf
;
358 pSiS
->CRT2HSync
= NULL
;
359 pSiS
->CRT2VRefresh
= NULL
;
360 pSiS
->MetaModes
= NULL
;
362 pSiS
->UseSiSXinerama
= TRUE
;
363 pSiS
->CRT2IsScrn0
= FALSE
;
370 /* Chipset dependent defaults */
372 if(pSiS
->Chipset
== PCI_CHIP_SIS530
) {
373 /* TW: TQ still broken on 530/620? */
374 pSiS
->TurboQueue
= FALSE
;
377 if(pSiS
->Chipset
== PCI_CHIP_SIS6326
) {
378 pSiS
->newFastVram
= 1;
381 if(pSiS
->sishw_ext
.jChipType
== SIS_315H
||
382 pSiS
->sishw_ext
.jChipType
== SIS_315
) {
383 /* Cursor engine seriously broken */
384 pSiS
->HWCursor
= FALSE
;
387 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
388 pSiS
->OptUseColorCursor
= 0;
390 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
391 pSiS
->OptUseColorCursor
= 0;
392 pSiS
->OptUseColorCursorBlend
= 1;
393 pSiS
->OptColorCursorBlendThreshold
= 0x37000000;
394 } else if(pSiS
->VGAEngine
== SIS_315_VGA
) {
395 pSiS
->OptUseColorCursor
= 1;
398 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
399 pSiS
->AllowHotkey
= 0;
400 } else if(pSiS
->VGAEngine
== SIS_315_VGA
) {
401 pSiS
->AllowHotkey
= 1;
404 /* Collect the options */
407 /* PCI retry - What the heck is/was this for? */
409 if(xf86GetOptValBool(pSiS
->Options
, OPTION_PCI_RETRY
, &pSiS
->UsePCIRetry
)) {
412 xf86DrvMsg(pScrn
->scrnIndex
, from
, "PCI retry %s\n",
413 pSiS
->UsePCIRetry
? enabledstr
: disabledstr
);
417 #if 0 /* This is not used */
418 if(xf86GetOptValFreq(pSiS
->Options
, OPTION_SET_MEMCLOCK
, OPTUNITS_MHZ
,
420 pSiS
->MemClock
= (int)(temp
* 1000.0);
421 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
422 "Memory clock set to %.3f MHz\n", pSiS
->MemClock
/1000.0);
426 /* FastVRAM (5597/5598, 6326 and 530/620 only)
428 if((pSiS
->VGAEngine
== SIS_OLD_VGA
) || (pSiS
->VGAEngine
== SIS_530_VGA
)) {
430 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FAST_VRAM
, &pSiS
->newFastVram
)) {
433 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Fast VRAM %s\n",
434 (pSiS
->newFastVram
== -1) ?
435 ((pSiS
->oldChipset
== OC_SIS620
) ? "enabled (for read only)" :
436 "enabled (for write only)") :
437 (pSiS
->newFastVram
? "enabled (for read and write)" : disabledstr
));
440 /* NoHostBus (5597/5598 only)
442 if((pSiS
->Chipset
== PCI_CHIP_SIS5597
)) {
444 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOHOSTBUS
, &pSiS
->NoHostBus
)) {
447 xf86DrvMsg(pScrn
->scrnIndex
, from
, "SiS5597/5598 VGA-to-CPU host bus %s\n",
448 pSiS
->NoHostBus
? disabledstr
: enabledstr
);
452 * This options limits the amount of video memory X uses for screen
453 * and off-screen buffers. This option should be used if using DRI
454 * is intended. The kernel framebuffer driver required for DRM will
455 * start its memory heap at 12MB if it detects more than 16MB, at 8MB if
456 * between 8 and 16MB are available, otherwise at 4MB. So, if the amount
457 * of memory X uses, a clash between the framebuffer's memory heap
458 * and X is avoided. The amount is to be specified in KB.
460 if(xf86GetOptValULong(pSiS
->Options
, OPTION_MAXXFBMEM
,
462 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
463 "MaxXFBMem: Framebuffer memory shall be limited to %d KB\n",
465 pSiS
->maxxfbmem
*= 1024;
469 * Turns off 2D acceleration
471 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_NOACCEL
, FALSE
)) {
472 pSiS
->NoAccel
= TRUE
;
473 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0)
474 pSiS
->NoXvideo
= TRUE
;
475 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "2D Acceleration and Xv disabled\n");
477 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "2D Acceleration disabled\n");
482 /* RenderAcceleration
483 * En/Disables RENDER acceleration (315/330 series only)
485 if((pSiS
->VGAEngine
== SIS_315_VGA
) && (!pSiS
->NoAccel
)) {
486 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RENDER
, &pSiS
->doRender
)) {
487 if(!pSiS
->doRender
) {
488 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "RENDER Acceleration disabled\n");
495 * Chooses whether to use the hardware or software cursor
498 if(xf86GetOptValBool(pSiS
->Options
, OPTION_HW_CURSOR
, &pSiS
->HWCursor
)) {
501 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_SW_CURSOR
, FALSE
)) {
503 pSiS
->HWCursor
= FALSE
;
504 pSiS
->OptUseColorCursor
= 0;
506 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Using %s cursor\n",
507 pSiS
->HWCursor
? "HW" : "SW");
511 * ColorHWCursorBlending
512 * ColorHWCursorBlendThreshold
514 * Enable/disable color hardware cursors;
515 * enable/disable color hw cursor emulation for 300 series
516 * select emultation transparency threshold for 300 series
519 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,0,0)
521 #ifdef SIS_ARGB_CURSOR
522 if((pSiS
->HWCursor
) && ((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
))) {
524 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USERGBCURSOR
, &pSiS
->OptUseColorCursor
)) {
527 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Color HW cursor is %s\n",
528 pSiS
->OptUseColorCursor
? enabledstr
: disabledstr
);
530 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
532 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USERGBCURSORBLEND
, &pSiS
->OptUseColorCursorBlend
)) {
535 if(pSiS
->OptUseColorCursor
) {
536 xf86DrvMsg(pScrn
->scrnIndex
, from
,
537 "HW cursor color blending emulation is %s\n",
538 (pSiS
->OptUseColorCursorBlend
) ? enabledstr
: disabledstr
);
543 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_USERGBCURSORBLENDTH
, &temp
)) {
544 if((temp
>= 0) && (temp
<= 255)) {
546 pSiS
->OptColorCursorBlendThreshold
= (temp
<< 24);
548 temp
= pSiS
->OptColorCursorBlendThreshold
>> 24;
549 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
550 "Illegal color HW cursor blending threshold, valid range 0-255\n");
553 temp
= pSiS
->OptColorCursorBlendThreshold
>> 24;
555 if(pSiS
->OptUseColorCursor
) {
556 if(pSiS
->OptUseColorCursorBlend
) {
557 xf86DrvMsg(pScrn
->scrnIndex
, from
,
558 "HW cursor color blending emulation threshold is %d\n", temp
);
571 * Enable/disable and configure merged framebuffer mode
576 if(pSiS
->DualHeadMode
) {
578 if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB
, &val
)) {
579 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
580 "Option \"MergedFB\" cannot be used in Dual Head mode\n");
584 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
586 if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB
, &val
)) {
587 if(val
) pSiS
->MergedFB
= TRUE
;
588 } else if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB2
, &val
)) {
589 if(val
) pSiS
->MergedFB
= TRUE
;
593 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2POS
);
595 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2POS2
);
598 if(!xf86NameCmp(strptr
,"LeftOf")) {
599 pSiS
->CRT2Position
= sisLeftOf
;
601 pSiS
->CRT2IsScrn0
= TRUE
;
603 } else if(!xf86NameCmp(strptr
,"RightOf")) {
604 pSiS
->CRT2Position
= sisRightOf
;
606 pSiS
->CRT2IsScrn0
= FALSE
;
608 } else if(!xf86NameCmp(strptr
,"Above")) {
609 pSiS
->CRT2Position
= sisAbove
;
611 pSiS
->CRT2IsScrn0
= FALSE
;
613 } else if(!xf86NameCmp(strptr
,"Below")) {
614 pSiS
->CRT2Position
= sisBelow
;
616 pSiS
->CRT2IsScrn0
= TRUE
;
618 } else if(!xf86NameCmp(strptr
,"Clone")) {
619 pSiS
->CRT2Position
= sisClone
;
621 pSiS
->CRT2IsScrn0
= TRUE
;
624 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "CRT2Position");
625 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
626 "Valid parameters are \"RightOf\", \"LeftOf\", \"Above\", \"Below\", or \"Clone\"\n");
629 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_METAMODES
);
631 pSiS
->MetaModes
= xalloc(strlen(strptr
) + 1);
632 if(pSiS
->MetaModes
) memcpy(pSiS
->MetaModes
, strptr
, strlen(strptr
) + 1);
634 if(pSiS
->MetaModes
) {
635 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2HSYNC
);
637 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2HSYNC2
);
640 pSiS
->CRT2HSync
= xalloc(strlen(strptr
) + 1);
641 if(pSiS
->CRT2HSync
) memcpy(pSiS
->CRT2HSync
, strptr
, strlen(strptr
) + 1);
643 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2VREFRESH
);
645 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2VREFRESH2
);
648 pSiS
->CRT2VRefresh
= xalloc(strlen(strptr
) + 1);
649 if(pSiS
->CRT2VRefresh
) memcpy(pSiS
->CRT2VRefresh
, strptr
, strlen(strptr
) + 1);
652 xf86DrvMsg(pScrn
->scrnIndex
, X_ERROR
,
653 "Option \"MergedFB\" (alias \"TwinView\") requires Option \"MetaModes\".\n");
654 xf86DrvMsg(pScrn
->scrnIndex
, X_ERROR
,
655 "MergedFB (alias TwinView) mode disabled.\n");
656 pSiS
->MergedFB
= FALSE
;
660 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOSISXINERAMA
, &val
)) {
661 if(val
) pSiS
->UseSiSXinerama
= FALSE
;
662 } else if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOSISXINERAMA2
, &val
)) {
663 if(val
) pSiS
->UseSiSXinerama
= FALSE
;
665 if(pSiS
->UseSiSXinerama
) {
666 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2ISSCRN0
, &val
)) {
667 pSiS
->CRT2IsScrn0
= val
? TRUE
: FALSE
;
676 /* Some options can only be specified in the Master Head's Device
677 * section. Here we give the user a hint in the log.
680 if((pSiS
->DualHeadMode
) && (pSiS
->SecondHead
)) {
681 static const char *mystring
= "Option \"%s\" is only accepted in Master Head's device section\n";
684 if(pSiS
->VGAEngine
!= SIS_315_VGA
) {
685 if(xf86GetOptValBool(pSiS
->Options
, OPTION_TURBOQUEUE
, &val
)) {
686 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "TurboQueue");
689 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RESTOREBYSET
, &val
)) {
690 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "RestoreBySetMode");
692 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLEHOTKEY
, &val
)) {
693 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "EnableHotKey");
695 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLESISCTRL
, &val
)) {
696 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "EnableSiSCtrl");
698 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEROMDATA
, &val
)) {
699 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "UseROMData");
701 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEOEM
, &val
)) {
702 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "UseOEMData");
704 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT1
, &val
)) {
705 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT1");
707 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NODDCFORCRT2
, &val
)) {
708 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "NoCRT2Detection");
710 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT2REDETECTION
, &val
)) {
711 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT2ReDetection");
713 if(xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT2TYPE
)) {
714 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT2Type");
716 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SCALELCD
, &val
)) {
717 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ScaleLCD");
719 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_PDC
, &vali
)) {
720 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "PanelDelayCompensation");
722 if(xf86GetOptValString(pSiS
->Options
, OPTION_SPECIALTIMING
)) {
723 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "SpecialTiming");
725 if(xf86GetOptValString(pSiS
->Options
, OPTION_LVDSHL
)) {
726 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "LVDSHL");
728 if(xf86GetOptValString(pSiS
->Options
, OPTION_TVSTANDARD
)) {
729 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "TVStandard");
731 if(xf86GetOptValString(pSiS
->Options
, OPTION_CHTVTYPE
)) {
732 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVType");
734 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVOVERSCAN
, &val
)) {
735 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVOverscan");
737 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVSOVERSCAN
, &val
)) {
738 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVSuperOverscan");
740 if((xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHCVBS
, &vali
)) ||
741 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHSVIDEO
, &vali
)) ||
742 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMAFLICKERFILTER
, &vali
)) ||
743 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMABANDWIDTH
, &vali
)) ||
744 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMAFLICKERFILTER
, &vali
)) ||
745 (xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVCVBSCOLOR
, &val
)) ||
746 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVTEXTENHANCE
, &vali
)) ||
747 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCONTRAST
, &vali
)) ||
748 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVEDGEENHANCE
, &vali
)) ||
749 (xf86GetOptValString(pSiS
->Options
, OPTION_SISTVANTIFLICKER
)) ||
750 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVSATURATION
, &vali
)) ||
751 (xf86GetOptValBool(pSiS
->Options
, OPTION_SISTVCHROMAFILTER
, &val
)) ||
752 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVLUMAFILTER
, &vali
)) ||
753 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBCOARSE
, &vali
)) ||
754 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBFINE
, &vali
)) ||
755 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
, &vali
)) ||
756 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
, &vali
)) ||
757 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXSCALE
, &vali
)) ||
758 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYSCALE
, &vali
))) {
759 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
760 "TV related options are only accepted in Master Head's device section");
762 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT1GAMMA
, &val
)) {
763 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CRT1Gamma");
765 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2GAMMA
, &val
)) {
766 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CRT2Gamma");
768 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVONCRT2
, &val
)) {
769 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "XvOnCRT2");
777 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
780 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Using VRAM command queue, size %dk\n",
781 pSiS
->cmdQueueSize
/ 1024);
783 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Using MMIO command queue, size 512k\n");
791 if(xf86GetOptValBool(pSiS
->Options
, OPTION_TURBOQUEUE
, &pSiS
->TurboQueue
)) {
794 xf86DrvMsg(pScrn
->scrnIndex
, from
, "TurboQueue %s\n",
795 pSiS
->TurboQueue
? enabledstr
: disabledstr
);
798 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
802 /* RestoreBySetMode (300/315/330 series only)
803 * Set this to force the driver to set the old mode instead of restoring
804 * the register contents. This can be used to overcome problems with
805 * LCD panels and video bridges.
807 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RESTOREBYSET
, &val
)) {
808 pSiS
->restorebyset
= val
? TRUE
: FALSE
;
811 /* EnableHotkey (300/315/330 series only)
812 * Enables or disables the BIOS hotkey switch for
813 * switching the output device on laptops.
814 * This key causes a total machine hang on many 300 series
815 * machines, it is therefore by default disabled on such.
816 * In dual head mode, using the hotkey is lethal, so we
817 * forbid it then in any case.
818 * However, although the driver disables the hotkey as
819 * BIOS developers intented to do that, some buggy BIOSes
820 * still cause the machine to freeze. Hence the warning.
825 if(pSiS
->DualHeadMode
) {
826 pSiS
->AllowHotkey
= 0;
830 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLEHOTKEY
, &val
)) {
831 pSiS
->AllowHotkey
= val
? 1 : 0;
833 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Hotkey display switching is %s%s\n",
834 pSiS
->AllowHotkey
? enabledstr
: disabledstr
,
835 flag
? " in dual head mode" : "");
836 if(pSiS
->Chipset
== PCI_CHIP_SIS630
||
837 pSiS
->Chipset
== PCI_CHIP_SIS650
||
838 pSiS
->Chipset
== PCI_CHIP_SIS660
) {
839 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
840 "WARNING: Using the Hotkey might freeze your machine, regardless\n");
841 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
842 "\twhether enabled or disabled. This is no driver bug.\n");
846 /* UseROMData (300/315/330 series only)
847 * This option is enabling/disabling usage of some machine
848 * specific data from the BIOS ROM. This option can - and
849 * should - be used in case the driver makes problems
850 * because SiS changed the location of this data.
852 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEROMDATA
, &val
)) {
853 pSiS
->OptROMUsage
= val
? 1 : 0;
854 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
855 "Video ROM data usage shall be %s\n",
856 val
? enabledstr
: disabledstr
);
859 /* UseOEMData (300/315/330 series only)
860 * The driver contains quite a lot data for OEM LCD panels
861 * and TV connector specifics which override the defaults.
862 * If this data is incorrect, the TV may lose color and
863 * the LCD panel might show some strange effects. Use this
864 * option to disable the usage of this data.
866 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEOEM
, &val
)) {
867 pSiS
->OptUseOEM
= val
? 1 : 0;
868 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
869 "Internal LCD/TV/VGA2 OEM data usage shall be %s\n",
870 val
? enabledstr
: disabledstr
);
873 /* ForceCRT1 (300/315/330 series only)
874 * This option can be used to force CRT1 to be switched on/off. Its
875 * intention is mainly for old monitors that can't be detected
876 * automatically. This is only useful on machines with a video bridge.
877 * In normal cases, this option won't be necessary.
879 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT1
, &val
)) {
880 pSiS
->forceCRT1
= val
? 1 : 0;
881 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
882 "CRT1 shall be forced to %s\n",
886 /* NoCRT2DDCDetection (315/330 series only)
887 * If set to true, this disables CRT2 detection using DDC. This is
888 * to avoid problems with not entirely DDC compiant LCD panels or
889 * VGA monitors connected to the secondary VGA plug. Since LCD and
890 * VGA share the same DDC channel, it might in some cases be impossible
891 * to determine if the device is a CRT monitor or a flat panel.
893 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NODDCFORCRT2
, &val
)) {
894 pSiS
->nocrt2ddcdetection
= val
? TRUE
: FALSE
;
897 /* ForceCRT2ReDetection (315/330 series only)
898 * If set to true, it forces re-detection of the LCD panel and
899 * a secondary VGA connection even if the BIOS already had found
900 * about it. This is meant for custom panels (ie such with
901 * non-standard resolutions) which the BIOS will "detect" according
902 * to the established timings, resulting in only a very vague idea
903 * about the panels real resolution. As for secondary VGA, this
904 * enables us to include a Plasma panel's proprietary modes.
906 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT2REDETECTION
, &val
)) {
908 pSiS
->forcecrt2redetection
= TRUE
;
909 pSiS
->nocrt2ddcdetection
= FALSE
;
910 } else pSiS
->forcecrt2redetection
= FALSE
;
913 /* ForceCRT2Type (300/315/330 series only)
914 * Used for forcing the driver to initialize a given
916 * (SVIDEO, COMPOSITE and SCART for overriding detection)
918 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT2TYPE
);
920 if(!xf86NameCmp(strptr
,"TV"))
921 pSiS
->ForceCRT2Type
= CRT2_TV
;
922 else if(!xf86NameCmp(strptr
,"SVIDEO")) {
923 pSiS
->ForceCRT2Type
= CRT2_TV
;
924 pSiS
->ForceTVType
= TV_SVIDEO
;
925 } else if(!xf86NameCmp(strptr
,"COMPOSITE")) {
926 pSiS
->ForceCRT2Type
= CRT2_TV
;
927 pSiS
->ForceTVType
= TV_AVIDEO
;
928 } else if(!xf86NameCmp(strptr
,"SCART")) {
929 pSiS
->ForceCRT2Type
= CRT2_TV
;
930 pSiS
->ForceTVType
= TV_SCART
;
931 } else if((!xf86NameCmp(strptr
,"LCD")) || (!xf86NameCmp(strptr
,"DVI-D")))
932 pSiS
->ForceCRT2Type
= CRT2_LCD
;
933 else if((!xf86NameCmp(strptr
,"VGA")) || (!xf86NameCmp(strptr
,"DVI-A")))
934 pSiS
->ForceCRT2Type
= CRT2_VGA
;
935 else if(!xf86NameCmp(strptr
,"NONE"))
936 pSiS
->ForceCRT2Type
= 0;
937 else if(pSiS
->Chipset
== PCI_CHIP_SIS550
) {
938 if(!xf86NameCmp(strptr
,"DSTN")) {
939 pSiS
->ForceCRT2Type
= CRT2_LCD
;
941 } else if(!xf86NameCmp(strptr
,"FSTN")) {
942 pSiS
->ForceCRT2Type
= CRT2_LCD
;
946 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "ForceCRT2Type");
947 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
948 "Valid parameters are \"LCD\" (=\"DVI-D\"), \"TV\", \"SVIDEO\", \"COMPOSITE\",\n"
949 "\t\"SCART\", \"VGA\" (=\"DVI-A\") or \"NONE\", on the SiS550 also \"DSTN\"\n"
953 if(pSiS
->ForceCRT2Type
!= CRT2_DEFAULT
)
954 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
955 "CRT2 type shall be %s\n", strptr
);
958 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SPECIALTIMING
);
961 BOOLEAN found
= FALSE
;
962 if(!xf86NameCmp(strptr
,"NONE")) {
963 pSiS
->SiS_Pr
->SiS_CustomT
= CUT_FORCENONE
;
964 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
965 "Special timing disabled\n");
967 while(mycustomttable
[i
].chipID
!= 0) {
968 if(!xf86NameCmp(strptr
,mycustomttable
[i
].optionName
)) {
969 pSiS
->SiS_Pr
->SiS_CustomT
= mycustomttable
[i
].SpecialID
;
971 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
972 "Special timing for %s %s forced\n",
973 mycustomttable
[i
].vendorName
, mycustomttable
[i
].cardName
);
979 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SpecialTiming");
980 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Valid parameters are:\n");
981 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "\t\"NONE\" (to disable special timings)\n");
983 while(mycustomttable
[i
].chipID
!= 0) {
984 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
985 "\t\"%s\" (for %s %s)\n",
986 mycustomttable
[i
].optionName
,
987 mycustomttable
[i
].vendorName
,
988 mycustomttable
[i
].cardName
);
996 /* Allow sisctrl tool to change driver settings */
998 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLESISCTRL
, &val
)) {
999 if(val
) pSiS
->enablesisctrl
= TRUE
;
1002 xf86DrvMsg(pScrn
->scrnIndex
, from
, "SiSCtrl utility interface is %s\n",
1003 pSiS
->enablesisctrl
? enabledstr
: disabledstr
);
1005 /* ScaleLCD (300/315/330 series only)
1006 * Can be used to force the bridge/panel link to [do|not do] the
1007 * scaling of modes lower than the panel's native resolution.
1008 * Setting this to TRUE will force the bridge/panel link
1009 * to scale; FALSE will rely on the panel's capabilities.
1010 * Not supported on all machines.
1012 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SCALELCD
, &val
)) {
1013 pSiS
->UsePanelScaler
= val
? 0 : 1;
1014 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "LCD scaling is %s\n",
1015 pSiS
->UsePanelScaler
? disabledstr
: enabledstr
);
1018 /* PanelDelayCompensation (300/315/330 series only)
1019 * This might be required if the LCD panel shows "small waves".
1020 * The parameter is an integer, (on 300 series usually either
1021 * 4, 32 or 24; on 315 series + LV bridge usually 3 or 51)
1022 * Why this option? Simply because SiS did poor BIOS design.
1023 * The PDC value depends on the very LCD panel used in a
1024 * particular machine. For most panels, the driver is able
1025 * to detect the correct value. However, some panels require
1026 * a different setting. For 300 series, the value given must
1027 * be within the mask 0x3c.
1029 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_PDC
, &pSiS
->PDC
)) {
1030 if((pSiS
->VGAEngine
== SIS_300_VGA
) && (pSiS
->PDC
& ~0x3c)) {
1031 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1032 "Illegal PanelDelayCompensation parameter\n");
1035 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1036 "Panel delay compensation shall be %d\n",
1041 /* LVDSHL (300/315/330 series + 30xLV bridge only)
1042 * This might be required if the LCD panel is too dark.
1043 * The parameter is an integer from 0 to 3.
1045 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_LVDSHL
, &pSiS
->SiS_Pr
->LVDSHL
)) {
1046 if((pSiS
->SiS_Pr
->LVDSHL
< 0) || (pSiS
->SiS_Pr
->LVDSHL
> 3)) {
1047 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1048 "Illegal LVDSHL parameter, valid is 0 through 3\n");
1049 pSiS
->SiS_Pr
->LVDSHL
= -1;
1051 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1052 "LVDSHL will be %d\n",
1053 pSiS
->SiS_Pr
->LVDSHL
);
1060 /* TVStandard (300/315/330 series and 6326 w/ TV only)
1061 * This option is for overriding the autodetection of
1062 * the BIOS/Jumper option for PAL / NTSC
1064 if((pSiS
->VGAEngine
== SIS_300_VGA
) ||
1065 (pSiS
->VGAEngine
== SIS_315_VGA
) ||
1066 ((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
))) {
1067 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_TVSTANDARD
);
1068 if(strptr
!= NULL
) {
1069 if(!xf86NameCmp(strptr
,"PAL"))
1070 pSiS
->OptTVStand
= 1;
1071 else if((!xf86NameCmp(strptr
,"PALM")) ||
1072 (!xf86NameCmp(strptr
,"PAL-M"))) {
1073 pSiS
->OptTVStand
= 1;
1074 pSiS
->NonDefaultPAL
= 1;
1075 } else if((!xf86NameCmp(strptr
,"PALN")) ||
1076 (!xf86NameCmp(strptr
,"PAL-N"))) {
1077 pSiS
->OptTVStand
= 1;
1078 pSiS
->NonDefaultPAL
= 0;
1079 } else if(!xf86NameCmp(strptr
,"NTSC"))
1080 pSiS
->OptTVStand
= 0;
1082 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "TVStandard");
1083 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1084 "Valid parameters are \"PAL\", \"PALM\", \"PALN\" or \"NTSC\"\n");
1087 if(pSiS
->OptTVStand
!= -1) {
1088 static const char *tvstdstr
= "TV standard shall be %s\n";
1089 if(pSiS
->Chipset
== PCI_CHIP_SIS6326
) {
1090 pSiS
->NonDefaultPAL
= -1;
1091 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, tvstdstr
,
1092 pSiS
->OptTVStand
? "PAL" : "NTSC");
1094 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, tvstdstr
,
1096 ( (pSiS
->NonDefaultPAL
== -1) ? "PAL" :
1097 ((pSiS
->NonDefaultPAL
) ? "PALM" : "PALN") )
1104 /* CHTVType (315/330 series only)
1105 * Used for telling the driver if the TV output shall
1106 * be i480 HDTV or SCART.
1108 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1109 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CHTVTYPE
);
1110 if(strptr
!= NULL
) {
1111 if(!xf86NameCmp(strptr
,"SCART"))
1113 else if(!xf86NameCmp(strptr
,"HDTV"))
1116 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "CHTVType");
1117 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1118 "Valid parameters are \"SCART\" or \"HDTV\"\n");
1120 if(pSiS
->chtvtype
!= -1)
1121 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1122 "Chrontel: TV type shall be %s\n", strptr
);
1126 /* CHTVOverscan (300/315/330 series only)
1127 * CHTVSuperOverscan (300/315/330 series only)
1128 * These options are for overriding the BIOS option for
1129 * TV Overscan. Some BIOS don't even have such an option.
1130 * SuperOverscan is only supported with PAL.
1131 * Both options are only effective on machines with a
1132 * CHRONTEL TV encoder. SuperOverscan is only available
1135 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1137 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVOVERSCAN
, &val
)) {
1138 pSiS
->OptTVOver
= val
? 1 : 0;
1139 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1140 "Chrontel: TV overscan shall be %s\n",
1141 val
? enabledstr
: disabledstr
);
1143 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVSOVERSCAN
, &pSiS
->OptTVSOver
)) {
1144 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1145 "Chrontel: TV super overscan shall be %s\n",
1146 pSiS
->OptTVSOver
? enabledstr
: disabledstr
);
1150 /* Various parameters for TV output via SiS bridge, Chrontel or SiS6326
1152 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1154 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHCVBS
,
1155 &pSiS
->chtvlumabandwidthcvbs
);
1156 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHSVIDEO
,
1157 &pSiS
->chtvlumabandwidthsvideo
);
1158 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMAFLICKERFILTER
,
1159 &pSiS
->chtvlumaflickerfilter
);
1160 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMABANDWIDTH
,
1161 &pSiS
->chtvchromabandwidth
);
1162 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMAFLICKERFILTER
,
1163 &pSiS
->chtvchromaflickerfilter
);
1164 xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVCVBSCOLOR
,
1165 &pSiS
->chtvcvbscolor
);
1166 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVTEXTENHANCE
,
1167 &pSiS
->chtvtextenhance
);
1168 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCONTRAST
,
1169 &pSiS
->chtvcontrast
);
1170 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVEDGEENHANCE
,
1171 &pSiS
->sistvedgeenhance
);
1172 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVSATURATION
,
1173 &pSiS
->sistvsaturation
);
1174 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVLUMAFILTER
,
1175 &pSiS
->sistvyfilter
);
1176 if((pSiS
->sistvyfilter
< 0) || (pSiS
->sistvyfilter
> 8)) {
1177 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1178 "Illegal Y Filter number; valid is 0 (off), 1 (default), 2-8 (filter number 1-7)\n");
1179 pSiS
->sistvyfilter
= 1;
1181 xf86GetOptValBool(pSiS
->Options
, OPTION_SISTVCHROMAFILTER
,
1182 &pSiS
->sistvcfilter
);
1183 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBCOARSE
,
1184 &pSiS
->sistvcolcalibc
);
1185 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBFINE
,
1186 &pSiS
->sistvcolcalibf
);
1187 if((pSiS
->sistvcolcalibf
> 127) || (pSiS
->sistvcolcalibf
< -128) ||
1188 (pSiS
->sistvcolcalibc
> 120) || (pSiS
->sistvcolcalibc
< -120)) {
1189 pSiS
->sistvcolcalibf
= pSiS
->sistvcolcalibc
= 0;
1190 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1191 "Illegal Color Calibration. Range is -128 to 127 (fine), -120 to 120 (coarse)\n");
1193 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
,
1195 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
,
1197 if(pSiS
->tvxpos
> 32) { pSiS
->tvxpos
= 32; tmp
= 1; }
1198 if(pSiS
->tvxpos
< -32) { pSiS
->tvxpos
= -32; tmp
= 1; }
1199 if(pSiS
->tvypos
> 32) { pSiS
->tvypos
= 32; tmp
= 1; }
1200 if(pSiS
->tvypos
< -32) { pSiS
->tvypos
= -32; tmp
= 1; }
1201 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1202 "Illegal TV x or y offset. Range is from -32 to 32\n");
1204 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXSCALE
,
1206 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYSCALE
,
1208 if(pSiS
->tvxscale
> 16) { pSiS
->tvxscale
= 16; tmp
= 1; }
1209 if(pSiS
->tvxscale
< -16) { pSiS
->tvxscale
= -16; tmp
= 1; }
1210 if(pSiS
->tvyscale
> 3) { pSiS
->tvyscale
= 3; tmp
= 1; }
1211 if(pSiS
->tvyscale
< -4) { pSiS
->tvyscale
= -4; tmp
= 1; }
1212 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1213 "Illegal TV x or y scaling parameter. Range is from -16 to 16 (X), -4 to 3 (Y)\n");
1216 if((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
)) {
1218 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SIS6326FORCETVPPLUG
);
1220 if(!xf86NameCmp(strptr
,"COMPOSITE"))
1221 pSiS
->sis6326tvplug
= 1;
1222 else if(!xf86NameCmp(strptr
,"SVIDEO"))
1223 pSiS
->sis6326tvplug
= 0;
1225 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SIS6326TVForcePlug");
1226 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1227 "Valid parameters are \"COMPOSITE\" or \"SVIDEO\"\n");
1230 xf86GetOptValBool(pSiS
->Options
, OPTION_SIS6326ENABLEYFILTER
,
1231 &pSiS
->sis6326enableyfilter
);
1232 xf86GetOptValBool(pSiS
->Options
, OPTION_SIS6326YFILTERSTRONG
,
1233 &pSiS
->sis6326yfilterstrong
);
1234 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
,
1236 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
,
1238 if(pSiS
->tvxpos
> 16) { pSiS
->tvxpos
= 16; tmp
= 1; }
1239 if(pSiS
->tvxpos
< -16) { pSiS
->tvxpos
= -16; tmp
= 1; }
1240 if(pSiS
->tvypos
> 16) { pSiS
->tvypos
= 16; tmp
= 1; }
1241 if(pSiS
->tvypos
< -16) { pSiS
->tvypos
= -16; tmp
= 1; }
1242 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1243 "Illegal TV x or y offset. Range is from -16 to 16\n");
1244 xf86GetOptValInteger(pSiS
->Options
, OPTION_SIS6326FSCADJUST
,
1245 &pSiS
->sis6326fscadjust
);
1246 if(pSiS
->sis6326fscadjust
) {
1247 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1248 "Adjusting the default FSC by %d\n",
1249 pSiS
->sis6326fscadjust
);
1253 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
) ||
1254 ((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
))) {
1255 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SISTVANTIFLICKER
);
1257 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SIS6326ANTIFLICKER
);
1260 if(!xf86NameCmp(strptr
,"OFF"))
1261 pSiS
->sistvantiflicker
= 0;
1262 else if(!xf86NameCmp(strptr
,"LOW"))
1263 pSiS
->sistvantiflicker
= 1;
1264 else if(!xf86NameCmp(strptr
,"MED"))
1265 pSiS
->sistvantiflicker
= 2;
1266 else if(!xf86NameCmp(strptr
,"HIGH"))
1267 pSiS
->sistvantiflicker
= 3;
1268 else if(!xf86NameCmp(strptr
,"ADAPTIVE"))
1269 pSiS
->sistvantiflicker
= 4;
1271 pSiS
->sistvantiflicker
= -1;
1272 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SISTVAntiFlicker");
1273 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1274 "Valid parameters are \"OFF\", \"LOW\", \"MED\", \"HIGH\" or \"ADAPTIVE\"\n");
1279 /* CRT1Gamma - disable gamma correction for CRT1
1284 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT1GAMMA
, &val
)) {
1286 pSiS
->CRT1gamma
= val
;
1288 xf86DrvMsg(pScrn
->scrnIndex
, from
, "CRT1 gamma correction is %s\n",
1289 pSiS
->CRT1gamma
? enabledstr
: disabledstr
);
1292 /* CRT2Gamma - disable gamma correction for CRT2
1294 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1296 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2GAMMA
, &val
)) {
1297 pSiS
->CRT2gamma
= val
;
1307 /* VESA - DEPRECATED
1308 * This option is for forcing the driver to use
1309 * the VESA BIOS extension for mode switching.
1314 if(xf86GetOptValBool(pSiS
->Options
, OPTION_VESA
, &val
)) {
1315 pSiS
->VESA
= val
? 1 : 0;
1316 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1317 "VESA: VESA usage shall be %s\n",
1318 val
? enabledstr
: disabledstr
);
1319 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1320 "*** Option \"VESA\" is deprecated. *** \n");
1324 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1326 /* NoInternalModes (300/315/330 series only)
1327 * Since the mode switching code for these chipsets is a
1328 * Asm-to-C translation of BIOS code, we only have timings
1329 * for a pre-defined number of modes. The default behavior
1330 * is to replace XFree's default modes with a mode list
1331 * generated out of the known and supported modes. Use
1332 * this option to disable this. NOT RECOMMENDED.
1335 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOINTERNALMODES
, &pSiS
->noInternalModes
))
1337 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Usage of built-in modes is %s\n",
1338 pSiS
->noInternalModes
? disabledstr
: enabledstr
);
1343 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SHADOW_FB
, &pSiS
->ShadowFB
)) {
1345 if(pSiS
->MergedFB
) {
1346 pSiS
->ShadowFB
= FALSE
;
1347 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1348 "Shadow Frame Buffer not supported in MergedFB mode\n");
1353 if(pSiS
->ShadowFB
) {
1354 pSiS
->NoAccel
= TRUE
;
1355 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0)
1356 pSiS
->NoXvideo
= TRUE
;
1357 xf86DrvMsg(pScrn
->scrnIndex
, from
,
1358 "Using \"Shadow Frame Buffer\" - 2D acceleration and Xv disabled\n");
1360 xf86DrvMsg(pScrn
->scrnIndex
, from
,
1361 "Using \"Shadow Frame Buffer\" - 2D acceleration disabled\n");
1366 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_ROTATE
))) {
1368 if(pSiS
->MergedFB
) {
1369 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1370 "Screen rotation not supported in MergedFB mode\n");
1373 if(!xf86NameCmp(strptr
, "CW")) {
1375 } else if(!xf86NameCmp(strptr
, "CCW")) {
1378 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "Rotate");
1379 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1380 "Valid parameters are \"CW\" or \"CCW\"\n");
1384 pSiS
->ShadowFB
= TRUE
;
1385 pSiS
->NoAccel
= TRUE
;
1386 pSiS
->HWCursor
= FALSE
;
1387 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0)
1388 pSiS
->NoXvideo
= TRUE
;
1389 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1390 "Rotating screen %sclockwise; (2D acceleration and Xv disabled)\n",
1391 (pSiS
->Rotate
== -1) ? "counter " : "");
1393 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1394 "Rotating screen %sclockwise (2D acceleration %sdisabled)\n",
1395 (pSiS
->Rotate
== -1) ? "counter " : "",
1396 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0)
1397 "and RandR extension "
1409 * Set this to TRUE to disable Xv hardware video acceleration
1411 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,3,99,0,0)
1412 if((!pSiS
->NoAccel
) && (!pSiS
->NoXvideo
)) {
1414 if(!pSiS
->NoXvideo
) {
1416 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_NOXVIDEO
, FALSE
)) {
1417 pSiS
->NoXvideo
= TRUE
;
1418 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "XVideo extension disabled\n");
1421 if(!pSiS
->NoXvideo
) {
1425 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1427 * On chipsets with only one overlay (315, 650, 740, 330), the user can
1428 * choose to display the overlay on CRT1 or CRT2. By setting this
1429 * option to TRUE, the overlay will be displayed on CRT2. The
1430 * default is: CRT1 if only CRT1 available, CRT2 if only CRT2
1431 * available, and CRT1 if both is available and detected.
1432 * Since implementation of the XV_SWITCHCRT Xv property this only
1433 * selects the default CRT.
1435 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVONCRT2
, &val
)) {
1436 pSiS
->XvOnCRT2
= val
? TRUE
: FALSE
;
1440 if((pSiS
->VGAEngine
== SIS_OLD_VGA
) || (pSiS
->VGAEngine
== SIS_530_VGA
)) {
1441 /* NoYV12 (for 5597/5598, 6326 and 530/620 only)
1442 * YV12 has problems with videos larger than 384x288. So
1443 * allow the user to disable YV12 support to force the
1444 * application to use YUV2 instead.
1446 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOYV12
, &val
)) {
1447 pSiS
->NoYV12
= val
? 1 : 0;
1448 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1449 "Xv YV12/I420 support is %s\n",
1450 pSiS
->NoYV12
? disabledstr
: enabledstr
);
1454 /* Some Xv properties' defaults can be set by options */
1455 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFCONTRAST
, &tmp
)) {
1456 if((tmp
>= 0) && (tmp
<= 7)) pSiS
->XvDefCon
= tmp
;
1457 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1458 "XvDefaultContrast" ,0, 7);
1460 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFBRIGHTNESS
, &tmp
)) {
1461 if((tmp
>= -128) && (tmp
<= 127)) pSiS
->XvDefBri
= tmp
;
1462 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1463 "XvDefaultBrightness", -128, 127);
1465 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1466 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFHUE
, &tmp
)) {
1467 if((tmp
>= -8) && (tmp
<= 7)) pSiS
->XvDefHue
= tmp
;
1468 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1469 "XvDefaultHue", -8, 7);
1471 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFSATURATION
, &tmp
)) {
1472 if((tmp
>= -7) && (tmp
<= 7)) pSiS
->XvDefSat
= tmp
;
1473 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1474 "XvDefaultSaturation", -7, 7);
1477 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDEFDISABLEGFX
, &val
)) {
1478 if(val
) pSiS
->XvDefDisableGfx
= TRUE
;
1479 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1480 "Graphics display will be %s during Xv usage\n",
1481 val
? disabledstr
: enabledstr
);
1483 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1484 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDEFDISABLEGFXLR
, &val
)) {
1485 if(val
) pSiS
->XvDefDisableGfxLR
= TRUE
;
1486 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1487 "Graphics display left/right of overlay will be %s during Xv usage\n",
1488 val
? disabledstr
: enabledstr
);
1490 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDISABLECOLORKEY
, &val
)) {
1491 if(val
) pSiS
->XvDisableColorKey
= TRUE
;
1492 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1493 "Xv Color key is %s\n",
1494 val
? disabledstr
: enabledstr
);
1496 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVUSECHROMAKEY
, &val
)) {
1497 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1498 "Xv Chroma-keying is %s\n",
1499 val
? enabledstr
: disabledstr
);
1500 if(val
) pSiS
->XvUseChromaKey
= TRUE
;
1502 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVINSIDECHROMAKEY
, &val
)) {
1503 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1504 "Xv: Video is transparent if %s chroma key range\n",
1505 val
? "inside" : "outside");
1506 if(val
) pSiS
->XvInsideChromaKey
= TRUE
;
1508 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
1509 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVYUVCHROMAKEY
, &val
)) {
1510 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1511 "Xv: Chroma key is in %s format\n",
1512 val
? "YUV" : "RGB");
1513 if(val
) pSiS
->XvYUVChromaKey
= TRUE
;
1516 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1517 "Xv: Chroma key is of same format as video source\n");
1519 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVCHROMAMIN
, &tmp
)) {
1520 if((tmp
>= 0) && (tmp
<= 0xffffff)) pSiS
->XvChromaMin
= tmp
;
1521 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1522 "XvChromaMin", 0, 0xffffff);
1524 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVCHROMAMAX
, &tmp
)) {
1525 if((tmp
>= 0) && (tmp
<= 0xffffff)) pSiS
->XvChromaMax
= tmp
;
1526 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1527 "XvChromaMax", 0, 0xffffff);
1530 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVMEMCPY
, &val
)) {
1531 pSiS
->XvUseMemcpy
= val
? TRUE
: FALSE
;
1532 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "Xv will %suse memcpy()\n",
1538 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1540 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDBRIR
, &tmp
)) {
1541 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaBriR
= tmp
;
1542 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1543 "StoredGammaBrightnessRed", 100, 10000);
1545 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDBRIG
, &tmp
)) {
1546 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaBriG
= tmp
;
1547 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1548 "StoredGammaBrightnessGreen", 100, 10000);
1550 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDBRIB
, &tmp
)) {
1551 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaBriB
= tmp
;
1552 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1553 "StoredGammaBrightnessBlue", 100, 10000);
1555 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDPBRIR
, &tmp
)) {
1556 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaPBriR
= tmp
;
1557 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1558 "StoredGammaPreBrightnessRed", 100, 10000);
1560 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDPBRIG
, &tmp
)) {
1561 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaPBriG
= tmp
;
1562 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1563 "StoredGammaPreBrightnessGreen", 100, 10000);
1565 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_STOREDPBRIB
, &tmp
)) {
1566 if((tmp
>= 100) && (tmp
<= 10000)) pSiS
->GammaPBriB
= tmp
;
1567 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1568 "StoredGammaPreBrightnessBlue", 100, 10000);
1574 const OptionInfoRec
*
1575 SISAvailableOptions(int chipid
, int busid
)