summaryrefslogtreecommitdiff
path: root/src/i830_modes.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2005-03-03 18:01:51 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2005-03-03 18:01:51 +0000
commit49dcbacf7fa7f29d18c18eec7e2f99e859bf4c7e (patch)
tree733133fabd6cdec4dfe45c32a1e251b5e9e2601c /src/i830_modes.c
parent7eaf88d00d7539fde68422ae6566f23993aa2633 (diff)
Limit the maximum refresh rate to 85Hz and remove the bogus
100Hz and 120Hz settings as they don't match close enough and are really unsupported.
Diffstat (limited to 'src/i830_modes.c')
-rw-r--r--src/i830_modes.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/i830_modes.c b/src/i830_modes.c
index 9b78866c..97ce45a5 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -60,8 +60,10 @@
#define C_PRIME (((C - J) * K/256.0) + J)
#define M_PRIME (K/256.0 * M)
+extern const int i830refreshes[];
+
static DisplayModePtr
-i830GetGTF (int h_pixels, int v_lines, float freq,
+I830GetGTF (int h_pixels, int v_lines, float freq,
int interlaced, int margins)
{
float h_pixels_rnd;
@@ -90,6 +92,7 @@ i830GetGTF (int h_pixels, int v_lines, float freq,
float h_sync;
float h_front_porch;
float v_odd_front_porch_lines;
+ char modename[20];
DisplayModePtr m;
m = xnfcalloc(sizeof(DisplayModeRec), 1);
@@ -341,6 +344,9 @@ i830GetGTF (int h_pixels, int v_lines, float freq,
m->HSync = h_freq;
m->VRefresh = freq;
+ sprintf(modename, "%dx%d", m->HDisplay,m->VDisplay);
+ m->name = xnfstrdup(modename);
+
return (m);
}
@@ -390,8 +396,16 @@ CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
vrefresh >= pScrn->monitor->vrefresh[i].lo; vrefresh -= 1.0f) {
if (vrefresh != (float)0.0f) {
- pMode = i830GetGTF(mode->XResolution, mode->YResolution,
- vrefresh, 0, 0);
+ float best_vrefresh;
+ int int_vrefresh;
+
+ /* Find the best refresh for the Intel chipsets */
+ int_vrefresh = I830GetBestRefresh(pScrn, (int)vrefresh);
+ best_vrefresh = (float)i830refreshes[int_vrefresh];
+
+ /* Now, grab the best mode from the available refresh */
+ pMode = I830GetGTF(mode->XResolution, mode->YResolution,
+ best_vrefresh, 0, 0);
pMode->type = M_T_BUILTIN;
@@ -649,6 +663,7 @@ i830SetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe)
data->mode |= (1 << 11);
data->block->RefreshRate = ((double)(data->block->PixelClock) /
(double)(pMode->HTotal * pMode->VTotal)) * 100;
+ data->block->RefreshRate = i830refreshes[I830GetBestRefresh(pScrn, data->block->RefreshRate / 100)] * 100;
#ifdef DEBUG
ErrorF("Video Modeline: ID: 0x%x Name: %s %i %i %i %i - "
" %i %i %i %i %.2f MHz Refresh: %.2f Hz\n",