diff options
author | David Airlie <airlied@linux.ie> | 2007-02-02 14:54:00 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-02-02 15:34:37 +1100 |
commit | d7317604c843e21c1df048a9253ed55a1957cccd (patch) | |
tree | c5fa31df8be9c098aad15a7dbbe7574759b2bc48 | |
parent | 15c68ac19ff9971ae02cf52036ba36ddea1a6759 (diff) |
get rid of mergetype and displaytype from radeon.h
-rw-r--r-- | src/radeon.h | 7 | ||||
-rw-r--r-- | src/radeon_display.c | 99 | ||||
-rw-r--r-- | src/radeon_driver.c | 41 | ||||
-rw-r--r-- | src/radeon_video.c | 4 |
4 files changed, 75 insertions, 76 deletions
diff --git a/src/radeon.h b/src/radeon.h index 204c1f23..83bec697 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -440,11 +440,6 @@ typedef struct { framebuffer */ int Flags; /* Saved copy of mode flags */ - /* VE/M6 support */ - RADEONMonitorType DisplayType; /* Monitor connected on */ - RADEONDDCType DDCType; - RADEONConnectorType ConnectorType; - Bool IsMobility; /* Mobile chips for laptops */ Bool IsIGP; /* IGP chips */ Bool HasSingleDAC; /* only TVDAC on chip */ @@ -771,8 +766,6 @@ typedef struct { DisplayModePtr currentMode, savedCurrentMode; /* merged fb stuff, also covers clone modes */ - Bool MergedFB; - RADEONMonitorType MergeType; void (*PointerMoved)(int index, int x, int y); Bool NoVirtual; diff --git a/src/radeon_display.c b/src/radeon_display.c index b9d2bee0..4f31cdbf 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -887,21 +887,7 @@ void RADEONGetPanelInfo (ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Invalid PanelSize option: %s\n", s); RADEONGetPanelInfoFromReg(pScrn); } - } else { - - if(info->DisplayType == MT_LCD) { - RADEONGetLVDSInfo(pScrn); - if (info->MergeType == MT_DFP) { - RADEONGetTMDSInfo(pScrn); - } - } else if ((info->DisplayType == MT_DFP) || (info->MergeType == MT_DFP)) { - RADEONGetTMDSInfo(pScrn); - if (!pScrn->monitor->DDC) - RADEONGetHardCodedEDIDFromBIOS(pScrn); - else if (!info->IsSecondary) - RADEONUpdatePanelSize(pScrn); - } - } + } } void RADEONGetTVDacAdjInfo(ScrnInfoPtr pScrn) @@ -1127,10 +1113,12 @@ void RADEONSetupConnectors(ScrnInfoPtr pScrn) } for (i = 0; i < 2; i++) { + RADEONOutputPrivatePtr radeon_output = pRADEONEnt->PortInfo[i]; + int DDCReg = 0; char *names[] = { "DDC1", "DDC2" }; - switch(pRADEONEnt->PortInfo[i]->DDCType) { + switch(radeon_output->DDCType) { case DDC_MONID: DDCReg = RADEON_GPIO_MONID; break; case DDC_DVI : DDCReg = RADEON_GPIO_DVI_DDC; break; case DDC_VGA: DDCReg = RADEON_GPIO_VGA_DDC; break; @@ -1139,10 +1127,27 @@ void RADEONSetupConnectors(ScrnInfoPtr pScrn) } if (DDCReg) { - pRADEONEnt->PortInfo[i]->DDCReg = DDCReg; - RADEONI2CInit(pScrn, &pRADEONEnt->PortInfo[i]->pI2CBus, DDCReg, names[i]); + radeon_output->DDCReg = DDCReg; + RADEONI2CInit(pScrn, &radeon_output->pI2CBus, DDCReg, names[i]); + } + + if (radeon_output->type == OUTPUT_LVDS) { + RADEONGetLVDSInfo(pScrn); } + + if (radeon_output->type == OUTPUT_DVI) { + RADEONGetTMDSInfo(pScrn); + + RADEONGetHardCodedEDIDFromBios(pScrn); + + RADEONUpdatePanelSize(pScrn); + + } + + } + + } static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr output) @@ -1190,7 +1195,7 @@ void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr output) } } -static void RADEONQueryConnectedDisplays(ScrnInfoPtr pScrn) +void RADEONQueryConnectedDisplays(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); @@ -1297,11 +1302,7 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn) xf86OutputPtr output; RADEONOutputPrivatePtr radeon_output; - info->MergeType = MT_NONE; - if (!info->IsSecondary) { - RADEONQueryConnectedDisplays(pScrn); - pRADEONEnt->PortInfo[0]->crtc_num = 1; pRADEONEnt->PortInfo[1]->crtc_num = 2; @@ -1378,7 +1379,6 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn) radeon_output = output->driver_private; pRADEONEnt->Controller[1]->binding = 2; if (output) { - info->DisplayType = radeon_output->MonType; pScrn->monitor->DDC = output->MonInfo; } } else { @@ -1386,18 +1386,12 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn) radeon_output = output->driver_private; pRADEONEnt->Controller[0]->binding = 1; if (output) { - info->DisplayType = radeon_output->MonType; pScrn->monitor->DDC = output->MonInfo; } } if(!pRADEONEnt->HasSecondary) { - output = RADEONGetCrtcConnector(pScrn, 2); - radeon_output = output->driver_private; - if (output) - info->MergeType = radeon_output->MonType; - if (info->MergeType) - pRADEONEnt->Controller[1]->binding = 1; + pRADEONEnt->Controller[1]->binding = 1; } } else { output = RADEONGetCrtcConnector(pScrn, 1); @@ -1405,7 +1399,6 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn) if (output) { if (radeon_output->MonType == MT_NONE) radeon_output->MonType = MT_CRT; - info->DisplayType = radeon_output->MonType; pScrn->monitor->DDC = output->MonInfo; } output = RADEONGetCrtcConnector(pScrn, 2); @@ -1425,16 +1418,6 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "---- Secondary Head: Not used ----\n"); } - info->HBlank = 0; - info->HOverPlus = 0; - info->HSyncWidth = 0; - info->VBlank = 0; - info->VOverPlus = 0; - info->VSyncWidth = 0; - info->DotClock = 0; - info->UseBiosDividers = FALSE; - - info->OverlayOnCRTC2 = FALSE; return TRUE; } @@ -2236,13 +2219,24 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONMonitorType montype; + int i = 0; + + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + RADEONOutputPrivatePtr radeon_output = output->driver_private; + + if (output->crtc == crtc) { + montype = radeon_output->MonType; + } + } switch (radeon_crtc->crtc_id) { case 0: - RADEONInit2(pScrn, mode, NULL, 1, &info->ModeReg, MT_CRT); + RADEONInit2(pScrn, mode, NULL, 1, &info->ModeReg, montype); break; case 1: - RADEONInit2(pScrn, NULL, mode, 2, &info->ModeReg, MT_CRT); + RADEONInit2(pScrn, NULL, mode, 2, &info->ModeReg, montype); break; } } @@ -2397,12 +2391,23 @@ radeon_detect(xf86OutputPtr output) radeon_output->MonType = MT_UNKNOWN; RADEONConnectorFindMonitor(pScrn, output); - if (radeon_output->MonType == MT_UNKNOWN) + if (radeon_output->MonType == MT_UNKNOWN) { + output->subpixel_order = SubPixelUnknown; return XF86OutputStatusUnknown; + } else if (radeon_output->MonType == MT_NONE) { + output->subpixel_order = SubPixelUnknown; return XF86OutputStatusDisconnected; - } else - return XF86OutputStatusConnected; + } else { + + switch(radeon_output->MonType) { + case MT_LCD: + case MT_DFP: output->subpixel_order = SubPixelHorizontalRGB; break; + default: output->subpixel_order = SubPixelNone; break; + } + + return XF86OutputStatusConnected; + } } diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 5371c4c0..4ece51c5 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1429,7 +1429,6 @@ static Bool RADEONPreInitVRAM(ScrnInfoPtr pScrn) * be able to be adjusted by user with a config option. */ if (info->IsPrimary) { pScrn->videoRam /= 2; - info->MergedFB = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %dk of videoram for primary head\n", pScrn->videoRam); @@ -2076,7 +2075,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) "Direct Rendering Disabled -- " "Dual-head configuration is not working with " "DRI at present.\n" - "Please use the radeon MergedFB option if you " + "Please use the radeon randr 1.2 support option if you " "want Dual-head with DRI.\n"); return FALSE; } @@ -2419,8 +2418,23 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10 return FALSE; } + if (!info->IsSecondary) { + RADEONQueryConnectedDisplays(pScrn); + } + RADEONMapControllers(pScrn); + info->HBlank = 0; + info->HOverPlus = 0; + info->HSyncWidth = 0; + info->VBlank = 0; + info->VOverPlus = 0; + info->VSyncWidth = 0; + info->DotClock = 0; + info->UseBiosDividers = FALSE; + + info->OverlayOnCRTC2 = FALSE; + RADEONGetClockInfo(pScrn); RADEONGetPanelInfo(pScrn); RADEONGetTVDacAdjInfo(pScrn); @@ -2464,7 +2478,6 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) info = RADEONPTR(pScrn); info->IsSecondary = FALSE; info->IsPrimary = FALSE; - info->MergedFB = FALSE; info->IsSwitching = FALSE; info->MMIO = NULL; @@ -3604,16 +3617,6 @@ _X_EXPORT Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, else if (strcmp(s, "NONE") == 0) subPixelOrder = SubPixelNone; PictureSetSubpixelOrder (pScreen, subPixelOrder); } - - if (PictureGetSubpixelOrder (pScreen) == SubPixelUnknown) { - switch (info->DisplayType) { - case MT_NONE: subPixelOrder = SubPixelUnknown; break; - case MT_LCD: subPixelOrder = SubPixelHorizontalRGB; break; - case MT_DFP: subPixelOrder = SubPixelHorizontalRGB; break; - default: subPixelOrder = SubPixelNone; break; - } - PictureSetSubpixelOrder (pScreen, subPixelOrder); - } #endif pScrn->vtSema = TRUE; @@ -4061,11 +4064,9 @@ static void RADEONRestoreCommonRegisters(ScrnInfoPtr pScrn, CARD32 tmp; RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - if (pRADEONEnt->HasSecondary || info->MergedFB) { - tmp = INREG(RADEON_DAC_CNTL2); - OUTREG(RADEON_DAC_CNTL2, tmp & ~RADEON_DAC2_DAC_CLK_SEL); - usleep(100000); - } + tmp = INREG(RADEON_DAC_CNTL2); + OUTREG(RADEON_DAC_CNTL2, tmp & ~RADEON_DAC2_DAC_CLK_SEL); + usleep(100000); } } @@ -5968,9 +5969,9 @@ static Bool RADEONInit(ScrnInfoPtr pScrn, DisplayModePtr mode, RADEONInfoPtr info = RADEONPTR(pScrn); if (info->IsSecondary) { - return RADEONInit2(pScrn, NULL, mode, 2, save, info->DisplayType); + return RADEONInit2(pScrn, NULL, mode, 2, save, 0); } else { - return RADEONInit2(pScrn, mode, NULL, 1, save, info->DisplayType); + return RADEONInit2(pScrn, mode, NULL, 1, save, 0); } } diff --git a/src/radeon_video.c b/src/radeon_video.c index 93ea1ebf..ed4cbfb7 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -1332,7 +1332,7 @@ RADEONAllocAdaptor(ScrnInfoPtr pScrn) */ /* Figure out which head we are on */ - if ((info->MergedFB && info->OverlayOnCRTC2) || info->IsSecondary) + if ((info->OverlayOnCRTC2) || info->IsSecondary) dot_clock = info->ModeReg.dot_clock_freq_2; else dot_clock = info->ModeReg.dot_clock_freq; @@ -2469,7 +2469,7 @@ RADEONDisplayVideo( y_mult = 1; /* TODO NO IDEA WHAT THIS IS ABOUT */ - if (info->MergedFB) { + if (0) {//info->MergedFB) { if (overlay_mode->Flags & V_INTERLACE) v_inc_shift++; if (overlay_mode->Flags & V_DBLSCAN) { |