diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2008-12-10 17:16:56 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2008-12-10 17:16:56 -0500 |
commit | fb46c30d316ab3ec54c54f3aec91d5164070a423 (patch) | |
tree | 157b36c66215a99c706d452df74d2d1e56222f8b /src | |
parent | c0bcea9150ef215fa614733cef9a5b71a55a33bd (diff) |
Add support for Apple eMacs
Thanks to Joseph Adams for helping me sort this out.
Verified on eMac G4/1.0 with radeon 7500
Later eMacs with radeon 9200 or 9600 chips may have
different ddc setups. Need to verify.
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon.h | 3 | ||||
-rw-r--r-- | src/radeon_modes.c | 46 | ||||
-rw-r--r-- | src/radeon_output.c | 32 |
3 files changed, 79 insertions, 2 deletions
diff --git a/src/radeon.h b/src/radeon.h index 8427e84c..a64782ef 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -393,7 +393,8 @@ typedef enum { RADEON_MAC_POWERBOOK_VGA, RADEON_MAC_MINI_EXTERNAL, RADEON_MAC_MINI_INTERNAL, - RADEON_MAC_IMAC_G5_ISIGHT + RADEON_MAC_IMAC_G5_ISIGHT, + RADEON_MAC_EMAC } RADEONMacModel; #endif diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 2c723957..b289d6cf 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -186,6 +186,46 @@ static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output) return new; } +#if defined(__powerpc__) +/* Apple eMacs need special modes for the internal CRT, e.g., + * Modeline "640x480" 62.12 640 680 752 864 480 481 484 521 +HSync +Vsync + * Modeline "800x600" 76.84 800 848 936 1072 600 601 604 640 +HSync +Vsync + * Modeline "1024x768" 99.07 1024 1088 1200 1376 768 769 772 809 +HSync +Vsync + * Modeline "1152x864" 112.36 1152 1224 1352 1552 864 865 868 905 +HSync +Vsync + * Modeline "1280x960" 124.54 1280 1368 1504 1728 960 961 964 1001 +HSync +Vsync + */ +static DisplayModePtr RADEONeMacNativeMode(xf86OutputPtr output) +{ + ScrnInfoPtr pScrn = output->scrn; + DisplayModePtr new = NULL; + + new = xnfcalloc(1, sizeof (DisplayModeRec)); + if (new) { + new->name = xnfalloc(strlen("1024x768") + 1); + new->name = "1024x768"; + new->HDisplay = 1024; + new->HSyncStart = 1088; + new->HSyncEnd = 1200; + new->HTotal = 1376; + + new->VDisplay = 768; + new->VSyncStart = 769; + new->VSyncEnd = 772; + new->VTotal = 809; + + new->Clock = 99070; + new->Flags = 0; + new->type = M_T_DRIVER | M_T_PREFERRED; + new->next = NULL; + new->prev = NULL; + } + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Added native eMac 1024x768 mode\n"); + + return new; +} +#endif + /* this function is basically a hack to add the screen modes */ static void RADEONAddScreenModes(xf86OutputPtr output, DisplayModePtr *modeList) { @@ -284,6 +324,12 @@ RADEONProbeOutputModes(xf86OutputPtr output) } else { if (output->MonInfo) modes = xf86OutputGetEDIDModes (output); +#if defined(__powerpc__) + if ((info->MacModel == RADEON_MAC_EMAC) && + (radeon_output->DACType == DAC_PRIMARY) && + (modes == NULL)) + modes = RADEONeMacNativeMode(output); +#endif if (modes == NULL) { if ((radeon_output->type == OUTPUT_LVDS) && info->IsAtomBios) { atomBiosResult = RHDAtomBiosFunc(pScrn->scrnIndex, diff --git a/src/radeon_output.c b/src/radeon_output.c index e77abaf2..5924c814 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -2363,6 +2363,31 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn) info->BiosConnector[2].ddc_i2c.valid = FALSE; info->BiosConnector[2].valid = TRUE; return TRUE; + case RADEON_MAC_EMAC: + /* eMac G4 800/1.0 with radeon 7500, no EDID on internal monitor + * later eMac's (G4 1.25/1.42) with radeon 9200 and 9600 may have + * different ddc setups. need to verify + */ + info->BiosConnector[0].ddc_i2c = legacy_setup_i2c_bus(RADEON_GPIO_VGA_DDC); + info->BiosConnector[0].DACType = DAC_PRIMARY; + info->BiosConnector[0].TMDSType = TMDS_NONE; + info->BiosConnector[0].ConnectorType = CONNECTOR_VGA; + info->BiosConnector[0].valid = TRUE; + + info->BiosConnector[1].ddc_i2c = legacy_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); + info->BiosConnector[1].DACType = DAC_TVDAC; + info->BiosConnector[1].load_detection = FALSE; + info->BiosConnector[1].TMDSType = TMDS_NONE; + info->BiosConnector[1].ConnectorType = CONNECTOR_VGA; + info->BiosConnector[1].valid = TRUE; + + info->BiosConnector[2].ConnectorType = CONNECTOR_STV; + info->BiosConnector[2].DACType = DAC_TVDAC; + info->BiosConnector[2].load_detection = FALSE; + info->BiosConnector[2].TMDSType = TMDS_NONE; + info->BiosConnector[2].ddc_i2c.valid = FALSE; + info->BiosConnector[2].valid = TRUE; + return TRUE; default: return FALSE; } @@ -2543,7 +2568,7 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn) * Unforunately, there doesn't seem to be any good way to figure it out. */ - /* + /* * PowerBook5,[1-5]: external tmds, single-link * PowerBook5,[789]: external tmds, dual-link * PowerBook5,6: external tmds, single-link or dual-link @@ -2601,6 +2626,9 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn) } else if (strstr(cpuline, "iMac G5 (iSight)")) { ret = RADEON_MAC_IMAC_G5_ISIGHT; break; + } else if (strstr(cpuline, "eMac")) { + ret = RADEON_MAC_EMAC; + break; } /* No known PowerMac model detected */ @@ -2728,6 +2756,8 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) info->MacModel = RADEON_MAC_MINI_EXTERNAL; else if (!strncmp("imac-g5-isight", optstr, strlen("imac-g5-isight"))) info->MacModel = RADEON_MAC_IMAC_G5_ISIGHT; + else if (!strncmp("emac", optstr, strlen("emac"))) + info->MacModel = RADEON_MAC_EMAC; else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid Mac Model: %s\n", optstr); } |