en:ibm:gradd:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:ibm:gradd:index [2014/06/26 03:39] – [About this Book] valerius2ken:ibm:gradd:index [2014/06/26 03:53] (current) – [GRADD Model Components] valerius2k
Line 49: Line 49:
  
 VMAN tracks information about the current state of the pointer. All drawing VMI commands that affect the display surface must include the areas of the screen being updated by the primitive. VMAN uses this information to determine whether or not the pointer should be hidden before it passes a drawing request down the GRADD chain. On return from the drawing command, VMAN will restore the pointer if it was previously hidden.  VMAN tracks information about the current state of the pointer. All drawing VMI commands that affect the display surface must include the areas of the screen being updated by the primitive. VMAN uses this information to determine whether or not the pointer should be hidden before it passes a drawing request down the GRADD chain. On return from the drawing command, VMAN will restore the pointer if it was previously hidden. 
 +
 +== Video Helper Functions ==
 +
 +VMAN exports a number of helper services that GRADDs may use for common required functions. By using video helpers, a GRADD can avoid operating system specific calls. These helper functions are described below: 
 +
 +The [[VHAllocMem]] helper returns a 32-bit pointer to a piece of memory. The caller of this function supplies the byte count required. 
 +
 +The [[VHFreeMem]] helper frees memory that has been allocated via the VHAllocMem helper. 
 +
 +The [[VHLockMem]] helper makes code or data segments available for ring 0 interrupt-time processing. 
 +
 +The [[VHPhystoVirt]] helper converts physical address ranges to linear virtual address ranges for processes using VMI. 
 +
 +The [[VHMap]] helper aliases process memory to a global ring 0 context. 
 +
 +The [[VHMapVRAM]] helper converts the physical address of VRAM to linear virtual aperture for both process and global ring 0 context.   
 +
 +=== Translation Layers ===
 +
 +Translation layers use the [[CHAININFO]] structure to gain access to the hardware capabilities and available modes. The [[VMI_CMD_QUERYCHAININFO]] function returns the CHAININFO structure. 
 +
 +When the [[VMIEntry]] function receives an operation from a translation layer, VMAN checks the function number and either handles the operation or forwards it to the appropriate GRADD. VMAN will handle the operation if the GRADD returns an RC_SIMULATE. The GRADD Model diagram shows how the VMAN component handles communication among the various components and the paths that commands can take during processing. 
 +
 +== Translation Layer between OS/2 Graphics Engine and VMAN ==
 +
 +The translation layer for the OS/2 Graphics Engine (GRE) is called GRE2VMAN. For a system that uses OS/2 as the dominant operating system service, GRE2VMAN is the first translation layer and the first component of the GRADD model to be loaded. When GRE2VMAN is loaded, it calls VMAN's VMIEntry function with a [[VMI_CMD_INIT]]. When VMAN receives a VMI_CMD_INIT for the first time, it loads the other GRADD model components. 
 +
 +== Virtual VMI device driver (VVMI) ==
 +
 +Video Manager (VMAN) creates a thread which is used to process all VMAN requests from the VDM. This thread is blocked by VVMI until a request is made, at which time the thread is unblocked and the request is serviced by VMAN. 
 +
 +== Future Translation Layers ==
 +
 +In the future, other graphics subsystems can be adapted to work in the IBM Operating System/2 operating system. To accomplish this, a translation layer must be provided (shown as 'n2VMAN' in the GRADD Model diagram). This translation layer must map the graphics primitives of the graphics subsystem to the appropriate VMI_CMD_ functions. 
 +
 +== Translation Layer For Extensions ==
 +
 +The GRADD Model can be extended using the VMI extension protocol. Using this protocol, a translation layer directs extension functions to a GRADD through the [[VMI_CMD_EXTENSION]] function. In order to accomplish this, a translation layer must be provided (shown as 'EXT2VMAN' in the GRADD Model diagram). 
 +
 +See [[Adding Extensions]] for more information. 
 +
 +=== Graphics Adapter Device Driver (GRADD) ===
 +
 +This section describes how the Graphics Adapter Device Driver components interface with VMAN. 
 +
 +== Graphics Hardware Interface (GHI) ==
 +
 +The entry point and functions supported by a GRADD are referred to as the Graphics Hardware Interface (GHI). The differences between the VMAN protocol (VMI) and the protocol for the GRADDs GHI include the following: 
 +
 +The GHI is a subset of the VMI. 
 +The **ulFunction** parameter value changes to the appropriate GHI_CMD_ function name. 
 +
 +Each GRADD has an exported function, called [[HWEntry]], which is the same function type as [[VMIEntry]] in VMAN. 
 +
 +HWEntry receives all of the operations from VMAN. 
 +
 +In the GRADD model, the GRADDs are the only components that have direct access to the video hardware. GRADD code uses the accelerated features of a graphics adapter. By returning RC_SIMULATE for a graphics operation, the GRADD gives the SOFTDRAW component permission to draw directly to the video memory of the hardware. The serialization of video memory is handled by the Video Manager through the the [[GHI_CMD_REQUESTHW]] function. 
 +
 +Each GRADD must process the following GHI_CMD_ functions: 
 +
 +  * [[GHI_CMD_INIT]]
 +  * [[GHI_CMD_QUERYCAPS]] 
 +  * [[GHI_CMD_QUERYMODES]] 
 +  * [[GHI_CMD_SETMODE]] 
 +  * [[GHI_CMD_PALETTE]] 
 +
 +* This function is mandatory only when a 256-color mode has been chosen. 
 +
 +The following GHI functions can return RC_SIMULATE and let VMAN handle the operations: 
 +
 +  * [[GHI_CMD_BANK]] 
 +  * [[GHI_CMD_BITBLT]] 
 +  * [[GHI_CMD_LINE]] 
 +  * [[GHI_CMD_MOVEPTR]] 
 +  * [[GHI_CMD_SETPTR]] 
 +  * [[GHI_CMD_SHOWPTR]] 
 +  * [[GHI_CMD_TEXT]] 
 +
 +The GHI function numbers are assigned in such a way that they can be used as a zero-based index into a function jump table. 
 +
 +== System Management (RAS) ==
 +
 +Because performance is critical in a video graphics subsystem, all systems management and RAS hooks should be placed in a filter GRADD. This protects the majority of users, who do not need this support, from performance degradations caused by the addition of trace points and hooks. 
 +