From 7b527dec48e7ff7b5978508cb2795ba0718c7dab Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 2 Jan 2006 09:32:54 +0000 Subject: [PATCH] Oops, actually use the timings in the modes db. :) FIXME: Add some way of specifying the refresh rate we want to select! --- src/video/fbcon/SDL_fbvideo.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c index e2522328f..42cee11e8 100644 --- a/src/video/fbcon/SDL_fbvideo.c +++ b/src/video/fbcon/SDL_fbvideo.c @@ -770,10 +770,19 @@ static int choose_fbmodes_mode(struct fb_var_screeninfo *vinfo) if ( modesdb ) { /* Parse the mode definition file */ while ( read_fbmodes_mode(modesdb, &cinfo) ) { - if ( vinfo->xres == cinfo.xres && - vinfo->yres == cinfo.yres ) { + if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) && + (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) { + vinfo->pixclock = cinfo.pixclock; + vinfo->left_margin = cinfo.left_margin; + vinfo->right_margin = cinfo.right_margin; + vinfo->upper_margin = cinfo.upper_margin; + vinfo->lower_margin = cinfo.lower_margin; + vinfo->hsync_len = cinfo.hsync_len; + vinfo->vsync_len = cinfo.vsync_len; + if ( matched ) { + break; + } matched = 1; - break; } } fclose(modesdb);