2 /* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.5 2004/07/26 22:40:56 twini Exp $ */
4 * SiS driver option evaluation
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) The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * Authors: Thomas Winischhofer <thomas@winischhofer.net>
35 #include "xf86PciInfo.h"
37 #include "xf86Cursor.h"
41 extern const customttable mycustomttable
[];
51 OPTION_FORCE_CRT1TYPE
,
52 OPTION_FORCE_CRT2TYPE
,
71 OPTION_NOINTERNALMODES
,
76 OPTION_CHTVLUMABANDWIDTHCVBS
,
77 OPTION_CHTVLUMABANDWIDTHSVIDEO
,
78 OPTION_CHTVLUMAFLICKERFILTER
,
79 OPTION_CHTVCHROMABANDWIDTH
,
80 OPTION_CHTVCHROMAFLICKERFILTER
,
82 OPTION_CHTVTEXTENHANCE
,
84 OPTION_SISTVEDGEENHANCE
,
85 OPTION_SISTVANTIFLICKER
,
86 OPTION_SISTVSATURATION
,
87 OPTION_SISTVCHROMAFILTER
,
88 OPTION_SISTVLUMAFILTER
,
89 OPTION_SISTVCOLCALIBFINE
,
90 OPTION_SISTVCOLCALIBCOARSE
,
95 OPTION_SIS6326ANTIFLICKER
,
96 OPTION_SIS6326ENABLEYFILTER
,
97 OPTION_SIS6326YFILTERSTRONG
,
98 OPTION_SIS6326FORCETVPPLUG
,
99 OPTION_SIS6326FSCADJUST
,
102 OPTION_USERGBCURSORBLEND
,
103 OPTION_USERGBCURSORBLENDTH
,
106 OPTION_FORCECRT2REDETECTION
,
111 OPTION_XVDEFCONTRAST
,
112 OPTION_XVDEFBRIGHTNESS
,
114 OPTION_XVDEFSATURATION
,
115 OPTION_XVDEFDISABLEGFX
,
116 OPTION_XVDEFDISABLEGFXLR
,
118 OPTION_XVUSECHROMAKEY
,
121 OPTION_XVDISABLECOLORKEY
,
122 OPTION_XVINSIDECHROMAKEY
,
123 OPTION_XVYUVCHROMAKEY
,
124 OPTION_XVDEFAULTADAPTOR
,
127 OPTION_SPECIALTIMING
,
138 OPTION_CRT2VREFRESH2
,
140 OPTION_NOSISXINERAMA
,
141 OPTION_NOSISXINERAMA2
,
144 OPTION_ENABLESISCTRL
,
147 OPTION_OVERRULERANGES
,
154 static const OptionInfoRec SISOptions
[] = {
155 { OPTION_SW_CURSOR
, "SWcursor", OPTV_BOOLEAN
, {0}, FALSE
},
156 { OPTION_HW_CURSOR
, "HWcursor", OPTV_BOOLEAN
, {0}, FALSE
},
157 { OPTION_NOACCEL
, "NoAccel", OPTV_BOOLEAN
, {0}, FALSE
},
158 { OPTION_TURBOQUEUE
, "TurboQueue", OPTV_BOOLEAN
, {0}, FALSE
},
159 { OPTION_FAST_VRAM
, "FastVram", OPTV_BOOLEAN
, {0}, FALSE
},
160 { OPTION_NOHOSTBUS
, "NoHostBus", OPTV_BOOLEAN
, {0}, FALSE
},
161 { OPTION_RENDER
, "RenderAcceleration", OPTV_BOOLEAN
, {0}, FALSE
},
162 { OPTION_FORCE_CRT1TYPE
, "ForceCRT1Type", OPTV_STRING
, {0}, FALSE
},
163 { OPTION_FORCE_CRT2TYPE
, "ForceCRT2Type", OPTV_STRING
, {0}, FALSE
},
164 { OPTION_YPBPRAR
, "YPbPrAspectRatio", OPTV_STRING
, {0}, FALSE
},
165 { OPTION_SHADOW_FB
, "ShadowFB", OPTV_BOOLEAN
, {0}, FALSE
},
166 { OPTION_DRI
, "DRI", OPTV_BOOLEAN
, {0}, FALSE
},
167 { OPTION_AGP_SIZE
, "AGPSize", OPTV_INTEGER
, {0}, FALSE
},
168 { OPTION_AGP_SIZE2
, "GARTSize", OPTV_INTEGER
, {0}, FALSE
},
169 { OPTION_ROTATE
, "Rotate", OPTV_STRING
, {0}, FALSE
},
170 { OPTION_NOXVIDEO
, "NoXvideo", OPTV_BOOLEAN
, {0}, FALSE
},
171 { OPTION_VESA
, "Vesa", OPTV_BOOLEAN
, {0}, FALSE
},
172 { OPTION_MAXXFBMEM
, "MaxXFBMem", OPTV_INTEGER
, {0}, -1 },
173 { OPTION_FORCECRT1
, "ForceCRT1", OPTV_BOOLEAN
, {0}, FALSE
},
174 { OPTION_XVONCRT2
, "XvOnCRT2", OPTV_BOOLEAN
, {0}, FALSE
},
175 { OPTION_PDC
, "PanelDelayCompensation", OPTV_INTEGER
, {0}, -1 },
176 { OPTION_PDCA
, "PanelDelayCompensation1",OPTV_INTEGER
, {0}, -1 },
177 { OPTION_PDCS
, "PDC", OPTV_INTEGER
, {0}, -1 },
178 { OPTION_PDCAS
, "PDC1", OPTV_INTEGER
, {0}, -1 },
179 { OPTION_EMI
, "EMI", OPTV_INTEGER
, {0}, -1 },
180 { OPTION_LVDSHL
, "LVDSHL", OPTV_INTEGER
, {0}, -1 },
181 { OPTION_SPECIALTIMING
, "SpecialTiming", OPTV_STRING
, {0}, -1 },
182 { OPTION_TVSTANDARD
, "TVStandard", OPTV_STRING
, {0}, -1 },
183 { OPTION_USEROMDATA
, "UseROMData", OPTV_BOOLEAN
, {0}, -1 },
184 { OPTION_NOINTERNALMODES
, "NoInternalModes", OPTV_BOOLEAN
, {0}, FALSE
},
185 { OPTION_USEOEM
, "UseOEMData", OPTV_BOOLEAN
, {0}, -1 },
186 { OPTION_NOYV12
, "NoYV12", OPTV_BOOLEAN
, {0}, -1 },
187 { OPTION_CHTVTYPE
, "CHTVType", OPTV_BOOLEAN
, {0}, -1 },
188 { OPTION_CHTVOVERSCAN
, "CHTVOverscan", OPTV_BOOLEAN
, {0}, -1 },
189 { OPTION_CHTVSOVERSCAN
, "CHTVSuperOverscan", OPTV_BOOLEAN
, {0}, -1 },
190 { OPTION_CHTVLUMABANDWIDTHCVBS
, "CHTVLumaBandwidthCVBS", OPTV_INTEGER
, {0}, -1 },
191 { OPTION_CHTVLUMABANDWIDTHSVIDEO
, "CHTVLumaBandwidthSVIDEO",OPTV_INTEGER
, {0}, -1 },
192 { OPTION_CHTVLUMAFLICKERFILTER
, "CHTVLumaFlickerFilter", OPTV_INTEGER
, {0}, -1 },
193 { OPTION_CHTVCHROMABANDWIDTH
, "CHTVChromaBandwidth", OPTV_INTEGER
, {0}, -1 },
194 { OPTION_CHTVCHROMAFLICKERFILTER
, "CHTVChromaFlickerFilter",OPTV_INTEGER
, {0}, -1 },
195 { OPTION_CHTVCVBSCOLOR
, "CHTVCVBSColor", OPTV_BOOLEAN
, {0}, -1 },
196 { OPTION_CHTVTEXTENHANCE
, "CHTVTextEnhance", OPTV_INTEGER
, {0}, -1 },
197 { OPTION_CHTVCONTRAST
, "CHTVContrast", OPTV_INTEGER
, {0}, -1 },
198 { OPTION_SISTVEDGEENHANCE
, "SISTVEdgeEnhance", OPTV_INTEGER
, {0}, -1 },
199 { OPTION_SISTVANTIFLICKER
, "SISTVAntiFlicker", OPTV_STRING
, {0}, FALSE
},
200 { OPTION_SISTVSATURATION
, "SISTVSaturation", OPTV_INTEGER
, {0}, -1 },
201 { OPTION_SISTVCHROMAFILTER
, "SISTVCFilter", OPTV_BOOLEAN
, {0}, -1 },
202 { OPTION_SISTVLUMAFILTER
, "SISTVYFilter", OPTV_INTEGER
, {0}, -1 },
203 { OPTION_SISTVCOLCALIBFINE
, "SISTVColorCalibFine", OPTV_INTEGER
, {0}, -1 },
204 { OPTION_SISTVCOLCALIBCOARSE
, "SISTVColorCalibCoarse", OPTV_INTEGER
, {0}, -1 },
205 { OPTION_TVXSCALE
, "SISTVXScale", OPTV_INTEGER
, {0}, -1 },
206 { OPTION_TVYSCALE
, "SISTVYScale", OPTV_INTEGER
, {0}, -1 },
207 { OPTION_TVXPOSOFFSET
, "TVXPosOffset", OPTV_INTEGER
, {0}, -1 },
208 { OPTION_TVYPOSOFFSET
, "TVYPosOffset", OPTV_INTEGER
, {0}, -1 },
209 { OPTION_SIS6326ANTIFLICKER
, "SIS6326TVAntiFlicker", OPTV_STRING
, {0}, FALSE
},
210 { OPTION_SIS6326ENABLEYFILTER
, "SIS6326TVEnableYFilter", OPTV_BOOLEAN
, {0}, -1 },
211 { OPTION_SIS6326YFILTERSTRONG
, "SIS6326TVYFilterStrong", OPTV_BOOLEAN
, {0}, -1 },
212 { OPTION_SIS6326FORCETVPPLUG
, "SIS6326TVForcePlug", OPTV_STRING
, {0}, -1 },
213 { OPTION_SIS6326FSCADJUST
, "SIS6326FSCAdjust", OPTV_INTEGER
, {0}, -1 },
214 { OPTION_USERGBCURSOR
, "UseColorHWCursor", OPTV_BOOLEAN
, {0}, -1 },
215 { OPTION_USERGBCURSORBLEND
, "ColorHWCursorBlending", OPTV_BOOLEAN
, {0}, -1 },
216 { OPTION_USERGBCURSORBLENDTH
, "ColorHWCursorBlendThreshold", OPTV_INTEGER
,{0},-1 },
217 { OPTION_RESTOREBYSET
, "RestoreBySetMode", OPTV_BOOLEAN
, {0}, -1 },
218 { OPTION_NODDCFORCRT2
, "NoCRT2Detection", OPTV_BOOLEAN
, {0}, -1 },
219 { OPTION_FORCECRT2REDETECTION
, "ForceCRT2ReDetection", OPTV_BOOLEAN
, {0}, -1 },
220 { OPTION_SENSEYPBPR
, "SenseYPbPr", OPTV_BOOLEAN
, {0}, -1 },
221 { OPTION_CRT1GAMMA
, "CRT1Gamma", OPTV_BOOLEAN
, {0}, -1 },
222 { OPTION_CRT2GAMMA
, "CRT2Gamma", OPTV_BOOLEAN
, {0}, -1 },
223 { OPTION_STOREDBRI
, "StoredGammaBrightness", OPTV_STRING
, {0}, -1 },
224 { OPTION_STOREDPBRI
, "StoredGammaPreBrightness",OPTV_STRING
, {0}, -1 },
225 { OPTION_XVGAMMA
, "XvGamma", OPTV_STRING
, {0}, -1 },
226 { OPTION_XVDEFCONTRAST
, "XvDefaultContrast", OPTV_INTEGER
, {0}, -1 },
227 { OPTION_XVDEFBRIGHTNESS
, "XvDefaultBrightness", OPTV_INTEGER
, {0}, -1 },
228 { OPTION_XVDEFHUE
, "XvDefaultHue", OPTV_INTEGER
, {0}, -1 },
229 { OPTION_XVDEFSATURATION
, "XvDefaultSaturation", OPTV_INTEGER
, {0}, -1 },
230 { OPTION_XVDEFDISABLEGFX
, "XvDefaultDisableGfx", OPTV_BOOLEAN
, {0}, -1 },
231 { OPTION_XVDEFDISABLEGFXLR
, "XvDefaultDisableGfxLR", OPTV_BOOLEAN
, {0}, -1 },
232 { OPTION_XVCHROMAMIN
, "XvChromaMin", OPTV_INTEGER
, {0}, -1 },
233 { OPTION_XVCHROMAMAX
, "XvChromaMax", OPTV_INTEGER
, {0}, -1 },
234 { OPTION_XVUSECHROMAKEY
, "XvUseChromaKey", OPTV_BOOLEAN
, {0}, -1 },
235 { OPTION_XVINSIDECHROMAKEY
, "XvInsideChromaKey", OPTV_BOOLEAN
, {0}, -1 },
236 { OPTION_XVYUVCHROMAKEY
, "XvYUVChromaKey", OPTV_BOOLEAN
, {0}, -1 },
237 { OPTION_XVDISABLECOLORKEY
, "XvDisableColorKey", OPTV_BOOLEAN
, {0}, -1 },
238 { OPTION_XVMEMCPY
, "XvUseMemcpy", OPTV_BOOLEAN
, {0}, -1 },
239 { OPTION_XVDEFAULTADAPTOR
, "XvDefaultAdaptor", OPTV_STRING
, {0}, -1 },
240 { OPTION_SCALELCD
, "ScaleLCD", OPTV_BOOLEAN
, {0}, -1 },
241 { OPTION_CENTERLCD
, "CenterLCD", OPTV_BOOLEAN
, {0}, -1 },
242 { OPTION_ENABLEHOTKEY
, "EnableHotkey", OPTV_BOOLEAN
, {0}, -1 },
243 { OPTION_ENABLESISCTRL
, "EnableSiSCtrl", OPTV_BOOLEAN
, {0}, -1 },
244 { OPTION_OVERRULERANGES
, "OverruleFrequencyRanges",OPTV_BOOLEAN
, {0}, -1 },
246 { OPTION_MERGEDFB
, "MergedFB", OPTV_BOOLEAN
, {0}, FALSE
},
247 { OPTION_MERGEDFB2
, "TwinView", OPTV_BOOLEAN
, {0}, FALSE
}, /* alias */
248 { OPTION_MERGEDFBAUTO
, "MergedFBAuto", OPTV_BOOLEAN
, {0}, FALSE
},
249 { OPTION_CRT2HSYNC
, "CRT2HSync", OPTV_STRING
, {0}, FALSE
},
250 { OPTION_CRT2HSYNC2
, "SecondMonitorHorizSync", OPTV_STRING
, {0}, FALSE
}, /* alias */
251 { OPTION_CRT2VREFRESH
, "CRT2VRefresh", OPTV_STRING
, {0}, FALSE
},
252 { OPTION_CRT2VREFRESH2
, "SecondMonitorVertRefresh", OPTV_STRING
, {0}, FALSE
}, /* alias */
253 { OPTION_CRT2POS
, "CRT2Position", OPTV_STRING
, {0}, FALSE
},
254 { OPTION_CRT2POS2
, "TwinViewOrientation", OPTV_STRING
, {0}, FALSE
}, /* alias */
255 { OPTION_METAMODES
, "MetaModes", OPTV_STRING
, {0}, FALSE
},
256 { OPTION_MERGEDDPI
, "MergedDPI", OPTV_STRING
, {0}, FALSE
},
258 { OPTION_NOSISXINERAMA
, "NoMergedXinerama", OPTV_BOOLEAN
, {0}, FALSE
},
259 { OPTION_NOSISXINERAMA2
, "NoTwinviewXineramaInfo", OPTV_BOOLEAN
, {0}, FALSE
}, /* alias */
260 { OPTION_CRT2ISSCRN0
, "MergedXineramaCRT2IsScreen0",OPTV_BOOLEAN
,{0},FALSE
},
266 { -1, NULL
, OPTV_NONE
, {0}, FALSE
}
270 SiSOptions(ScrnInfoPtr pScrn
)
272 SISPtr pSiS
= SISPTR(pScrn
);
275 static const char *mybadparm
= "\"%s\" is is not a valid parameter for option \"%s\"\n";
276 static const char *disabledstr
= "disabled";
277 static const char *enabledstr
= "enabled";
278 static const char *ilrangestr
= "Illegal %s parameter. Valid range is %d through %d\n";
280 /* Collect all of the relevant option flags (fill in pScrn->options) */
281 xf86CollectOptions(pScrn
, NULL
);
283 /* Process the options */
284 if(!(pSiS
->Options
= xalloc(sizeof(SISOptions
)))) return;
286 memcpy(pSiS
->Options
, SISOptions
, sizeof(SISOptions
));
288 xf86ProcessOptions(pScrn
->scrnIndex
, pScrn
->options
, pSiS
->Options
);
292 pSiS
->newFastVram
= -1;
293 pSiS
->NoHostBus
= FALSE
;
294 pSiS
->TurboQueue
= TRUE
;
296 /* TODO: Option (315 series VRAM command queue) */
297 /* But beware: sisfb does not know about this!!! */
298 pSiS
->cmdQueueSize
= 512*1024;
300 pSiS
->doRender
= TRUE
;
301 pSiS
->HWCursor
= TRUE
;
302 pSiS
->Rotate
= FALSE
;
303 pSiS
->ShadowFB
= FALSE
;
304 pSiS
->loadDRI
= FALSE
;
305 pSiS
->agpWantedPages
= AGP_PAGES
;
307 pSiS
->NoXvideo
= FALSE
;
309 pSiS
->forceCRT1
= -1;
312 pSiS
->XvOnCRT2
= FALSE
;
317 pSiS
->OptTVStand
= -1;
318 pSiS
->OptROMUsage
= -1;
319 pSiS
->noInternalModes
= FALSE
;
320 pSiS
->OptUseOEM
= -1;
321 pSiS
->OptTVOver
= -1;
322 pSiS
->OptTVSOver
= -1;
323 pSiS
->chtvlumabandwidthcvbs
= -1;
324 pSiS
->chtvlumabandwidthsvideo
= -1;
325 pSiS
->chtvlumaflickerfilter
= -1;
326 pSiS
->chtvchromabandwidth
= -1;
327 pSiS
->chtvchromaflickerfilter
= -1;
328 pSiS
->chtvcvbscolor
= -1;
329 pSiS
->chtvtextenhance
= -1;
330 pSiS
->chtvcontrast
= -1;
331 pSiS
->sistvedgeenhance
= -1;
332 pSiS
->sistvantiflicker
= -1;
333 pSiS
->sistvsaturation
= -1;
334 pSiS
->sistvcfilter
= -1;
335 pSiS
->sistvyfilter
= 1; /* 0 = off, 1 = default, 2-8 = filter no */
336 pSiS
->sistvcolcalibc
= 0;
337 pSiS
->sistvcolcalibf
= 0;
338 pSiS
->sis6326enableyfilter
= -1;
339 pSiS
->sis6326yfilterstrong
= -1;
340 pSiS
->sis6326tvplug
= -1;
341 pSiS
->sis6326fscadjust
= 0;
346 pSiS
->NonDefaultPAL
= pSiS
->NonDefaultNTSC
= -1;
348 pSiS
->restorebyset
= TRUE
;
349 pSiS
->nocrt2ddcdetection
= FALSE
;
350 pSiS
->forcecrt2redetection
= TRUE
; /* default changed since 13/09/2003 */
351 pSiS
->SenseYPbPr
= TRUE
;
352 pSiS
->ForceCRT1Type
= CRT1_VGA
;
353 pSiS
->ForceCRT2Type
= CRT2_DEFAULT
;
354 pSiS
->ForceYPbPrAR
= TV_YPBPR169
;
355 pSiS
->ForceTVType
= -1;
356 pSiS
->CRT1gamma
= TRUE
;
357 pSiS
->CRT1gammaGiven
= FALSE
;
358 pSiS
->CRT2gamma
= TRUE
;
359 pSiS
->XvGamma
= FALSE
;
360 pSiS
->XvGammaGiven
= FALSE
;
361 pSiS
->enablesisctrl
= FALSE
;
362 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
371 pSiS
->XvDefDisableGfx
= FALSE
;
372 pSiS
->XvDefDisableGfxLR
= FALSE
;
373 pSiS
->XvDefAdaptorBlit
= FALSE
;
374 pSiS
->UsePanelScaler
= -1;
375 pSiS
->CenterLCD
= -1;
376 pSiS
->XvUseMemcpy
= TRUE
;
377 pSiS
->XvUseChromaKey
= FALSE
;
378 pSiS
->XvDisableColorKey
= FALSE
;
379 pSiS
->XvInsideChromaKey
= FALSE
;
380 pSiS
->XvYUVChromaKey
= FALSE
;
381 pSiS
->XvChromaMin
= 0x000101fe;
382 pSiS
->XvChromaMax
= 0x000101ff;
383 pSiS
->XvGammaRed
= pSiS
->XvGammaGreen
= pSiS
->XvGammaBlue
=
384 pSiS
->XvGammaRedDef
= pSiS
->XvGammaGreenDef
= pSiS
->XvGammaBlueDef
= 1000;
385 pSiS
->GammaBriR
= pSiS
->GammaBriG
= pSiS
->GammaBriB
= 1000;
386 pSiS
->GammaPBriR
= pSiS
->GammaPBriG
= pSiS
->GammaPBriB
= 1000;
387 pSiS
->HideHWCursor
= FALSE
;
388 pSiS
->HWCursorIsVisible
= FALSE
;
389 pSiS
->OverruleRanges
= TRUE
;
391 pSiS
->MergedFB
= pSiS
->MergedFBAuto
= FALSE
;
392 pSiS
->CRT2Position
= sisRightOf
;
393 pSiS
->CRT2HSync
= NULL
;
394 pSiS
->CRT2VRefresh
= NULL
;
395 pSiS
->MetaModes
= NULL
;
396 pSiS
->MergedFBXDPI
= pSiS
->MergedFBYDPI
= 0;
398 pSiS
->UseSiSXinerama
= TRUE
;
399 pSiS
->CRT2IsScrn0
= FALSE
;
406 /* Chipset dependent defaults */
408 if(pSiS
->Chipset
== PCI_CHIP_SIS530
) {
409 /* TQ still broken on 530/620? */
410 pSiS
->TurboQueue
= FALSE
;
413 if(pSiS
->Chipset
== PCI_CHIP_SIS6326
) {
414 pSiS
->newFastVram
= 1;
417 if(pSiS
->sishw_ext
.jChipType
== SIS_315H
||
418 pSiS
->sishw_ext
.jChipType
== SIS_315
) {
419 /* Cursor engine seriously broken */
420 pSiS
->HWCursor
= FALSE
;
423 /* DRI only supported on 300 series,
424 * so don't load DRI by default on
427 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
428 pSiS
->loadDRI
= TRUE
;
431 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
432 pSiS
->OptUseColorCursor
= 0;
434 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
435 pSiS
->OptUseColorCursor
= 0;
436 pSiS
->OptUseColorCursorBlend
= 1;
437 pSiS
->OptColorCursorBlendThreshold
= 0x37000000;
438 } else if(pSiS
->VGAEngine
== SIS_315_VGA
) {
439 pSiS
->OptUseColorCursor
= 1;
443 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
444 pSiS
->AllowHotkey
= 0;
445 } else if(pSiS
->VGAEngine
== SIS_315_VGA
) {
446 pSiS
->AllowHotkey
= 1;
449 /* Collect the options */
451 /* FastVRAM (5597/5598, 6326 and 530/620 only)
453 if((pSiS
->VGAEngine
== SIS_OLD_VGA
) || (pSiS
->VGAEngine
== SIS_530_VGA
)) {
455 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FAST_VRAM
, &pSiS
->newFastVram
)) {
458 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Fast VRAM %s\n",
459 (pSiS
->newFastVram
== -1) ?
460 ((pSiS
->oldChipset
== OC_SIS620
) ? "enabled (for read only)" :
461 "enabled (for write only)") :
462 (pSiS
->newFastVram
? "enabled (for read and write)" : disabledstr
));
465 /* NoHostBus (5597/5598 only)
467 if((pSiS
->Chipset
== PCI_CHIP_SIS5597
)) {
469 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOHOSTBUS
, &pSiS
->NoHostBus
)) {
472 xf86DrvMsg(pScrn
->scrnIndex
, from
, "SiS5597/5598 VGA-to-CPU host bus %s\n",
473 pSiS
->NoHostBus
? disabledstr
: enabledstr
);
477 * This options limits the amount of video memory X uses for screen
478 * and off-screen buffers. This option should be used if using DRI
479 * is intended. The kernel framebuffer driver required for DRM will
480 * start its memory heap at 12MB if it detects more than 16MB, at 8MB if
481 * between 8 and 16MB are available, otherwise at 4MB. So, if the amount
482 * of memory X uses, a clash between the framebuffer's memory heap
483 * and X is avoided. The amount is to be specified in KB.
485 if(xf86GetOptValULong(pSiS
->Options
, OPTION_MAXXFBMEM
,
487 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
488 "MaxXFBMem: Framebuffer memory shall be limited to %ld KB\n",
490 pSiS
->maxxfbmem
*= 1024;
494 * Turns off 2D acceleration
496 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_NOACCEL
, FALSE
)) {
497 pSiS
->NoAccel
= TRUE
;
498 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
499 pSiS
->NoXvideo
= TRUE
;
500 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "2D Acceleration and Xv disabled\n");
502 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "2D Acceleration disabled\n");
507 /* RenderAcceleration
508 * En/Disables RENDER acceleration (315/330 series only)
510 if((pSiS
->VGAEngine
== SIS_315_VGA
) && (!pSiS
->NoAccel
)) {
511 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RENDER
, &pSiS
->doRender
)) {
512 if(!pSiS
->doRender
) {
513 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "RENDER Acceleration disabled\n");
520 * Chooses whether to use the hardware or software cursor
523 if(xf86GetOptValBool(pSiS
->Options
, OPTION_HW_CURSOR
, &pSiS
->HWCursor
)) {
526 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_SW_CURSOR
, FALSE
)) {
528 pSiS
->HWCursor
= FALSE
;
529 pSiS
->OptUseColorCursor
= 0;
531 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Using %s cursor\n",
532 pSiS
->HWCursor
? "HW" : "SW");
536 * ColorHWCursorBlending
537 * ColorHWCursorBlendThreshold
539 * Enable/disable color hardware cursors;
540 * enable/disable color hw cursor emulation for 300 series
541 * select emultation transparency threshold for 300 series
544 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,2,99,0,0)
546 #ifdef SIS_ARGB_CURSOR
547 if((pSiS
->HWCursor
) && ((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
))) {
549 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USERGBCURSOR
, &pSiS
->OptUseColorCursor
)) {
552 xf86DrvMsg(pScrn
->scrnIndex
, from
, "Color HW cursor is %s\n",
553 pSiS
->OptUseColorCursor
? enabledstr
: disabledstr
);
555 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
557 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USERGBCURSORBLEND
, &pSiS
->OptUseColorCursorBlend
)) {
560 if(pSiS
->OptUseColorCursor
) {
561 xf86DrvMsg(pScrn
->scrnIndex
, from
,
562 "HW cursor color blending emulation is %s\n",
563 (pSiS
->OptUseColorCursorBlend
) ? enabledstr
: disabledstr
);
568 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_USERGBCURSORBLENDTH
, &temp
)) {
569 if((temp
>= 0) && (temp
<= 255)) {
571 pSiS
->OptColorCursorBlendThreshold
= (temp
<< 24);
573 temp
= pSiS
->OptColorCursorBlendThreshold
>> 24;
574 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
575 "Illegal color HW cursor blending threshold, valid range 0-255\n");
578 temp
= pSiS
->OptColorCursorBlendThreshold
>> 24;
580 if(pSiS
->OptUseColorCursor
) {
581 if(pSiS
->OptUseColorCursorBlend
) {
582 xf86DrvMsg(pScrn
->scrnIndex
, from
,
583 "HW cursor color blending emulation threshold is %d\n", temp
);
593 /* OverruleFrequencyRanges
595 * Enable/disable overruling bogus frequency ranges for TV and LCD(A)
597 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
599 if(xf86GetOptValBool(pSiS
->Options
, OPTION_OVERRULERANGES
, &val
)) {
601 pSiS
->OverruleRanges
= FALSE
;
602 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "Overruling frequency ranges disabled\n");
610 * Enable/disable and configure merged framebuffer mode
615 if(pSiS
->DualHeadMode
) {
617 if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB
, &val
)) {
618 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
619 "Option \"MergedFB\" cannot be used in Dual Head mode\n");
623 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
625 if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB
, &val
)) {
627 pSiS
->MergedFB
= TRUE
;
628 pSiS
->MergedFBAuto
= FALSE
;
630 } else if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFB2
, &val
)) {
632 pSiS
->MergedFB
= TRUE
;
633 pSiS
->MergedFBAuto
= FALSE
;
637 if(xf86GetOptValBool(pSiS
->Options
, OPTION_MERGEDFBAUTO
, &val
)) {
638 if(!pSiS
->MergedFB
) {
640 pSiS
->MergedFB
= pSiS
->MergedFBAuto
= TRUE
;
643 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
644 "Option \"MergedFB\" overrules option \"MergedFBAuto\"\n");
649 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2POS
);
651 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2POS2
);
654 if(!xf86NameCmp(strptr
,"LeftOf")) {
655 pSiS
->CRT2Position
= sisLeftOf
;
657 pSiS
->CRT2IsScrn0
= TRUE
;
659 } else if(!xf86NameCmp(strptr
,"RightOf")) {
660 pSiS
->CRT2Position
= sisRightOf
;
662 pSiS
->CRT2IsScrn0
= FALSE
;
664 } else if(!xf86NameCmp(strptr
,"Above")) {
665 pSiS
->CRT2Position
= sisAbove
;
667 pSiS
->CRT2IsScrn0
= FALSE
;
669 } else if(!xf86NameCmp(strptr
,"Below")) {
670 pSiS
->CRT2Position
= sisBelow
;
672 pSiS
->CRT2IsScrn0
= TRUE
;
674 } else if(!xf86NameCmp(strptr
,"Clone")) {
675 pSiS
->CRT2Position
= sisClone
;
677 pSiS
->CRT2IsScrn0
= TRUE
;
680 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "CRT2Position");
681 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
682 "Valid parameters are \"RightOf\", \"LeftOf\", \"Above\", \"Below\", or \"Clone\"\n");
685 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_METAMODES
);
687 pSiS
->MetaModes
= xalloc(strlen(strptr
) + 1);
688 if(pSiS
->MetaModes
) memcpy(pSiS
->MetaModes
, strptr
, strlen(strptr
) + 1);
690 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2HSYNC
);
692 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2HSYNC2
);
695 pSiS
->CRT2HSync
= xalloc(strlen(strptr
) + 1);
696 if(pSiS
->CRT2HSync
) memcpy(pSiS
->CRT2HSync
, strptr
, strlen(strptr
) + 1);
698 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2VREFRESH
);
700 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CRT2VREFRESH2
);
703 pSiS
->CRT2VRefresh
= xalloc(strlen(strptr
) + 1);
704 if(pSiS
->CRT2VRefresh
) memcpy(pSiS
->CRT2VRefresh
, strptr
, strlen(strptr
) + 1);
706 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_MERGEDDPI
);
708 int val1
= 0, val2
= 0;
709 sscanf(strptr
, "%d %d", &val1
, &val2
);
711 pSiS
->MergedFBXDPI
= val1
;
712 pSiS
->MergedFBYDPI
= val2
;
714 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "MergedDPI");
719 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOSISXINERAMA
, &val
)) {
720 if(val
) pSiS
->UseSiSXinerama
= FALSE
;
721 } else if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOSISXINERAMA2
, &val
)) {
722 if(val
) pSiS
->UseSiSXinerama
= FALSE
;
724 if(pSiS
->UseSiSXinerama
) {
725 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2ISSCRN0
, &val
)) {
726 pSiS
->CRT2IsScrn0
= val
? TRUE
: FALSE
;
735 /* Some options can only be specified in the Master Head's Device
736 * section. Here we give the user a hint in the log.
739 if((pSiS
->DualHeadMode
) && (pSiS
->SecondHead
)) {
740 static const char *mystring
= "Option \"%s\" is only accepted in Master Head's device section\n";
743 if(pSiS
->VGAEngine
!= SIS_315_VGA
) {
744 if(xf86GetOptValBool(pSiS
->Options
, OPTION_TURBOQUEUE
, &val
)) {
745 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "TurboQueue");
748 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RESTOREBYSET
, &val
)) {
749 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "RestoreBySetMode");
751 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLEHOTKEY
, &val
)) {
752 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "EnableHotKey");
754 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLESISCTRL
, &val
)) {
755 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "EnableSiSCtrl");
757 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEROMDATA
, &val
)) {
758 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "UseROMData");
760 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEOEM
, &val
)) {
761 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "UseOEMData");
763 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT1
, &val
)) {
764 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT1");
766 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NODDCFORCRT2
, &val
)) {
767 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "NoCRT2Detection");
769 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT2REDETECTION
, &val
)) {
770 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT2ReDetection");
772 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SENSEYPBPR
, &val
)) {
773 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "SenseYPbPr");
775 if(xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT1TYPE
)) {
776 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT1Type");
778 if(xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT2TYPE
)) {
779 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ForceCRT2Type");
781 if(xf86GetOptValString(pSiS
->Options
, OPTION_YPBPRAR
)) {
782 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "YPbPrAspectRatio");
784 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SCALELCD
, &val
)) {
785 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "ScaleLCD");
787 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CENTERLCD
, &val
)) {
788 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CenterLCD");
790 if((xf86GetOptValInteger(pSiS
->Options
, OPTION_PDC
, &vali
)) ||
791 (xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCS
, &vali
))) {
792 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "PanelDelayCompensation (PDC)");
794 if((xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCA
, &vali
)) ||
795 (xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCAS
, &vali
))) {
796 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "PanelDelayCompensation1 (PDC1)");
798 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_EMI
, &vali
)) {
799 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "EMI");
801 if(xf86GetOptValString(pSiS
->Options
, OPTION_SPECIALTIMING
)) {
802 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "SpecialTiming");
804 if(xf86GetOptValString(pSiS
->Options
, OPTION_LVDSHL
)) {
805 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "LVDSHL");
807 if(xf86GetOptValString(pSiS
->Options
, OPTION_TVSTANDARD
)) {
808 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "TVStandard");
810 if(xf86GetOptValString(pSiS
->Options
, OPTION_CHTVTYPE
)) {
811 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVType");
813 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVOVERSCAN
, &val
)) {
814 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVOverscan");
816 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVSOVERSCAN
, &val
)) {
817 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CHTVSuperOverscan");
819 if((xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHCVBS
, &vali
)) ||
820 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHSVIDEO
, &vali
)) ||
821 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMAFLICKERFILTER
, &vali
)) ||
822 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMABANDWIDTH
, &vali
)) ||
823 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMAFLICKERFILTER
, &vali
)) ||
824 (xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVCVBSCOLOR
, &val
)) ||
825 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVTEXTENHANCE
, &vali
)) ||
826 (xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCONTRAST
, &vali
)) ||
827 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVEDGEENHANCE
, &vali
)) ||
828 (xf86GetOptValString(pSiS
->Options
, OPTION_SISTVANTIFLICKER
)) ||
829 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVSATURATION
, &vali
)) ||
830 (xf86GetOptValBool(pSiS
->Options
, OPTION_SISTVCHROMAFILTER
, &val
)) ||
831 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVLUMAFILTER
, &vali
)) ||
832 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBCOARSE
, &vali
)) ||
833 (xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBFINE
, &vali
)) ||
834 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
, &vali
)) ||
835 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
, &vali
)) ||
836 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXSCALE
, &vali
)) ||
837 (xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYSCALE
, &vali
))) {
838 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
839 "TV related options are only accepted in Master Head's device section");
841 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2GAMMA
, &val
)) {
842 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "CRT2Gamma");
844 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVONCRT2
, &val
)) {
845 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "XvOnCRT2");
847 if(xf86GetOptValString(pSiS
->Options
, OPTION_XVDEFAULTADAPTOR
)) {
848 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mystring
, "XvDefaultAdaptor");
856 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
859 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Using VRAM command queue, size %dk\n",
860 pSiS
->cmdQueueSize
/ 1024);
862 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Using MMIO command queue, size 512k\n");
870 if(xf86GetOptValBool(pSiS
->Options
, OPTION_TURBOQUEUE
, &pSiS
->TurboQueue
)) {
873 xf86DrvMsg(pScrn
->scrnIndex
, from
, "TurboQueue %s\n",
874 pSiS
->TurboQueue
? enabledstr
: disabledstr
);
877 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
881 /* RestoreBySetMode (300/315/330 series only)
882 * Set this to force the driver to set the old mode instead of restoring
883 * the register contents. This can be used to overcome problems with
884 * LCD panels and video bridges.
886 if(xf86GetOptValBool(pSiS
->Options
, OPTION_RESTOREBYSET
, &val
)) {
887 pSiS
->restorebyset
= val
? TRUE
: FALSE
;
890 /* EnableHotkey (300/315/330 series only)
891 * Enables or disables the BIOS hotkey switch for
892 * switching the output device on laptops.
893 * This key causes a total machine hang on many 300 series
894 * machines, it is therefore by default disabled on such.
895 * In dual head mode, using the hotkey is lethal, so we
896 * forbid it then in any case.
897 * However, although the driver disables the hotkey as
898 * BIOS developers intented to do that, some buggy BIOSes
899 * still cause the machine to freeze. Hence the warning.
904 if(pSiS
->DualHeadMode
) {
905 pSiS
->AllowHotkey
= 0;
909 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLEHOTKEY
, &val
)) {
910 pSiS
->AllowHotkey
= val
? 1 : 0;
912 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Hotkey display switching is %s%s\n",
913 pSiS
->AllowHotkey
? enabledstr
: disabledstr
,
914 flag
? " in dual head mode" : "");
915 if(pSiS
->Chipset
== PCI_CHIP_SIS630
||
916 pSiS
->Chipset
== PCI_CHIP_SIS650
||
917 pSiS
->Chipset
== PCI_CHIP_SIS660
) {
918 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
919 "WARNING: Using the Hotkey might freeze your machine, regardless\n");
920 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
921 "\twhether enabled or disabled. This is no driver bug.\n");
925 /* UseROMData (300/315/330 series only)
926 * This option is enabling/disabling usage of some machine
927 * specific data from the BIOS ROM. This option can - and
928 * should - be used in case the driver makes problems
929 * because SiS changed the location of this data.
931 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEROMDATA
, &val
)) {
932 pSiS
->OptROMUsage
= val
? 1 : 0;
933 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
934 "Video ROM data usage shall be %s\n",
935 val
? enabledstr
: disabledstr
);
938 /* UseOEMData (300/315/330 series only)
939 * The driver contains quite a lot data for OEM LCD panels
940 * and TV connector specifics which override the defaults.
941 * If this data is incorrect, the TV may lose color and
942 * the LCD panel might show some strange effects. Use this
943 * option to disable the usage of this data.
945 if(xf86GetOptValBool(pSiS
->Options
, OPTION_USEOEM
, &val
)) {
946 pSiS
->OptUseOEM
= val
? 1 : 0;
947 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
948 "Internal LCD/TV/VGA2 OEM data usage shall be %s\n",
949 val
? enabledstr
: disabledstr
);
952 /* NoCRT2DDCDetection (315/330 series only)
953 * If set to true, this disables CRT2 detection using DDC. This is
954 * to avoid problems with not entirely DDC compiant LCD panels or
955 * VGA monitors connected to the secondary VGA plug. Since LCD and
956 * VGA share the same DDC channel, it might in some cases be impossible
957 * to determine if the device is a CRT monitor or a flat panel.
959 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NODDCFORCRT2
, &val
)) {
960 pSiS
->nocrt2ddcdetection
= val
? TRUE
: FALSE
;
963 /* ForceCRT2ReDetection (315/330 series only)
964 * If set to true, it forces re-detection of the LCD panel and
965 * a secondary VGA connection even if the BIOS already had found
966 * about it. This is meant for custom panels (ie such with
967 * non-standard resolutions) which the BIOS will "detect" according
968 * to the established timings, resulting in only a very vague idea
969 * about the panels real resolution. As for secondary VGA, this
970 * enables us to include a Plasma panel's proprietary modes.
972 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT2REDETECTION
, &val
)) {
974 pSiS
->forcecrt2redetection
= TRUE
;
975 pSiS
->nocrt2ddcdetection
= FALSE
;
976 } else pSiS
->forcecrt2redetection
= FALSE
;
979 /* SenseYPbPr (315/330 series only)
980 * If set to true, the driver will sense for YPbPr TV. This is
981 * inconvenient for folks connecting SVideo and CVBS at the same
982 * time, because this condition will be detected as YPbPr (since
983 * the TV output pins are shared). "False" will not sense for
984 * YPbPr and detect SVideo or CVBS only.
986 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SENSEYPBPR
, &val
)) {
987 if(val
) pSiS
->SenseYPbPr
= TRUE
;
988 else pSiS
->SenseYPbPr
= FALSE
;
992 /* ForceCRT1Type (315/330 series only)
993 * Used for forcing the driver to initialize CRT1 as
994 * VGA (analog) or LCDA (for simultanious LCD and TV
995 * display) - on M650/651 and 661 or later with 301C/30xLV only!
997 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
998 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT1TYPE
);
1000 if(!xf86NameCmp(strptr
,"VGA")) {
1001 pSiS
->ForceCRT1Type
= CRT1_VGA
;
1002 } else if( (!xf86NameCmp(strptr
,"LCD")) ||
1003 (!xf86NameCmp(strptr
,"LCDA")) ||
1004 (!xf86NameCmp(strptr
,"DVI-D")) ||
1005 (!xf86NameCmp(strptr
,"LCD-A")) ) {
1006 pSiS
->ForceCRT1Type
= CRT1_LCDA
;
1008 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "ForceCRT1Type");
1009 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1010 "Valid parameters are \"VGA\" or \"LCD\" (alias \"DVI-D\")\n");
1015 /* ForceCRT1 (300/315/330 series only)
1016 * This option can be used to force CRT1 to be switched on/off. Its
1017 * intention is mainly for old monitors that can't be detected
1018 * automatically. This is only useful on machines with a video bridge.
1019 * In normal cases, this option won't be necessary.
1021 if(xf86GetOptValBool(pSiS
->Options
, OPTION_FORCECRT1
, &val
)) {
1022 pSiS
->forceCRT1
= val
? 1 : 0;
1023 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1024 "CRT1 shall be forced %s\n",
1025 val
? "ON" : "OFF");
1026 if(!pSiS
->forceCRT1
) pSiS
->ForceCRT1Type
= CRT1_VGA
;
1029 /* ForceCRT2Type (300/315/330 series only)
1030 * Used for forcing the driver to initialize a given
1032 * (SVIDEO, COMPOSITE and SCART for overriding detection)
1034 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_FORCE_CRT2TYPE
);
1035 if(strptr
!= NULL
) {
1036 if(!xf86NameCmp(strptr
,"TV"))
1037 pSiS
->ForceCRT2Type
= CRT2_TV
;
1038 else if( (!xf86NameCmp(strptr
,"SVIDEO")) ||
1039 (!xf86NameCmp(strptr
,"SVHS")) ) {
1040 pSiS
->ForceCRT2Type
= CRT2_TV
;
1041 pSiS
->ForceTVType
= TV_SVIDEO
;
1042 } else if( (!xf86NameCmp(strptr
,"COMPOSITE")) ||
1043 (!xf86NameCmp(strptr
,"CVBS")) ) {
1044 pSiS
->ForceCRT2Type
= CRT2_TV
;
1045 pSiS
->ForceTVType
= TV_AVIDEO
;
1046 } else if( (!xf86NameCmp(strptr
,"COMPOSITE SVIDEO")) || /* Ugly, but shorter than a parsing function */
1047 (!xf86NameCmp(strptr
,"COMPOSITE+SVIDEO")) ||
1048 (!xf86NameCmp(strptr
,"SVIDEO+COMPOSITE")) ||
1049 (!xf86NameCmp(strptr
,"SVIDEO COMPOSITE")) ) {
1050 pSiS
->ForceCRT2Type
= CRT2_TV
;
1051 pSiS
->ForceTVType
= (TV_SVIDEO
| TV_AVIDEO
);
1052 } else if(!xf86NameCmp(strptr
,"SCART")) {
1053 pSiS
->ForceCRT2Type
= CRT2_TV
;
1054 pSiS
->ForceTVType
= TV_SCART
;
1055 } else if((!xf86NameCmp(strptr
,"LCD")) || (!xf86NameCmp(strptr
,"DVI-D"))) {
1056 if(pSiS
->ForceCRT1Type
== CRT1_VGA
) {
1057 pSiS
->ForceCRT2Type
= CRT2_LCD
;
1059 pSiS
->ForceCRT2Type
= 0;
1060 xf86DrvMsg(pScrn
->scrnIndex
, X_ERROR
,
1061 "Can't set both CRT1 and CRT2 type to LCD; CRT2 disabled\n");
1063 } else if((!xf86NameCmp(strptr
,"VGA")) || (!xf86NameCmp(strptr
,"DVI-A"))) {
1064 if(pSiS
->ForceCRT1Type
== CRT1_VGA
) {
1065 pSiS
->ForceCRT2Type
= CRT2_VGA
;
1067 pSiS
->ForceCRT2Type
= 0;
1068 xf86DrvMsg(pScrn
->scrnIndex
, X_ERROR
,
1069 "CRT2 can only be TV or off while CRT1 is LCD; CRT2 disabled\n");
1071 } else if(!xf86NameCmp(strptr
,"NONE"))
1072 pSiS
->ForceCRT2Type
= 0;
1073 else if((!xf86NameCmp(strptr
,"DSTN")) && (pSiS
->Chipset
== PCI_CHIP_SIS550
)) {
1074 if(pSiS
->ForceCRT1Type
== CRT1_VGA
) {
1075 pSiS
->ForceCRT2Type
= CRT2_LCD
;
1078 } else if((!xf86NameCmp(strptr
,"FSTN")) && (pSiS
->Chipset
== PCI_CHIP_SIS550
)) {
1079 if(pSiS
->ForceCRT1Type
== CRT1_VGA
) {
1080 pSiS
->ForceCRT2Type
= CRT2_LCD
;
1084 } else if(!xf86NameCmp(strptr
,"HIVISION")) {
1085 pSiS
->ForceCRT2Type
= CRT2_TV
;
1086 pSiS
->ForceTVType
= TV_HIVISION
;
1087 } else if((!xf86NameCmp(strptr
,"YPBPR1080I")) && (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1088 pSiS
->ForceCRT2Type
= CRT2_TV
;
1089 pSiS
->ForceTVType
= TV_YPBPR
;
1090 pSiS
->ForceYPbPrType
= TV_YPBPR1080I
;
1091 } else if(((!xf86NameCmp(strptr
,"YPBPR525I")) || (!xf86NameCmp(strptr
,"YPBPR480I"))) &&
1092 (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1093 pSiS
->ForceCRT2Type
= CRT2_TV
;
1094 pSiS
->ForceTVType
= TV_YPBPR
;
1095 pSiS
->ForceYPbPrType
= TV_YPBPR525I
;
1096 } else if(((!xf86NameCmp(strptr
,"YPBPR525P")) || (!xf86NameCmp(strptr
,"YPBPR480P"))) &&
1097 (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1098 pSiS
->ForceCRT2Type
= CRT2_TV
;
1099 pSiS
->ForceTVType
= TV_YPBPR
;
1100 pSiS
->ForceYPbPrType
= TV_YPBPR525P
;
1101 } else if(((!xf86NameCmp(strptr
,"YPBPR750P")) || (!xf86NameCmp(strptr
,"YPBPR720P"))) &&
1102 (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1103 pSiS
->ForceCRT2Type
= CRT2_TV
;
1104 pSiS
->ForceTVType
= TV_YPBPR
;
1105 pSiS
->ForceYPbPrType
= TV_YPBPR750P
;
1108 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "ForceCRT2Type");
1109 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1110 "Valid parameters are \"LCD\" (=\"DVI-D\"), \"TV\", \"SVIDEO\", \"COMPOSITE\",\n"
1111 "\t\"SVIDEO+COMPOSITE\", \"SCART\", \"VGA\" (=\"DVI-A\") or \"NONE\"; on the SiS550\n"
1112 "\talso \"DSTN\" and \"FSTN\""
1114 "; on SiS 301/301B bridges also \"HIVISION\", and on\n"
1115 "\tSiS315/330 series with 301C/30xLV bridge also \"YPBPR480I\", \"YPBPR480P\",\n"
1116 "\t\"YPBPR720P\" and \"YPBPR1080I\""
1121 if(pSiS
->ForceCRT2Type
!= CRT2_DEFAULT
)
1122 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1123 "CRT2 type shall be %s\n", strptr
);
1126 if(pSiS
->ForceTVType
== TV_YPBPR
) {
1127 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_YPBPRAR
);
1128 if(strptr
!= NULL
) {
1129 if(!xf86NameCmp(strptr
,"4:3LB"))
1130 pSiS
->ForceYPbPrAR
= TV_YPBPR43LB
;
1131 else if(!xf86NameCmp(strptr
,"4:3"))
1132 pSiS
->ForceYPbPrAR
= TV_YPBPR43
;
1133 else if(!xf86NameCmp(strptr
,"16:9"))
1134 pSiS
->ForceYPbPrAR
= TV_YPBPR169
;
1136 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "YPbPrAspectRatio");
1137 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1138 "Valid parameters are \"4:3LB\", \"4:3\" and \"16:9\"\n");
1143 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SPECIALTIMING
);
1144 if(strptr
!= NULL
) {
1146 BOOLEAN found
= FALSE
;
1147 if(!xf86NameCmp(strptr
,"NONE")) {
1148 pSiS
->SiS_Pr
->SiS_CustomT
= CUT_FORCENONE
;
1149 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1150 "Special timing disabled\n");
1152 while(mycustomttable
[i
].chipID
!= 0) {
1153 if(!xf86NameCmp(strptr
,mycustomttable
[i
].optionName
)) {
1154 pSiS
->SiS_Pr
->SiS_CustomT
= mycustomttable
[i
].SpecialID
;
1156 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1157 "Special timing for %s %s forced\n",
1158 mycustomttable
[i
].vendorName
, mycustomttable
[i
].cardName
);
1164 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SpecialTiming");
1165 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "Valid parameters are:\n");
1166 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
, "\t\"NONE\" (to disable special timings)\n");
1168 while(mycustomttable
[i
].chipID
!= 0) {
1169 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1170 "\t\"%s\" (for %s %s)\n",
1171 mycustomttable
[i
].optionName
,
1172 mycustomttable
[i
].vendorName
,
1173 mycustomttable
[i
].cardName
);
1181 /* Allow sisctrl tool to change driver settings */
1183 if(xf86GetOptValBool(pSiS
->Options
, OPTION_ENABLESISCTRL
, &val
)) {
1184 if(val
) pSiS
->enablesisctrl
= TRUE
;
1187 xf86DrvMsg(pScrn
->scrnIndex
, from
, "SiSCtrl utility interface is %s\n",
1188 pSiS
->enablesisctrl
? enabledstr
: disabledstr
);
1190 /* ScaleLCD (300/315/330 series only)
1191 * Can be used to force the bridge/panel link to [do|not do] the
1192 * scaling of modes lower than the panel's native resolution.
1193 * Setting this to TRUE will force the bridge/panel link
1194 * to scale; FALSE will rely on the panel's capabilities.
1195 * Not supported on all machines.
1197 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SCALELCD
, &val
)) {
1198 pSiS
->UsePanelScaler
= val
? 0 : 1;
1199 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "LCD scaling is %s\n",
1200 pSiS
->UsePanelScaler
? disabledstr
: enabledstr
);
1203 /* CenterLCD (300/315/330 + SiS video bridge only)
1204 * If LCD shall not be scaled, this selects whether 1:1 data
1205 * will be sent to the output, or the image shall be centered
1206 * on the LCD. For LVDS panels, screen will always be centered,
1207 * since these have no built-in scaler. For TMDS, this is
1208 * selectable. Non-centered means that the driver will pass
1209 * 1:1 data to the output and that the panel will have to
1210 * scale by itself (if supported by the panel).
1212 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CENTERLCD
, &val
)) {
1213 pSiS
->CenterLCD
= val
? 1 : 0;
1214 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "Non-scaled LCD output will %sbe centered\n",
1215 pSiS
->CenterLCD
? "not " : "");
1218 /* PanelDelayCompensation (300/315/330 series only)
1219 * This might be required if the LCD panel shows "small waves"
1221 * The parameter is an integer, (on 300 series usually either
1222 * 4, 32 or 24; on 315 series + LV bridge usually 3 or 51)
1223 * Why this option? Simply because SiS did poor BIOS design.
1224 * The PDC value depends on the very LCD panel used in a
1225 * particular machine. For most panels, the driver is able
1226 * to detect the correct value. However, some panels require
1227 * a different setting. For 300 series, the value given must
1228 * be within the mask 0x3c. For 661 and later, if must be
1229 * within the range of 0 to 31.
1233 xf86GetOptValInteger(pSiS
->Options
, OPTION_PDC
, &val
);
1234 xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCS
, &val
);
1237 if((pSiS
->VGAEngine
== SIS_300_VGA
) && (pSiS
->PDC
& ~0x3c)) {
1238 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1239 "Illegal PanelDelayCompensation parameter\n");
1242 if(pSiS
->VGAEngine
== SIS_315_VGA
) pSiS
->PDC
&= 0x1f;
1243 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1244 "Panel delay compensation shall be %d (for LCD=CRT2)\n",
1249 /* PanelDelayCompensation1 (315 series only)
1250 * Same as above, but for LCD-via-CRT1 ("LCDA")
1252 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1254 xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCA
, &val
);
1255 xf86GetOptValInteger(pSiS
->Options
, OPTION_PDCAS
, &val
);
1258 if(pSiS
->PDCA
> 0x1f) {
1259 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1260 "Illegal PanelDelayCompensation1 (PDC1) parameter (0 <= PDC1 <= 31\n");
1263 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1264 "Panel delay compensation shall be %d (for LCD=CRT1)\n",
1271 /* LVDSHL (300/315/330 series + 30xLV bridge only)
1272 * This might be required if the LCD panel is too dark.
1273 * The parameter is an integer from 0 to 3.
1275 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_LVDSHL
, &pSiS
->SiS_Pr
->LVDSHL
)) {
1276 if((pSiS
->SiS_Pr
->LVDSHL
< 0) || (pSiS
->SiS_Pr
->LVDSHL
> 3)) {
1277 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1278 "Illegal LVDSHL parameter, valid is 0 through 3\n");
1279 pSiS
->SiS_Pr
->LVDSHL
= -1;
1281 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1282 "LVDSHL will be %d\n",
1283 pSiS
->SiS_Pr
->LVDSHL
);
1287 /* EMI (315/330 series + 302LV/302ELV bridge only)
1288 * This might be required if the LCD panel loses sync on
1289 * mode switches. So far, this problem should not show up
1290 * due to the auto-detection (from reading the values set
1291 * by the BIOS; however, the BIOS values are wrong sometimes
1292 * such as in the case of some Compal machines with a
1293 * 1400x1050, or some Inventec(Compaq) machines with a
1295 * The parameter is an integer from 0 to 0x60ffffff.
1297 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_EMI
, &pSiS
->EMI
)) {
1298 if((pSiS
->EMI
< 0) || (pSiS
->EMI
> 0x60ffffff)) {
1299 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1300 "Illegal EMI parameter, valid is 0 through 0x60ffffff\n");
1303 pSiS
->EMI
&= 0x60ffffff;
1304 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1305 "EMI will be 0x%04x\n", pSiS
->EMI
);
1312 /* TVStandard (300/315/330 series and 6326 w/ TV only)
1313 * This option is for overriding the autodetection of
1314 * the BIOS/Jumper option for PAL / NTSC
1316 if((pSiS
->VGAEngine
== SIS_300_VGA
) ||
1317 (pSiS
->VGAEngine
== SIS_315_VGA
) ||
1318 ((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
))) {
1319 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_TVSTANDARD
);
1320 if(strptr
!= NULL
) {
1321 if(!xf86NameCmp(strptr
,"PAL"))
1322 pSiS
->OptTVStand
= 1;
1323 else if((!xf86NameCmp(strptr
,"PALM")) ||
1324 (!xf86NameCmp(strptr
,"PAL-M"))) {
1325 pSiS
->OptTVStand
= 1;
1326 pSiS
->NonDefaultPAL
= 1;
1327 } else if((!xf86NameCmp(strptr
,"PALN")) ||
1328 (!xf86NameCmp(strptr
,"PAL-N"))) {
1329 pSiS
->OptTVStand
= 1;
1330 pSiS
->NonDefaultPAL
= 0;
1331 } else if((!xf86NameCmp(strptr
,"NTSCJ")) ||
1332 (!xf86NameCmp(strptr
,"NTSC-J"))) {
1333 pSiS
->OptTVStand
= 0;
1334 pSiS
->NonDefaultNTSC
= 1;
1335 } else if(!xf86NameCmp(strptr
,"NTSC"))
1336 pSiS
->OptTVStand
= 0;
1338 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "TVStandard");
1339 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1340 "Valid parameters are \"PAL\", \"PALM\", \"PALN\", \"NTSC\", \"NTSCJ\"\n");
1343 if(pSiS
->OptTVStand
!= -1) {
1344 static const char *tvstdstr
= "TV standard shall be %s\n";
1345 if(pSiS
->Chipset
== PCI_CHIP_SIS6326
) {
1346 pSiS
->NonDefaultPAL
= -1;
1347 pSiS
->NonDefaultNTSC
= -1;
1348 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, tvstdstr
,
1349 pSiS
->OptTVStand
? "PAL" : "NTSC");
1351 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, tvstdstr
,
1353 ( (pSiS
->NonDefaultPAL
== -1) ? "PAL" :
1354 ((pSiS
->NonDefaultPAL
) ? "PALM" : "PALN") ) :
1355 (pSiS
->NonDefaultNTSC
== -1) ? "NTSC" : "NTSCJ"));
1361 /* CHTVType (315/330 series + Chrontel only)
1362 * Used for telling the driver if the TV output shall
1363 * be 525i YPbPr or SCART.
1365 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1366 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_CHTVTYPE
);
1367 if(strptr
!= NULL
) {
1368 if(!xf86NameCmp(strptr
,"SCART"))
1370 else if(!xf86NameCmp(strptr
,"YPBPR525I"))
1373 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "CHTVType");
1374 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1375 "Valid parameters are \"SCART\" or \"YPBPR525I\"\n");
1377 if(pSiS
->chtvtype
!= -1)
1378 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1379 "Chrontel: TV type shall be %s\n", strptr
);
1383 /* CHTVOverscan (300/315/330 series only)
1384 * CHTVSuperOverscan (300/315/330 series only)
1385 * These options are for overriding the BIOS option for
1386 * TV Overscan. Some BIOS don't even have such an option.
1387 * SuperOverscan is only supported with PAL.
1388 * Both options are only effective on machines with a
1389 * CHRONTEL TV encoder. SuperOverscan is only available
1392 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1394 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVOVERSCAN
, &val
)) {
1395 pSiS
->OptTVOver
= val
? 1 : 0;
1396 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1397 "Chrontel: TV overscan shall be %s\n",
1398 val
? enabledstr
: disabledstr
);
1400 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVSOVERSCAN
, &pSiS
->OptTVSOver
)) {
1401 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1402 "Chrontel: TV super overscan shall be %s\n",
1403 pSiS
->OptTVSOver
? enabledstr
: disabledstr
);
1407 /* Various parameters for TV output via SiS bridge, Chrontel or SiS6326
1409 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1411 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHCVBS
,
1412 &pSiS
->chtvlumabandwidthcvbs
);
1413 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMABANDWIDTHSVIDEO
,
1414 &pSiS
->chtvlumabandwidthsvideo
);
1415 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVLUMAFLICKERFILTER
,
1416 &pSiS
->chtvlumaflickerfilter
);
1417 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMABANDWIDTH
,
1418 &pSiS
->chtvchromabandwidth
);
1419 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCHROMAFLICKERFILTER
,
1420 &pSiS
->chtvchromaflickerfilter
);
1421 xf86GetOptValBool(pSiS
->Options
, OPTION_CHTVCVBSCOLOR
,
1422 &pSiS
->chtvcvbscolor
);
1423 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVTEXTENHANCE
,
1424 &pSiS
->chtvtextenhance
);
1425 xf86GetOptValInteger(pSiS
->Options
, OPTION_CHTVCONTRAST
,
1426 &pSiS
->chtvcontrast
);
1427 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVEDGEENHANCE
,
1428 &pSiS
->sistvedgeenhance
);
1429 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVSATURATION
,
1430 &pSiS
->sistvsaturation
);
1431 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVLUMAFILTER
,
1432 &pSiS
->sistvyfilter
);
1433 if((pSiS
->sistvyfilter
< 0) || (pSiS
->sistvyfilter
> 8)) {
1434 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1435 "Illegal Y Filter number; valid is 0 (off), 1 (default), 2-8 (filter number 1-7)\n");
1436 pSiS
->sistvyfilter
= 1;
1438 xf86GetOptValBool(pSiS
->Options
, OPTION_SISTVCHROMAFILTER
,
1439 &pSiS
->sistvcfilter
);
1440 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBCOARSE
,
1441 &pSiS
->sistvcolcalibc
);
1442 xf86GetOptValInteger(pSiS
->Options
, OPTION_SISTVCOLCALIBFINE
,
1443 &pSiS
->sistvcolcalibf
);
1444 if((pSiS
->sistvcolcalibf
> 127) || (pSiS
->sistvcolcalibf
< -128) ||
1445 (pSiS
->sistvcolcalibc
> 120) || (pSiS
->sistvcolcalibc
< -120)) {
1446 pSiS
->sistvcolcalibf
= pSiS
->sistvcolcalibc
= 0;
1447 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1448 "Illegal Color Calibration. Range is -128 to 127 (fine), -120 to 120 (coarse)\n");
1450 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
,
1452 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
,
1454 if(pSiS
->tvxpos
> 32) { pSiS
->tvxpos
= 32; tmp
= 1; }
1455 if(pSiS
->tvxpos
< -32) { pSiS
->tvxpos
= -32; tmp
= 1; }
1456 if(pSiS
->tvypos
> 32) { pSiS
->tvypos
= 32; tmp
= 1; }
1457 if(pSiS
->tvypos
< -32) { pSiS
->tvypos
= -32; tmp
= 1; }
1458 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1459 "Illegal TV x or y offset. Range is from -32 to 32\n");
1461 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXSCALE
,
1463 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYSCALE
,
1465 if(pSiS
->tvxscale
> 16) { pSiS
->tvxscale
= 16; tmp
= 1; }
1466 if(pSiS
->tvxscale
< -16) { pSiS
->tvxscale
= -16; tmp
= 1; }
1467 if(pSiS
->tvyscale
> 3) { pSiS
->tvyscale
= 3; tmp
= 1; }
1468 if(pSiS
->tvyscale
< -4) { pSiS
->tvyscale
= -4; tmp
= 1; }
1469 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1470 "Illegal TV x or y scaling parameter. Range is from -16 to 16 (X), -4 to 3 (Y)\n");
1473 if((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
)) {
1475 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SIS6326FORCETVPPLUG
);
1477 if(!xf86NameCmp(strptr
,"COMPOSITE"))
1478 pSiS
->sis6326tvplug
= 1;
1479 else if(!xf86NameCmp(strptr
,"SVIDEO"))
1480 pSiS
->sis6326tvplug
= 0;
1482 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SIS6326TVForcePlug");
1483 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1484 "Valid parameters are \"COMPOSITE\" or \"SVIDEO\"\n");
1487 xf86GetOptValBool(pSiS
->Options
, OPTION_SIS6326ENABLEYFILTER
,
1488 &pSiS
->sis6326enableyfilter
);
1489 xf86GetOptValBool(pSiS
->Options
, OPTION_SIS6326YFILTERSTRONG
,
1490 &pSiS
->sis6326yfilterstrong
);
1491 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVXPOSOFFSET
,
1493 xf86GetOptValInteger(pSiS
->Options
, OPTION_TVYPOSOFFSET
,
1495 if(pSiS
->tvxpos
> 16) { pSiS
->tvxpos
= 16; tmp
= 1; }
1496 if(pSiS
->tvxpos
< -16) { pSiS
->tvxpos
= -16; tmp
= 1; }
1497 if(pSiS
->tvypos
> 16) { pSiS
->tvypos
= 16; tmp
= 1; }
1498 if(pSiS
->tvypos
< -16) { pSiS
->tvypos
= -16; tmp
= 1; }
1499 if(tmp
) xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1500 "Illegal TV x or y offset. Range is from -16 to 16\n");
1501 xf86GetOptValInteger(pSiS
->Options
, OPTION_SIS6326FSCADJUST
,
1502 &pSiS
->sis6326fscadjust
);
1503 if(pSiS
->sis6326fscadjust
) {
1504 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1505 "Adjusting the default FSC by %d\n",
1506 pSiS
->sis6326fscadjust
);
1510 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
) ||
1511 ((pSiS
->Chipset
== PCI_CHIP_SIS6326
) && (pSiS
->SiS6326Flags
& SIS6326_HASTV
))) {
1512 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SISTVANTIFLICKER
);
1514 strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_SIS6326ANTIFLICKER
);
1517 if(!xf86NameCmp(strptr
,"OFF"))
1518 pSiS
->sistvantiflicker
= 0;
1519 else if(!xf86NameCmp(strptr
,"LOW"))
1520 pSiS
->sistvantiflicker
= 1;
1521 else if(!xf86NameCmp(strptr
,"MED"))
1522 pSiS
->sistvantiflicker
= 2;
1523 else if(!xf86NameCmp(strptr
,"HIGH"))
1524 pSiS
->sistvantiflicker
= 3;
1525 else if(!xf86NameCmp(strptr
,"ADAPTIVE"))
1526 pSiS
->sistvantiflicker
= 4;
1528 pSiS
->sistvantiflicker
= -1;
1529 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "SISTVAntiFlicker");
1530 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1531 "Valid parameters are \"OFF\", \"LOW\", \"MED\", \"HIGH\" or \"ADAPTIVE\"\n");
1536 /* CRT2Gamma - enable/disable gamma correction for CRT2
1538 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1540 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT2GAMMA
, &val
)) {
1541 pSiS
->CRT2gamma
= val
;
1545 /* Default adaptor: Overlay (default) or Blitter */
1546 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1547 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_XVDEFAULTADAPTOR
))) {
1548 if(!xf86NameCmp(strptr
, "OVERLAY")) {
1549 pSiS
->XvDefAdaptorBlit
= FALSE
;
1550 } else if(!xf86NameCmp(strptr
, "BLITTER")) {
1551 pSiS
->XvDefAdaptorBlit
= TRUE
;
1553 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "XvDefaultAdaptor");
1554 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1555 "Valid parameters are \"OVERLAY\" or \"BLITTER\"\n");
1566 /* CRT1Gamma - enable/disable gamma correction for CRT1
1570 if(xf86GetOptValBool(pSiS
->Options
, OPTION_CRT1GAMMA
, &val
)) {
1571 pSiS
->CRT1gamma
= val
;
1572 pSiS
->CRT1gammaGiven
= TRUE
;
1576 /* VESA - DEPRECATED
1577 * This option is for forcing the driver to use
1578 * the VESA BIOS extension for mode switching.
1582 if(xf86GetOptValBool(pSiS
->Options
, OPTION_VESA
, &val
)) {
1583 pSiS
->VESA
= val
? 1 : 0;
1584 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1585 "VESA: VESA usage shall be %s\n",
1586 val
? enabledstr
: disabledstr
);
1587 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1588 "*** Option \"VESA\" is deprecated. *** \n");
1589 if(pSiS
->VESA
) pSiS
->ForceCRT1Type
= CRT1_VGA
;
1593 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1595 /* NoInternalModes (300/315/330 series only)
1596 * Since the mode switching code for these chipsets is a
1597 * Asm-to-C translation of BIOS code, we only have timings
1598 * for a pre-defined number of modes. The default behavior
1599 * is to replace XFree's default modes with a mode list
1600 * generated out of the known and supported modes. Use
1601 * this option to disable this. NOT RECOMMENDED.
1603 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOINTERNALMODES
, &pSiS
->noInternalModes
)) {
1604 if(pSiS
->noInternalModes
) {
1605 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "Usage of built-in modes is %s\n", disabledstr
);
1613 if(xf86GetOptValBool(pSiS
->Options
, OPTION_SHADOW_FB
, &pSiS
->ShadowFB
)) {
1615 if(pSiS
->MergedFB
) {
1616 pSiS
->ShadowFB
= FALSE
;
1617 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1618 "Shadow Frame Buffer not supported in MergedFB mode\n");
1623 if(pSiS
->ShadowFB
) {
1624 pSiS
->NoAccel
= TRUE
;
1625 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
1626 pSiS
->NoXvideo
= TRUE
;
1627 xf86DrvMsg(pScrn
->scrnIndex
, from
,
1628 "Using \"Shadow Frame Buffer\" - 2D acceleration and Xv disabled\n");
1630 xf86DrvMsg(pScrn
->scrnIndex
, from
,
1631 "Using \"Shadow Frame Buffer\" - 2D acceleration disabled\n");
1636 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_ROTATE
))) {
1638 if(pSiS
->MergedFB
) {
1639 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1640 "Screen rotation not supported in MergedFB mode\n");
1643 if(!xf86NameCmp(strptr
, "CW")) {
1645 } else if(!xf86NameCmp(strptr
, "CCW")) {
1648 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, mybadparm
, strptr
, "Rotate");
1649 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1650 "Valid parameters are \"CW\" or \"CCW\"\n");
1654 pSiS
->ShadowFB
= TRUE
;
1655 pSiS
->NoAccel
= TRUE
;
1656 pSiS
->HWCursor
= FALSE
;
1657 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
1658 pSiS
->NoXvideo
= TRUE
;
1659 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1660 "Rotating screen %sclockwise; (2D acceleration and Xv disabled)\n",
1661 (pSiS
->Rotate
== -1) ? "counter " : "");
1663 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1664 "Rotating screen %sclockwise (2D acceleration %sdisabled)\n",
1665 (pSiS
->Rotate
== -1) ? "counter " : "",
1666 #if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0)
1667 "and RandR extension "
1681 if(xf86GetOptValBool(pSiS
->Options
, OPTION_DRI
, &pSiS
->loadDRI
)) {
1684 xf86DrvMsg(pScrn
->scrnIndex
, from
, "DRI %s\n",
1685 pSiS
->loadDRI
? enabledstr
: disabledstr
);
1691 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_AGP_SIZE
, &vali
)) {
1693 } else if(xf86GetOptValInteger(pSiS
->Options
, OPTION_AGP_SIZE2
, &vali
)) {
1697 if((vali
>= 8) && (vali
<= 512)) {
1698 pSiS
->agpWantedPages
= (vali
* 1024 * 1024) / AGP_PAGE_SIZE
;
1700 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
, "AGPSize (alias GARTSize)", 8, 512);
1707 * Set this to TRUE to disable Xv hardware video acceleration
1709 #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,99,0,0)
1710 if((!pSiS
->NoAccel
) && (!pSiS
->NoXvideo
)) {
1712 if(!pSiS
->NoXvideo
) {
1714 if(xf86ReturnOptValBool(pSiS
->Options
, OPTION_NOXVIDEO
, FALSE
)) {
1715 pSiS
->NoXvideo
= TRUE
;
1716 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "XVideo extension disabled\n");
1719 if(!pSiS
->NoXvideo
) {
1723 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1725 * On chipsets with only one overlay (315, 650, 740, 330), the user can
1726 * choose to display the overlay on CRT1 or CRT2. By setting this
1727 * option to TRUE, the overlay will be displayed on CRT2. The
1728 * default is: CRT1 if only CRT1 available, CRT2 if only CRT2
1729 * available, and CRT1 if both is available and detected.
1730 * Since implementation of the XV_SWITCHCRT Xv property this only
1731 * selects the default CRT.
1733 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVONCRT2
, &val
)) {
1734 pSiS
->XvOnCRT2
= val
? TRUE
: FALSE
;
1738 if((pSiS
->VGAEngine
== SIS_OLD_VGA
) || (pSiS
->VGAEngine
== SIS_530_VGA
)) {
1739 /* NoYV12 (for 5597/5598, 6326 and 530/620 only)
1740 * YV12 has problems with videos larger than 384x288. So
1741 * allow the user to disable YV12 support to force the
1742 * application to use YUV2 instead.
1744 if(xf86GetOptValBool(pSiS
->Options
, OPTION_NOYV12
, &val
)) {
1745 pSiS
->NoYV12
= val
? 1 : 0;
1746 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1747 "Xv YV12/I420 support is %s\n",
1748 pSiS
->NoYV12
? disabledstr
: enabledstr
);
1752 /* Some Xv properties' defaults can be set by options */
1753 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFCONTRAST
, &tmp
)) {
1754 if((tmp
>= 0) && (tmp
<= 7)) pSiS
->XvDefCon
= tmp
;
1755 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1756 "XvDefaultContrast" ,0, 7);
1758 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFBRIGHTNESS
, &tmp
)) {
1759 if((tmp
>= -128) && (tmp
<= 127)) pSiS
->XvDefBri
= tmp
;
1760 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1761 "XvDefaultBrightness", -128, 127);
1763 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1764 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFHUE
, &tmp
)) {
1765 if((tmp
>= -8) && (tmp
<= 7)) pSiS
->XvDefHue
= tmp
;
1766 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1767 "XvDefaultHue", -8, 7);
1769 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVDEFSATURATION
, &tmp
)) {
1770 if((tmp
>= -7) && (tmp
<= 7)) pSiS
->XvDefSat
= tmp
;
1771 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1772 "XvDefaultSaturation", -7, 7);
1775 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDEFDISABLEGFX
, &val
)) {
1776 if(val
) pSiS
->XvDefDisableGfx
= TRUE
;
1777 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1778 "Graphics display will be %s during Xv usage\n",
1779 val
? disabledstr
: enabledstr
);
1781 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1782 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDEFDISABLEGFXLR
, &val
)) {
1783 if(val
) pSiS
->XvDefDisableGfxLR
= TRUE
;
1784 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1785 "Graphics display left/right of overlay will be %s during Xv usage\n",
1786 val
? disabledstr
: enabledstr
);
1788 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVDISABLECOLORKEY
, &val
)) {
1789 if(val
) pSiS
->XvDisableColorKey
= TRUE
;
1790 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1791 "Xv Color key is %s\n",
1792 val
? disabledstr
: enabledstr
);
1794 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVUSECHROMAKEY
, &val
)) {
1795 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1796 "Xv Chroma-keying is %s\n",
1797 val
? enabledstr
: disabledstr
);
1798 if(val
) pSiS
->XvUseChromaKey
= TRUE
;
1800 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVINSIDECHROMAKEY
, &val
)) {
1801 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1802 "Xv: Video is transparent if %s chroma key range\n",
1803 val
? "inside" : "outside");
1804 if(val
) pSiS
->XvInsideChromaKey
= TRUE
;
1806 if(pSiS
->VGAEngine
== SIS_300_VGA
) {
1807 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVYUVCHROMAKEY
, &val
)) {
1808 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
,
1809 "Xv: Chroma key is in %s format\n",
1810 val
? "YUV" : "RGB");
1811 if(val
) pSiS
->XvYUVChromaKey
= TRUE
;
1814 xf86DrvMsg(pScrn
->scrnIndex
, X_INFO
,
1815 "Xv: Chroma key is of same format as video source\n");
1817 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVCHROMAMIN
, &tmp
)) {
1818 if((tmp
>= 0) && (tmp
<= 0xffffff)) pSiS
->XvChromaMin
= tmp
;
1819 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1820 "XvChromaMin", 0, 0xffffff);
1822 if(xf86GetOptValInteger(pSiS
->Options
, OPTION_XVCHROMAMAX
, &tmp
)) {
1823 if((tmp
>= 0) && (tmp
<= 0xffffff)) pSiS
->XvChromaMax
= tmp
;
1824 else xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
, ilrangestr
,
1825 "XvChromaMax", 0, 0xffffff);
1828 if(xf86GetOptValBool(pSiS
->Options
, OPTION_XVMEMCPY
, &val
)) {
1829 pSiS
->XvUseMemcpy
= val
? TRUE
: FALSE
;
1830 xf86DrvMsg(pScrn
->scrnIndex
, X_CONFIG
, "Xv will %suse memcpy()\n",
1834 if(pSiS
->VGAEngine
== SIS_315_VGA
) {
1835 /* XvGamma - enable/disable gamma correction for Xv
1836 * Supported for CRT1 only
1838 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_XVGAMMA
))) {
1839 if( (!xf86NameCmp(strptr
,"off")) ||
1840 (!xf86NameCmp(strptr
,"false")) ||
1841 (!xf86NameCmp(strptr
,"no")) ||
1842 (!xf86NameCmp(strptr
,"0")) ) {
1843 pSiS
->XvGamma
= FALSE
;
1844 pSiS
->XvGammaGiven
= TRUE
;
1845 } else if( (!xf86NameCmp(strptr
,"on")) ||
1846 (!xf86NameCmp(strptr
,"true")) ||
1847 (!xf86NameCmp(strptr
,"yes")) ||
1848 (!xf86NameCmp(strptr
,"1")) ) {
1849 pSiS
->XvGamma
= pSiS
->XvGammaGiven
= TRUE
;
1851 float val1
= 0.0, val2
= 0.0, val3
= 0.0;
1853 int result
= sscanf(strptr
, "%f %f %f", &val1
, &val2
, &val3
);
1855 if((val1
>= 0.1) && (val1
<= 10.0)) {
1856 pSiS
->XvGammaGreen
= pSiS
->XvGammaBlue
= pSiS
->XvGammaRed
=
1857 pSiS
->XvGammaGreenDef
= pSiS
->XvGammaBlueDef
= pSiS
->XvGammaRedDef
= (int)(val1
* 1000);
1860 } else if(result
== 3) {
1861 if((val1
>= 0.1) && (val1
<= 10.0) &&
1862 (val2
>= 0.1) && (val2
<= 10.0) &&
1863 (val3
>= 0.1) && (val3
<= 10.0)) {
1864 pSiS
->XvGammaRed
= pSiS
->XvGammaRedDef
= (int)(val1
* 1000);
1865 pSiS
->XvGammaGreen
= pSiS
->XvGammaGreenDef
= (int)(val2
* 1000);
1866 pSiS
->XvGammaBlue
= pSiS
->XvGammaBlueDef
= (int)(val3
* 1000);
1871 pSiS
->XvGamma
= pSiS
->XvGammaGiven
= TRUE
;
1873 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1874 "XvGamma expects either a boolean, or 1 or 3 real numbers (0.1 - 10.0)\n");
1882 if((pSiS
->VGAEngine
== SIS_300_VGA
) || (pSiS
->VGAEngine
== SIS_315_VGA
)) {
1883 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_STOREDBRI
))) {
1884 float val1
= 0.0, val2
= 0.0, val3
= 0.0;
1886 int result
= sscanf(strptr
, "%f %f %f", &val1
, &val2
, &val3
);
1888 if((val1
>= 0.1) && (val1
<= 10.0)) {
1890 pSiS
->GammaBriR
= pSiS
->GammaBriG
= pSiS
->GammaBriB
= (int)(val1
* 1000);
1892 } else if(result
== 3) {
1893 if((val1
>= 0.1) && (val1
<= 10.0) &&
1894 (val2
>= 0.1) && (val2
<= 10.0) &&
1895 (val3
>= 0.1) && (val3
<= 10.0)) {
1897 pSiS
->GammaBriR
= (int)(val1
* 1000);
1898 pSiS
->GammaBriG
= (int)(val2
* 1000);
1899 pSiS
->GammaBriB
= (int)(val3
* 1000);
1903 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1904 "StoredGammaBrightness expects 1 or 3 real numbers (0.1 - 10.0)\n");
1907 if((strptr
= (char *)xf86GetOptValString(pSiS
->Options
, OPTION_STOREDPBRI
))) {
1908 float val1
= 0.0, val2
= 0.0, val3
= 0.0;
1910 int result
= sscanf(strptr
, "%f %f %f", &val1
, &val2
, &val3
);
1912 if((val1
>= 0.1) && (val1
<= 10.0)) {
1914 pSiS
->GammaPBriR
= pSiS
->GammaPBriG
= pSiS
->GammaPBriB
= (int)(val1
* 1000);
1916 } else if(result
== 3) {
1917 if((val1
>= 0.1) && (val1
<= 10.0) &&
1918 (val2
>= 0.1) && (val2
<= 10.0) &&
1919 (val3
>= 0.1) && (val3
<= 10.0)) {
1921 pSiS
->GammaPBriR
= (int)(val1
* 1000);
1922 pSiS
->GammaPBriG
= (int)(val2
* 1000);
1923 pSiS
->GammaPBriB
= (int)(val3
* 1000);
1927 xf86DrvMsg(pScrn
->scrnIndex
, X_WARNING
,
1928 "\"StoredGammaPreBrightness\" expects 1 or 3 real numbers (0.1 - 10.0)\n");
1935 const OptionInfoRec
*
1936 SISAvailableOptions(int chipid
, int busid
)