File DirectFB-1.2.9-ignore-fbmodes.patch of Package DirectFB

Index: DirectFB-1.2.9/include/directfb.h
===================================================================
--- DirectFB-1.2.9.orig/include/directfb.h
+++ DirectFB-1.2.9/include/directfb.h
@@ -6326,6 +6326,11 @@ DEFINE_INTERFACE(   IDirectFBDataBuffer,
      );
 )
 
+static inline int ignore_fb_modes()
+{
+     return getenv("SUSE_IGNORE_FBMODES") != NULL;
+}
+
 #ifdef __cplusplus
 }
 #endif
Index: DirectFB-1.2.9/systems/fbdev/fbdev.c
===================================================================
--- DirectFB-1.2.9.orig/systems/fbdev/fbdev.c
+++ DirectFB-1.2.9/systems/fbdev/fbdev.c
@@ -945,7 +945,9 @@ system_get_deviceid( unsigned int *ret_v
 static DFBResult
 init_modes( void )
 {
-     dfb_fbdev_read_modes();
+     if (!ignore_fb_modes()) {
+         dfb_fbdev_read_modes();
+     }
 
      if (!dfb_fbdev->shared->modes) {
           /* try to use current mode*/
Index: DirectFB-1.2.9/systems/sdl/sdl.c
===================================================================
--- DirectFB-1.2.9.orig/systems/sdl/sdl.c
+++ DirectFB-1.2.9/systems/sdl/sdl.c
@@ -96,7 +96,9 @@ system_initialize( CoreDFB *core, void *
 
      dfb_sdl_core = core;
 
-     dfb_fbdev_read_modes();  /* use same mode list as a fake */
+     if (!ignore_fb_modes()) {
+     	dfb_fbdev_read_modes();  /* use same mode list as a fake */
+     }
 
      driver = getenv( "SDL_VIDEODRIVER" );
      if (driver && !strcasecmp( driver, "directfb" )) {