Abstract:
The present invention discloses methods and apparatus for implementing automatic graphics operations with selectable triggering mechanism. One mechanism is hardware related, using the vertical counter in the video control section of the graphics processor. The other mechanism is software related, using the host to directly command the graphics processor. The graphics operations are specified in the header file written by the host in the frame buffer memory. Several header files can be chained together to form a sequence of header files corresponding to very complex graphics operations. Automatic graphics operations, therefore, can be completed without further host intervention resulting in powerful graphics, video, and animation performance.

Description:
This U.S. patent application filed by inventors Richard C. A. Owen, Karl S. Mills, Bradley A. May and Lauren E. Linstad is a continuation of now abandoned U.S. patent application Ser. No. 08/550,795, filed by inventors Richard C. A. Owen, Karl S. Mills, Bradley A. May and Lauren E. Linstad on Oct. 31, 1995 entitled &#34;AUTOMATIC GRAPHICS OPERATION&#34; and claims the benefit thereof. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to the field of high performance graphics systems, and more particularly to interfacing and interactions between the host computer and the graphics processor. 
     2. Description of the Related Art 
     Typical high performance graphics applications consist of a host computer with general capabilities and a specialized hardware graphics processor to perform dedicated graphic operations. A graphics processor has built-in hardware circuitry to carry out time-consuming tasks such as line drawing, block filling and block transfers (BLT). In addition, most graphics processors can be programmed to generate video control signals for video display. The host computer sends commands to and receives status from the graphics processor as part of its overall software. Upon receipt of the commands from the host, the graphics processor can carry out its operations independently. The host can also read the status of the graphics processor by accessing its internal registers or in some cases by monitoring the graphics processor signals. However, there is still some overhead involved in exchanging information. The problem becomes more pronounced when the host desires to send a series of commands to the graphics processor. The interaction between the host and the graphics processor, therefore, needs to be optimized to relieve the host of the burden of managing the graphics operations and the video control functions. 
     There are several interaction schemes that the host can adopt. First, in a polling scheme, the host can monitor the graphics processor (by reading a status bit for example) to determine if the previous set of commands has been completed so that it can send a new set of commands. The most serious drawback of this polling scheme is that it wastes host time because the host can go back to its normal function only after the entire graphic sequence has been completed. Second, in an interrupt scheme, the graphics processor can send an interrupt signal to the host when it finishes the set of commands. The problem with this interrupt scheme is that there is still some idle time before the host can respond, and the host might become inefficient for being continuously interrupted. It is therefore desirable to have a better interaction scheme that minimizes the interaction between the host and the graphics processor so that they can become more independent of each other. 
     In animation and video processing, the interaction problem becomes more severe. In these applications, there are two update rates: the animation update (or the image update) and the screen refresh. The animation update refers to the rate at which a new image replaces an old image. The screen refresh rate refers to the rate at which the video controller starts a new vertical retrace cycle. While the animation update rate depends on the nature of the image sequence and the speed of the graphics processor, the screen refresh rate depends on the type of display monitor and the programmed video control parameters. These two update rates are totally independent. 
     There are basically two schemes for updating the images in the display memory. In the first scheme, the display memory is written to as the display is being updated. Since there is no coordination between what part of the display memory is being displayed and what part is being altered, there can be an undesirable effect to the display, referred to as banding or tearing, where the image seems to jump or distort because part of the old image and part of the new image are displayed. In the second scheme, the new image or image portion is written into nonviewable memory space, and when the screen refresh is past the point where banding can occur, this memory content is transferred to the display memory. The problem with this scheme is that the host cannot independently predict when the screen refresh is at a safe point to send a transfer command. This is because screen refresh is an activity independent of the host and there is no relationship between the display clock and the host clock. Even with interrupts, there are still problems of software overhead, initialization, and reliability. 
     These scenarios show that there is a need for an optimized interaction scheme between the host and the graphics processor to minimize delays and avoid undesirable graphic effects. Graphics operations can then be carried out automatically without intervention from the host. 
     BRIEF SUMMARY OF THE INVENTION 
     The present invention comprises a high-performance graphics processor with many novel hardware built-in features. Important in the graphics processor of the present invention is the BLT Engine which acts as a central controller, initiating fetch, process, and store requests. One major feature of the BLT Engine, relevant in the present invention, is the automatic triggering. Automatic BLTs are triggered in one of two ways: (1) when the screen vertical count reaches a predetermined value, or (2) when the trigger bit is set by the host. In the first method, the host programs values to specify a safe region for automatic block transfers, and when the vertical counter reaches this safe range, BLT will be triggered. This method solves the problem of synchronization of the image updating with the screen refresh without host processor intervention. In the second method, the host has a direct control when it wants to trigger the auto BLTs. 
     During an automatic BLT, various variables for the BLT must be transferred from the frame buffer into the control path. These variables include source and destination location and extents, and the source of the next BLT in the chain. Chaining a sequence of BLT operations is accomplished by setting a bit in the LNCNTL register in the graphics processor. 
     This invention takes advantage of the automatic BLT triggering mechanism and automatic chaining of the graphics processor to implement the automatic graphics operation. 
     In the first configuration, the host builds up a set of graphics operations as a series of header files in nonviewable parts of the buffer memory (off screen memory). Each header file contains register data and graphics control data. The final entry in the header file points to the next operation to be executed. The last header file will contain a value for the LNCNTL which disables the chaining process. After writing the sequence of header files to the off screen memory, the host then commands the graphics processor to start execution, providing the location of the first header file. The graphics processor will read the header files and execute the specified graphics operations until it reaches the header containing the disabled chaining bit at which time all operations are completed. During the entire period, the host is free to carry out its normal tasks. 
     In the second configuration, the host builds up the sequence of header files as before. In addition, the host programs registers to specify the vertical scan line range within which to start the graphics operation. Then the host is free to go back to its normal tasks. When the vertical sync counter is within the specified vertical scan line range, the graphics processor will start the graphics operation as before. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram showing a typical graphics system with host computer and video control. 
     FIG. 2 is a detailed block diagram showing the graphics processor 20 of FIG. 1. 
     FIG. 3 is a diagram showing the correspondence between a sequence of header files and the graphics display. 
     FIG. 4 is a flow diagram showing steps for automatic BLT operations using the screen refresh triggering mechanism. 
     FIG. 5 is a flow diagram showing steps for automatic BLT operations using the host triggering mechanism. 
     FIG. 6 is a diagram showing the chaining of the header files. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The present invention is best described by describing a typical preferred embodiment. 
     FIG. 1 shows a typical configuration of a graphics system. The host computer 10 is any general purpose processor with normal power and capability to interface with memories, peripheral devices and the graphics processor. The graphics processor 20 is a processor with built-in hardware circuitry for accelerated graphics operations and video control functions. Host computer 10 communicates with graphics processor 20 through interface bus 30. Both host computer 10 and graphics processor 20 can obtain information from frame buffer memory 40. In addition, graphics processor 20 generates video and video control signals to display monitor 50. 
     In a preferred embodiment, host computer 10 comprises an advanced processor 20 such as an Intel X86 type graphics processor or a Power PC processor. The graphics processor 20 is a high-performance graphics controller with hardware built-in features such as video control functions, BLT engine, and automatic block transfer (BLT) operations; and interface bus 30 is either a Peripheral Component Interconnect (PCI) or VL Video Electronics Standard Association (VESA) Local bus. PCI and VL buses are popular buses for the local interconnection between a host and peripheral devices such as a graphics controller. The PCI bus provides an interface to the host to access the frame buffer memory 40. 
     FIG. 2 is a detailed block diagram illustrating the graphics processor 20 of FIG. 1. 
     The following features are relevant to the present invention. 
     1. HOST INTERFACE 52: 
     The graphics processor 20 connects directly to any PCI or VL-Bus local bus 30. It provides an interface to the frame buffer memory 40. The frame buffer memory 40 can be allocated at least to: (1) accelerated display region, (2) SVGA (Super VGA) display region, and (3) autoBLT parameter region. The autoBLT parameter region is where the host 10 writes the header files and the graphics processor 20 retrieves the header files. 
     2. BLT ENGINE 54: 
     The BLT Engine 54 is the master controller for graphics operations. The BLT engine 54 causes data to be fetched from the frame buffer memory 40 into the internal static RAMs 56, initiates pixel path control operations, and causes the results to be stored back to the frame buffer memory 40, the SRAM 56, or the host 10. 
     The BLT engine 54 decodes commands it receives from the command pipe. The commands normally come directly from the host interface 52. The BLT engine 54 contains all of the registers 56 used in the lower level graphics functions. These registers 56 include pointers for frame buffer 40 and SRAM 56, BLT extents, resize BLT sources, and control registers. 
     3. GRAPHICS ACCELERATOR REGISTERS: 
     The graphics processor 20 has a set of graphics accelerator registers 56 located in the BLT engine 54 accessible as memory-mapped registers 56 occupying 16 Kbytes of memory space. These registers 56 are typically written by the host 10 to set up graphics operations executed by the graphics processor 20. Some of the relevant registers 56 are: 
     LNCNTL: Line control and Auto BLT control flags 
     COMMAND: Command/Data Register 
     OP{0-2} 13  opRDRAM: Color RDRAM Address Registers 
     RESIZE{A-C} 13  opRDRAM: Automatic BLT Header Source Address Registers 
     START 13  BLT 13  i (i=1,2,3): Start AutoBLT of Window i (i=1,2,3) 
     STOP 13  BLT 13  i (i=1,2,3): Stop AutoBLT of Window i (i=1,2,3) 
     The LNCNTL (Line Control) Register has 16 bits. The LNCNTL register has a Chain Enable bit which is used to chain auto BLTs together. When this bit is HIGH, auto BLT will fetch a new header when complete. When LOW, chaining is ended. 
     The COMMAND register is 32-bit. It allows direct access to the Write FIFO between the host and the BLT engine. 
     The CONTROL register is 16-bit. It controls and returns status of various parts of the command pipe and read/write FIFO. The CONTROL register has an AUTO --  BLT --  EN bit. When AUTO --  BLT --  EN is 0, the auto BLT arm/trigger mechanism is disabled, when 1, the mechanism operates normally. 
     The OP{0-2} --  opRDRAM registers are 32-bit, supplying the RDRAM XY address to a selected OFU (Operand Fetch Unit). The OP0 --  opRDRAM register can store the result X byte and Y line address. 
     The RESIZE{A-C} --  opRDRAM registers are 32-bit, containing the source address for the automatic Resize BLT, and the control bits for the automatic graphics operation. Each register contains a separate source address, triggered by the appropriate Vertical count from the vertical sync counter of the graphics processor. Each register has two control bits: TRIGGER and ARM. The TRIGGER bit is used to trigger auto BLT. When TRIGGER is HIGH, auto BLT is triggered as soon as the register is written. When TRIGGER is LOW, it waits for the vertical sync counters to reach the appropriate vertical count. The ARM bit is used to prepare for automatic BLT. When ARM is HIGH, automatic BLT is armed, i.e. when the vertical sync counter reaches the appropriate vertical count, auto BLT will start. When ARM is LOW, auto BLT must be armed externally. These control bits are summarized as follows: 
     
         ______________________________________Trigger Arm       Operation______________________________________0      0          External arm0      1          Automatic armed. Trigger when vertical             count is reached.1      0          Trigger auto BLT as soon as register is             written.1      1          INVALID______________________________________ 
    
     The remaining bits of RESIZE{A-C} 13  opRDRAM are used to specify the vertical and horizontal positions where source data reside in RDRAM memory. 
     The START --  BLT --  1 8-bit register defines where (in multiples of 32 scanlines) during scan refresh AutoBLT of Window 1 is enabled, to prevent tearing of the window. AutoBLT is enabled when START --  BLT --  1≦current scanline&lt;STOP --  BLT --  1. This register is disabled when bit 31 of RESIZEA 13  opRDRAM is 1. 
     The STOP --  BLT --  1 8-bit register defines where (in multiples of 32 scanlines) during screen refresh AutoBLT of Window 1 is disabled, to prevent tearing of the window. This register is disabled when bit 31 of RESIZEA --  opRDRAM is 1. In addition, bit 7 (MSB) of this register is used to enable the Window 1. If it is 1, Window 1 is enabled; if it is 0, Window 1 is disabled, i.e., AutoBLT is not triggered. 
     The START --  BLT --  1 must be different from STOP --  BLT --  1. 
     The START --  BLT 13  2, STOP --  BLT --  2, START --  BLT --  3 and STOP --  BLT --  3 are similar except that the RESIZEB 13  opRDRAM and RESIZEC 13  opRDRAM, respectively, are used instead. Therefore, three windows can be set active at the same time with three different safe regions. 
     The START --  BLT --  i and STOP --  BLT 13  i (i=1,2,3) define the safe regions for the autoBLT triggered by the vertical count value to carry out graphics operations without creating any undesirable effects. 
     AUTOMATIC BLT OPERATIONS 
     Two things need to be done to accomplish automatic BLT operation. First, a header file must be created to specify the graphics operations to be performed. This header file essentially contains the graphics variables to be loaded into the graphics processor. Second, after the header file is created, the triggering mechanism must be selected. 
     1. HEADER FILE 
     The header file contains data to be loaded to the graphics processor. The header file is written by the host into a nonviewable area of the frame buffer memory 40. The graphics processor will read the header file and fill its specified registers by the values contained in the header file. There are 28 registers whose values are specified in the header file. Each value requires 16 bits, therefore the total number of bytes to fill a header file is 56. The order of the registers in the header file must be followed. 
     2. TRIGGERING MECHANISM 
     The automatic BLT operation can be triggered by either of two ways: screen refresh and host direct control. 
     (1) Screen refresh. 
     The graphics processor 20 has its own video control circuitry to generate video control signals such as horizontal sync, vertical sync and pixel clock. Once initialized, the graphics processor 20 generates these signals independently of the BLT engine 54 and the host 10. Screen refresh is referred to as the mechanism in which the video screen is updated with new images. It is essentially dictated by the vertical sync. The graphics processor 20 has a vertical sync counter to increment the vertical line count. In applications such as animation or video, it is important to synchronize the updating of the images with the screen refresh to avoid any undesirable display effects. 
     When the TRIGGER and ARM bits in the RESIZE{A-C} --  opRDRAM are programmed 0 and 1, respectively, the vertical sync triggering mechanism is enabled. The START --  BLT --  i and STOP --  BLT --  i registers provide the vertical count range in which the autoBLT will be triggered. As soon as the vertical count value exceeds the corresponding START --  BLT 13  i, the autoBLT will start if the graphics processor is not busy doing something else. If the graphics processor is busy doing something else, it will complete that task and immediately start the autoBLT operations as long as the vertical count value is less than that in the corresponding STOP --  BLT --  i. Therefore, the START --  BLT --  i value and the STOP --  BLT --  i value give the earliest frame time and the latest frame time that autoBLT operations can start. Once started, the autoBLT operations will be completed regardless of the vertical count value. Therefore, the values written into START --  BLT --  i and STOP --  BLT --  i should be selected carefully to ensure that graphics operations can proceed safely without overwriting an image or image portion as it is being displayed. 
     Since there are three sets of independent registers for this autoBLT by screen refresh, three windows on the screen can be independently refreshed (e.g., updated). 
     FIG. 3 shows the correspondence between the autoBLT registers and the windows on the screen. The screen 110 is the screen of the monitor displaying the images. On the screen, the windows 111, 112 and 113 are three simultaneously active windows displayed on the screen. The parameter sets 121, 122 and 123 correspond to the windows 111, 112 and 113, respectively. The location of windows 111, 112 and 113 are specified by values in the parameter sets 121, 122, and 123 respectively. The location of the parameter sets is specified by RESIZE (A-C) 13  op RDRAM. The safe regions for the vertical line triggering are specified in the corresponding START --  BLT --  i and STOP --  BLT --  i registers. 
     FIG. 4 presents a flow diagram to illustrate the interactions between the host 10 and the graphics processor 20. Block 200 includes the steps performed by the host computer 10. Block 220 includes the steps performed by the graphics processor 20. In both blocks, it is assumed that the host computer 10 has other normal tasks to do such as servicing peripheral devices, executing the main program, and responding to interrupts. Similarly, the graphics processor 20 also has its own normal tasks to attend to such as generating video control signals. When the host computer 10 is ready to initiate automatic graphics operations, it will first build a header file, or a sequence of header files in which case chaining will be employed (to be discussed later). In step 210, the host 10 writes 56 bytes of the header file to the buffer memory 40. In step 211, the host 10 writes the start and stop values of the vertical scanlines to establish the safe region. Up to three safe regions can be established corresponding to three active windows, or three sets of automatic graphics operations. In step 212, the host 10 programs TRIGGER=0 and ARM=1 of the corresponding RESIZE{A-C} --  opRDRAM registers to enable the screen refresh triggering mechanism. As soon as the graphics processor 20 is programmed with these bits, it will be ready for automatic operations. The host 10 then can go back to its normal tasks in step 213. Block 220 shows the steps carried out by the graphics processor. The following discussion will assume that only one window is active. In the preferred embodiment, three windows can be enabled at the same time. In step 221, if the host 10 has not enabled the screen refresh triggering option, the graphics processor 20 continues normal operation as shown in step 230. Once the screen refresh triggering option is enabled, the graphics processor 20 will enable the comparison of the internal vertical counter with the start and stop values programmed by the host 10. Since the comparison is done by independent hardware within the graphics processor, the graphics processor 20 is not busy when performing this task. At the end of every operation, the graphics processor 20 will check the results of this comparison as shown in step 222. If the vertical counter is outside the range established by the safe region, the graphics processor continues normal operation in step 230. If the vertical counter is within the range, the graphics processor will suspend normal operation and will fetch the automatic BLT header as shown in step 223. These values will then be stored to the registers (step 224), and the automatic BLT will then be executed in step 225. Once the automatic BLT is complete, the graphics processor 20 will return to step 221. 
     (2) Host Direct Control. 
     Although the screen refresh triggering mechanism allows the synchronization of BLT operations and the screen refresh, there are situations in which it is more desirable for the host to control the automatic BLT operations directly. In other words, the graphics processor will carry out the autoBLT operations immediately after being programmed by the host 10. 
     FIG. 5 shows a flow diagram to illustrate the interaction between the host 10 and the graphics processor 20. Block 300 consists of the host&#39;s steps and block 320 consists of the graphics processor&#39;s steps. As before, the host 10 first sets up the header file in step 301. When the host 10 is ready for autoBLT operations, in step 302 it will program the TRIGGER and ARM bits to be 1 and 0, respectively. Then the host 10 can go back to its normal tasks in step 303. On the graphics processor&#39;s side, in step 321, if the host 10 has not triggered the automatic BLT, normal operation will continue in step 330. If the trigger is enabled, the automatic operation will start in step 322. 
     LINKING GRAPHICS OPERATIONS 
     Although each header file contains sufficient information for a complete graphics operation, it is desirable to chain many header files together to allow a sequence of graphics operations to be performed without being interrupted by the host 10. In this way, very complex graphics tasks can be accomplished. This is possible because there is a chaining enable bit in the graphics processor. The LNCNTL register Chain Enable Bit is used to enable the chaining. When this bit is HIGH, chaining is enabled; when LOW, chaining is disabled. Each header file contains pointers for the next header file. These pointers are NEXT 13  HEAD.pt.X and NEXT --  HEAD.pt.Y. (Note that the nonviewable area of the buffer memory is considered as a two dimensional extension of the viewable area, and that a header file may be written on any &#34;line&#34; (Y value) as well as at any choice of position on the line (X value).) When chaining is enabled, after the first BLT operation is completed, the graphics processor will read a new set of parameters from the location specified by NEXT --  HEAD.pt.X and NEXT --  HEAD.pt.Y and execute a new BLT. Chaining is continued until the Chain Enable Bit of LNCNTL is LOW indicating that this is the last header file in the sequence. 
     Chaining is independent of the triggering mechanism. Therefore, a sequence of autoBLT operations can be chained and triggered either by screen refresh or by the host as described above. 
     FIG. 6 shows a diagram illustrating the correspondence between chaining and displaying. Display screen 400 is the normal screen showing three active windows WA 401, WBB&#39; 402, and WC 403. Register sets RA 411, RB 412 and RC 413 contain registers to specify the XY position and the safe regions corresponding to WA, WBB&#39; and WC, respectively. The header memory area HA 414 and HC 417 contain the LNCNTL chaining enable bits which are zero, disabling the chaining. The autoBLT operations, therefore, are performed as specified in the header memory area HA 414 and HC 417 only. Header memory area HB has chaining, i.e., its chaining enable bit is one. Suppose the next header pointer in HB points to HB&#39; 416 and the HB&#39; header contain a chaining enable bit of zero. Then when the BLT operation in the header memory area HB is completed, the graphics processor will fetch the parameters contained in HB&#39; header memory area and execute its BLT operation. After HB&#39; BLT operation is completed, the graphics processor will return to its normal mode. The window WBB&#39; 402 therefore shows the results of the two BLT operations from HB and HB&#39;. 
     The combination of the automatic graphics operation triggered by either the screen refresh or the host 10 and the chaining method can produce very complex and powerful graphics operations without involving much host overhead and therefore minimize host interactions. In essence, graphics programs may be built in the buffer memory 40 by the host 10, and through the use of chaining in accordance with the present invention, executed and the results displayed without host intervention. 
     Finally, while the automatic graphics operation of the present invention has been disclosed and described with respect to a preferred embodiment thereof, it will be understood that the apparatus and methods of the present invention may be varied without departing from the spirit and scope of the invention.