summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/radeon.man2
-rw-r--r--src/radeon.h3
-rw-r--r--src/radeon_modes.c46
-rw-r--r--src/radeon_output.c32
4 files changed, 81 insertions, 2 deletions
diff --git a/man/radeon.man b/man/radeon.man
index 57a7af5d..178305db 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -477,6 +477,8 @@ mini \-\- mini-external alias
.br
imac-g5-isight \-\- iMac G5 iSight
.br
+emac \-\- eMac G4
+.br
The default value is
.B undefined.
.TP
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);
}