Date: Mon, 12 Jul 2004 14:17:47 -0500
authorSam Lantinga <slouken@libsdl.org>
Sat, 21 Aug 2004 11:34:24 +0000
changeset 9415095c4a264aa
parent 940 bb1588ebe47b
child 942 41a59de7f2ed
Date: Mon, 12 Jul 2004 14:17:47 -0500
From: Richard Smith
Subject: Re: [SDL] Disableing color depth and mode searching

> Also, I should add that a quick way to get the desired effect is to
> #define BROKEN_MODES on top of the SDL_fbvideo.c file.
>

Ah yes, I see that looks like that will do what I need. Curious as to
why this is a #define and not an enviroment variable like the other
settings.

I would think that finding cards (or chips) with broken modes would be
the norm rather than the execption.
src/video/fbcon/SDL_fbvideo.c
     1.1 --- a/src/video/fbcon/SDL_fbvideo.c	Sat Aug 21 05:29:45 2004 +0000
     1.2 +++ b/src/video/fbcon/SDL_fbvideo.c	Sat Aug 21 11:34:24 2004 +0000
     1.3 @@ -463,31 +463,31 @@
     1.4  	current_w = vinfo.xres;
     1.5  	current_h = vinfo.yres;
     1.6  	current_index = ((vinfo.bits_per_pixel+7)/8)-1;
     1.7 -#ifdef BROKEN_MODES
     1.8 -	FB_AddMode(this, current_index, current_w, current_h);
     1.9 -#else
    1.10 -	for ( i=0; i<NUM_MODELISTS; ++i ) {
    1.11 -		SDL_nummodes[i] = 0;
    1.12 -		SDL_modelist[i] = NULL;
    1.13 -		for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) {
    1.14 -			unsigned int w, h;
    1.15 +	if ( getenv("SDL_FB_BROKEN_MODES") != NULL ) {
    1.16 +		FB_AddMode(this, current_index, current_w, current_h);
    1.17 +	} else {
    1.18 +		for ( i=0; i<NUM_MODELISTS; ++i ) {
    1.19 +			SDL_nummodes[i] = 0;
    1.20 +			SDL_modelist[i] = NULL;
    1.21 +			for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) {
    1.22 +				unsigned int w, h;
    1.23  
    1.24 -			/* See if we are querying for the current mode */
    1.25 -			w = checkres[j].w;
    1.26 -			h = checkres[j].h;
    1.27 -			if ( i == current_index ) {
    1.28 -				if ( (current_w > w) || (current_h > h) ) {
    1.29 -					/* Only check once */
    1.30 -					FB_AddMode(this, i, current_w, current_h);
    1.31 -					current_index = -1;
    1.32 +				/* See if we are querying for the current mode */
    1.33 +				w = checkres[j].w;
    1.34 +				h = checkres[j].h;
    1.35 +				if ( i == current_index ) {
    1.36 +					if ( (current_w > w) || (current_h > h) ) {
    1.37 +						/* Only check once */
    1.38 +						FB_AddMode(this, i, current_w, current_h);
    1.39 +						current_index = -1;
    1.40 +					}
    1.41  				}
    1.42 -			}
    1.43 -			if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
    1.44 -				FB_AddMode(this, i, w, h);
    1.45 +				if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
    1.46 +					FB_AddMode(this, i, w, h);
    1.47 +				}
    1.48  			}
    1.49  		}
    1.50  	}
    1.51 -#endif /* BROKEN_MODES */
    1.52  
    1.53  	/* Fill in our hardware acceleration capabilities */
    1.54  	this->info.wm_available = 0;