1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for displaying pixels in a data processing system. Still more particularly, the present invention provides a method and apparatus for updating a window identification buffer used to display pixels in a data processing system dynamically based on the requirements of an application environment.
2. Description of Related Art
Computer graphics concerns the synthesis or display of real or imaginary objects from computer-based models. In computer graphics systems, images are displayed on a display device to a user in two dimensional and three dimensional forms. These images are displayed using pixels. A pixel is short for a picture element. One spot in a rectilinear grid of thousands of such spots that are individually “painted” to form an image produced on the screen by a computer or on paper by a printer. A pixel is the smallest element that display or print hardware and software can manipulate in creating letters, numbers, or graphics. These pixels and information relating to these pixels are stored in a buffer. The information describing a pixel is identified using a window ID (WID). A WID is used as an index into a window attribute table (WAT). The WAT contains information describing how a pixel will be displayed on the screen. For example, a WAT identifies depth, color map, buffer, and gamma for a pixel.
Typically, the WID is drawn into a separate buffer, which is used to describe how the pixels in the frame buffer or buffers will be displayed. Some graphic systems, such as, for example, UNIX servers, use overlays to enhance the performance of three dimensional applications, which need to have data overlaid on top of a three dimensional application. These type of servers typically require a separate WID buffer for the color planes and overlays to allow for a unique pixel interpretation for each layer. That is, separate WID buffers are used so that for any given pixel location, e.g., x=10, y=10, the pixel in the overlay can have a different pixel interpretation, e.g., different color map, depth, etc., from the one in the color planes.
An example of such an overlay is shown in
In
The different window ID planes are used to associate every pixel on the screen with its WID. For example, a pixel in the color plane at location x=12 and y=15 is associated with the WID in the color plane layer of the window ID planes at the location x=12 and y=15. A single WID can hold two WID values, zero and one; two WID planes may hold four WIDs 0, 1, 2, and 3; and so on.
Currently, WID management algorithms are all based on the idea of a fixed number of WID planes for each layer, such as overlay and color plane, regardless of the actual number of WIDs required by each layer. An inefficient fixed method can lead to technicolor as multiple windows end up sharing the same WID. Technicolor occurs when a window is displayed using the wrong color map values. In other words, a window may be displayed with the incorrect colors due to a sharing of the color table with multiple applications. One solution to this problem is to provide a graphics adaptor with the maximum number of WID planes that a graphics designer can envision being needed by each layer. Such a solution is costly and wasteful. Therefore, it would be advantageous to have an improved method, apparatus, and computer instructions for managing WIDs.
The present invention provides a method, apparatus, and computer instructions in a data processing system for managing window identifiers for different layers. A request is received to create or change a window, wherein the received request includes a set of attributes. A determination is made in response to this request as to whether a shareable window identifier is present in the layer, wherein the sharable window identifier has correct attributes matching the set of attributes for the window. This determination is made if the request is made to create a window. If a shareable window identifier is absent, a determination is made as to whether a free window identifier is present in the first layer. A determination is made as to whether a free window identifier plane is present in another layer if a free window identifier is absent in the first layer. If a free window identifier plane is present, the free window identifier plane is assigned to the layer for use to create the window.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
In
Typically, an eight bit split WID may be identified in hardware in which three bits are used to identify the WID for the overlay buffer and in which five bits are used to identify the WID for the color buffer. For example, the first three bits are used as an index into an overlay WAT while the lower five bits are used as an index into a color WAT. With three bits, eight WID entries may be identified or assigned to a pixel using the WID overlay buffer. Thirty-two different WID entries may be assigned to pixels using the WID color buffer. In this manner, a WID for a color buffer may be painted without overwriting the WIDs for the overlay buffer.
Alternatively, some hardware makes use of an eight bit split WID in which four bits are used to identify the WID for the color buffer and the other four bits are used to identify the WID for the overlay buffer. As a result, such a configuration provides sixteen WIDs for both the overlay and color planes.
Thus, in known systems, either an eight bit split WID with five bits used to identify a WID for the color buffer and three bits used to identify the WID for the overlay buffer or an eight bit split WID with four bits being used to identify each of the WID for the color buffer and the overlay buffer are provided in a graphics adapter. These configurations are fixed and not changeable.
As applications become more graphically sophisticated, these two static approaches to providing WID planes are fast becoming too limiting. This is especially true for today's dynamic graphics environment where the number of WIDs required for each layer, i.e. color and overlay, can vary greatly over time. Thus, there is a need for an improved apparatus and method for providing dynamically adjustable WID splits to accommodate the dynamic graphics environments of today's computer applications.
Additionally, with an apparatus and method to dynamically adjust configurable WID tables, a mechanism for changing color and overlaying WID plane splits based on application needs is provided.
Turning next to
With reference now to
Expansion bus interface 514 provides a connection for a keyboard and mouse adapter 520, modem 522, and additional memory 524. SCSI host bus adapter 512 provides a connection for hard disk drive 526, tape drive 528, and CD-ROM drive 530. Typical PCI local bus implementations will support three or four PCI expansion slots or add-in connectors.
An operating system runs on processor 502 and is used to coordinate and provide control of various components within data processing system 500 in
Those of ordinary skill in the art will appreciate that the hardware in
For example, data processing system 500, if optionally configured as a network computer, may not include SCSI host bus adapter 512, hard disk drive 526, tape drive 528, and CD-ROM 530, as noted by dotted line 532 in
The depicted example in
Turning next to
WID buffer 614 contains WIDs that are used as an index into color WAT table 606 and overlay WAT table 608. Each of these WAT tables 606 and 608 describes how a pixel will be rendered on a display device.
The programmable WAT color size selection device 650 is used to select which bits from the WID buffer 614 are used to identify a color WAT table 606 entry and which bits from the WID buffer 614 are used to identify an overlay WAT table 608 entry. The programmable WAT color size selection device 650 is programmable by an outside entity via a data bus (not shown), such as PCI local bus 506 in
That is, based on the control data received, the configuration of the programmable WAT color size selection device 650 is modified so that an identified number of bits received from the WID buffer 614 are passed along to the color WAT table 606 to thereby identify an entry in the color WAT table 606. The remaining bits from the WID buffer are passed along to the overlay WAT table 608 for identifying an overlay WAT table entry. The identified color WAT table entry and overlay WAT table entry are then output to the RAMDAC staged pipeline 604 for use with data from the color buffer 610 and overlay buffer 612 to generate a screen image on the display device 660.
The control data used to set the WID split in the programmable WAT color size selection device 650 may be generated by any outside source that is capable of interfacing with the graphics adapter 600 and selecting the WAT color size to be used. In a preferred embodiment, the WAT color size is selected based on the currently active application environment and the control data is sent to the graphics adapter 600 by graphics device driver software. Of course other mechanisms for setting the WID split may be used without departing from the spirit and scope of the present invention. Such other mechanisms may take the form of a physical switch, a separate input line upon which control signals are received from external circuitry, and the like.
For example, an application may change an attribute (new color map, swap buffers, etc.) that will require a new WID. Typically this happens when a new window is opened by an application. The new window will be assigned a shared WID if it has the same pixel interpretation as another window, i.e. same color map, buffer, depth, layer, etc., or it is assigned a new WID. It as at this time that the WID split may need to be changed based on these new attributes for the new window.
As a result, the graphics device driver software may send control data to the programmable WAT color size selection device 650 based on these new attributes for the new window to thereby program the programmable WAT color size selection device 650 to change the split of the WIDs from the WID buffer. Such splits may include, for example, 7-1 color/overlay split of the 8 bit WID, 6-2, 5-3, 4-4, and the like, splits of the 8 bit WID from the WID buffer 614.
In this way, various levels of color and overlay graphics capabilities are obtainable dynamically based on the particular active application environment currently being used by the computing system. The graphics device driver, e.g., XServer, dynamically manages the WID split based on the currently active application environment. In this way, different WID splits may be obtained for different applications as the different applications become active in the computing system.
In
In this example, only four bits are used as an index into a WAT table. Each table contains sixteen entries, which are indexed by a WID from WID buffer 614 in
As discussed previously, in known systems, either an eight bit split WID with five bits used to identify a WID for the color buffer and three bits used to identify the WID for the overlay buffer or an eight bit split WID with four bits being used to identify each of the WID for the color buffer and the overlay buffer are provided in a graphics adapter. These configurations are fixed and not changeable. That is, the graphics adapter may include only a single color WAT table and overlay WAT table that may be indexed by a fixed number of bits from a WID buffer. Thus, there is no flexibility with regard to the color and overlay capabilities of the graphics adapter.
However, modern dynamic graphics environment would benefit from a more flexible approach to a split WID such that the number of bits used to identify the WIDs for each of the color buffer and the overlay buffer is selectable. The present invention provides a mechanism by which the number of bits used to identify the WIDs for each of the color buffer and the overlay buffer may be programmed into the graphics adapter based on the currently active application environment.
In order to facilitate this programmability, the size of the color WAT table 606 and overlay WAT table 608 may be increased to accommodate the maximum number of bits that may be used to index into the tables. That is, if the maximum number of bits for a color WAT table is 7, such as in a 7-1 bit split between color and overlay WAT tables, then the number of entries in the color WAT table 606 will need to be a sufficient to cover all possible values obtainable from the 7 bit color WID. Similarly, if the maximum number of bits for an overlay WAT table is 4, such as in a 4-4 bit split between color and overlay WAT tables, then the number of entries in the overlay WAT table 608 will need to be sufficient to cover all possible values obtainable from the 4 bit overlay WID. With such a color WAT table 606 and overlay WAT table 608, even if lower numbers of bits are used than the maximum, the resulting WID will index into a particular entry of the color WAT table 606 and overlay WAT table 608.
For example, when determining the WID split, the graphics device driver may determine that there are no WIDs available for the color planes but there are plenty of WIDs available for the overlay planes. In such an instance, the WID split may be changed by taking one plane from the overlay WIDs and giving it to the color plane WIDs. This change in WID split may be realized by the graphics device driver sending control data to the programmable WAT color size selection device to thereby set the WID split such that one plane is moved from the overlay WIDs to the color plane WIDs.
With dynamically splitable WID planes and dynamically splitable WIDs, the graphics device driver also includes a mechanism for changing the color and overlay wood plane split based on the need of the application. Application 810 may create a window requiring its own WID or change an existing window such that the existing window requires its own WID. In creating a window, the WID for that window may require a different depth, color map, layer, or may be double buffered. In changing an existing window, a new WID may be required if a new color map is required. Application 810 sends a request to graphics device driver 830 to create a window or change an existing window.
In these examples, graphics device driver 830 checks to see if a WID is available for the requested layer. The layer may be an overlay or a color plane in these examples. If a WID is available, then the WID is assigned.
If a WID is not available for the requested layer, graphics device driver 830 checks to see if a WID plane can be obtained from the other layer. If the layer requiring the WID is the overlay, then a check is made to see if a WID plane is available in the color plane. In these examples, a single WID cannot be taken from another layer. Instead, an entire WID plane is transferred from one layer to another layer.
For example, assume the color plane has five WID planes and the overlay has three WID planes. If an additional WID is required for the overlay plane, graphics device driver 830 splits the WID planes such that each layer had four WID planes. This split or reassignment by graphics device driver 830 is made only if one of the WID planes assigned to the color plane is available.
A free WID plane is available if the number of used WIDs in the layer is less than 2(n−1) in which N is the number of WID planes assigned to the layer. For example, if four WID planes are present in a layer, 2(n-1) is equal to eight. As a result, a free WID plane is present in the layer if the number of used WIDs in the layer is eight or less. If six WID planes a present in a layer, then 2(n-1) is equal to thirty-two. As a result, a free WID plane is present if the number of used WIDs in this layer is equal to or less than thirty-two.
If a WID plane is unavailable, then sharing of WIDs occurs with the potential problems of technicolor. If a WID plane is available, a WID plane is assigned to the new layer, such as the overlay, in which the WID is required. This reassignment of the WID plane may require repainting of the WID planes and updating the WAT entries in the new layer. These actions may be required because the WID plane that is to be moved or reassigned should be contiguous to the WID planes for the new layer. Then, a new WID is assigned to the new window in the new layer.
Thereafter, or if a control data to reprogram the WID split has not been received, the operation reads the next WID from the WID buffer (step 930). The bits of the WID are then split in accordance with the WID split that is currently in effect (step 940) and the corresponding bits are sent to the color and overlay WAT tables (step 950). Thereafter, a determination is made as to whether an end condition has occurred (step 960), such as shutdown of the computing device, for example. If so, the operation terminates. Otherwise, the operation returns to step 910 and the operation is repeated until an end condition is encountered.
Thus, with the present invention, flexibility in the graphics capabilities of a graphics adapter is obtained by providing a dynamically programmable graphics adapter. More specifically, with the present invention, the number of bits used for color and overlay WAT table indexing is dynamically changeable to obtain varying color and overlay capabilities. Furthermore, this indexing into the WAT tables may be dynamically changeable based on the particular application environment that is currently active.
Turning next to
The process begins by receiving a request (step 1000). The request is received from an application. The request may be, for example, the creation of a new window or a change to an existing window.
Next, a determination is made as to whether the request received will create a window in layer N (step 1002). Layer N is a layer, such as the overlay or color plane. In this example, N is equal to zero for a color plane and is equal to one for an overlay. Although only two layers are assumed, the process illustrated in this figure may be modified to accommodate additional layers.
If a new window is to be created in layer N, a determination is made as to whether a shareable WID with the correct attributes exists in layer N (step 1004). Sharable WIDs are WIDs which may be used by more than one window at a time. All WIDs are sharable unless the window to which a WID is assigned is double buffered or has its own color map. If a shareable WID with the correct attributes does exist in layer N, then this WID is assigned the new window (step 1006) with the process terminating thereafter.
With reference again to step 1004, if a shareable WID with the correct attributes does not exist in layer N, a determination is made as to whether a free WID is available in layer N (step 1008). A free WID is a WID that is unassigned to a window. If a free WID is available in layer N, the window is assigned the free WID and the WID attributes are set (step 1010) with the process terminating thereafter. The window attributes that are set include, for example, the depth, layer, color map, and buffer. In step 1008, if a free WID is unavailable in layer N, a determination is made as to whether a free WID plane is available in any of the other layers (step 1012). A free WID plane is available if the number of used WIDs in the layer is less than 2(n-1) in which N is the number of WID planes assigned to the layer.
If a free WID plane is available in another layer, the WID plane from the other layer is assigned to the WID planes in layer N (step 1014) with the process then returning to step 1010 as described above. If a free WID plane is unavailable in one of the other layers, the window is assigned the WID from layer N with the closest matching attributes available (step 1016) with the process terminating thereafter. Step 1016 is a prior art process that results in the sharing of WIDs. This sharing may result in technicolor.
With reference again to step 1002, if the request is not to create a window, then the request is assumed to be one to change an existing window. In this case, sharing a WID cannot occur because the window needs its own color map. As a result, the process proceeds directly to step 1008 as described above.
Thus, the present invention provides an improved method, apparatus, and computer instructions for managing WIDs and WID planes. The mechanism of the present invention provides for dynamically changing the assignment of WID planes between different layers, depending on the needs of applications. This mechanism allows for reassigning a plane from one layer to another layer if a WID is unavailable in the current layer requiring a WID. This mechanism provides an ability to avoid technicolor in which multiple windows share the same WID.
It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
This application is related to commonly assigned U.S. patent application entitled “Apparatus and Method for Dynamically Programming a Window ID Configuration Based on an Application Environment,” Ser. No. 10/394,305, attorney docket number AUS920030028US1 filed on Mar. 20, 2003 and hereby incorporated by reference.