Efficient adapter context switching

Electrical computers and digital data processing systems: input/ – Access locking

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C709S241000, C709S241000

Reexamination Certificate

active

06629175

ABSTRACT:

BACKGROUND
1. Field of the Present Invention
The present invention relates to the field of computer graphics and more particularly to a method and system for managing a complex graphics state on an adapter supporting multiple threads running in a windowing-type operating system environment.
2. History of Related Art
Graphics adapters have become a standard I/O peripheral device for microprocessor based computing systems. Some graphics adapters incorporate the ability to rastorize graphic primitives using state information that specify graphics attributes, such as pixel depth, that are set by graphics commands. Theses attributes are referred to as the adapter context. For these graphic adapters, software must insure that when a thread sends commands to the adapter, the commands are interpreted using the correct adapter context. In addition, software must insure that only one thread accesses the adapter at any given time.
Many widely distributed operating systems enable multi-tasking operation in which two or more application programs are executing simultaneously. Typically, each application program may spawn one or more threads where each thread is dedicated to a specific task. In addition, most multi-tasking operating systems provide a protection mechanism to prevent application programmers from accessing or otherwise modifying code that is essential to the operating system. In a Windows® environment, for example, a protection mechanism is provided by assigning application code to one of four hierarchical “rings,” rings
0
through
3
, where ring
0
code is the most highly protected code (accessible only to other ring
0
code) and ring
3
code is the least protected code (accessible to code of all rings). In a similar manner, Unix® systems utilize a “kernel” mode and a “user” mode. While the present disclosure is described with frequent references to the ring protection mechanism of the Windows® operating system, it is to be understood that the invention is not limited to a Windows® implementation and is generally applicable to any multi-tasking operating system employing some manner of protection mechanism.
In a Windows® operating environment, conventional application software is typically written as ring
3
code. At the other end of the spectrum, the core operating system routines and tasks including device drivers that are designed to configure settings on various peripheral devices are ring
0
code. If a ring
3
application program requires the use of ring
0
code, the operating system provides a mechanism by which the ring
3
code can make a call that will result in the execution of ring
0
code. Typically, the ring
3
to ring
0
transition is a time consuming and expensive transition because the operating system must initiate a sequence of complex subroutine calls. Each of these subroutine calls typically require the operating system to store the context of the calling subroutine for later retrieval. It will be appreciated by those familiar with the most common multi-tasking operating systems that it is desirable to avoid ring
3
to ring
0
transitions whenever possible. In the area of high performance computer graphics, minimizing the number of such transitions can determine the ultimate performance of the graphics application. When multiple threads that access the adapter, each with its own corresponding adapter context, are running simultaneously, the task of re-instating the appropriate adapter context that each thread must perform prior to sending adapter commands negatively affects system performance. This is especially true in memory protected operating systems in which a transition from application code to core code is initiated with each change of adapter context. Therefore, it would be highly desirable to implement a method and system that minimized operating system overhead while supporting multi-threaded graphics execution.
SUMMARY OF THE INVENTION
The problems identified above are address by a method and system for controlling access to an adapter, such as a graphics adapter. The method includes querying an adapter lock with a first thread. Thereafter, responsive to determining that the lock indicates the first thread does not have access to the adapter, a sequence to obtain access to the adapter is initiated where the sequence includes writing the adapter context corresponding to the first thread. The sequence includes a ring
3
to ring
0
transition. The method also includes, in response to determining that the lock indicates the first thread has access to the adapter, communicating to the adapter with the first thread without invoking the sequence to obtain access to the adapter. In one embodiment, querying the adapter lock includes writing a first word of the adapter lock using an atomic operation. The method may further include writing a set of command buffers with the first thread and, responsive to determining that the first has access to the adapter, transferring the commands buffers to the adapter. In one embodiment, the sequence to obtain access to the adapter includes the first thread obtaining ownership of a mutex lock prior to updating the adapter context. The sequence to obtain access to the adapter may include updating the adapter lock status to indicate the first thread having access to the adapter.
The invention further contemplates a data processing system that includes a processor, a bus bridge, and an adapter. The processor has access to a system memory via a system bus. The bus bridge is connected between the system bus and a peripheral bus. The adapter, such as a graphics adapter is connected to the peripheral bus. In one embodiment, the system memory contains a display driver suitable for modifying the context of the adapter and user code suitable for writing a set of command buffers that are executable by the adapter. The system memory preferably further includes a routine suitable for querying an adapter lock to determine if the user code has access to the adapter in response to the user code indicating that a set of command buffers is ready to be transferred to the adapter. In this manner the set of command buffers can be transferred to the adapter without invoking the display driver to modify the adapter context or placing context restoring commands at the start of each command buffer.


REFERENCES:
patent: 5752032 (1998-05-01), Keller et al.
patent: 5826073 (1998-10-01), Ben-Meir et al.
patent: 5893912 (1999-04-01), Freund et al.
patent: 5983292 (1999-11-01), Nordstrom et al.
patent: 6173309 (2001-01-01), Kirshenbaum et al.
patent: 6173377 (2001-01-01), Yanai et al.
patent: 6179489 (2001-01-01), So et al.
patent: 6208361 (2001-03-01), Gossett
patent: 6223204 (2001-04-01), Tucker
patent: 6314563 (2001-11-01), Agesen et al.
“Give a Process to your Drivers”, Francois Armand, Chorus systemes, Sep. 1991.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Efficient adapter context switching does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Efficient adapter context switching, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Efficient adapter context switching will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3103624

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.