sisfb: delete dead SIS_XORG_XF86 code

Delete code for compiling the driver for X.org/XFree86. The development
has forked, so there is no point keeping this code in the tree.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by Aaro Koskinen and committed by Paul Mundt e7d828ab f3fff735

-788
-537
drivers/video/sis/init.c
··· 340 /* HELPER: Get ModeID */ 341 /*********************************************/ 342 343 - #ifndef SIS_XORG_XF86 344 static 345 - #endif 346 unsigned short 347 SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 348 int Depth, bool FSTN, int LCDwidth, int LCDheight) ··· 2997 SiS_Pr->SiS_SelectCRT2Rate = 0; 2998 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); 2999 3000 - #ifdef SIS_XORG_XF86 3001 - xf86DrvMsgVerb(0, X_PROBED, 4, "(init: VBType=0x%04x, VBInfo=0x%04x)\n", 3002 - SiS_Pr->SiS_VBType, SiS_Pr->SiS_VBInfo); 3003 - #endif 3004 - 3005 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { 3006 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { 3007 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; ··· 3196 } 3197 3198 /*********************************************/ 3199 - /* X.org/XFree86: SET SCREEN PITCH */ 3200 - /*********************************************/ 3201 - 3202 - #ifdef SIS_XORG_XF86 3203 - static void 3204 - SiS_SetPitchCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3205 - { 3206 - SISPtr pSiS = SISPTR(pScrn); 3207 - unsigned short HDisplay = pSiS->scrnPitch >> 3; 3208 - 3209 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x13,(HDisplay & 0xFF)); 3210 - SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0xF0,(HDisplay >> 8)); 3211 - } 3212 - 3213 - static void 3214 - SiS_SetPitchCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3215 - { 3216 - SISPtr pSiS = SISPTR(pScrn); 3217 - unsigned short HDisplay = pSiS->scrnPitch2 >> 3; 3218 - 3219 - /* Unlock CRT2 */ 3220 - if(pSiS->VGAEngine == SIS_315_VGA) 3221 - SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2F, 0x01); 3222 - else 3223 - SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24, 0x01); 3224 - 3225 - SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(HDisplay & 0xFF)); 3226 - SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0xF0,(HDisplay >> 8)); 3227 - } 3228 - 3229 - static void 3230 - SiS_SetPitch(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn) 3231 - { 3232 - SISPtr pSiS = SISPTR(pScrn); 3233 - bool isslavemode = false; 3234 - 3235 - if( (pSiS->VBFlags2 & VB2_VIDEOBRIDGE) && 3236 - ( ((pSiS->VGAEngine == SIS_300_VGA) && 3237 - (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0xa0) == 0x20) || 3238 - ((pSiS->VGAEngine == SIS_315_VGA) && 3239 - (SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x50) == 0x10) ) ) { 3240 - isslavemode = true; 3241 - } 3242 - 3243 - /* We need to set pitch for CRT1 if bridge is in slave mode, too */ 3244 - if((pSiS->VBFlags & DISPTYPE_DISP1) || (isslavemode)) { 3245 - SiS_SetPitchCRT1(SiS_Pr, pScrn); 3246 - } 3247 - /* We must not set the pitch for CRT2 if bridge is in slave mode */ 3248 - if((pSiS->VBFlags & DISPTYPE_DISP2) && (!isslavemode)) { 3249 - SiS_SetPitchCRT2(SiS_Pr, pScrn); 3250 - } 3251 - } 3252 - #endif 3253 - 3254 - /*********************************************/ 3255 /* SiSSetMode() */ 3256 /*********************************************/ 3257 3258 - #ifdef SIS_XORG_XF86 3259 - /* We need pScrn for setting the pitch correctly */ 3260 - bool 3261 - SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, bool dosetpitch) 3262 - #else 3263 bool 3264 SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 3265 - #endif 3266 { 3267 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3268 unsigned short RealModeNo, ModeIdIndex; ··· 3232 SiS_GetSysFlags(SiS_Pr); 3233 3234 SiS_Pr->SiS_VGAINFO = 0x11; 3235 - #if defined(SIS_XORG_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__)) 3236 - if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3237 - #endif 3238 3239 #ifdef SIS_LINUX_KERNEL 3240 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); ··· 3352 } 3353 } 3354 3355 - #ifdef SIS_XORG_XF86 3356 - if(pScrn) { 3357 - /* SetPitch: Adapt to virtual size & position */ 3358 - if((ModeNo > 0x13) && (dosetpitch)) { 3359 - SiS_SetPitch(SiS_Pr, pScrn); 3360 - } 3361 - 3362 - /* Backup/Set ModeNo in BIOS scratch area */ 3363 - SiS_GetSetModeID(pScrn, ModeNo); 3364 - } 3365 - #endif 3366 - 3367 SiS_CloseCRTC(SiS_Pr); 3368 3369 SiS_Handle760(SiS_Pr); ··· 3363 3364 return true; 3365 } 3366 - 3367 - /*********************************************/ 3368 - /* X.org/XFree86: SiSBIOSSetMode() */ 3369 - /* for non-Dual-Head mode */ 3370 - /*********************************************/ 3371 - 3372 - #ifdef SIS_XORG_XF86 3373 - bool 3374 - SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3375 - DisplayModePtr mode, bool IsCustom) 3376 - { 3377 - SISPtr pSiS = SISPTR(pScrn); 3378 - unsigned short ModeNo = 0; 3379 - 3380 - SiS_Pr->UseCustomMode = false; 3381 - 3382 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3383 - 3384 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting custom mode %dx%d\n", 3385 - SiS_Pr->CHDisplay, 3386 - (mode->Flags & V_INTERLACE ? SiS_Pr->CVDisplay * 2 : 3387 - (mode->Flags & V_DBLSCAN ? SiS_Pr->CVDisplay / 2 : 3388 - SiS_Pr->CVDisplay))); 3389 - 3390 - } else { 3391 - 3392 - /* Don't need vbflags here; checks done earlier */ 3393 - ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3394 - if(!ModeNo) return false; 3395 - 3396 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo); 3397 - 3398 - } 3399 - 3400 - return(SiSSetMode(SiS_Pr, pScrn, ModeNo, true)); 3401 - } 3402 - 3403 - /*********************************************/ 3404 - /* X.org/XFree86: SiSBIOSSetModeCRT2() */ 3405 - /* for Dual-Head modes */ 3406 - /*********************************************/ 3407 - 3408 - bool 3409 - SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3410 - DisplayModePtr mode, bool IsCustom) 3411 - { 3412 - SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3413 - SISPtr pSiS = SISPTR(pScrn); 3414 - #ifdef SISDUALHEAD 3415 - SISEntPtr pSiSEnt = pSiS->entityPrivate; 3416 - #endif 3417 - unsigned short ModeIdIndex; 3418 - unsigned short ModeNo = 0; 3419 - unsigned char backupreg = 0; 3420 - 3421 - SiS_Pr->UseCustomMode = false; 3422 - 3423 - /* Remember: Custom modes for CRT2 are ONLY supported 3424 - * -) on the 30x/B/C, and 3425 - * -) if CRT2 is LCD or VGA, or CRT1 is LCDA 3426 - */ 3427 - 3428 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3429 - 3430 - ModeNo = 0xfe; 3431 - 3432 - } else { 3433 - 3434 - ModeNo = SiS_GetModeNumber(pScrn, mode, pSiS->VBFlags); 3435 - if(!ModeNo) return false; 3436 - 3437 - } 3438 - 3439 - SiSRegInit(SiS_Pr, BaseAddr); 3440 - SiSInitPtr(SiS_Pr); 3441 - SiS_GetSysFlags(SiS_Pr); 3442 - #if defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) 3443 - SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3444 - #else 3445 - SiS_Pr->SiS_VGAINFO = 0x11; 3446 - #endif 3447 - 3448 - SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3449 - 3450 - SiSInitPCIetc(SiS_Pr); 3451 - SiSSetLVDSetc(SiS_Pr); 3452 - SiSDetermineROMUsage(SiS_Pr); 3453 - 3454 - /* Save mode info so we can set it from within SetMode for CRT1 */ 3455 - #ifdef SISDUALHEAD 3456 - if(pSiS->DualHeadMode) { 3457 - pSiSEnt->CRT2ModeNo = ModeNo; 3458 - pSiSEnt->CRT2DMode = mode; 3459 - pSiSEnt->CRT2IsCustom = IsCustom; 3460 - pSiSEnt->CRT2CR30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 3461 - pSiSEnt->CRT2CR31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); 3462 - pSiSEnt->CRT2CR35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3463 - pSiSEnt->CRT2CR38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3464 - #if 0 3465 - /* We can't set CRT2 mode before CRT1 mode is set - says who...? */ 3466 - if(pSiSEnt->CRT1ModeNo == -1) { 3467 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3468 - "Setting CRT2 mode delayed until after setting CRT1 mode\n"); 3469 - return true; 3470 - } 3471 - #endif 3472 - pSiSEnt->CRT2ModeSet = true; 3473 - } 3474 - #endif 3475 - 3476 - if(SiS_Pr->UseCustomMode) { 3477 - 3478 - unsigned short temptemp = SiS_Pr->CVDisplay; 3479 - 3480 - if(SiS_Pr->CModeFlag & DoubleScanMode) temptemp >>= 1; 3481 - else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1; 3482 - 3483 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3484 - "Setting custom mode %dx%d on CRT2\n", 3485 - SiS_Pr->CHDisplay, temptemp); 3486 - 3487 - } else { 3488 - 3489 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3490 - "Setting standard mode 0x%x on CRT2\n", ModeNo); 3491 - 3492 - } 3493 - 3494 - SiS_UnLockCRT2(SiS_Pr); 3495 - 3496 - if(!SiS_Pr->UseCustomMode) { 3497 - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; 3498 - } else { 3499 - ModeIdIndex = 0; 3500 - } 3501 - 3502 - SiS_GetVBType(SiS_Pr); 3503 - 3504 - SiS_InitVB(SiS_Pr); 3505 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3506 - if(SiS_Pr->ChipType >= SIS_315H) { 3507 - SiS_ResetVB(SiS_Pr); 3508 - SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10); 3509 - SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c); 3510 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3511 - } else { 3512 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3513 - } 3514 - } 3515 - 3516 - /* Get VB information (connectors, connected devices) */ 3517 - if(!SiS_Pr->UseCustomMode) { 3518 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 1); 3519 - } else { 3520 - /* If this is a custom mode, we don't check the modeflag for CRT2Mode */ 3521 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 0); 3522 - } 3523 - SiS_SetYPbPr(SiS_Pr); 3524 - SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex); 3525 - SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3526 - SiS_SetLowModeTest(SiS_Pr, ModeNo); 3527 - 3528 - SiS_ResetSegmentRegisters(SiS_Pr); 3529 - 3530 - /* Set mode on CRT2 */ 3531 - if( (SiS_Pr->SiS_VBType & VB_SISVB) || 3532 - (SiS_Pr->SiS_IF_DEF_LVDS == 1) || 3533 - (SiS_Pr->SiS_IF_DEF_CH70xx != 0) || 3534 - (SiS_Pr->SiS_IF_DEF_TRUMPION != 0) ) { 3535 - SiS_SetCRT2Group(SiS_Pr, ModeNo); 3536 - } 3537 - 3538 - SiS_StrangeStuff(SiS_Pr); 3539 - 3540 - SiS_DisplayOn(SiS_Pr); 3541 - SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3542 - 3543 - if(SiS_Pr->ChipType >= SIS_315H) { 3544 - if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { 3545 - if(!(SiS_IsDualEdge(SiS_Pr))) { 3546 - SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x13,0xfb); 3547 - } 3548 - } 3549 - } 3550 - 3551 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3552 - if(SiS_Pr->ChipType >= SIS_315H) { 3553 - if(!SiS_Pr->SiS_ROMNew) { 3554 - if(SiS_IsVAMode(SiS_Pr)) { 3555 - SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01); 3556 - } else { 3557 - SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x35,0xFE); 3558 - } 3559 - } 3560 - 3561 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg); 3562 - 3563 - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x30) & SetCRT2ToLCD) { 3564 - SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc); 3565 - } 3566 - } else if((SiS_Pr->ChipType == SIS_630) || 3567 - (SiS_Pr->ChipType == SIS_730)) { 3568 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg); 3569 - } 3570 - } 3571 - 3572 - /* SetPitch: Adapt to virtual size & position */ 3573 - SiS_SetPitchCRT2(SiS_Pr, pScrn); 3574 - 3575 - SiS_Handle760(SiS_Pr); 3576 - 3577 - return true; 3578 - } 3579 - 3580 - /*********************************************/ 3581 - /* X.org/XFree86: SiSBIOSSetModeCRT1() */ 3582 - /* for Dual-Head modes */ 3583 - /*********************************************/ 3584 - 3585 - bool 3586 - SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 3587 - DisplayModePtr mode, bool IsCustom) 3588 - { 3589 - SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3590 - SISPtr pSiS = SISPTR(pScrn); 3591 - unsigned short ModeIdIndex, ModeNo = 0; 3592 - unsigned char backupreg = 0; 3593 - #ifdef SISDUALHEAD 3594 - SISEntPtr pSiSEnt = pSiS->entityPrivate; 3595 - unsigned char backupcr30, backupcr31, backupcr38, backupcr35, backupp40d=0; 3596 - bool backupcustom; 3597 - #endif 3598 - 3599 - SiS_Pr->UseCustomMode = false; 3600 - 3601 - if((IsCustom) && (SiS_CheckBuildCustomMode(pScrn, mode, pSiS->VBFlags))) { 3602 - 3603 - unsigned short temptemp = SiS_Pr->CVDisplay; 3604 - 3605 - if(SiS_Pr->CModeFlag & DoubleScanMode) temptemp >>= 1; 3606 - else if(SiS_Pr->CInfoFlag & InterlaceMode) temptemp <<= 1; 3607 - 3608 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3609 - "Setting custom mode %dx%d on CRT1\n", 3610 - SiS_Pr->CHDisplay, temptemp); 3611 - ModeNo = 0xfe; 3612 - 3613 - } else { 3614 - 3615 - ModeNo = SiS_GetModeNumber(pScrn, mode, 0); /* don't give VBFlags */ 3616 - if(!ModeNo) return false; 3617 - 3618 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3619 - "Setting standard mode 0x%x on CRT1\n", ModeNo); 3620 - } 3621 - 3622 - SiSInitPtr(SiS_Pr); 3623 - SiSRegInit(SiS_Pr, BaseAddr); 3624 - SiS_GetSysFlags(SiS_Pr); 3625 - #if defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__) || defined(__amd64__) || defined(__x86_64__) 3626 - SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff); 3627 - #else 3628 - SiS_Pr->SiS_VGAINFO = 0x11; 3629 - #endif 3630 - 3631 - SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86); 3632 - 3633 - SiSInitPCIetc(SiS_Pr); 3634 - SiSSetLVDSetc(SiS_Pr); 3635 - SiSDetermineROMUsage(SiS_Pr); 3636 - 3637 - SiS_UnLockCRT2(SiS_Pr); 3638 - 3639 - if(!SiS_Pr->UseCustomMode) { 3640 - if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return false; 3641 - } else { 3642 - ModeIdIndex = 0; 3643 - } 3644 - 3645 - /* Determine VBType */ 3646 - SiS_GetVBType(SiS_Pr); 3647 - 3648 - SiS_InitVB(SiS_Pr); 3649 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3650 - if(SiS_Pr->ChipType >= SIS_315H) { 3651 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3652 - } else { 3653 - backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3654 - } 3655 - } 3656 - 3657 - /* Get VB information (connectors, connected devices) */ 3658 - /* (We don't care if the current mode is a CRT2 mode) */ 3659 - SiS_GetVBInfo(SiS_Pr, ModeNo, ModeIdIndex, 0); 3660 - SiS_SetYPbPr(SiS_Pr); 3661 - SiS_SetTVMode(SiS_Pr, ModeNo, ModeIdIndex); 3662 - SiS_GetLCDResInfo(SiS_Pr, ModeNo, ModeIdIndex); 3663 - SiS_SetLowModeTest(SiS_Pr, ModeNo); 3664 - 3665 - SiS_OpenCRTC(SiS_Pr); 3666 - 3667 - /* Set mode on CRT1 */ 3668 - SiS_SetCRT1Group(SiS_Pr, ModeNo, ModeIdIndex); 3669 - if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 3670 - SiS_SetCRT2Group(SiS_Pr, ModeNo); 3671 - } 3672 - 3673 - /* SetPitch: Adapt to virtual size & position */ 3674 - SiS_SetPitchCRT1(SiS_Pr, pScrn); 3675 - 3676 - SiS_HandleCRT1(SiS_Pr); 3677 - 3678 - SiS_StrangeStuff(SiS_Pr); 3679 - 3680 - SiS_CloseCRTC(SiS_Pr); 3681 - 3682 - #ifdef SISDUALHEAD 3683 - if(pSiS->DualHeadMode) { 3684 - pSiSEnt->CRT1ModeNo = ModeNo; 3685 - pSiSEnt->CRT1DMode = mode; 3686 - } 3687 - #endif 3688 - 3689 - if(SiS_Pr->UseCustomMode) { 3690 - SiS_Pr->CRT1UsesCustomMode = true; 3691 - SiS_Pr->CSRClock_CRT1 = SiS_Pr->CSRClock; 3692 - SiS_Pr->CModeFlag_CRT1 = SiS_Pr->CModeFlag; 3693 - } else { 3694 - SiS_Pr->CRT1UsesCustomMode = false; 3695 - } 3696 - 3697 - /* Reset CRT2 if changing mode on CRT1 */ 3698 - #ifdef SISDUALHEAD 3699 - if(pSiS->DualHeadMode) { 3700 - if(pSiSEnt->CRT2ModeNo != -1) { 3701 - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, 3702 - "(Re-)Setting mode for CRT2\n"); 3703 - backupcustom = SiS_Pr->UseCustomMode; 3704 - backupcr30 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30); 3705 - backupcr31 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x31); 3706 - backupcr35 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); 3707 - backupcr38 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38); 3708 - if(SiS_Pr->SiS_VBType & VB_SISVB) { 3709 - /* Backup LUT-enable */ 3710 - if(pSiSEnt->CRT2ModeSet) { 3711 - backupp40d = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x0d) & 0x08; 3712 - } 3713 - } 3714 - if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) { 3715 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,pSiSEnt->CRT2CR30); 3716 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,pSiSEnt->CRT2CR31); 3717 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,pSiSEnt->CRT2CR35); 3718 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,pSiSEnt->CRT2CR38); 3719 - } 3720 - 3721 - SiSBIOSSetModeCRT2(SiS_Pr, pSiSEnt->pScrn_1, 3722 - pSiSEnt->CRT2DMode, pSiSEnt->CRT2IsCustom); 3723 - 3724 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x30,backupcr30); 3725 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x31,backupcr31); 3726 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupcr35); 3727 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupcr38); 3728 - if(SiS_Pr->SiS_VBType & VB_SISVB) { 3729 - SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d, ~0x08, backupp40d); 3730 - } 3731 - SiS_Pr->UseCustomMode = backupcustom; 3732 - } 3733 - } 3734 - #endif 3735 - 3736 - /* Warning: From here, the custom mode entries in SiS_Pr are 3737 - * possibly overwritten 3738 - */ 3739 - 3740 - SiS_DisplayOn(SiS_Pr); 3741 - SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xFF); 3742 - 3743 - if(SiS_Pr->SiS_VBType & VB_SIS30xBLV) { 3744 - if(SiS_Pr->ChipType >= SIS_315H) { 3745 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x38,backupreg); 3746 - } else if((SiS_Pr->ChipType == SIS_630) || 3747 - (SiS_Pr->ChipType == SIS_730)) { 3748 - SiS_SetReg(SiS_Pr->SiS_P3d4,0x35,backupreg); 3749 - } 3750 - } 3751 - 3752 - SiS_Handle760(SiS_Pr); 3753 - 3754 - /* Backup/Set ModeNo in BIOS scratch area */ 3755 - SiS_GetSetModeID(pScrn,ModeNo); 3756 - 3757 - return true; 3758 - } 3759 - #endif /* Linux_XF86 */ 3760 3761 #ifndef GETBITSTR 3762 #define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) ··· 3576 if(modeflag & DoubleScanMode) tempax |= 0x80; 3577 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,tempax); 3578 3579 - #ifdef SIS_XORG_XF86 3580 - #ifdef TWDEBUG 3581 - xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", 3582 - SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal, 3583 - SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal, 3584 - SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd); 3585 - xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 3586 - SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1], 3587 - SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3], 3588 - SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5], 3589 - SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]); 3590 - xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 3591 - SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9], 3592 - SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11], 3593 - SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13], 3594 - SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]); 3595 - xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]); 3596 - #endif 3597 - #endif 3598 } 3599 3600 void 3601 SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 3602 int xres, int yres, 3603 - #ifdef SIS_XORG_XF86 3604 - DisplayModePtr current 3605 - #endif 3606 #ifdef SIS_LINUX_KERNEL 3607 struct fb_var_screeninfo *var, bool writeres 3608 #endif ··· 3627 3628 D = B - F - C; 3629 3630 - #ifdef SIS_XORG_XF86 3631 - current->HDisplay = (E * 8); 3632 - current->HSyncStart = (E * 8) + (F * 8); 3633 - current->HSyncEnd = (E * 8) + (F * 8) + (C * 8); 3634 - current->HTotal = (E * 8) + (F * 8) + (C * 8) + (D * 8); 3635 - #ifdef TWDEBUG 3636 - xf86DrvMsg(0, X_INFO, 3637 - "H: A %d B %d C %d D %d E %d F %d HT %d HDE %d HRS %d HBS %d HBE %d HRE %d\n", 3638 - A, B, C, D, E, F, HT, HDE, HRS, HBS, HBE, HRE); 3639 - #else 3640 - (void)VBS; (void)HBS; (void)A; 3641 - #endif 3642 - #endif 3643 #ifdef SIS_LINUX_KERNEL 3644 if(writeres) var->xres = xres = E * 8; 3645 var->left_margin = D * 8; ··· 3679 3680 D = B - F - C; 3681 3682 - #ifdef SIS_XORG_XF86 3683 - current->VDisplay = VDE + 1; 3684 - current->VSyncStart = VRS + 1; 3685 - current->VSyncEnd = ((VRS & ~0x1f) | VRE) + 1; 3686 - if(VRE <= (VRS & 0x1f)) current->VSyncEnd += 32; 3687 - current->VTotal = E + D + C + F; 3688 - #if 0 3689 - current->VDisplay = E; 3690 - current->VSyncStart = E + D; 3691 - current->VSyncEnd = E + D + C; 3692 - current->VTotal = E + D + C + F; 3693 - #endif 3694 - #ifdef TWDEBUG 3695 - xf86DrvMsg(0, X_INFO, 3696 - "V: A %d B %d C %d D %d E %d F %d VT %d VDE %d VRS %d VBS %d VBE %d VRE %d\n", 3697 - A, B, C, D, E, F, VT, VDE, VRS, VBS, VBE, VRE); 3698 - #endif 3699 - #endif 3700 #ifdef SIS_LINUX_KERNEL 3701 if(writeres) var->yres = yres = E; 3702 var->upper_margin = D; ··· 3693 * a negative D. The CRT controller does not 3694 * seem to like correcting HRE to 50) 3695 */ 3696 - #ifdef SIS_XORG_XF86 3697 - current->HDisplay = 320; 3698 - current->HSyncStart = 328; 3699 - current->HSyncEnd = 376; 3700 - current->HTotal = 400; 3701 - #endif 3702 #ifdef SIS_LINUX_KERNEL 3703 var->left_margin = (400 - 376); 3704 var->right_margin = (328 - 320);
··· 340 /* HELPER: Get ModeID */ 341 /*********************************************/ 342 343 static 344 unsigned short 345 SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 346 int Depth, bool FSTN, int LCDwidth, int LCDheight) ··· 2999 SiS_Pr->SiS_SelectCRT2Rate = 0; 3000 SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2); 3001 3002 if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) { 3003 if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { 3004 SiS_Pr->SiS_SetFlag |= ProgrammingCRT2; ··· 3203 } 3204 3205 /*********************************************/ 3206 /* SiSSetMode() */ 3207 /*********************************************/ 3208 3209 bool 3210 SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) 3211 { 3212 SISIOADDRESS BaseAddr = SiS_Pr->IOAddress; 3213 unsigned short RealModeNo, ModeIdIndex; ··· 3301 SiS_GetSysFlags(SiS_Pr); 3302 3303 SiS_Pr->SiS_VGAINFO = 0x11; 3304 3305 #ifdef SIS_LINUX_KERNEL 3306 KeepLockReg = SiS_GetReg(SiS_Pr->SiS_P3c4,0x05); ··· 3424 } 3425 } 3426 3427 SiS_CloseCRTC(SiS_Pr); 3428 3429 SiS_Handle760(SiS_Pr); ··· 3447 3448 return true; 3449 } 3450 3451 #ifndef GETBITSTR 3452 #define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) ··· 4054 if(modeflag & DoubleScanMode) tempax |= 0x80; 4055 SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,tempax); 4056 4057 } 4058 4059 void 4060 SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, 4061 int xres, int yres, 4062 #ifdef SIS_LINUX_KERNEL 4063 struct fb_var_screeninfo *var, bool writeres 4064 #endif ··· 4127 4128 D = B - F - C; 4129 4130 #ifdef SIS_LINUX_KERNEL 4131 if(writeres) var->xres = xres = E * 8; 4132 var->left_margin = D * 8; ··· 4192 4193 D = B - F - C; 4194 4195 #ifdef SIS_LINUX_KERNEL 4196 if(writeres) var->yres = yres = E; 4197 var->upper_margin = D; ··· 4224 * a negative D. The CRT controller does not 4225 * seem to like correcting HRE to 50) 4226 */ 4227 #ifdef SIS_LINUX_KERNEL 4228 var->left_margin = (400 - 376); 4229 var->right_margin = (328 - 320);
-40
drivers/video/sis/init.h
··· 56 #include "osdef.h" 57 #include "initdef.h" 58 59 - #ifdef SIS_XORG_XF86 60 - #include "sis.h" 61 - #define SIS_NEED_inSISREG 62 - #define SIS_NEED_inSISREGW 63 - #define SIS_NEED_inSISREGL 64 - #define SIS_NEED_outSISREG 65 - #define SIS_NEED_outSISREGW 66 - #define SIS_NEED_outSISREGL 67 - #include "sis_regs.h" 68 - #endif 69 - 70 #ifdef SIS_LINUX_KERNEL 71 #include "vgatypes.h" 72 #include "vstruct.h" ··· 1510 }; 1511 1512 bool SiSInitPtr(struct SiS_Private *SiS_Pr); 1513 - #ifdef SIS_XORG_XF86 1514 - unsigned short SiS_GetModeID(int VGAEngine, unsigned int VBFlags, int HDisplay, int VDisplay, 1515 - int Depth, bool FSTN, int LCDwith, int LCDheight); 1516 - #endif 1517 unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 1518 int VDisplay, int Depth, bool FSTN, 1519 unsigned short CustomT, int LCDwith, int LCDheight, ··· 1564 unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1565 #endif 1566 void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1567 - #ifdef SIS_XORG_XF86 1568 - bool SiSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, unsigned short ModeNo, 1569 - bool dosetpitch); 1570 - bool SiSBIOSSetMode(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1571 - DisplayModePtr mode, bool IsCustom); 1572 - bool SiSBIOSSetModeCRT2(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1573 - DisplayModePtr mode, bool IsCustom); 1574 - bool SiSBIOSSetModeCRT1(struct SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, 1575 - DisplayModePtr mode, bool IsCustom); 1576 - #endif 1577 #ifdef SIS_LINUX_KERNEL 1578 bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1579 #endif 1580 void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1581 void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1582 unsigned short ModeIdIndex); 1583 - #ifdef SIS_XORG_XF86 1584 - void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1585 - int yres, DisplayModePtr current); 1586 - #endif 1587 #ifdef SIS_LINUX_KERNEL 1588 void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1589 int yres, struct fb_var_screeninfo *var, bool writeres); ··· 1596 unsigned short ModeIdIndex, unsigned short RRTI); 1597 extern bool SiS_IsVAMode(struct SiS_Private *); 1598 extern bool SiS_IsDualEdge(struct SiS_Private *); 1599 - 1600 - #ifdef SIS_XORG_XF86 1601 - /* From other modules: */ 1602 - extern unsigned short SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, 1603 - unsigned int VBFlags); 1604 - extern unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, unsigned short offset, 1605 - unsigned char value); 1606 - extern unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id); 1607 - extern unsigned short SiS_GetModeNumber(ScrnInfoPtr pScrn, DisplayModePtr mode, 1608 - unsigned int VBFlags); 1609 - #endif 1610 1611 #ifdef SIS_LINUX_KERNEL 1612 #ifdef SIS300
··· 56 #include "osdef.h" 57 #include "initdef.h" 58 59 #ifdef SIS_LINUX_KERNEL 60 #include "vgatypes.h" 61 #include "vstruct.h" ··· 1521 }; 1522 1523 bool SiSInitPtr(struct SiS_Private *SiS_Pr); 1524 unsigned short SiS_GetModeID_LCD(int VGAEngine, unsigned int VBFlags, int HDisplay, 1525 int VDisplay, int Depth, bool FSTN, 1526 unsigned short CustomT, int LCDwith, int LCDheight, ··· 1579 unsigned short SiS_GetLatencyFactor630(struct SiS_Private *SiS_Pr, unsigned short index); 1580 #endif 1581 void SiS_LoadDAC(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short ModeIdIndex); 1582 #ifdef SIS_LINUX_KERNEL 1583 bool SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); 1584 #endif 1585 void SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth); 1586 void SiS_CalcLCDACRT1Timing(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 1587 unsigned short ModeIdIndex); 1588 #ifdef SIS_LINUX_KERNEL 1589 void SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata, int xres, 1590 int yres, struct fb_var_screeninfo *var, bool writeres); ··· 1625 unsigned short ModeIdIndex, unsigned short RRTI); 1626 extern bool SiS_IsVAMode(struct SiS_Private *); 1627 extern bool SiS_IsDualEdge(struct SiS_Private *); 1628 1629 #ifdef SIS_LINUX_KERNEL 1630 #ifdef SIS300
-162
drivers/video/sis/init301.c
··· 1166 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1167 #endif 1168 #endif 1169 - #ifdef SIS_XORG_XF86 1170 - #ifdef TWDEBUG 1171 - xf86DrvMsg(0, X_PROBED, "(init301: VBInfo=0x%04x, SetFlag=0x%04x)\n", 1172 - SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1173 - #endif 1174 - #endif 1175 } 1176 1177 /*********************************************/ ··· 1409 } 1410 1411 SiS_Pr->SiS_VBInfo &= ~SetPALTV; 1412 - 1413 - #ifdef SIS_XORG_XF86 1414 - #ifdef TWDEBUG 1415 - xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo); 1416 - #endif 1417 - #endif 1418 } 1419 1420 /*********************************************/ ··· 1435 unsigned char *ROMAddr; 1436 unsigned short temp; 1437 1438 - #ifdef SIS_XORG_XF86 1439 - #ifdef TWDEBUG 1440 - xf86DrvMsg(0, X_INFO, "Paneldata driver: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", 1441 - SiS_Pr->PanelHT, SiS_Pr->PanelVT, 1442 - SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, 1443 - SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, 1444 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, 1445 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, 1446 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); 1447 - #endif 1448 - #endif 1449 - 1450 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { 1451 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { 1452 SiS_Pr->SiS_NeedRomModeData = true; ··· 1455 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; 1456 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = 1457 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; 1458 - 1459 - #ifdef SIS_XORG_XF86 1460 - #ifdef TWDEBUG 1461 - xf86DrvMsg(0, X_INFO, "Paneldata BIOS: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n", 1462 - SiS_Pr->PanelHT, SiS_Pr->PanelVT, 1463 - SiS_Pr->PanelHRS, SiS_Pr->PanelHRE, 1464 - SiS_Pr->PanelVRS, SiS_Pr->PanelVRE, 1465 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK, 1466 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A, 1467 - SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B); 1468 - #endif 1469 - #endif 1470 1471 } 1472 #endif ··· 2156 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); 2157 #endif 2158 #endif 2159 - #ifdef SIS_XORG_XF86 2160 - xf86DrvMsgVerb(0, X_PROBED, 4, 2161 - "(init301: LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x SetFlag=0x%04x)\n", 2162 - SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo, SiS_Pr->SiS_SetFlag); 2163 - #endif 2164 } 2165 2166 /*********************************************/ ··· 2368 } 2369 2370 } 2371 - 2372 - #ifdef SIS_XORG_XF86 2373 - #ifdef TWDEBUG 2374 - xf86DrvMsg(0, X_INFO, "VCLKIndex %d (0x%x)\n", VCLKIndex, VCLKIndex); 2375 - #endif 2376 - #endif 2377 2378 return VCLKIndex; 2379 } ··· 3480 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; 3481 } 3482 3483 - #ifdef SIS_XORG_XF86 3484 - #ifdef TWDEBUG 3485 - xf86DrvMsg(0, X_INFO, "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex); 3486 - #endif 3487 - #endif 3488 - 3489 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; 3490 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; 3491 SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; ··· 3838 ret = 1; 3839 } 3840 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); 3841 - #ifdef SIS_XORG_XF86 3842 - #ifdef TWDEBUG 3843 - xf86DrvMsg(0, 0, "Setting PWD %x\n", temp); 3844 - #endif 3845 - #endif 3846 } 3847 #endif 3848 return ret; ··· 5362 5363 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); 5364 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ 5365 - 5366 - #ifdef SIS_XORG_XF86 5367 - #ifdef TWDEBUG 5368 - xf86DrvMsg(0, X_INFO, "%d %d %d %d %d %d %d %d (%d %d %d %d)\n", 5369 - SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal, 5370 - SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal, 5371 - SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd); 5372 - 5373 - xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 5374 - SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1], 5375 - SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3], 5376 - SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5], 5377 - SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]); 5378 - xf86DrvMsg(0, X_INFO, " 0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n", 5379 - SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9], 5380 - SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11], 5381 - SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13], 5382 - SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]); 5383 - xf86DrvMsg(0, X_INFO, " 0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]); 5384 - #endif 5385 - #endif 5386 } 5387 5388 /* Setup panel link ··· 7051 7052 /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */ 7053 7054 - #ifdef SIS_XORG_XF86 7055 - #ifdef TWDEBUG 7056 - xf86DrvMsg(0, X_INFO, "lcdvdes 0x%x lcdvdee 0x%x\n", tempcx, tempbx); 7057 - #endif 7058 - #endif 7059 - 7060 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ 7061 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ 7062 ··· 7099 tempbx = SiS_Pr->CVSyncStart; 7100 } 7101 7102 - #ifdef SIS_XORG_XF86 7103 - #ifdef TWDEBUG 7104 - xf86DrvMsg(0, X_INFO, "lcdvrs 0x%x\n", tempbx); 7105 - #endif 7106 - #endif 7107 - 7108 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ 7109 7110 temp = (tempbx >> 4) & 0xF0; ··· 7109 temp &= 0xf0; 7110 temp |= (SiS_Pr->CVSyncEnd & 0x0f); 7111 } 7112 - 7113 - #ifdef SIS_XORG_XF86 7114 - #ifdef TWDEBUG 7115 - xf86DrvMsg(0, X_INFO, "lcdvre[3:0] 0x%x\n", (temp & 0x0f)); 7116 - #endif 7117 - #endif 7118 7119 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); 7120 ··· 7148 tempax >>= 1; 7149 } 7150 7151 - #ifdef SIS_XORG_XF86 7152 - #ifdef TWDEBUG 7153 - xf86DrvMsg(0, X_INFO, "lcdhdee 0x%x\n", tempbx); 7154 - #endif 7155 - #endif 7156 - 7157 tempbx += bridgeoffset; 7158 7159 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ ··· 7173 tempbx += bridgeoffset; 7174 } 7175 7176 - #ifdef SIS_XORG_XF86 7177 - #ifdef TWDEBUG 7178 - xf86DrvMsg(0, X_INFO, "lcdhrs 0x%x\n", tempbx); 7179 - #endif 7180 - #endif 7181 - 7182 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ 7183 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); 7184 ··· 7190 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; 7191 tempbx += bridgeoffset; 7192 } 7193 - 7194 - #ifdef SIS_XORG_XF86 7195 - #ifdef TWDEBUG 7196 - xf86DrvMsg(0, X_INFO, "lcdhre 0x%x\n", tempbx); 7197 - #endif 7198 - #endif 7199 7200 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ 7201 ··· 8588 SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8589 } 8590 8591 - #ifdef SIS_XORG_XF86 8592 - #ifdef TWDEBUG 8593 - xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES); 8594 - xf86DrvMsg(0, X_INFO, "(init301: HDE 0x%03x VDE 0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE); 8595 - xf86DrvMsg(0, X_INFO, "(init301: VGAHDE 0x%03x VGAVDE 0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE); 8596 - xf86DrvMsg(0, X_INFO, "(init301: HT 0x%03x VT 0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT); 8597 - xf86DrvMsg(0, X_INFO, "(init301: VGAHT 0x%03x VGAVT 0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT); 8598 - #endif 8599 - #endif 8600 - 8601 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8602 SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8603 } ··· 8798 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); 8799 if(!dataptr) return false; 8800 } 8801 - #ifdef SIS_XORG_XF86 8802 - #ifdef TWDEBUG 8803 - xf86DrvMsg(0, X_INFO, "Trumpion block success\n"); 8804 - #endif 8805 - #endif 8806 return true; 8807 } 8808 #endif ··· 8984 } 8985 8986 /* Our own DDC functions */ 8987 - #ifndef SIS_XORG_XF86 8988 static 8989 - #endif 8990 unsigned short 8991 SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 8992 unsigned short adaptnum, unsigned short DDCdatatype, bool checkcr32, ··· 9092 9093 SiS_SetupDDCN(SiS_Pr); 9094 9095 - #ifdef SIS_XORG_XF86 9096 - #ifdef TWDEBUG 9097 - xf86DrvMsg(0, X_INFO, "DDC Port %x Index %x Shift %d\n", 9098 - SiS_Pr->SiS_DDC_Port, SiS_Pr->SiS_DDC_Index, temp); 9099 - #endif 9100 - #endif 9101 return 0; 9102 } 9103 ··· 9154 SiS_SetSwitchDDC2(SiS_Pr); 9155 if(SiS_PrepareDDC(SiS_Pr)) { 9156 SiS_SetStop(SiS_Pr); 9157 - #ifdef SIS_XORG_XF86 9158 - #ifdef TWDEBUG 9159 - xf86DrvMsg(0, X_INFO, "Probe: Prepare failed\n"); 9160 - #endif 9161 - #endif 9162 return 0xFFFF; 9163 } 9164 mask = 0xf0; ··· 9167 } else { 9168 failed = true; 9169 ret = 0xFFFF; 9170 - #ifdef SIS_XORG_XF86 9171 - #ifdef TWDEBUG 9172 - xf86DrvMsg(0, X_INFO, "Probe: Read 1 failed\n"); 9173 - #endif 9174 - #endif 9175 } 9176 } 9177 if(!failed) { ··· 9176 if(temp == value) ret = 0; 9177 else { 9178 ret = 0xFFFF; 9179 - #ifdef SIS_XORG_XF86 9180 - #ifdef TWDEBUG 9181 - xf86DrvMsg(0, X_INFO, "Probe: Read 2 failed\n"); 9182 - #endif 9183 - #endif 9184 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { 9185 if(temp == 0x30) ret = 0; 9186 } ··· 9185 return ret; 9186 } 9187 9188 - #ifndef SIS_XORG_XF86 9189 static 9190 - #endif 9191 unsigned short 9192 SiS_ProbeDDC(struct SiS_Private *SiS_Pr) 9193 { ··· 9202 return flag; 9203 } 9204 9205 - #ifndef SIS_XORG_XF86 9206 static 9207 - #endif 9208 unsigned short 9209 SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer) 9210 { ··· 9449 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); 9450 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); 9451 if (!watchdog) { 9452 - #ifdef SIS_XORG_XF86 9453 - #ifdef TWDEBUG 9454 - xf86DrvMsg(0, X_INFO, "SetClkHigh failed\n"); 9455 - #endif 9456 - #endif 9457 return 0xFFFF; 9458 } 9459 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
··· 1166 SiS_Pr->SiS_VBInfo, SiS_Pr->SiS_SetFlag); 1167 #endif 1168 #endif 1169 } 1170 1171 /*********************************************/ ··· 1415 } 1416 1417 SiS_Pr->SiS_VBInfo &= ~SetPALTV; 1418 } 1419 1420 /*********************************************/ ··· 1447 unsigned char *ROMAddr; 1448 unsigned short temp; 1449 1450 if((ROMAddr = GetLCDStructPtr661(SiS_Pr))) { 1451 if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) { 1452 SiS_Pr->SiS_NeedRomModeData = true; ··· 1479 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19]; 1480 SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C = 1481 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20]; 1482 1483 } 1484 #endif ··· 2192 SiS_Pr->SiS_LCDInfo, SiS_Pr->SiS_LCDResInfo, SiS_Pr->SiS_LCDTypeInfo); 2193 #endif 2194 #endif 2195 } 2196 2197 /*********************************************/ ··· 2409 } 2410 2411 } 2412 2413 return VCLKIndex; 2414 } ··· 3527 default : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data; break; 3528 } 3529 3530 SiS_Pr->SiS_RVBHCMAX = (LCDPtr+ResIndex)->RVBHCMAX; 3531 SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT; 3532 SiS_Pr->SiS_VGAHT = (LCDPtr+ResIndex)->VGAHT; ··· 3891 ret = 1; 3892 } 3893 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x27,0x7f,temp); 3894 } 3895 #endif 3896 return ret; ··· 5420 5421 temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)); 5422 SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp); /* ? */ 5423 } 5424 5425 /* Setup panel link ··· 7130 7131 /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */ 7132 7133 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx); /* lcdvdes */ 7134 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx); /* lcdvdee */ 7135 ··· 7184 tempbx = SiS_Pr->CVSyncStart; 7185 } 7186 7187 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx); /* lcdvrs */ 7188 7189 temp = (tempbx >> 4) & 0xF0; ··· 7200 temp &= 0xf0; 7201 temp |= (SiS_Pr->CVSyncEnd & 0x0f); 7202 } 7203 7204 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp); 7205 ··· 7245 tempax >>= 1; 7246 } 7247 7248 tempbx += bridgeoffset; 7249 7250 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx); /* lcdhdee */ ··· 7276 tempbx += bridgeoffset; 7277 } 7278 7279 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx); /* lcdhrs */ 7280 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0)); 7281 ··· 7299 if(SiS_IsDualLink(SiS_Pr)) tempbx >>= 1; 7300 tempbx += bridgeoffset; 7301 } 7302 7303 SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx); /* lcdhre */ 7304 ··· 8703 SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8704 } 8705 8706 if(SiS_Pr->SiS_SetFlag & LowModeTests) { 8707 SiS_SetGroup1(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex); 8708 } ··· 8923 dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr); 8924 if(!dataptr) return false; 8925 } 8926 return true; 8927 } 8928 #endif ··· 9114 } 9115 9116 /* Our own DDC functions */ 9117 static 9118 unsigned short 9119 SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine, 9120 unsigned short adaptnum, unsigned short DDCdatatype, bool checkcr32, ··· 9224 9225 SiS_SetupDDCN(SiS_Pr); 9226 9227 return 0; 9228 } 9229 ··· 9292 SiS_SetSwitchDDC2(SiS_Pr); 9293 if(SiS_PrepareDDC(SiS_Pr)) { 9294 SiS_SetStop(SiS_Pr); 9295 return 0xFFFF; 9296 } 9297 mask = 0xf0; ··· 9310 } else { 9311 failed = true; 9312 ret = 0xFFFF; 9313 } 9314 } 9315 if(!failed) { ··· 9324 if(temp == value) ret = 0; 9325 else { 9326 ret = 0xFFFF; 9327 if(SiS_Pr->SiS_DDC_DeviceAddr == 0xa0) { 9328 if(temp == 0x30) ret = 0; 9329 } ··· 9338 return ret; 9339 } 9340 9341 static 9342 unsigned short 9343 SiS_ProbeDDC(struct SiS_Private *SiS_Pr) 9344 { ··· 9357 return flag; 9358 } 9359 9360 static 9361 unsigned short 9362 SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, unsigned char *buffer) 9363 { ··· 9606 temp = SiS_GetReg(SiS_Pr->SiS_DDC_Port,SiS_Pr->SiS_DDC_Index); 9607 } while((!(temp & SiS_Pr->SiS_DDC_Clk)) && --watchdog); 9608 if (!watchdog) { 9609 return 0xFFFF; 9610 } 9611 SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT);
-14
drivers/video/sis/init301.h
··· 56 #include "osdef.h" 57 #include "initdef.h" 58 59 - #ifdef SIS_XORG_XF86 60 - #include "sis.h" 61 - #include "sis_regs.h" 62 - #endif 63 - 64 #ifdef SIS_LINUX_KERNEL 65 #include "vgatypes.h" 66 #include "vstruct.h" ··· 407 unsigned short adaptnum, unsigned short DDCdatatype, 408 unsigned char *buffer, unsigned int VBFlags2); 409 410 - #ifdef SIS_XORG_XF86 411 - unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 412 - int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 413 - bool checkcr32, unsigned int VBFlags2); 414 - unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 415 - unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 416 - unsigned char *buffer); 417 - #else 418 static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 419 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 420 bool checkcr32, unsigned int VBFlags2); 421 static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 422 static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 423 unsigned char *buffer); 424 - #endif 425 static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr); 426 static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr); 427 static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr);
··· 56 #include "osdef.h" 57 #include "initdef.h" 58 59 #ifdef SIS_LINUX_KERNEL 60 #include "vgatypes.h" 61 #include "vstruct.h" ··· 412 unsigned short adaptnum, unsigned short DDCdatatype, 413 unsigned char *buffer, unsigned int VBFlags2); 414 415 static unsigned short SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, 416 int VGAEngine, unsigned short adaptnum, unsigned short DDCdatatype, 417 bool checkcr32, unsigned int VBFlags2); 418 static unsigned short SiS_ProbeDDC(struct SiS_Private *SiS_Pr); 419 static unsigned short SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype, 420 unsigned char *buffer); 421 static void SiS_SetSwitchDDC2(struct SiS_Private *SiS_Pr); 422 static unsigned short SiS_SetStart(struct SiS_Private *SiS_Pr); 423 static unsigned short SiS_SetStop(struct SiS_Private *SiS_Pr);
-20
drivers/video/sis/osdef.h
··· 56 57 /* The choices are: */ 58 #define SIS_LINUX_KERNEL /* Linux kernel framebuffer */ 59 - #undef SIS_XORG_XF86 /* XFree86/X.org */ 60 61 #ifdef OutPortByte 62 #undef OutPortByte ··· 109 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) 110 111 #endif /* LINUX_KERNEL */ 112 - 113 - /**********************************************************************/ 114 - /* XFree86/X.org */ 115 - /**********************************************************************/ 116 - 117 - #ifdef SIS_XORG_XF86 118 - 119 - #define SIS300 120 - #define SIS315H 121 - 122 - #define OutPortByte(p,v) outSISREG((IOADDRESS)(p),(CARD8)(v)) 123 - #define OutPortWord(p,v) outSISREGW((IOADDRESS)(p),(CARD16)(v)) 124 - #define OutPortLong(p,v) outSISREGL((IOADDRESS)(p),(CARD32)(v)) 125 - #define InPortByte(p) inSISREG((IOADDRESS)(p)) 126 - #define InPortWord(p) inSISREGW((IOADDRESS)(p)) 127 - #define InPortLong(p) inSISREGL((IOADDRESS)(p)) 128 - #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize) 129 - 130 - #endif /* XF86 */ 131 132 #endif /* _OSDEF_H_ */
··· 56 57 /* The choices are: */ 58 #define SIS_LINUX_KERNEL /* Linux kernel framebuffer */ 59 60 #ifdef OutPortByte 61 #undef OutPortByte ··· 110 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize) 111 112 #endif /* LINUX_KERNEL */ 113 114 #endif /* _OSDEF_H_ */
-9
drivers/video/sis/vgatypes.h
··· 62 #define SISIOMEMTYPE __iomem 63 #endif 64 65 - #ifdef SIS_XORG_XF86 66 - #if XF86_VERSION_CURRENT < XF86_VERSION_NUMERIC(4,2,0,0,0) 67 - typedef unsigned long IOADDRESS; 68 - typedef unsigned long SISIOADDRESS; 69 - #else 70 - typedef IOADDRESS SISIOADDRESS; 71 - #endif 72 - #endif 73 - 74 typedef enum _SIS_CHIP_TYPE { 75 SIS_VGALegacy = 0, 76 SIS_530,
··· 62 #define SISIOMEMTYPE __iomem 63 #endif 64 65 typedef enum _SIS_CHIP_TYPE { 66 SIS_VGALegacy = 0, 67 SIS_530,
-6
drivers/video/sis/vstruct.h
··· 233 { 234 unsigned char ChipType; 235 unsigned char ChipRevision; 236 - #ifdef SIS_XORG_XF86 237 - PCITAG PciTag; 238 - #endif 239 #ifdef SIS_LINUX_KERNEL 240 void *ivideo; 241 #endif ··· 277 unsigned short SiS_IF_DEF_FSTN; 278 unsigned short SiS_SysFlags; 279 unsigned char SiS_VGAINFO; 280 - #ifdef SIS_XORG_XF86 281 - unsigned short SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4; 282 - #endif 283 bool SiS_UseROM; 284 bool SiS_ROMNew; 285 bool SiS_XGIROM;
··· 233 { 234 unsigned char ChipType; 235 unsigned char ChipRevision; 236 #ifdef SIS_LINUX_KERNEL 237 void *ivideo; 238 #endif ··· 280 unsigned short SiS_IF_DEF_FSTN; 281 unsigned short SiS_SysFlags; 282 unsigned char SiS_VGAINFO; 283 bool SiS_UseROM; 284 bool SiS_ROMNew; 285 bool SiS_XGIROM;