gf_display_query_mode()

Query a display for supported modes

Synopsis:

#include <gf/gf.h>

int gf_display_query_mode( gf_display_t     display,
                           int              index,
                           gf_modeinfo_t   *mode );

Arguments:

display
The handle for a display whose list of available modes you want to query.
index
The index of the mode you want to query. Modes are indexed starting at 0. You can iterate through the list of modes by incrementing the index until the function returns an index out of range error.
mode
A pointer to a gf_modeinfo_t structure which the function fills in with information about the queried mode.

Library:

gf

Description:

This function queries the capabilities of a mode in the specified display's list of supported modes. Modes are indexed starting at 0.

The mode argument is filled in with information about the queried mode:

typedef struct {
        unsigned        flags;
        gf_format_t     primary_format;
        unsigned        xres;
        unsigned        yres;
        unsigned        refresh[7];
} gf_modeinfo_t;

It contains at least the following members:

flags
One flag is defined: GF_MODE_GENERIC. Arbitrary xres/yres/refresh rates may be specified. For modes of this type, a generic formula (the Vesa GTF) is used to calculate the settings used to program the display controller. The xres, yres and refresh members don't apply when this mode is specified.
primary_format
This member is used to support devices where the pixel format of the main layer is tied to the selected video mode, for example, drivers that use the VESA BIOS for modeswitching.

On some devices, the main layer may support more than one pixel format. In this case multiple modes are reported with identical xres, yres, and refresh values, but different values for primary_format. It won't matter which of the reported format values is passed to gf_display_set_mode(), since any of the formats reported via gf_layer_query() can be used to create surfaces displayable on the main layer regardless.

xres, yres
The horizontal and vertical resolution for the queried mode. These members have meaning only if GF_MODE_GENERIC isn't set in flags.
refresh
A zero-terminated list of supported refresh rates. Up to 6 discrete refresh rates can be supported for non-generic modes. This member has meaning only if GF_MODE_GENERIC isn't set in flags.

Returns:

GF_ERR_OK
Success.
GF_ERR_MEM
Memory allocation failure.
GF_ERR_IODISPLAY
Could not access the /dev/io-display directory. Check to ensure that io-display is running. The sloginfo utility may provide more information.
GF_ERR_PARM
The mode index is out of bounds.
GF_ERR_CFG
Badly configured display; check the io-display configuration file.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_display_set_mode(), gf_layer_query()