Remove some #if 0 guarding code duplicated in xf86Modes.c
This commit is contained in:
parent
fd41f46ac6
commit
85617b56e5
|
@ -636,146 +636,6 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
|
||||||
return MODE_OK;
|
return MODE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* xf86SetModeCrtc
|
|
||||||
*
|
|
||||||
* Initialises the Crtc parameters for a mode. The initialisation includes
|
|
||||||
* adjustments for interlaced and double scan modes.
|
|
||||||
*/
|
|
||||||
_X_EXPORT void
|
|
||||||
xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
|
|
||||||
{
|
|
||||||
if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN))
|
|
||||||
return;
|
|
||||||
|
|
||||||
p->CrtcHDisplay = p->HDisplay;
|
|
||||||
p->CrtcHSyncStart = p->HSyncStart;
|
|
||||||
p->CrtcHSyncEnd = p->HSyncEnd;
|
|
||||||
p->CrtcHTotal = p->HTotal;
|
|
||||||
p->CrtcHSkew = p->HSkew;
|
|
||||||
p->CrtcVDisplay = p->VDisplay;
|
|
||||||
p->CrtcVSyncStart = p->VSyncStart;
|
|
||||||
p->CrtcVSyncEnd = p->VSyncEnd;
|
|
||||||
p->CrtcVTotal = p->VTotal;
|
|
||||||
if (p->Flags & V_INTERLACE) {
|
|
||||||
if (adjustFlags & INTERLACE_HALVE_V) {
|
|
||||||
p->CrtcVDisplay /= 2;
|
|
||||||
p->CrtcVSyncStart /= 2;
|
|
||||||
p->CrtcVSyncEnd /= 2;
|
|
||||||
p->CrtcVTotal /= 2;
|
|
||||||
}
|
|
||||||
/* Force interlaced modes to have an odd VTotal */
|
|
||||||
/* maybe we should only do this when INTERLACE_HALVE_V is set? */
|
|
||||||
p->CrtcVTotal |= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p->Flags & V_DBLSCAN) {
|
|
||||||
p->CrtcVDisplay *= 2;
|
|
||||||
p->CrtcVSyncStart *= 2;
|
|
||||||
p->CrtcVSyncEnd *= 2;
|
|
||||||
p->CrtcVTotal *= 2;
|
|
||||||
}
|
|
||||||
if (p->VScan > 1) {
|
|
||||||
p->CrtcVDisplay *= p->VScan;
|
|
||||||
p->CrtcVSyncStart *= p->VScan;
|
|
||||||
p->CrtcVSyncEnd *= p->VScan;
|
|
||||||
p->CrtcVTotal *= p->VScan;
|
|
||||||
}
|
|
||||||
p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
|
|
||||||
p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
|
|
||||||
p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
|
|
||||||
p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
|
|
||||||
|
|
||||||
p->CrtcHAdjusted = FALSE;
|
|
||||||
p->CrtcVAdjusted = FALSE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/**
|
|
||||||
* Allocates and returns a copy of pMode, including pointers within pMode.
|
|
||||||
*/
|
|
||||||
_X_EXPORT DisplayModePtr
|
|
||||||
xf86DuplicateMode(DisplayModePtr pMode)
|
|
||||||
{
|
|
||||||
DisplayModePtr pNew;
|
|
||||||
|
|
||||||
pNew = xnfalloc(sizeof(DisplayModeRec));
|
|
||||||
*pNew = *pMode;
|
|
||||||
pNew->next = NULL;
|
|
||||||
pNew->prev = NULL;
|
|
||||||
if (pNew->name == NULL) {
|
|
||||||
xf86SetModeDefaultName(pMode);
|
|
||||||
} else {
|
|
||||||
pNew->name = xnfstrdup(pMode->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pNew;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Duplicates every mode in the given list and returns a pointer to the first
|
|
||||||
* mode.
|
|
||||||
*
|
|
||||||
* \param modeList doubly-linked mode list
|
|
||||||
*/
|
|
||||||
_X_EXPORT DisplayModePtr
|
|
||||||
xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList)
|
|
||||||
{
|
|
||||||
DisplayModePtr first = NULL, last = NULL;
|
|
||||||
DisplayModePtr mode;
|
|
||||||
|
|
||||||
for (mode = modeList; mode != NULL; mode = mode->next) {
|
|
||||||
DisplayModePtr new;
|
|
||||||
|
|
||||||
new = xf86DuplicateMode(mode);
|
|
||||||
|
|
||||||
/* Insert pNew into modeList */
|
|
||||||
if (last) {
|
|
||||||
last->next = new;
|
|
||||||
new->prev = last;
|
|
||||||
} else {
|
|
||||||
first = new;
|
|
||||||
new->prev = NULL;
|
|
||||||
}
|
|
||||||
new->next = NULL;
|
|
||||||
last = new;
|
|
||||||
}
|
|
||||||
|
|
||||||
return first;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the given modes should program to the same timings.
|
|
||||||
*
|
|
||||||
* This doesn't use Crtc values, as it might be used on ModeRecs without the
|
|
||||||
* Crtc values set. So, it's assumed that the other numbers are enough.
|
|
||||||
*/
|
|
||||||
_X_EXPORT Bool
|
|
||||||
xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2)
|
|
||||||
{
|
|
||||||
if (pMode1->Clock == pMode2->Clock &&
|
|
||||||
pMode1->HDisplay == pMode2->HDisplay &&
|
|
||||||
pMode1->HSyncStart == pMode2->HSyncStart &&
|
|
||||||
pMode1->HSyncEnd == pMode2->HSyncEnd &&
|
|
||||||
pMode1->HTotal == pMode2->HTotal &&
|
|
||||||
pMode1->HSkew == pMode2->HSkew &&
|
|
||||||
pMode1->VDisplay == pMode2->VDisplay &&
|
|
||||||
pMode1->VSyncStart == pMode2->VSyncStart &&
|
|
||||||
pMode1->VSyncEnd == pMode2->VSyncEnd &&
|
|
||||||
pMode1->VTotal == pMode2->VTotal &&
|
|
||||||
pMode1->VScan == pMode2->VScan &&
|
|
||||||
pMode1->Flags == pMode2->Flags)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xf86CheckModeForMonitor
|
* xf86CheckModeForMonitor
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue