summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsap7@yahoo.gr>2006-08-14 17:55:14 +0300
committerGeorge Sapountzis <gsap7@yahoo.gr>2007-01-21 19:42:18 +0200
commit2402e364d07bef810b5c019a755a25865f803b77 (patch)
tree456f3d24f54a40b1b6a22f9215943ef25a06c663
parent2d64927ba54b39be30334407ecbec8b6d1ac1822 (diff)
Minor refactoring of module (un)loading for TV_OUT.
-rw-r--r--src/atimach64.c11
-rw-r--r--src/atimode.c9
-rw-r--r--src/atipreinit.c41
3 files changed, 26 insertions, 35 deletions
diff --git a/src/atimach64.c b/src/atimach64.c
index 24da669f..98eb894d 100644
--- a/src/atimach64.c
+++ b/src/atimach64.c
@@ -646,15 +646,16 @@ ATIMach64Calculate
{
pMode->Flags &= ~(V_PHSYNC | V_NHSYNC | V_PVSYNC | V_NVSYNC);
- if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0)
-#ifdef TV_OUT
- && !pATI->tvActive
-#endif
-)
+ if (pATI->OptionPanelDisplay && (pATI->LCDPanelID >= 0))
VDisplay = pATI->LCDVertical;
else
VDisplay = pMode->CrtcVDisplay;
+#ifdef TV_OUT
+ if (pATI->tvActive)
+ VDisplay = pMode->CrtcVDisplay;
+#endif
+
if (VDisplay < 400)
pMode->Flags |= V_PHSYNC | V_NVSYNC;
else if (VDisplay < 480)
diff --git a/src/atimode.c b/src/atimode.c
index 227eea29..d4554048 100644
--- a/src/atimode.c
+++ b/src/atimode.c
@@ -741,16 +741,17 @@ ATIModeCalculate
MaxScalerClock = 80000; /* Conservative */
pATIHW->pll_vclk_cntl &= ~PLL_ECP_DIV;
#ifdef TV_OUT
- if (!pATI->OptionTvOut) {
-#endif /* TV_OUT */
+ if (pATI->OptionTvOut) {
/* XXX Don't do this for TVOut! */
+ }
+ else
+#endif /* TV_OUT */
+ {
ECPClock = pMode->SynthClock;
for (Index = 0; (ECPClock > MaxScalerClock) && (Index < 2); Index++)
ECPClock >>= 1;
pATIHW->pll_vclk_cntl |= SetBits(Index, PLL_ECP_DIV);
-#ifdef TV_OUT
}
-#endif /* TV_OUT */
}
else if (pATI->DAC == ATI_DAC_IBMRGB514)
{
diff --git a/src/atipreinit.c b/src/atipreinit.c
index b5259189..cb5ba139 100644
--- a/src/atipreinit.c
+++ b/src/atipreinit.c
@@ -178,7 +178,7 @@ ATIPreInit
#ifndef AVOID_CPIO
xf86Int10InfoPtr pInt10Info = NULL;
- vbeInfoPtr pVBE;
+ vbeInfoPtr pVBE = NULL;
pointer pInt10Module, pDDCModule = NULL, pVBEModule = NULL;
#endif /* AVOID_CPIO */
@@ -301,14 +301,7 @@ ATIPreInit
ATIProcessOptions(pScreenInfo, pATI);
}
-#ifdef AVOID_CPIO
-
- else /* if (flags & PROBE_DETECT) */
- {
- return TRUE;
- }
-
-#else /* AVOID_CPIO */
+#ifndef AVOID_CPIO
#ifdef TV_OUT
@@ -349,17 +342,7 @@ ATIPreInit
if ((pVBE = VBEInit(pInt10Info, pATI->iEntity)))
{
ConfiguredMonitor = vbeDoEDID(pVBE, pDDCModule);
-#ifdef TV_OUT
- pATI->pInt10 = pInt10Info;
- pATI->pVBE = pVBE;
- pVBE = NULL;
-#else
- vbeFree(pVBE);
-#endif /* TV_OUT */
}
-#ifndef TV_OUT
- xf86UnloadSubModule(pVBEModule);
-#endif /* TV_OUT */
}
if (!(flags & PROBE_DETECT))
@@ -383,20 +366,21 @@ ATIPreInit
}
#ifndef TV_OUT
+ /* De-activate VBE */
+ vbeFree(pVBE);
+ xf86UnloadSubModule(pVBEModule);
+
/* De-activate int10 */
xf86FreeInt10(pInt10Info);
xf86UnloadSubModule(pInt10Module);
#else
+ pATI->pInt10 = pInt10Info;
+ pATI->pVBE = pVBE;
+ pVBE = NULL;
pInt10Info = NULL;
#endif /* TV_OUT */
- if (flags & PROBE_DETECT)
- {
- xf86UnloadSubModule(pDDCModule);
- return TRUE;
- }
-
- if (ConfiguredMonitor)
+ if (ConfiguredMonitor && !(flags & PROBE_DETECT))
{
xf86PrintEDID(ConfiguredMonitor);
xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor);
@@ -407,6 +391,11 @@ ATIPreInit
#endif /* AVOID_CPIO */
+ if (flags & PROBE_DETECT)
+ {
+ return TRUE;
+ }
+
pATI->Block0Base = 0; /* Might no longer be valid */
if ((pVideo = pATI->PCIInfo))
{