1 Index: src/video/fbcon/SDL_fbvideo.c
2 ===================================================================
3 --- src/video/fbcon/SDL_fbvideo.c (revision 2990)
4 +++ src/video/fbcon/SDL_fbvideo.c (working copy)
9 +#ifndef HAVE_GETPAGESIZE
10 #include <asm/page.h> /* For definition of PAGE_SIZE */
14 #include "SDL_video.h"
15 @@ -425,7 +427,7 @@ FB_CheckMode(_THIS, struct fb_var_screen
18 FB_AddMode(_THIS, int index, unsigned int w, unsigned int h,
20 + int check_timings, int reversed)
24 @@ -448,10 +450,12 @@ FB_AddMode(_THIS, int index, unsigned in
27 for (i = 0; i < (sizeof(vesa_timings) / sizeof(vesa_timings[0])); ++i) {
28 - if ((w == vesa_timings[i].xres) &&
29 - (h == vesa_timings[i].yres) && vesa_timings[i].pixclock) {
32 + if (vesa_timings[i].pixclock) {
33 + if (!reversed && w == vesa_timings[i].xres && h == vesa_timings[i].yres ||
34 + reversed && h == vesa_timings[i].xres && w == vesa_timings[i].yres) {
41 @@ -667,24 +671,33 @@ FB_VideoInit(_THIS, SDL_PixelFormat * vf
42 SDL_modelist[i] = NULL;
44 if (SDL_getenv("SDL_FB_BROKEN_MODES") != NULL) {
45 - FB_AddMode(this, current_index, current_w, current_h, 0);
46 + FB_AddMode(this, current_index, current_w, current_h, 0, 0);
48 while (read_fbmodes_mode(modesdb, &vinfo)) {
49 for (i = 0; i < NUM_MODELISTS; ++i) {
53 /* See if we are querying for the current mode */
56 +try_reversed_dynamic:
57 if (i == current_index) {
58 if ((current_w > w) || (current_h > h)) {
60 - FB_AddMode(this, i, current_w, current_h, 0);
61 + FB_AddMode(this, i, current_w, current_h, 0, reversed);
65 if (FB_CheckMode(this, &vinfo, i, &w, &h)) {
66 - FB_AddMode(this, i, w, h, 0);
67 + FB_AddMode(this, i, w, h, 0, reversed);
70 + /* See if a reversed X/Y matches */
72 + unsigned tmp = w; w = h; h = tmp;
74 + goto try_reversed_dynamic;
78 @@ -694,19 +707,28 @@ FB_VideoInit(_THIS, SDL_PixelFormat * vf
79 for (i = 0; i < NUM_MODELISTS; ++i) {
80 for (j = 0; j < (sizeof(checkres) / sizeof(checkres[0])); ++j) {
84 /* See if we are querying for the current mode */
88 if (i == current_index) {
89 if ((current_w > w) || (current_h > h)) {
91 - FB_AddMode(this, i, current_w, current_h, 0);
92 + FB_AddMode(this, i, current_w, current_h, 0, reversed);
96 if (FB_CheckMode(this, &vinfo, i, &w, &h)) {
97 - FB_AddMode(this, i, w, h, 1);
98 + FB_AddMode(this, i, w, h, 1, reversed);
101 + /* See if a reversed X/Y matches */
103 + unsigned tmp = w; w = h; h = tmp;
105 + goto try_reversed_static;