summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Adams <joeyadams3.14159@gmail.com>2008-12-11 00:57:03 -0500
committerAlex Deucher <alexdeucher@gmail.com>2008-12-11 00:57:03 -0500
commit0e99017cb9a6d46b891705df73678c2705439532 (patch)
tree5aa29cbf0d1f5e168b38c097cb8c1002b361700e /src
parentfb46c30d316ab3ec54c54f3aec91d5164070a423 (diff)
Add more eMac modes, fix crash in last patch
Diffstat (limited to 'src')
-rw-r--r--src/radeon_modes.c71
1 files changed, 45 insertions, 26 deletions
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index b289d6cf..5cd4e296 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -194,35 +194,54 @@ static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output)
* 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)
+static DisplayModePtr RADEONeMacModes(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;
+ DisplayModePtr last=NULL, new=NULL, first=NULL;
+ int i, *modep;
+ static const char *modenames[5] = {
+ "640x480", "800x600", "1024x768", "1152x864", "1280x960"
+ };
+ static int modes[9*5] = {
+ 62120, 640, 680, 752, 864, 480, 481, 484, 521,
+ 76840, 800, 848, 936, 1072, 600, 601, 604, 640,
+ 99070, 1024, 1088, 1200, 1376, 768, 769, 772, 809,
+ 112360, 1152, 1224, 1352, 1552, 864, 865, 868, 905,
+ 124540, 1280, 1368, 1504, 1728, 960, 961, 964, 1001
+ };
+ modep = modes;
+
+ for (i=0; i<5; i++) {
+ new = xnfcalloc(1, sizeof (DisplayModeRec));
+ if (new) {
+ new->name = xnfalloc(strlen(modenames[i]) + 1);
+ strcpy(new->name, modenames[i]);
+ new->Clock = *modep++;
+
+ new->HDisplay = *modep++;
+ new->HSyncStart = *modep++;
+ new->HSyncEnd = *modep++;
+ new->HTotal = *modep++;
+
+ new->VDisplay = *modep++;
+ new->VSyncStart = *modep++;
+ new->VSyncEnd = *modep++;
+ new->VTotal = *modep++;
+
+ new->Flags = 0;
+ new->type = M_T_DRIVER;
+ if (i==2)
+ new->type |= M_T_PREFERRED;
+ new->next = NULL;
+ new->prev = last;
+ if (last) last->next = new;
+ last = new;
+ if (!first) first = new;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Added eMac mode %s\n", modenames[i]);
+ }
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Added native eMac 1024x768 mode\n");
-
- return new;
+ return first;
}
#endif
@@ -328,7 +347,7 @@ RADEONProbeOutputModes(xf86OutputPtr output)
if ((info->MacModel == RADEON_MAC_EMAC) &&
(radeon_output->DACType == DAC_PRIMARY) &&
(modes == NULL))
- modes = RADEONeMacNativeMode(output);
+ modes = RADEONeMacModes(output);
#endif
if (modes == NULL) {
if ((radeon_output->type == OUTPUT_LVDS) && info->IsAtomBios) {