Remove code that relies on CP_HaveCustomData, HaveCustomModes, or AddedPlasmaModes

None of these three structure fields are ever set to non-FALSE values
(memset at structure initialization sets them all to FALSE).  Remove
any and all code that is gated by them being set to non-FALSE.
This commit is contained in:
Ian Romanick
2007-04-27 10:14:23 -07:00
parent 23e6a4c8e7
commit 5aa3427c0e
6 changed files with 9 additions and 132 deletions

View File

@@ -1366,7 +1366,7 @@ XGIBIOSSetMode(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr pScr
}
ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags, pXGI->HaveCustomModes);
ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags);
if(!ModeNo) return FALSE;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Setting standard mode 0x%x\n", ModeNo);
@@ -1481,7 +1481,7 @@ XGIBIOSSetModeCRT1(XGI_Private *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, ScrnInfoPtr
} else {
ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags, pXGI->HaveCustomModes);
ModeNo = XGI_CalcModeIndex(pScrn, mode, pXGI->VBFlags);
if(!ModeNo) return FALSE;
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3,

View File

@@ -198,8 +198,8 @@ extern void XGICalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned in
extern unsigned char XGI_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
extern unsigned char XGI_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
extern USHORT XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned long VBFlags,
BOOLEAN hcm);
extern USHORT XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode,
unsigned long VBFlags);
#endif
#endif

View File

@@ -238,7 +238,6 @@ typedef struct _XGI_Private
int CenterScreen;
USHORT CP_Vendor, CP_Product;
BOOLEAN CP_HaveCustomData;
int CP_PreferredX, CP_PreferredY, CP_PreferredIndex;
int CP_MaxX, CP_MaxY, CP_MaxClock;
BOOLEAN CP_Supports64048075;

View File

@@ -705,7 +705,6 @@ typedef struct {
unsigned long ForceYPbPrType, ForceYPbPrAR;
unsigned long lockcalls; /* Count unlock calls for debug */
BOOLEAN HaveCustomModes;
BOOLEAN IsCustom;
Atom xvBrightness, xvContrast, xvColorKey, xvHue, xvSaturation;
Atom xvAutopaintColorKey, xvSetDefaults, xvSwitchCRT;
@@ -737,7 +736,6 @@ typedef struct {
int AllowHotkey;
BOOLEAN enablexgictrl;
short Video_MaxWidth, Video_MaxHeight;
BOOLEAN AddedPlasmaModes;
short scrnPitch2;
unsigned long mmioSize;
#ifdef XGIMERGED
@@ -755,7 +753,6 @@ typedef struct {
int CRT1frameY1;
Bool CheckForCRT2;
Bool IsCustomCRT2;
BOOLEAN HaveCustomModes2;
int MergedFBXDPI, MergedFBYDPI;
#ifdef XGIXINERAMA
Bool UsexgiXinerama;

View File

@@ -3488,8 +3488,6 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags)
includelcdmodes = FALSE;
acceptcustommodes = FALSE;
}
pXGI->HaveCustomModes2 = FALSE;
}
if (pXGI->MergedFB) {
@@ -5240,7 +5238,7 @@ XGIPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode)
unsigned char CR17, CR38 = 0;
unsigned char CR35 = 0, CR79 = 0;
unsigned long vbflag;
int temp = 0, i;
int temp = 0;
int crt1rateindex = 0;
DisplayModePtr mymode;
#ifdef XGIMERGED
@@ -5261,119 +5259,7 @@ XGIPreSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int viewmode)
pXGI->IsCustom = FALSE;
#ifdef XGIMERGED
pXGI->IsCustomCRT2 = FALSE;
if (pXGI->MergedFB) {
/* CRT2 */
if (vbflag & CRT2_LCD) {
if (pXGI->XGI_Pr->CP_HaveCustomData) {
for (i = 0; i < 7; i++) {
if (pXGI->XGI_Pr->CP_DataValid[i]) {
if ((mymode2->HDisplay ==
pXGI->XGI_Pr->CP_HDisplay[i])
&& (mymode2->VDisplay ==
pXGI->XGI_Pr->CP_VDisplay[i])) {
if (mymode2->type & M_T_BUILTIN) {
pXGI->IsCustomCRT2 = TRUE;
}
}
}
}
}
}
if (vbflag & (CRT2_VGA | CRT2_LCD)) {
if (pXGI->AddedPlasmaModes) {
if (mymode2->type & M_T_BUILTIN) {
pXGI->IsCustomCRT2 = TRUE;
}
}
if (pXGI->HaveCustomModes2) {
if (!(mymode2->type & M_T_DEFAULT)) {
pXGI->IsCustomCRT2 = TRUE;
}
}
}
/* CRT1 */
if (pXGI->HaveCustomModes) {
if (!(mymode->type & M_T_DEFAULT)) {
pXGI->IsCustom = TRUE;
}
}
}
else
#endif
#ifdef XGIDUALHEAD
if (pXGI->DualHeadMode) {
if (!pXGI->SecondHead) {
/* CRT2 */
if (vbflag & CRT2_LCD) {
if (pXGI->XGI_Pr->CP_HaveCustomData) {
for (i = 0; i < 7; i++) {
if (pXGI->XGI_Pr->CP_DataValid[i]) {
if ((mymode->HDisplay ==
pXGI->XGI_Pr->CP_HDisplay[i])
&& (mymode->VDisplay ==
pXGI->XGI_Pr->CP_VDisplay[i])) {
if (mymode->type & M_T_BUILTIN) {
pXGI->IsCustom = TRUE;
}
}
}
}
}
}
if (vbflag & (CRT2_VGA | CRT2_LCD)) {
if (pXGI->AddedPlasmaModes) {
if (mymode->type & M_T_BUILTIN) {
pXGI->IsCustom = TRUE;
}
}
if (pXGI->HaveCustomModes) {
if (!(mymode->type & M_T_DEFAULT)) {
pXGI->IsCustom = TRUE;
}
}
}
}
else {
/* CRT1 */
if (pXGI->HaveCustomModes) {
if (!(mymode->type & M_T_DEFAULT)) {
pXGI->IsCustom = TRUE;
}
}
}
}
else
#endif
{
if (vbflag & CRT2_LCD) {
if (pXGI->XGI_Pr->CP_HaveCustomData) {
for (i = 0; i < 7; i++) {
if (pXGI->XGI_Pr->CP_DataValid[i]) {
if ((mymode->HDisplay == pXGI->XGI_Pr->CP_HDisplay[i])
&& (mymode->VDisplay ==
pXGI->XGI_Pr->CP_VDisplay[i])) {
if (mymode->type & M_T_BUILTIN) {
pXGI->IsCustom = TRUE;
}
}
}
}
}
}
if (vbflag & (CRT2_LCD | CRT2_VGA)) {
if (pXGI->AddedPlasmaModes) {
if (mymode->type & M_T_BUILTIN) {
pXGI->IsCustom = TRUE;
}
}
}
if ((pXGI->HaveCustomModes) && (!(vbflag & CRT2_TV))) {
if (!(mymode->type & M_T_DEFAULT)) {
pXGI->IsCustom = TRUE;
}
}
}
#ifdef UNLOCK_ALWAYS
xgiSaveUnlockExtRegisterLock(pXGI, NULL, NULL); /* Unlock Registers */
@@ -5704,17 +5590,12 @@ XGIPostSetMode(ScrnInfoPtr pScrn, XGIRegPtr xgiReg)
USHORT
XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode,
unsigned long VBFlags, BOOLEAN havecustommodes)
unsigned long VBFlags)
{
XGIPtr pXGI = XGIPTR(pScrn);
UShort i = (pXGI->CurrentLayout.bitsPerPixel + 7) / 8 - 1;
if (!(VBFlags & CRT1_LCDA)) {
if ((havecustommodes) && (!(mode->type & M_T_DEFAULT))) {
return 0xfe;
}
}
else {
if ((VBFlags & CRT1_LCDA)) {
if ((mode->HDisplay > pXGI->LCDwidth) ||
(mode->VDisplay > pXGI->LCDheight)) {
return 0;

View File

@@ -722,8 +722,8 @@ static void XGIPostSetMode(ScrnInfoPtr pScrn, XGIRegPtr xgiReg);
/* #ifdef XGIMERGED
static void XGIMergePointerMoved(int scrnIndex, int x, int y);
#endif */
USHORT XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode,
unsigned long VBFlags, BOOLEAN hcm);
USHORT XGI_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode,
unsigned long VBFlags);
unsigned char XGI_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
#ifdef DEBUG
static void XGIDumpModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode);