 |
Index for Section 9 |
|
 |
Alphabetical listing for L |
|
 |
Bottom of page |
|
load_color_map_entry(9r)
NAME
load_color_map_entry - Graphics: Loads the colormap entry into a colormap
SYNOPSIS
int (*ws_color_map_functions->load_color_map_entry)(
caddr_t colormap_handle,
int map,
ws_color_cell *entry );
ARGUMENTS
colormap_handle
Specifies the virtual address (handle) of device-specific information.
Typically this is a pointer to a private data structure that may
contain information such as the address of the hardware, state
information, and other information that may be shared between drivers.
The Workstation Subsystem allows separate handles for the cursor,
colormap, and the screen functions.
map Specifies the colormap map.
entry
Specifies a pointer to the typedef structure ws_color_cell, which
contains the colormap entry index and the values of red, green, and
blue that are to be loaded into the colormap map.
DATA STRUCTURES
The load_color_map_entry function accesses the ws_color_cell, and
ws_cursor_data structures defined in /usr/sys/include/sys/workstation.h.
DESCRIPTION
The load_color_map_entry function loads the specified colormap entry with
the values of red, green, and blue. This function can wait to load the
entry until vertical refresh interrupt time, but it cannot wait for the
interrupt to load the colormap. Also, the function must return immediately
in order not to affect the performance of X clients.
RETURN VALUES
If successful, the load_color_map_entry function returns 0 (zero). If
unsuccessful, it returns -1.
EXAMPLES
The following code is from the Compaq implementation of
load_color_map_entry in the myvga example driver:
int
myvga_load_color_map_entry_6bit(caddr_t colormap_handle,
int map,
register ws_color_cell *entry)
{
struct myvga_type *scp =
(struct myvga_type *)colormap_handle;
int shift = 10;
register int index = entry->index;
register unsigned int mask = 0x0000ffff >> shift;
int s;
if (myvga_developer_debug)
printf("myvga_load_color_map_entry_6bit: entry 0x%x = ",
entry->index);
printf("(0x%x, 0x%x, 0x%x)\n",
entry->red, entry->green, entry->blue);
SET_MYVGA_6BIT_DAC(scp);
/* Update CLUT database with 6-bit DAC values */
if (index >= 256 || index < 0)
return(-1);
s = splbio();
scp->cells[index].red = (entry->red >> shift) & mask;
scp->cells[index].green = (entry->green >> shift) & mask;
scp->cells[index].blue = (entry->blue >> shift) & mask;
scp->cells[index].dirty_cell = 1;
if (index < scp->min_dirty)
scp->min_dirty = index;
if (index > scp->max_dirty)
scp->max_dirty = index;
splx(s);
/*
* Enable a VBLANK interrupt to load dirty color cells.
* If VBLANK interrupts are not being used, do it now.
*/
if (!IS_MYVGA_DIRTY_CMAP(scp)) {
SET_MYVGA_DIRTY_CMAP(scp);
if (!myvga_enable_interrupt(scp))
myvga_clean_color_map(colormap_handle);
}
return (0);
}
FILES
/usr/sys/include/sys/workstation.h
/usr/sys/include/sys/wsdevice.h
SEE ALSO
Data Structures: ws_color_map_functions(9s)
 |
Index for Section 9 |
|
 |
Alphabetical listing for L |
|
 |
Top of page |
|