Index Index for
Section 9
Index Alphabetical
listing for M
Bottom of page Bottom of
page

MAP_SCREEN_AT_DEPTH(9r)

NAME

MAP_SCREEN_AT_DEPTH - Graphics: Maps a graphics device's memory and its registers to the server's virtual address space

SYNOPSIS

#include sys/ioctl.h #include sys/workstation.h int ioctl( int gfx_fd, unsigned long MAP_SCREEN_AT_DEPTH, void *ws_driver_structure_pointer );

ARGUMENTS

gfx_fd Specifies the file descriptor of the graphics device-special file (by convention /dev/ws0) that the open system call returns when the server is initialized. The server uses this file descriptor in subsequent ioctl calls to the Workstation Subsystem. MAP_SCREEN_AT_DEPTH Specifies the ioctl command used to access the ws_map_control structure. ws_driver_structure_pointer Specifies a pointer to the ws_map_control structure.

DESCRIPTION

The MAP_SCREEN_AT_DEPTH ioctl command tells the graphics driver to map the graphics device's memory and its registers into the virtual address space of the server. This allows the server to access the graphics hardware directly. The virtual addresses that are allocated when MAP_SCREEN_AT_DEPTH is invoked are returned in a subsequent call to GET_DEPTH_INFO. The MAP_SCREEN_AT_DEPTH ioctl command maps frame buffer memory; GET_DEPTH_INFO returns the virtual address of the mapping. This ioctl command accesses the ws_map_control data structure defined in /usr/sys/include/sys/workstation.h.

RESTRICTIONS

The graphics subsystem supports only one workstation per machine. Although most VGA devices support more than one depth of display with 16- bit pixels and 24-bit pixels (also known as TrueColor), the Compaq VGA controllers currently support only a single depth (8-bit pixels for all but the generic VGA driver, which supports 4-bit pixels).

RETURN VALUES

If successful, the MAP_SCREEN_AT_DEPTH ioctl command returns 0 (zero). If unsuccessful, it returns -1.

EXAMPLES

The following example shows how the generic VGA DDX issues a MAP_SCREEN_AT_DEPTH ioctl command from the genInitVGA routine: static ws_map_control * map; void genInitVGA(int index) { . . . if (map == NULL) map = (ws_map_control *) Xcalloc(sizeof(map)); if (!init_flags[index]) { map->map_unmap = MAP_SCREEN; map->screen = index; if ((err=ioctl(wsFd, MAP_SCREEN_AT_DEPTH, map))) { perror("Failed to map screen at depth"); exit (1); } init_flags[index] = 1; } . . .

FILES

/usr/sys/include/sys/ioctl.h /usr/sys/include/sys/workstation.h

SEE ALSO

ioctl Commands: CURSOR_ON_OFF(9r), GET_DEPTH_INFO(9r), MAP_SCREEN_AT_DEPTH(9r), VIDEO_ON_OFF(9r)

Index Index for
Section 9
Index Alphabetical
listing for M
Top of page Top of
page