SDL_ListModes : Not Working as expected

Hello Team,
We were running this sample example to findout the available modes, on the LCD tv.

#include <SDL/SDL.h>
#include <stdio.h>

int main(int argc, char argv[]) {
/
Information about the current video settings. /
/
Initialize defaults, Video and Audio */
SDL_Rect **fullmodes;
int i;
if((SDL_Init(SDL_INIT_EVERYTHING)) < 0) {
printf(“Could not initialize SDL: %s.\n”, SDL_GetError());
exit(-1);
}
const SDL_VideoInfo *vidInfo = NULL;
vidInfo = SDL_GetVideoInfo ();

    /* collect all fullscreen & hardware modes available */
    if (!(fullmodes = SDL_ListModes (vidInfo->vfmt,SDL_OPENGL))) {

        for(i=0;fullmodes[i];++i)
               printf( "SDL Mode: %d:  %d x %d\n", i, fullmodes[i]->w, fullmodes[i]->h);
    }
    else {

            printf("FullMode Eror\n");
    }

}
The program always fails to list the fullmode.

     (c) 2007-2009  Intel Corporation
     (c) 2001-2008  The world wide DirectFB Open Source Community
     (c) 2000-2004  Convergence (integrated media) GmbH----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2011-06-09 00:06)
(*) IntelCE/Systems: Available GDL driver memory:  55MB of 70MB
(*) Direct/Thread: Started 'Hotplug with Linux Input' (3070) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: Hotplug detecting enabled with Linux Input Driver
(*) DirectFB/Genefx: MMX detected and enabled
(*) IntelCE/GfxDriver: Using OpenGL ES 1.1 graphics library
(*) IntelCE/GfxDriver: Using SRB graphics library
(*) DirectFB/Graphics: Intel Corporation Intel_CE Graphics Driver  2.0 (Intel Corporation)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
FullMode Eror
(!!!)  *** WARNING [Application exited without deinitialization of DirectFB!] *** [core.c:871 in dfb_core_deinit_check()]
(!!!)  *** WARNING [still 1 objects in pool:'Layer Region Pool'] *** [object.c:359 in fusion_object_pool_destroy()]
(!!!)  *** WARNING [still 1 objects in pool:'Layer Context Pool'] *** [object.c:359 in fusion_object_pool_destroy()]

Hardware:
IntelAtomProcessor connected to LCD tv thru A/V  out .DirectFb example programs are working fine and displays pictures and screen savers on TV.

http://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors#CE_processors 
SDL-1.2 Version.
Direct FB-1.2.10.
Debian-5.0.8
Any Help on this will be really helpful.
Thanks,
Rashmi

We are using SDL , with DirectFB
so this maps to DirectFB_ListModes(… ) Function in SDL library.

static SDL_Rect *DirectFB_ListModes(_THIS, SDL_PixelFormat format, Uint32 flags)
{
if (flags & SDL_FULLSCREEN)
return HIDDEN->modelist;
else
if (SDLToDFBPixelFormat (format) != DSPF_UNKNOWN)
return (SDL_Rect
) -1;

return NULL;
}

when i checked further , SDLToDFBPixelFormat will return DSPF_RGB32.so it is not failing so i it looks like is not initialized properly.
Thanks,
Rashmi

We are using SDL , with DirectFB
so this maps to DirectFB_ListModes(… ) Function in SDL library.

static SDL_Rect *DirectFB_ListModes(_THIS, SDL_PixelFormat format, Uint32 flags)
{
if (flags & SDL_FULLSCREEN)
return HIDDEN->modelist;
else
if (SDLToDFBPixelFormat (format) != DSPF_UNKNOWN)
return (SDL_Rect
) -1;

return NULL;
}

when i checked further , SDLToDFBPixelFormat will return DSPF_RGB32.so it is not failing so i it looks like is not initialized properly.
Thanks,
Rashmi