97
97
ScrnInfoPtr pScrn = output->scrn;
98
98
RADEONOutputPrivatePtr radeon_output = output->driver_private;
99
99
DisplayModePtr new = NULL;
102
101
if (radeon_output->PanelXRes != 0 &&
103
102
radeon_output->PanelYRes != 0 &&
104
103
radeon_output->DotClock != 0) {
106
105
/* Add native panel size */
107
new = xnfcalloc(1, sizeof (DisplayModeRec));
108
sprintf(stmp, "%dx%d", radeon_output->PanelXRes, radeon_output->PanelYRes);
109
new->name = xnfalloc(strlen(stmp) + 1);
110
strcpy(new->name, stmp);
111
new->HDisplay = radeon_output->PanelXRes;
112
new->VDisplay = radeon_output->PanelYRes;
114
new->HTotal = new->HDisplay + radeon_output->HBlank;
115
new->HSyncStart = new->HDisplay + radeon_output->HOverPlus;
116
new->HSyncEnd = new->HSyncStart + radeon_output->HSyncWidth;
117
new->VTotal = new->VDisplay + radeon_output->VBlank;
118
new->VSyncStart = new->VDisplay + radeon_output->VOverPlus;
119
new->VSyncEnd = new->VSyncStart + radeon_output->VSyncWidth;
121
new->Clock = radeon_output->DotClock;
123
new->type = M_T_USERDEF | M_T_PREFERRED;
106
new = xf86CVTMode(radeon_output->PanelXRes, radeon_output->PanelYRes, 60.0, TRUE, FALSE);
108
new->type = M_T_DRIVER | M_T_PREFERRED;
125
110
new->next = NULL;
126
111
new->prev = NULL;
120
/* this function is basically a hack to add the screen modes */
121
static void RADEONAddScreenModes(xf86OutputPtr output, DisplayModePtr *modeList)
123
ScrnInfoPtr pScrn = output->scrn;
124
RADEONOutputPrivatePtr radeon_output = output->driver_private;
125
DisplayModePtr last = NULL;
126
DisplayModePtr new = NULL;
127
DisplayModePtr first = NULL;
129
int i, width, height;
130
char **ppModeName = pScrn->display->modes;
132
first = last = *modeList;
134
/* We have a flat panel connected to the primary display, and we
135
* don't have any DDC info.
137
for (i = 0; ppModeName[i] != NULL; i++) {
139
if (sscanf(ppModeName[i], "%dx%d", &width, &height) != 2) continue;
141
if (radeon_output->type == OUTPUT_LVDS) {
142
/* already added the native mode */
143
if (width == radeon_output->PanelXRes && height == radeon_output->PanelYRes)
146
/* Note: We allow all non-standard modes as long as they do not
147
* exceed the native resolution of the panel. Since these modes
148
* need the internal RMX unit in the video chips (and there is
149
* only one per card), this will only apply to the primary head.
151
if (width < 320 || width > radeon_output->PanelXRes ||
152
height < 200 || height > radeon_output->PanelYRes) {
153
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
154
"Mode %s is out of range.\n", ppModeName[i]);
155
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
156
"Valid FP modes must be between 320x200-%dx%d\n",
157
radeon_output->PanelXRes, radeon_output->PanelYRes);
162
new = xf86CVTMode(width, height, 60.0, TRUE, FALSE);
164
new->type |= M_T_USERDEF;
169
if (last) last->next = new;
171
if (!first) first = new;
174
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
175
"Adding Screen mode: %s\n", new->name);
179
/* Close the doubly-linked mode list, if we found any usable modes */
181
last->next = NULL; //first;
182
first->prev = NULL; //last;
186
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
187
"Total number of valid Screen mode(s) added: %d\n", count);
136
192
RADEONProbeOutputModes(xf86OutputPtr output)
138
ScrnInfoPtr pScrn = output->scrn;
139
194
RADEONOutputPrivatePtr radeon_output = output->driver_private;
140
195
xf86MonPtr edid_mon;
141
196
DisplayModePtr modes = NULL;
145
radeon_output->MonType = MT_UNKNOWN;
147
RADEONConnectorFindMonitor(pScrn, output);
149
198
ErrorF("in RADEONProbeOutputModes\n");
151
200
if (output->status == XF86OutputStatusConnected) {
167
216
xf86OutputSetEDID (output, edid_mon);
169
218
modes = xf86OutputGetEDIDModes (output);
172
/* add native panel mode */
173
221
modes = RADEONFPNativeMode(output);
222
/* add the screen modes */
223
RADEONAddScreenModes(output, &modes);
178
xf86ValidateModesUserConfig(pScrn, modes);
179
xf86PruneInvalidModes(pScrn, &modes, FALSE);