# US 2008/0303834 A1 · Deferred deletion and cleanup for graphics resources

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0303834 A1
- Document ID: US20080303834A1
- Status: Published application
- Kind: A1
- Application number: 11/811,076
- Filed: 2007-06-07
- Published: 2008-12-11
- Earliest claimed: 2007-06-07
- Assignees: Apple Inc.
- Inventors: Michael James Elliott Swift; Richard Schreyer
- Web page: https://patentgrep.com/patent/US20080303834A1

## CPC

- G06T 1/20: Processor architectures; Processor configuration, e.g. pipelining
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A method and an apparatus for maintaining separate information for graphics commands that have been sent to a graphics processing unit (GPU) and for graphics commands that have been processed by the GPU are described. The graphics commands may be associated with graphics resources. A manner to respond to a request for updating the graphics resources may be determined based on examining the separate information maintained for the graphics commands. The request may be received from a graphics API (application programming interface). Responding to the request may include at least one of notifying the graphics API regarding a status of the graphics resources and updating the graphics resources identified by the request.

## Claims

### Claim 1

A computer implemented method for processing graphics data, the method comprising:
maintaining first information representing graphics commands that have been sent to a graphics processing unit (GPU) and second information representing graphics commands that have been processed by the GPU; and
in response to a request received from a graphics API (application programming interface) for updating graphics resources identified by the request, examining the first and second information to determine a manner to respond to the request, including at least one of notifying the graphics API regarding a status of the graphics resources and updating the graphics resources identified by the request.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first and second information is maintained within a graphics driver associated with the GPU.

### Claim 3 (depends on 1)

The method of claim 1, wherein the first information comprises data representing a number of graphics command that have been sent to the GPU.

### Claim 4 (depends on 3)

The method of claim 3, wherein the second information comprises data representing a number of graphics commands that have been completed by the GPU.

### Claim 5 (depends on 4)

The method of claim 4, wherein the first information further comprises data representing which of the graphics commands received from the graphics API have been sent to the GPU, and wherein the second information further comprises data representing which of the graphics commands received from the graphics API have been completed by the GPU.

### Claim 6 (depends on 1)

The method of claim 1, wherein the request concerns whether a particular graphics command has been completed by the GPU, wherein the method further comprises:
in response to the request, identifying which of the graphics commands is associated with the request based on at least the first information; and
determining whether the particular graphics command has been completed by the GPU based on the second information in order to respond to the request.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
receiving a notification from the GPU indicating that one or more graphics command have been completed; and
in response to the notification, updating the second information regarding the completion of the one or more graphics commands.

### Claim 8 (depends on 7)

The method of claim 7, further comprising returning a response to the request indicating that the particular graphics command has been completed if the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 9 (depends on 7)

The method of claim 7, further comprising queuing the request if the second information indicates that the particular graphics command has not been completed by the GPU.

### Claim 10 (depends on 9)

The method of claim 9, further comprising returning a response to the queued request if subsequently the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 11 (depends on 7)

The method of claim 7, further comprising:
maintaining a graphics resource map representing graphics resources that have been allocated with the graphics commands that have been sent to the GPU; and
releasing graphics resources associated with the particular graphics command based on the graphics resource map, if the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
marking without releasing graphics resources associated with the particular graphics command in the graphics resource map, if the second information indicates that the particular graphics command has not been completed by the GPU; and
releasing the marked graphics resources associated with the particular graphics command if subsequently the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 13

A machine-readable medium having instructions stored therein which, when executed on a system, cause the system to perform a method for processing graphics data, the method comprising:
maintaining first information representing graphics commands that have been sent to a graphics processing unit (GPU) and second information representing graphics commands that have been processed by the GPU; and
in response to a request received from a graphics API (application programming interface) for updating graphics resources identified by the request, examining the first and second information to determine a manner to respond to the request, including at least one of notifying the graphics API regarding a status of the graphics resources and updating the graphics resources identified by the request.

### Claim 14 (depends on 13)

The machine-readable medium of claim 13, wherein the first and second information is maintained within a graphics driver associated with the GPU.

### Claim 15 (depends on 13)

The machine-readable medium of claim 13, wherein the first information comprises data representing a number of graphics command that have been sent to the GPU.

### Claim 16 (depends on 15)

The machine-readable medium of claim 15, wherein the second information comprises data representing a number of graphics commands that have been completed by the GPU.

### Claim 17 (depends on 16)

The machine-readable medium of claim 16, wherein the first information further comprises data representing which of the graphics commands received from the graphics API have been sent to the GPU, and wherein the second information further comprises data representing which of the graphics commands received from the graphics API have been completed by the GPU.

### Claim 18 (depends on 13)

The machine-readable medium of claim 13, wherein the request concerns whether a particular graphics command has been completed by the GPU, wherein the method further comprises:
in response to the request, identifying which of the graphics commands is associated with the request based on at least the first information; and
determining whether the particular graphics command has been completed by the GPU based on the second information in order to respond to the request.

### Claim 19 (depends on 18)

The machine-readable medium of claim 18, wherein the method further comprises:
receiving a notification from the GPU indicating that one or more graphics command have been completed; and
in response to the notification, updating the second information regarding the completion of the one or more graphics commands.

### Claim 20 (depends on 19)

The machine-readable medium of claim 19, wherein the method further comprises returning a response to the request indicating that the particular graphics command has been completed if the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 21 (depends on 19)

The machine-readable medium of claim 19, wherein the method further comprises queuing the request if the second information indicates that the particular graphics command has not been completed by the GPU.

### Claim 22 (depends on 21)

The machine-readable medium of claim 21, wherein the method further comprises returning a response to the queued request if subsequently the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 23 (depends on 19)

The machine-readable medium of claim 19, wherein the method further comprises:
maintaining a graphics resource map representing graphics resources that have been allocated with the graphics commands that have been sent to the GPU; and
releasing graphics resources associated with the particular graphics command based on the graphics resource map, if the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 24 (depends on 23)

The machine-readable medium of claim 23, wherein the method further comprises:
marking without releasing graphics resources associated with the particular graphics command in the graphics resource map, if the second information indicates that the particular graphics command has not been completed by the GPU; and
releasing the marked graphics resources associated with the particular graphics command if subsequently the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 25

A data processing system, comprising:
a graphics API (application programming interface) to receive graphics commands from an application;
a graphics processing unit (GPU) to process the graphics commands; and
a graphics driver coupled to the graphics API and the GPU to maintain communications between the graphics API and the GPU, wherein the graphics driver is configured to
maintain first information representing graphics commands that have been sent to the GPU and second information representing graphics commands that have been processed by the GPU, and
in response to a request received from the graphics API for updating graphics resources identified by the request, examinine the first and second information to determine a manner to respond to the request, including at least one of notifying the graphics API regarding a status of the graphics resources and updating the graphics resources identified by the request.

### Claim 26

An apparatus for processing graphics data, comprising:
means for maintaining first information representing graphics commands that have been sent to a graphics processing unit (GPU) and second information representing graphics commands that have been processed by the GPU; and
in response to a request received from a graphics API (application programming interface) for updating graphics resources identified by the request, means for examining the first and second information to determine a manner to respond to the request, including at least one of notifying the graphics API regarding a status of the graphics resources and updating the graphics resources identified by the request.

### Claim 27

A computer implemented method for processing graphics data, comprising:
maintaining first information representing graphics commands that have been sent to a graphics processing unit (GPU) and second information representing graphics commands that have been processed by the GPU;
in response to a first request from a graphics API (application programming interface) for querying whether a particular graphics command has been completed, examining at least one of the first and second information to determine whether the particular graphics command has been completed by the GPU;
returning a response to a first request indicating that the particular graphics command has been completed if the first information indicates that the particular graphics command has been sent to the GPU and the second information indicates that the particular graphics command has been completed by the GPU; and
queuing the first request if the first information indicates that the particular graphics command has been sent to the GPU and the second information indicates that the particular graphics command has not been completed by the GPU.

### Claim 28 (depends on 27)

The method of claim 27, further comprising:
receiving a notification from the GPU indicating that the particular graphics command has been completed; and
in response to the notification, updating the second information to indicate that the particular graphics command has been completed.

### Claim 29 (depends on 28)

The method of claim 28, further comprising returning a response to the queued first request indicating that the particular graphics command has been completed, if subsequently the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 30 (depends on 28)

The method of claim 28, further comprising:
receiving a second request from the graphics API for releasing graphics resources associated with the particular graphics command; and
in response to the second request, releasing the requested graphics resources if the first information indicates that the particular graphics command has been sent to the GPU and the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 31 (depends on 30)

The method of claim 30, further comprising:
maintaining a graphics resource map representing graphics resources that have been allocated for one or more graphics commands that have been sent to the GPU;
marking without releasing the requested graphics resources in the graphics resource map if the first information indicates that the particular graphics command has been sent to the GPU and the second information indicates that the particular graphics command has not been completed by the GPU; and
subsequently releasing the marked graphics resources if the second information indicates that the particular graphics command has been completed by the GPU.

### Claim 32

A computer implemented method for processing graphics data, comprising:
maintaining first information representing graphics commands that have been sent to a graphics processing unit (GPU) and second information representing graphics commands that have been processed by the GPU;
maintaining a graphics resource map representing graphics resources allocated to the graphics commands indicated by the first information;
in response to a request for release graphics resources of a particular graphics command, marking without releasing the requested graphics resources in the graphics resource map if the first information indicates that the particular graphics command has been sent to the GPU and the second information indicates that the particular graphics command has not been completed by the GPU.

### Claim 33 (depends on 32)

The method of claim 32, further comprising:
receiving a notification from the GPU indicating the particular graphics command has been completed; and
in response to the notification, updating the second information to indicate that the particular graphics command has been completed.

### Claim 34 (depends on 33)

The method of claim 33, further comprising releasing the graphics resources associated with the particular graphics command marked in the graphics resource map in response to updating the second information to indicate that the particular graphics command has been completed.

### Claim 35

A computer implemented method for processing graphics data, comprising:
temporarily storing in a stream command buffer one or more graphics commands received from a graphics API (application programming interface);
stamping in the stream command buffer each of the graphics commands that are sent to a graphics processing unit (GPU) for processing to indicate that the stamped graphics commands have been sent to the GPU; and
in response to a notification from the GPU indicating that at least a portion of the graphics commands sent have been completed by the GPU, stamping the completed graphics commands in the stream command buffer to indicate that the stamped graphics commands have been completed.

### Claim 36 (depends on 35)

The method of claim 35, further comprising releasing graphics resources associated with a particular graphics command only if the particular graphics command has been stamped indicating that the particular graphics command has been sent to the GPU and the particular graphics command has been completed by the GPU.
