# US 2008/0303837 A1 · Batching graphics operations with time stamp tracking

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

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

## CPC

- G06F 9/5044: {considering hardware capabilities}
- G06F 2209/508: Monitor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and an apparatus for updating graphics resource usage according to a stream of graphics commands atomically submitted to a graphics processing unit (GPU) are described. The stream of graphics commands may be received from a plurality of graphics APIs (application programming interfaces) by a graphics driver. Availability of graphics resources of the GPU may be monitored by the graphics driver for submitting the stream of graphics commands. A single notification from the GPU may indicate that all graphics commands submitted to the GPU have been executed for updating a usage of graphics resources associated with the executed graphics commands.

## Claims

### Claim 1

A computer implemented method for processing graphics data, the method comprising:
in response to a stream of graphics commands received from a plurality of graphics APIs (application programming interfaces), a graphics driver submitting atomically the stream of graphics commands to a graphics processing unit (GPU) based on availability of graphics resources of the GPU monitored by the graphics driver; and
in response to a single notification from the GPU indicating that all graphics commands submitted to the GPU have been executed, the graphics driver updating graphics resource usage in view of graphics resources associated with the executed graphics commands, such that subsequent graphics commands can be submitted to the GPU based on the updated graphics resource usage.

### Claim 2 (depends on 1)

The method of claim 1, wherein the single notification is generated by the GPU when an internal buffer of the GPU is empty and previous graphics commands have been executed.

### Claim 3 (depends on 2)

The method of claim 2, wherein the single notification message is generated via a hardware interrupt when the internal buffer of the GPU is empty and all previously submitted graphics commands have been executed.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
the graphics driver monitoring whether the internal buffer of the GPU is full; and
if the internal buffer of the GPU is full, the graphics driver sending a synchronization command to the GPU to register a notification from the GPU when the internal buffer of the GPU is empty and all submitted graphics commands have been executed, wherein the single notification message is sent from the GPU based on the registration of the graphics driver.

### Claim 5 (depends on 1)

The method of claim 1, wherein the graphics driver keeps track of a number of graphics commands sent down to the GPU and graphics resources associated with the sent graphics commands.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
updating a submit counter associated with the graphics resources prior to the submitting;
updating a completion counter associated with the graphics resource based on the number of graphics commands previously sent; and
comparing values of the submit counter and the completion counter of the graphics resources to determine whether all graphics commands have been executed.

### Claim 7 (depends on 6)

The method of claim 6, wherein the graphics resource is freed when the values of the submit counter and completion counter are equal.

### Claim 8 (depends on 6)

The method of claim 6, wherein the updating the submit counter comprises determining the number of graphics commands associated with the graphics resources.

### Claim 9

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:
in response to a stream of graphics commands received from a plurality of graphics APIs (application programming interfaces), a graphics driver submitting atomically the stream of graphics commands to a graphics processing unit (GPU) based on availability of graphics resources of the GPU monitored by the graphics driver; and
in response to a single notification from the GPU indicating that all graphics commands submitted to the GPU have been executed, the graphics driver updating graphics resource usage in view of graphics resources associated with the executed graphics commands, such that subsequent graphics commands can be submitted to the GPU based on the updated graphics resource usage.

### Claim 10 (depends on 9)

The machine-readable medium of claim 9, wherein the single notification is generated by the GPU when an internal buffer of the GPU is empty and previous graphics commands have been executed.

### Claim 11 (depends on 10)

The machine-readable medium of claim 10, wherein the single notification message is generated via a hardware interrupt when the internal buffer of the GPU is empty and all previously submitted graphics commands have been executed.

### Claim 12 (depends on 11)

The machine-readable medium of claim 11, wherein the method further comprises:
the graphics driver monitoring whether the internal buffer of the GPU is full; and
if the internal buffer of the GPU is full, the graphics driver sending a synchronization command to the GPU to register a notification from the GPU when the internal buffer of the GPU is empty and all submitted graphics commands have been executed, wherein the single notification message is sent from the GPU based on the registration of the graphics driver.

### Claim 13 (depends on 9)

The machine-readable medium of claim 9, wherein the graphics resource keeps track of a number of graphics commands sent down to the GPU and graphics resources associated with the sent graphics commands.

### Claim 14 (depends on 13)

The machine-readable medium of claim 13, wherein the method further comprises:
updating a submit counter associated with the graphics resources prior to the submitting;
updating a completion counter associated with the graphics resource based on the number of graphics commands previously sent; and
comparing values of the submit counter and the completion counter of the graphics resources to determine whether all graphics commands have been executed.

### Claim 15 (depends on 14)

The machine-readable medium of claim 14, wherein the graphics resource is freed when the values of the submit counter and completion counter are equal.

### Claim 16 (depends on 14)

The machine-readable medium of claim 14, wherein the updating the submit counter comprises determining the number of graphics commands associated with the graphics resources.

### Claim 17

An apparatus for processing graphics data, comprising:
in response to a stream of graphics commands received from a plurality of graphics APIs (application programming interfaces), means for a graphics driver submitting atomically the stream of graphics commands to a graphics processing unit (GPU) based on availability of graphics resources of the GPU monitored by the graphics driver; and
in response to a single notification from the GPU indicating that all graphics commands submitted to the GPU have been executed, means for the graphics driver updating graphics resource usage in view of graphics resources associated with the executed graphics commands, such that subsequent graphics commands can be submitted to the GPU based on the updated graphics resource usage.

### Claim 18

A computer implemented method for processing graphics data, the method comprising:
in response to a plurality of graphics commands received from a plurality of graphics APIs (application programming interfaces), a graphics driver sending at least a portion of the graphics commands to a graphics processing unit (GPU), wherein the graphics commands sent to the GPU are temporarily stored in an internal buffer of the GPU and the graphics commands are sent to the GPU until the internal buffer is full; and
when the internal buffer of the GPU is full, the graphics driver sending a synchronization command to the GPU to request a notification from the GPU, wherein the graphics driver is notified by the GPU when the internal buffer is empty and all previously commands sent and stored in the internal buffer have been executed.

### Claim 19 (depends on 18)

The method of claim 18, further comprising in response to the notification from the GPU, the graphics driver releasing graphics resources associated with the commands previously sent prior to sending the synchronization command.

### Claim 20 (depends on 19)

The method of claim 19, further comprising recording within the graphics driver the graphics resources associated with each graphics commands sent to the GPU prior to sending the synchronization command.

### Claim 21 (depends on 20)

The method of claim 20, further comprising the graphics driver recording a number of graphics commands sent to the GPU prior to sending the synchronization command.

### Claim 22 (depends on 21)

The method of claim 21, wherein the graphics commands are stored a command buffer by the plurality of graphics APIs and fetched by the graphics driver from the command buffer, wherein the recordation of the number of graphics commands and the associated graphics resources is performed by the graphics driver by examining each graphics command stored in the command buffer.

### Claim 23 (depends on 22)

The method of claim 22, wherein in response to the notification from the GPU, the graphics driver revisits the graphics commands stored in the command buffer to determine which of the commands have been executed and the associated graphics resources can be released based on the recordation of the graphics commands and the associated graphics resources.

### Claim 24 (depends on 18)

The method of claim 18, wherein the notification is issued via a hardware interrupt originated from the GPU.

### Claim 25

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:
in response to a plurality of graphics commands received from a plurality of graphics APIs (application programming interfaces), a graphics driver sending at least a portion of the graphics commands to a graphics processing unit (GPU), wherein the graphics commands sent to the GPU are temporarily stored in an internal buffer of the GPU and the graphics commands are sent to the GPU until the internal buffer is full; and
when the internal buffer of the GPU is full, the graphics driver sending a synchronization command to the GPU to request a notification from the GPU, wherein the graphics driver is notified by the GPU when the internal buffer is empty and all previously commands sent and stored in the internal buffer have been executed.

### Claim 26 (depends on 25)

The machine-readable medium of claim 25, wherein the method further comprises in response to the notification from the GPU, the graphics driver releasing graphics resources associated with the commands previously sent prior to sending the synchronization command.

### Claim 27 (depends on 26)

The machine-readable medium of claim 26, wherein the method further comprises recording within the graphics driver the graphics resources associated with each graphics commands sent to the GPU prior to sending the synchronization command.

### Claim 28 (depends on 27)

The machine-readable medium of claim 27, wherein the method further comprises the graphics driver recording a number of graphics commands sent to the GPU prior to sending the synchronization command.

### Claim 29 (depends on 28)

The machine-readable medium of claim 28, wherein the graphics commands are stored in a command buffer by the plurality of graphics APIs and fetched by the graphics driver from the command buffer, wherein the recordation of the number of graphics commands and the associated graphics resources is performed by the graphics driver by examining each graphics command stored in the command buffer.

### Claim 30 (depends on 29)

The machine-readable medium of claim 29, wherein in response to the notification from the GPU, the graphics driver revisits the graphics commands stored in the command buffer to determine which of the commands have been executed and the associated graphics resources can be released based on the recordation of the graphics commands and the associated graphics resources.

### Claim 31 (depends on 25)

The machine-readable medium of claim 25, wherein the notification is issued via a hardware interrupt originated from the GPU.

### Claim 32

An apparatus for processing graphics data, comprising:
in response to a plurality of graphics commands received from a plurality of graphics APIs (application programming interfaces), means for a graphics driver sending at least a portion of the graphics commands to a graphics processing unit (GPU), wherein the graphics commands sent to the GPU are temporarily stored in an internal buffer of the GPU and the graphics commands are sent to the GPU until the internal buffer is full; and
when the internal buffer of the GPU is full, means for the graphics driver sending a synchronization command to the GPU to request a notification from the GPU, wherein the graphics driver is notified by the GPU when the internal buffer is empty and all previously commands sent and stored in the internal buffer have been executed.
