Method and system for controlling a process
By receiving input data to generate commands and determining whether writing to external memory is required at the graphics processor, unnecessary writing operations are prevented, the problem of resource waste caused by external memory writing in 3D graphics processing systems is solved, and memory bandwidth and Savings in power consumption.
Patent Information
- Application Number
- CN201910256200.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-03-29
- Filing Date
- 2019-03-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-03-29
AI Technical Summary
In 3D graphics processing systems, the graphics processor's writing operations to external memory lead to increased power consumption and memory bandwidth, and existing API functions fail to effectively manage memory usage, resulting in unnecessary writing operations that waste resources.
Generate a command by receiving input data, causing the graphics processor to write the data buffer to the external memory, and receive further input data before writing to determine whether writing is required. If not, send a signal to the graphics processor to prevent the writing operation. , modify the command to avoid writing.
It effectively avoids unnecessary writing to external memory, saves memory bandwidth and power consumption, and improves system efficiency.
Smart Images

Figure CN110322390B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to methods and systems for controlling processing. In particular, the present disclosure relates to methods and systems for controlling processing of commands at a graphics processor, such as processing of graphics rendering commands, and a graphics processing system. Background Art
[0002] In a computer processing system such as a 3D graphics processing system, an input data stream is processed at a processor. Typically, a driver at a main processor such as a central processing unit (CPU) will process the input data stream and output at least one command configured to cause a graphics processing unit (GPU) to perform an operation such as rendering an image. In some cases, the command may cause the GPU to operate on data stored in a local memory (such as an on-chip memory). The command may also cause the locally stored data to be written by the GPU to an external memory for later use. When performing a write operation, the execution of the write to the external memory has an associated cost in terms of power consumption and memory bandwidth. A read operation (also with a similar associated cost) may cause data stored in the external memory to be accessed.
[0003] At the application level, an API function (such as glInvalidateFrameBuffer(), which is used to indicate that the contents of the memory are no longer used) can be provided to explicitly manage the use of the memory. Application developers can use such API functions. However, in practice, most applications do not provide API functions. Summary of the invention
[0004] This Summary is provided to introduce some concepts that will be further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
[0005] According to one aspect, there is provided a method for controlling command processing at a graphics processor, comprising:
[0006] receiving input data and generating commands from the input data for processing at a graphics processor, wherein the commands will cause the graphics processor to write out at least one data buffer to an external memory;
[0007] Submit the command to a queue for later processing at the graphics processor;
[0008] After submitting the command but before completing the write to the external memory, receiving further input data and determining from the further input data that the data buffer does not need to be written to the external memory; and
[0009] A graphics processor is signaled to prevent at least a portion of a write to the external memory from being performed for the command.
[0010] Determining that the data buffer does not need to be written to the external memory may include determining that subsequent commands will not use the data buffer stored in the external memory. Determining that subsequent commands will not use the data buffer stored in the external memory may include determining that further input data does not request access to the data buffer before the data buffer is cleared or invalidated.
[0011] Determining that further input data does not request access to the data buffer before the data buffer is cleared or invalidated may include: maintaining a data structure to track access requests to the data buffer received in further input data; when a function to clear or invalidate the data buffer is received, analyzing the data structure to determine whether a previous access request was made. Maintaining the data structure may include storing a comparison of an identifier identifying the data buffer and the command with a flag indicating whether an access request was received. Maintaining the data structure to track access requests may include determining whether an application level or driver level access request to the data buffer was received.
[0012] Determining that an access request is not present may include tracking access to data buffers to be written out by an application or driver layer in a system hierarchy.
[0013] Determining that the data buffer does not need to be written to the external memory may include determining if there is one or both of an implicit invalidation of the data and an explicit invalidation of the data.The method may include determining at the driver layer that the data to be written out is to be invalidated.
[0014] The command may include at least one configuration register setting that causes the graphics processor to write out at least one data buffer to the external memory.Signaling the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command may include modifying the register setting in the command at the graphics processor.
[0015] Signaling the graphics processor to prevent execution of at least a portion of the write to the external memory for the command may include signaling a queue to modify a command held in the queue so that the command does not cause the graphics processor to write out at least one data buffer to the external memory. The method may include, in response to signaling, searching the queue for the command and modifying the command.
[0016] Signaling the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command may include signaling the graphics processor to modify the command before the command is processed so that the command does not cause the graphics processor to write out at least one data buffer to the external memory. The method may include: in response to signaling, storing identifiers of the command and at least one data buffer, and modifying the command in response to determining that a command received from the queue for processing has a matching identifier.
[0017] Signaling the graphics processor to prevent execution of at least a portion of the write to the external memory for the command may include signaling the graphics processor to modify the command while processing the command so that the command does not cause the graphics processor to write out at least a portion of at least one data buffer to the external memory.
[0018] The command may include a pointer to a location in the external memory including setup data that causes the graphics processor to write out at least one data buffer to the external memory.Signaling the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command may include modifying the setup data.
[0019] Signaling the graphics processor to prevent execution of at least a portion of the write to the external memory for the command may include generating an interrupt signal that causes the graphics processor to stop processing the command.
[0020] The command may include at least one pointer to graphics data stored in the external memory.
[0021] The queue may be a command queue configured to store commands at the graphics processor until the commands can be processed at the graphics processor.
[0022] The at least one data buffer may include at least one of a depth buffer, a stencil buffer, and a color buffer.
[0023] Commands may be processed at the firmware or hardware level within the system hierarchy.
[0024] The generating command may be executed at a higher level in the system hierarchy than the level at which the command is processed.The generating command may be executed at a driver level in the system hierarchy.
[0025] The input data may include a plurality of application programming interface function calls. Further, the input data may include a plurality of application programming interface function calls including at least one of the following items: a clear function configured to clear a data buffer stored in the external memory; and an invalid function configured to invalidate a data buffer stored in the external memory.
[0026] A data buffer to be written to memory may be associated with a memory attachment of an object.
[0027] The input data may relate to a first rendering to be performed by the graphics processor, and further input data may relate to a second rendering to be performed by the graphics processor.
[0028] The task to be executed may include a write operation to a data buffer and at least one other operation, wherein preventing execution of at least a portion of the write to the external memory for the command includes preventing the graphics processor from completing execution of the at least one other operation.
[0029] According to another aspect, a system for controlling command processing at a graphics processor is provided, the system comprising a driver operable to communicate with the graphics processor, the driver being configured to:
[0030] receiving input data and generating commands from the input data for processing at a graphics processor, wherein the commands cause the graphics processor to write out at least one data buffer to an external memory;
[0031] Submit the command to a queue for later processing at the graphics processor;
[0032] receiving further input data and determining based on the further input data that the data buffer does not need to be written to the external memory; and
[0033] A graphics processor is signaled to prevent execution of at least a portion of a write to the external memory for the command.
[0034] The driver may be configured to determine that the data buffer does not need to be written to the external memory by being configured to determine that subsequent commands will not use the data buffer stored in the external memory. The driver may be configured to determine that subsequent commands will not use the data buffer stored in the external memory by being configured to determine that further input data does not request access to the data buffer before the data buffer is cleared or invalidated.
[0035] The driver may also include a data structure, and the driver may be configured to determine that further input data does not request access to the data buffer before the data buffer is cleared or invalidated by being configured to perform the following: maintaining a data structure to track access requests to the data buffer received in further input data; and when a function to clear the data buffer or invalidate the data buffer is received, analyzing the data structure to determine whether a previous access request was made. The data structure may include a comparison of an identifier identifying the data buffer and the command with a flag indicating whether an access request was received. The driver may be configured to maintain a data structure to track access requests by determining whether an application-level or driver-level access request to the data buffer is received.
[0036] The driver may be configured to track access to data buffers to be written out by the application or driver layer in the system level to determine that there are no access requests.
[0037] The driver may be configured to determine that the data buffer does not need to be written to the external memory by being configured to determine if there is one or both of an implicit invalidation of the data and an explicit invalidation of the data.
[0038] The command may include at least one configuration register setting that causes the graphics processor to write at least one data buffer to the external memory. The driver may be configured to signal the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command by modifying a register setting in the command or at the graphics processor.
[0039] The driver can be configured to signal the graphics processor to prevent execution of at least a portion of the write to the external memory for the command by being configured to signal the queue to modify the command held in the queue so that the command does not cause the graphics processor to write out at least one data buffer to the external memory. The system can also include a queue configured to search for the command and modify the command in response to the signal.
[0040] The driver can be configured to signal the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command by being configured to signal the graphics processor to modify the command before the command is processed so that the command does not cause the graphics processor to write out at least one data buffer to the external memory. The system can also include a command processor, wherein the command processor can be configured to store an identifier of the command and the at least one data buffer in response to the signaling, and modify the command in response to determining that a command to be processed received from the queue has a matching identifier.
[0041] The driver may be configured to signal the graphics processor to prevent execution of at least a portion of a write to the external memory for the command by being configured to signal the graphics processor to modify the command when processing the command so that the command does not cause the graphics processor to write out at least a portion of at least one data buffer to the external memory.
[0042] The command may include a pointer to a location in the external memory, the pointer including setup data to cause the graphics processor to write at least one data buffer out to the external memory. The driver may be configured to signal the graphics processor to prevent at least a portion of the write to the external memory from being performed in response to the command.
[0043] The driver may be configured to signal the graphics processor to prevent execution of at least a portion of the write to the external memory for the command by being configured to generate an interrupt signal that causes the graphics processor to stop processing the command.
[0044] The command may include at least one pointer to graphics data stored in the external memory.
[0045] The queue may be a command queue configured to store commands at the graphics processor until the commands can be processed at the graphics processor.
[0046] The at least one data buffer may include at least one of a depth buffer, a stencil buffer, and a color buffer.
[0047] Commands may be processed at the firmware or hardware level within the system hierarchy.
[0048] The driver may be configured to operate at a higher level in the system hierarchy than the level at which commands are processed.
[0049] The input data may include a plurality of application programming interface function calls. Further, the input data may include a plurality of application programming interface function calls including at least one of the following: a clear function configured to clear a data buffer stored in the external memory; and an invalid function configured to invalidate a data buffer stored in the external memory.
[0050] A data buffer to be written to memory may be associated with a memory attachment of an object.
[0051] The input data may relate to a first rendering performed by the graphics processor, and further input data may relate to a second rendering performed by the graphics processor.
[0052] The task to be performed may include writing of a data buffer and at least one other operation, wherein the driver may be configured to prevent the graphics processor from completing execution of the at least one other operation to prevent execution of at least a portion of writing to the external memory for the command.
[0053] According to another aspect, a system configured to perform a method as described herein is provided.
[0054] According to another aspect, there is provided a system as described herein, wherein the system is implemented in hardware on an integrated circuit.
[0055] According to another aspect, a method of manufacturing a system as described herein using an integrated circuit manufacturing system is provided.
[0056] According to another aspect, there is provided a method of manufacturing a system as described herein using an integrated circuit manufacturing system, the method comprising:
[0057] processing the computer-readable description of the graphics processing system using a layout processing system to generate a circuit layout description of an integrated circuit incorporating the system; and
[0058] Based on the circuit layout description, a system is manufactured using an integrated circuit production system.
[0059] According to another aspect, computer program code for performing a method as described herein is provided.
[0060] According to another aspect, a non-transitory computer-readable storage medium is provided, having computer-readable instructions stored thereon, which, when executed on a computer system, cause the computer system to perform the method as described herein.
[0061] According to another aspect, an integrated circuit definition data set is provided which, when processed in an integrated circuit manufacturing system, configures the integrated circuit manufacturing system to manufacture a system as described herein.
[0062] According to another aspect, a non-transitory computer-readable storage medium having stored thereon a computer-readable description of a system as described herein, which, when processed in an integrated circuit manufacturing system, causes the integrated circuit manufacturing system to manufacture an integrated circuit incorporating the system.
[0063] According to another aspect, there is provided a computer readable storage medium having stored thereon a computer readable description of a system as described herein, which when processed in an integrated circuit manufacturing system causes the integrated circuit manufacturing system to:
[0064] processing the computer-readable description of the system using a layout processing system to generate a circuit layout description of an integrated circuit incorporating the system; and
[0065] An integrated circuit generation system is used to manufacture a system from a circuit layout description.
[0066] According to another aspect, there is provided an integrated circuit manufacturing system configured to manufacture a system as described herein.
[0067] According to another aspect, there is provided an integrated circuit manufacturing system, comprising:
[0068] a non-transitory computer-readable storage medium having stored thereon a computer-readable description of a system as described herein;
[0069] a layout processing system configured to process the computer-readable description to generate a circuit layout description of an integrated circuit incorporating the system; and
[0070] An integrated circuit production system is configured to manufacture the system according to the circuit layout description. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The present invention will now be described by way of example with reference to the accompanying drawings, in which:
[0072] Figure 1 A schematic illustration of a system for processing commands is shown;
[0073] Figure 2 A schematic diagram of a graphics system is shown;
[0074] Figure 3 A flow chart showing a process for controlling the execution of a write operation;
[0075] Figure 3A Shows Figure 3 an illustration of the operation of a flowchart;
[0076] Figure 4 A flow chart showing the process of controlling the execution of commands; and
[0077] Figure 5 It is a schematic diagram of the integrated circuit manufacturing system. DETAILED DESCRIPTION
[0078] The following description is presented by way of example to enable those skilled in the art to make and use the present invention. The present invention is not limited to the embodiments described herein, and various modifications to the disclosed embodiments will be apparent to those skilled in the art. Embodiments will now be described only by way of example.
[0079] The following examples describe devices, systems, and methods in which write operations on data can be avoided. However, the devices, systems, and methods can be used in any situation in which locally stored data is written to external memory by a processor under the control of a driver or other higher-level management level.
[0080] The techniques disclosed herein are related to processing in a processing system (e.g., at a graphics processor). For example, these techniques may be related to processing of computer commands (e.g., commands for controlling the operation of a GPU). The data to be processed may include graphics, audio, images (including video), and / or digital data. For example, a data stream may include one or more frames of graphics data, audio data, image data, or a combination of the foregoing. For ease of understanding, the following examples will describe techniques in the context of graphics processing. However, as understood by the skilled person, these techniques may be more generally applied.
[0081] In a graphics processing system, graphics data is input to a processor and a rendering operation can be performed on the graphics data. There are several ways to perform this rendering operation. One example is immediate mode rendering, in which primitives are rendered to a frame buffer as soon as they are processed by the processor. Another example is tile-based rendering, in which a rendering space (e.g., a screen) is divided into multiple tiles, and the rendering process is performed one tile at a time, or a group of tiles at a time. The rendering mode employed is not important to the techniques discussed herein, as will be apparent from the following discussion. A brief overview of the rendering process is provided for context clarity purposes.
[0082] In rendering, graphics data is processed. Graphics data may include vertex data associated with vertices of one or more primitives (e.g., triangles), which may be used to represent objects in a scene (e.g., a 3D scene). Each vertex of a primitive has coordinates indicating its 3D position in the scene, so depth data can be calculated on the surface of the primitive for a set of sample points (e.g., corresponding to pixels or sub-pixel samples) covered by the primitive. The depth data indicates the scene depth of these primitive sample points from a viewpoint (e.g., a camera position in a scene). The depth data relates to the distance from the viewpoint to the primitive. Based on the depth information, it can be determined whether the primitive is visible. For example, a primitive may be (wholly or partially) behind another primitive. In the case where a primitive is not visible, the primitive does not need to be rendered. The depth value of the primitive at the sample point is usefully processed using a Z (or depth) buffer. For example, a Z or depth buffer may be an array of (logical) two-dimensional values representing the depth of a visible primitive (e.g., the nearest primitive to the viewpoint) at a sample point (e.g., at each pixel of a tile or screen). This enables hidden surface removal (HSR) to be performed.
[0083] Once a primitive has been processed (including determining whether it is visible in screen space (i.e., in a projection onto the 3D scene screen)), a color value may be output for each sample point (e.g., pixel) covered by the primitive. The color values may be stored in a color buffer. The color buffer may be an array of (logical) two-dimensional values representing the colors of the visible primitives at sample points (e.g., at each pixel of a tile or screen). It may be found that a primitive processed later obscures a primitive processed earlier. The color values of pixels corresponding to the later processed primitive may then be updated in the color buffer (either overwritten if the later processed primitive is opaque, or blended with the previous value if the later processed primitive is partially transparent).
[0084] In addition, a stencil buffer can be provided that can store per-sample information for a tile or screen. The stencil buffer can be used to modify or control rendering in a tile or screen. For example, a stencil buffer can define sample points that are rendered or not rendered (stencilling), or can be used to define transparent parts of an object (e.g. a window). More generally, a stencil buffer can be an array of (logically) two-dimensional values for rendering primitives at sample points (e.g. at each pixel of a tile or screen). The data in the stencil buffer can be modified during rendering when processing primitives.
[0085] Therefore, it is useful to use at least one of the depth buffer, color buffer, and stencil buffer in rendering. Figure 1 At the application / API level, depth buffer 104, color buffer 106, and / or stencil buffer 108 may be logical attachments to an object (which may be a software object) such as framebuffer object 102. The term "attachment" as used herein refers to an association between objects defined in a software layer (e.g., a graphics API). Each attachment is suitably a memory attachment. For example, in In , the depth buffer can be GL_DEPTH_ATTACHMENT, the color buffer can be GL_COLOR_ATTACHMENT, and / or the stencil buffer can be GL_STENCIL_ATTACHMENT. Each attachment is appropriately backed by an area in physical memory allocated to the corresponding attachment.
[0086] During rendering processing on the GPU, the physical memory allocated to the frame buffer object attachments can be local memory. The local memory can be on-chip (e.g., on the processor, such as in RAM or registers within the processor structure). In this way, fast processing using frame buffer object attachments (i.e., depth buffer, color buffer, and / or stencil buffer) can be achieved. As an example, a fast depth test can be performed based on the depth value associated with the primitive being processed and the value stored in the depth buffer.
[0087] At some stage, the processing using the frame buffer object attachment 104, 106, 108 will be completed. This may be due to the desire to free up storage space for further processing. Additionally or alternatively, this may be due to the fact that the processing of a frame, multiple frames, partial rendering, or rendering has been completed. Typically, the output of on-chip processing is used for rendering (or for performing a partial rendering), and the subsequent output is used for subsequent rendering (or other parts of the same rendering). At this stage, the memory contents of the local memory allocated to the frame buffer object attachment (such as the depth buffer 104) can be written to external memory. Writing out the memory contents in this way can preserve the memory contents when needed later. For example, considering the depth buffer, a portion of a frame may be processed and the contents of the depth buffer for that portion of the frame may be written to external memory. Primitives processed later may overlap with primitives processed in an earlier portion of the frame. Therefore, it would be useful to perform a depth test on the depth values previously in the depth buffer (i.e., the data previously written to the external memory). Additionally or alternatively, some applications expect to see the saved depth buffer after rendering, so it is often appropriate to write out the depth buffer when needed.
[0088] Typically, when rendering is submitted from the API / driver level (including a memory attachment of a framebuffer object to be written to external memory), it is not known whether this data will be needed later, i.e. whether it will be subsequently read.
[0089] In a simple example, consider a graphics processing task that includes two groups of primitives: group A and group B. Group A is processed first, and the depth buffer 104, color buffer 106, and stencil buffer 108 (as appropriate) are filled with data values, as described below. The first stage of processing the primitives in group A can be performed by a driver program (at least partially executed on the host CPU). The driver program prepares the data required for rendering the primitives in group A, and one result is the generation of at least one command 110 for controlling the GPU to render these primitives. For example, the command may involve one or more draw calls for drawing one or more primitives of the primitives in group A. The command may include setup information (e.g., configuration register values) and state data for controlling the GPU to perform the required rendering operations. The command submitted to the command queue may also include a pointer to a location where the relevant graphics data is stored in the external memory (e.g., a location to hold graphics data related to the group A primitives) so that the GPU can access the primitive data when performing rendering. The graphics data related to the group A primitives may include vertex data and one or more shader programs to be executed by the GPU on the vertices. In one example, the command may include at least one configuration register value that instructs the GPU to write out one or more of the depth buffer, the color buffer, and the stencil buffer during or after rendering. In another example, the graphics data stored in the external memory pointed to by the command may include instructions or setting data that instructs the GPU to write out one or more of the depth buffer, the color buffer, and the stencil buffer during or after rendering.
[0090] In an alternative example, instead of a command including GPU setup information and state data, the command may include instructions that tell the GPU how to operate. These instructions may then be interpreted at the GPU and used to control low-level operations of the GPU to perform rendering operations. The instructions included in the command may include instructions that cause the GPU to write out one or more of a depth buffer, a color buffer, and a stencil buffer during or after rendering.
[0091] For example, when the driver has completed command generation for a particular render or portion of a render, the start of the render on the GPU may be triggered (which may be referred to as the render being “kicked”), whereby the commands and associated data are flushed 112 to the command queue 114 .
[0092] In this example, since it is not known at this stage whether the data contents of any depth, color, and / or stencil buffers will be needed later in the rendering process, the command causes the GPU to perform a write operation to write data from the depth buffer (for example) to external memory. The external memory is typically off-chip memory (for example, in the form of DRAM or flash memory connected to the processor but not an integral part of its structure). In some examples, the buffer contents can be written to the external memory at the end of rendering, but can also be written to the external memory during rendering. Similar write operations on the color buffer and the stencil buffer can occur as a result of the command in addition or alternatively, but it is sufficient to explain the present technology by considering only one of these buffers. This article takes the depth buffer as an example.
[0093] In this example, initial processing of the input data stream (i.e., processing of the first portion of the data stream corresponding to the primitives in group A) can occur at a driver layer 116 in a processor (e.g., a central processing unit (CPU)). For example, a client driver (e.g., configured to interpret a program such as a program for an embedded system ( ES) The driver of API functions such as ) can control the initial processing. The command can be flushed to a layer below the driver layer in the system hierarchy. For example, the command can be flushed to a lower layer (represented herein as firmware or hardware layer 124) that can be implemented in the GPU or CPU or a combination thereof. The firmware or hardware layer 124 may include a command queue 114. The command queue may include a buffer, such as a first-in-first-out (FIFO) buffer for storing commands in the command queue. In this way, the commands in the FIFO buffer can be processed in the order in which the driver layer submits the commands to the firmware or hardware layer. In one example, the command queue buffer may be implemented by hardware within the GPU. The command queue may include a geometry command queue 120 and a pixel processing command queue 122. The geometry command queue is suitable for storing geometry processing commands. In some examples, the geometry command queue may constitute part of a tile accelerator at the GPU. In some examples, the pixel processing command queue is suitable for storing pixel processing commands such as 3D commands, and may constitute part of a pixel processing pipeline at the GPU.
[0094] In some examples, the driver can be configured to generate commands by collating or batching high-level commands (e.g., API functions) into work groups (e.g., GPU-specific commands) suitable for processing at a lower level in the system hierarchy. For example, API calls or functions received at the driver requesting the performance of specific graphics operations can be processed by the driver to generate GPU commands (including setup / register data and pointers to related data) to implement the operations requested in these API calls or functions. In an alternative example, the API calls or functions received at the driver can be interpreted / compiled into GPU instructions and included in the commands. The commands submitted to the command queue are suitable for reading and / or processing at the hardware or firmware layer 124. For example, the commands can be processed by one or more command processors 123 at the hardware or firmware layer 124.
[0095] As described above, in this example, the command queue includes commands that cause the GPU to write data from the depth buffer to external (off-chip) memory. For example, the command queue at firmware or hardware layer 124 may include commands containing GPU register values that will control the GPU to perform write operations. In some examples, the commands on the command queue include one or more command packets. The command packets may include metadata associated with the corresponding command.
[0096] In one example, the commands in the command queue are processed in the order in which they were submitted to the command queue. Thus, the command processor 123 at the hardware or firmware layer 124 will execute the commands in the order in which they were flushed 112 to the command queue 114. In another example, a scheduler may be implemented at the hardware or firmware layer 124 to analyze the contents of the command queue and determine which command to execute next. In this way, commands may be executed by the GPU in an order different from the order in which they were submitted to the command queue.
[0097] Once the commands are flushed to the command queue, processing of these commands (e.g., performing the operations indicated by these commands on the GPU) can occur concurrently with the driver layer 116 continuing to process the input data stream (e.g., the second portion of the data stream corresponding to the primitives of group B).
[0098] There are two main cases to consider in this example. In the first case, the rendering of primitives of group B utilizes at least one of the depth buffer, color buffer, and stencil buffer generated in the rendering of group A as input. For example, the rendering of group B may utilize the color buffer as part of the texture applied to the primitives of group B, or utilize the depth buffer when calculating the lighting of the primitives of group B. As previously described, the commands submitted for rendering group A cause the GPU to write out the locally stored buffers to external memory. Therefore, these saved buffers can be successfully used for the rendering of group B.
[0099] In this case, there is a memory bandwidth cost associated with writing the depth, color, and / or stencil buffer data to external memory when rendering group A. However, this write is necessary because this data is accessed later when rendering group B.
[0100] In another case, while rendering Group A primitives, rendering of Group B primitives does not utilize buffers written to external memory. For example, while processing Group B primitives, depth data associated with Group A primitives (i.e., data that Group A commands would result in writing to external memory) is not needed. This particular example also assumes that no further rendering that requires the use of Group A buffers needs to be performed after Group B.
[0101] In contrast to the first case, since the group A depth buffer data is not subsequently accessed, the memory bandwidth of the associated write operation is wasted. In some cases, the data that is unnecessarily written can typically be on the order of 8MB of data for rendering.
[0102] The inventors have recognized that there is a delay between submitting a command from the driver and executing the operation caused by the command on the GPU. Figure 1 In the system shown in FIG. 1 , graphics frame data is processed at the driver layer 116, resulting in commands for one or more renderings being flushed to the firmware or hardware layer 124. Here, the commands are placed in a command queue. One or more command processors 123 at the hardware or firmware layer 124 of the GPU receive commands from the command queue (in some examples in the order in which the commands are submitted) and process the commands to start the execution of operations corresponding to these commands. The start of execution of these operations on the GPU may be one or more frames after the processing of the API call / function at the driver layer. It has been found that the execution of operations at the GPU is typically 2 to 3 frames after the processing of the API call / function at the driver layer. Therefore, there is a delay between the client driver submitting work (possibly 3D work in a graphics processing system) and the firmware starting processing on the hardware.
[0103] As described above, the client driver may be several frames ahead of the hardware. In some examples, since the processing of each frame may result in multiple different renderings, this means that the client driver can be up to about 20 renderings ahead of the hardware.
[0104] Before the GPU hardware begins processing a command for a given rendering, frame, or portion of a frame, the client driver may already know additional information about the command. For example, the client driver may know that the buffer data is not used to process a later rendering or portion of a frame and / or the client driver may know that the buffer is cleared at the beginning of the next frame without being accessed at the same time. This knowledge can be used to prevent the buffer data from being written to external memory. Preventing the writing of buffer data may occur during the processing of the rendering or at the end of the rendering. Disabling the storage of buffer data if the firmware has not yet begun processing the original command can therefore result in significant memory bandwidth savings. In an example where the order of 8MB of data can be written out by a write command for each rendering, this method can allow up to 8MB of data bandwidth to be saved per rendering. There may be multiple renderings per frame, resulting in higher savings in memory bandwidth and power consumption for the entire frame.
[0105] The driver is able to know that buffer data is not being processed for later rendering by detecting at the API level (without utilizing an intermediate API function) whether the buffer data is cleared or invalidated. For example, when the driver begins processing an API function for a new frame or rendering, an API call is typically initiated to "clear" the buffer. This clear function indicates that all data in the buffer should be discarded (because new data will be generated for the new frame / rendering). Therefore, the driver knows that the existing buffer will not be accessed from this point on. As a result, write operations performed by the rendering preceding the new frame / rendering will not be needed. This can be considered an implicit invalidation of the buffer data. In another example, the driver may receive an "explicit invalidation" of the buffer in the form of an "invalidate" function called at the API. An example of such a function is glInvalidateFrameBuffer() in . This API function tells the driver to invalidate the data in the frame buffer (e.g., remove or mark the data for deletion / replacement). Such a function can be received halfway through the processing of a frame. Again, this allows the driver to know that the existing buffer will not be accessed from this point on, and write operations performed by the rendering before the invalidation will not be needed.
[0106] The driver may also be configured to track access to frame buffer objects at the API level. For example, the driver may maintain a data structure indicating whether any API-level access to buffer data has been requested for a given, identified rendering. In other words, the driver may maintain a data structure to track access requests to a given buffer data received in further input data. This enables the driver to trace back to several past renderings once an (implicit or explicit) invalidation is received, and may avoid write operations performed by several renderings that have been submitted to the GPU but not yet executed. When a function to clear a data buffer or invalidate a data buffer is received, the driver may be configured to analyze the data structure to determine whether a previous access request has been made previously. The data structure may include a comparison of an identifier with a flag, the identifier identifying a command (e.g., rendering) and a specific data buffer (e.g., a depth buffer for the rendering), and the flag (or other data such as a count) indicating whether one or more access requests have been received for the buffer.
[0107] Reference again Figure 1 , signals 126, 127 can be output for immediate processing (i.e., they are not queued), which can modify the command on the command queue or leaving the command queue. As shown, signals 126, 127 can be output by the driver, but not necessarily in all examples. In some examples, the signal can be output by a signal unit 128 at the driver layer. The processing mode of signals 126, 127 is different from the commands in the command queue. Suitably, the signal is processed immediately, or as quickly as possible. Signal 126 can be sent to the command queue 114 from the driver layer (e.g., from the signal unit 128).
[0108] Consider the above example of group A and group B primitives. In this example, the driver processes the group A primitives and outputs commands to the command queue. When processing the group B primitives, the driver knows that the depth buffer data of the group A primitives is not used when processing the group B primitives. For example, the driver can make this determination by determining that there are no API accesses to the depth buffer data (i.e., data that is subject to a write command). At the beginning of a subsequent frame (or more generally, when processing graphics data continues), the driver can determine that there is an invalidation of the depth buffer (e.g., a "clear" call at the beginning of the next frame). Therefore, the driver can determine that the depth buffer data that would be stored when executing the group A rendering commands will not be accessed before it is invalidated, and therefore does not need to be written out.
[0109] In response, the driver may output a signal to modify the relevant command (before it is started) to prevent the GPU from performing a write operation. The signal may be a signal from the driver, which includes a rendering identifier and an instruction on how to modify the relevant command. The rendering identifier may be an identifier of the rendering to which the relevant command relates. The instruction on how to modify the relevant command may include an indication of a write operation to be prevented (e.g., a write operation on one or more of a depth buffer, a color buffer, and a stencil buffer). For example, for a particular rendering identifier, the signal may include an instruction to cause a write operation on the depth buffer to be prevented.
[0110] In other cases, the command that causes the write operation to be performed can be modified in one of several ways. In some examples, the command can be modified when the command leaves the command queue. In some examples, the command can be modified before the command leaves the command queue.
[0111] In some examples, the modification check logic 130 may be implemented at the GPU. The modification check logic may be provided at the firmware or hardware. The modification check logic may be configured to receive a signal 127 from a driver layer (e.g., from a signal unit 128). The modification check logic may be configured to store the received signal. The received signal may be stored in a modification storage repository 131 accessible to the modification check logic. For example, the modification storage repository may be provided at the firmware or hardware layer 124. One or both of the modification check logic 130 and the modification storage repository 131 may be implemented as part of the command processor 123 so that they can easily check the command leaving the command queue. The modification check logic may access the command queue. The modification check logic may access commands in the command queue, such as commands leaving the command queue (e.g., the next command issued from a FIFO-implemented command queue, or a command selected as the next command issued by a scheduler), and may determine whether a signal related to the command is received. The modification check logic may make this determination, for example, based on a rendering identifier. For example, the modification check logic may be configured to check the command queue to find a command with (or about) a rendering identifier for which a signal is received.
[0112] In the event that the modification check logic determines a match (i.e., there is a command on the command queue associated with the received signal), the modification check logic can be configured to modify a configuration register value in or associated with the command before the GPU hardware reads and processes the command. For example, the modification check logic can modify the configuration register value in response to an indication in the signal of how to modify the associated command. For example, the modification check logic can modify the commands as they leave the command queue, but before any write operations resulting from those commands are performed.
[0113] The configuration register value in the command or the configuration register value associated with the command can be configured to cause a write operation to be performed. The command may include a pointer to a register storing the configuration register value. The configuration register value need not constitute part of the command itself. In some examples, the GPU can be configured to cause a write operation to be performed in response to reading a register value of "1".
[0114] In the case where a write operation is to be prevented, the modification check logic may cause the corresponding configuration register value (e.g., in a command or at a register) to change, for example, from "1" to "0." In some examples where the register value changes to "0," the GPU may be configured not to perform the operation corresponding to the register value.
[0115] Modification of commands may be implemented at a higher level in the system rather than at the firmware or hardware layer, such as at the driver layer. The driver may be configured to signal the firmware or hardware layer indicating that a particular rendering should not subject data from one or more buffers to a write operation. The signal sent by the driver may include a rendering identifier identifying the rendering to which the command to be modified relates. The signal sent by the driver may include an indication of how to modify the command. In response to receiving a signal from the driver layer, the firmware or hardware layer may be configured to determine whether the command in the command queue is associated with the rendering identifier, such as whether the command in the command queue includes the rendering identifier. In the event that it is determined that there is a command associated with the rendering identifier of the received signal, the firmware or hardware layer may change one or more configuration register values corresponding to the command (e.g., from "1" to "0"), for example, to prevent execution of a write operation associated with the command. In this method, commands are modified before they leave the queue.
[0116] In some examples, the command does not have to be modified. The signal unit can be configured to send a signal to the hardware at the GPU. The signal can cause the GPU to change its configuration registers, such as one or more configuration register values associated with a write operation corresponding to the particular command (or particular rendering), after loading a particular command for processing (e.g., at one or more command processors). For example, the GPU can be configured to change at least one configuration register value from "1" (which can indicate that an operation is to be performed) to "0" (which can indicate that an operation is not to be performed) in response to receiving a signal.
[0117] This method can prevent write operations from being performed even if commands are loaded for processing. This method of changing configuration registers on the GPU can be used to implement modifications of write operations on the way to rendering. For example, in a tile-based rendering system, rendering may involve performing write operations on multiple tiles during rendering. The driver can be configured to determine that at least some write operations are not necessary, and send a signal to the hardware at the GPU to prevent the performance of write operations (or further write operations). In the case where the hardware at the GPU receives the signal midway through rendering, write operations on one or more tiles may have been performed. However, it is possible to prevent one or more other write operations from being performed on one or more other tiles. Although some unnecessary writes may have occurred with respect to certain tiles, preventing further unnecessary write operations can result in memory bandwidth and power consumption savings.
[0118] Preventing the completion of the execution of the write operation (for example, by modifying the command to change the GPU operation so that the write process is not started) can save memory bandwidth and power consumption that would otherwise be used to write data to the external memory. In some cases, it may be a large portion of the total write bandwidth for the frame and / or rendering. For example, in some applications, the size of the depth buffer and the size of the color buffer may be roughly the same. Typically, each of the depth and color buffers may be written out each time rendering. The inventors have found that in practice, for most renderings, the depth buffer does not need to be written out to the external memory. This means that for such renderings, the write operations associated with writing the depth buffer to the memory can be omitted. Therefore, this can save about half of the total write bandwidth required without the omission.
[0119] Although Figure 1 Driver layer output signals 126, 127 are shown, but this is not necessary in all examples. For example, the signals 126, 127 may be generated by any software or hardware unit that accesses input data at a time prior to the corresponding execution on the GPU.
[0120] Reference now Figure 2, which shows a schematic diagram of a graphics system 200. System 200 can be implemented on a device such as a smart phone, a tablet, a laptop, a personal computer (PC), a television, or any other suitable device in which graphics data is to be processed. Graphics system 200 can be a tile-based graphics system. Data such as graphics data can be provided, for example, from an application. The graphics system is configured to process data and provide an output of the processed data. System 200 includes a general-purpose processor 210 and a graphics processor 220. The general-purpose processor and the graphics processor are configured to process data. Graphics processor 220 can be implemented at least in part in hardware or software or a combination thereof. For example, graphics processor 220 can be implemented in functionally fixed hardware, which includes circuits configured to process data accordingly as described herein. For example, graphics processor 220 can be a graphics processing unit (GPU), or can be implemented as a computer program running on a programmable device such as a CPU.
[0121] The general purpose processor 210 includes a plurality of functional blocks for processing data, wherein Figure 2 , a portion (but not all, for clarity) of the functional blocks of the general purpose processor 210 are shown. The general purpose processor 210 may be implemented in hardware or software, or a combination thereof. For example, the general purpose processor 210 may be implemented in fixed-function hardware that includes circuits configured to process data accordingly as described herein. For example, the general purpose processor 210 may be a CPU, or may be implemented as a computer program running on a programmable device such as a CPU. The general purpose processor 210 includes an application 212 (e.g., at an application layer at the processor). The application is configured to communicate with a driver 214 at a driver layer, for example, via an API. The general purpose processor may also include (or be communicatively coupled to) a command queue 222 implemented at a hardware or firmware layer. For example, the command queue 222 may be implemented in firmware 216. As Figure 2 As shown, both the general purpose processor 210 and the graphics processor 220 can access the firmware 216 that implements the command queue 222. The command queue can be implemented as a buffer, such as a FIFO buffer. The driver 214 is configured to communicate with the hardware or firmware layer. For example, the driver 214 is configured to communicate with the firmware 216. The driver is appropriately configured to communicate with the command queue 222. The application 212 can be implemented as a software unit or module running at the general purpose processor 210. The driver 214 can be implemented as a software unit or module running at the general purpose processor 210, such as a unit running according to the driver software.
[0122] The graphics processor 220 includes a plurality of functional blocks for processing data, wherein: Figure 22 shows a portion (but not all, for clarity) of the functional blocks of the graphics processor 220. The graphics processor 220 may include a command queue 222 implemented at the hardware or firmware level. For example, the command queue may be implemented in firmware 216. The command queue may be implemented as a buffer, such as a FIFO buffer. The graphics processor 220 includes one or more command processors ( Figure 2 224 in FIG. 1 ). The command processor 224 is configured to communicate with a hardware or firmware layer. For example, the command processor 224 is configured to communicate with the firmware 216. The command processor is suitably configured to communicate with the command queue 222. The command processor is also configured to communicate with the control register 226. The control register is configured to store values (e.g., configuration register values) associated with commands that can be processed by the command processor (e.g., commands on the command queue). The values stored in the control register can be used, for example, by the system to control the execution of operations such as write operations.
[0123] The graphics processor 220 includes rendering and shading logic 228. The rendering and shading logic includes geometry processing logic 230 and pixel processing logic 232. The geometry processing logic can be configured to perform geometry processing operations. The pixel processing logic can be configured to perform pixel processing operations. The rendering and shading logic is coupled to a command processor. The command processor can be coupled to one or both of the geometry processing logic and the pixel processing logic. For example, the command processor can cause one or both of the geometry processing logic and the pixel processing logic to start performing an operation. The rendering and shading logic is configured to communicate with a local memory 234. The local memory is configured to store depth data in a depth buffer 236, to store stencil data in a stencil buffer 238, and to store color data in a color buffer 240.
[0124] The general purpose processor 210 and the graphics processor 220 are configured to communicate with the external memory 250 via the bus 242. The external memory is configured to store graphics data 252, such as primitive data 254 and shader programs 256. The external memory is configured to store frame buffer object data 258, such as depth buffer data 260, stencil buffer data 262, and color buffer data 264. Therefore, when a write operation to the external memory is performed, data can be written from one or more of the depth buffer 236, pattern buffer 238, and color buffer 240 at the local memory 234 to a corresponding one or more of the depth buffer 260, stencil buffer 262, and color buffer 264 at the external memory 250.
[0125] The system 200 may include a memory management unit (MMU) (not shown) configured to manage memory resources of the external memory 250. The MMU may perform virtual memory management and convert virtual memory addresses to physical addresses. The MMU may be implemented as part of the general processor 210, or as a separate hardware component or computer program. The external memory 250 may include a plurality of memory blocks for storing data. The external memory 250 may include respective memory blocks that may store data from a depth buffer, a stencil buffer, and a color buffer of a frame buffer object. The storage space in the storage block may be allocated on demand. For example, the storage space may be allocated from one or more memory blocks in an available memory pool. The storage space is appropriately allocated page by page. In some examples, the size of the storage page is 4KB. Other ways of allocating storage space and storage page size may be used. The storage space of the memory block may be allocated in response to processing (e.g., at a command processor) a command. The storage space of the memory block may be allocated in response to issuing a write operation for execution, or in response to executing a write operation. The allocation of the storage block may be performed by the MMU.
[0126] Memory space allocation may occur at different stages. For example, a virtual memory block may be allocated to one or more of the depth buffer, color buffer, and stencil buffer, but a physical memory "backup" may be provided only when needed. Alternatively, the system 200 may wait until rendering occurs and data is written to a memory page in external memory (e.g., when a command issued from a command queue is processed and causes a write operation to be performed), the system may capture access to the external memory page, and only allocate physical memory in the external memory at that point. Therefore, memory pages that would otherwise have been mapped may be reserved for other uses of the system.
[0127] According to some examples, the system may be configured to operate in the following manner. An application 212 at a general processor 210 processes input data (e.g., input graphics data) and generates output. The graphics data may include geometric data that defines a graphics object. Parameters describing the graphics data 252 or at least a portion of the graphics data are stored in an external memory 250. The output of the application may be in the form of a high-level command, such as an API function. For example, a high-level command may include a command requesting the execution of one or more graphics operations. The application may be configured to communicate with the driver 214 via an API so that the application output can be passed to the driver. In response to the output generated by the application, the driver 214 may generate one or more commands. The driver software at the driver 214 is configured to generate one or more commands based on the processing of the input data stream (e.g., graphics data). The one or more commands may be generated by the driver by collating one or more high-level commands from the application. The commands generated by the driver may include commands for controlling the overall operation of the GPU. In some examples, there may be one command for a specific rendering, or one command for a tiling stage of rendering and another command for a pixel processing stage of rendering. For example, the driver may issue a command to start a geometry processing operation on specific data, start a pixel processing operation on specific data, and / or start a compute operation on specific data. One or more high-level commands may be collected into a working group that may be processed at a lower level in the system hierarchy.
[0128] The commands generated by the driver may include setup information required to configure the GPU to perform the desired operation. The setup information may take the form of one or more register bits. The commands generated by the driver may include a pointer to a location in memory where vertex / primitive data is stored, such as a relevant portion of graphics data 252.
[0129] After the driver's command generation (which may correspond to rendering or partial rendering) is completed, the start of rendering (or partial rendering) on the GPU may be triggered, for example, during a "refresh". This may cause the command to be placed on the command queue 222.
[0130] The driver 214 may determine that the generated one or more commands are to be refreshed. The determination that the one or more commands are to be refreshed may be based on one or more of the following:
[0131] The processing of a specific render or part of a render that has been completed,
[0132] a predetermined number (including fractions) of renders or frames of input data have been processed,
[0133] One or more commands reaches or exceeds the threshold number of commands,
[0134] One or more commands reaches or exceeds a threshold amount of data,
[0135] One or more commands are associated with a certain amount of data (such as command metadata), and the amount of associated data meets or exceeds a threshold amount of associated data, and / or
[0136] a predetermined amount of input data that has been processed to generate the one or more commands (e.g., where the input data is graphics data, the amount of input data may be characterized by the number of vertices, vertex attributes, primitives, etc. in the processed input data)
[0137] An example of a determined point in a processing operation at which it may be desirable to initiate a refresh is a point in time at which the driver predicts that it is no longer possible to generate an input command. The driver may be configured to predict that it is no longer possible to generate an input command based on previous frames and / or renderings (e.g., based on a command generation history of previous frames and / or renderings).
[0138] In some examples, a determination to flush one or more commands may be made at the end of rendering processing (ie, the number of renderings processed since the last flush is one) or when one or more commands reaches a predetermined number, whichever occurs first.
[0139] Upon determining that the one or more commands are to be flushed, the driver 214 may cause the one or more commands to be submitted to the command queue.
[0140] As commands in the command queue are issued for processing by the command processor, further processing of the input data occurs at the general purpose processor 210, such as at the application 212 and the driver 214. This may result in one or more further commands being generated by the driver and flushed to the command queue. This process may be repeated.
[0141] Commands can be issued from the command queue under the control of the scheduler, or commands can be issued from the command queue in the order in which they are submitted to the command queue. Some combinations of these methods are feasible. For example, commands can usually be issued from the command queue in the order in which they are submitted to the command queue, but the scheduler can modify the order of commands in the command queue, and / or select important commands to make them issue faster than in the order in which they are submitted. When a command is issued from the command queue, it is processed by the command processor. The processing of the command causes the rendering and shading logic to perform one or more operations. Performing one or more such operations can cause data to be stored in at least one of the depth buffer 236, the template buffer 238, and the color buffer 240. For example, the operation of processing graphics data such as vertex data may include writing depth data corresponding to the vertex data into the depth buffer. During or after rendering, the GPU may be caused to write one or more of the depth buffer, the template buffer, and the color buffer. The command may include a configuration register value indicating that the GPU performs a write operation. The command may include a pointer to data in a memory (e.g., an external memory), which includes instructions or setup data indicating that the GPU performs a write operation.
[0142] As described above, the system can be configured to determine whether there is an access request to the written data after such a write operation. Determining whether there is an access request for the written data can include tracking the operation to be performed (e.g., a read operation) in response to the command being flushed to the command queue and / or issued from the command queue. The determination can be made by the driver. For example, the driver can track the commands flushed to the command queue. The driver can maintain a data structure that indicates whether the command will cause the written data to be accessed for a particular rendering or a series of renderings (e.g., renderings identified by one or more rendering identifiers). The driver is appropriately configured to determine whether an API call to "clear" the buffer and / or "invalidate" the buffer occurs during processing of the input data (e.g., whether an implicit or explicit invalidation of the buffer occurs).
[0143] In the case of an access request for the data to be written, for example, an access request occurs between a write operation that causes the data to be written and the invalidation of the written data, then the write operation is necessary and should not be prevented. In the case of no access request for the data to be written, for example, no access request occurs between a write operation that causes the data to be written and the invalidation of the written data, then the write operation is not necessary, and by preventing the execution of the write operation, memory bandwidth and processing power can be saved. The driver can be configured to determine whether there is data invalidation or clearing about the written data without an intermediate access request. The system can be configured to control the completion of the execution of the write operation based on the determination. For example, the driver can be configured to control the completion of the execution of the write operation based on the determination. The system can be configured to control the completion of the execution of the write operation by performing at least one of the following: modifying the command in the command queue, modifying the command leaving the command queue, and modifying the behavior of the GPU in response to the processing of the command.
[0144] In some examples, the system is configured to modify the command and / or modify the behavior of the GPU in response to the signal.In some examples, the signal can be generated by a driver, such as a driver unit at a driver. Figure 2 Signal 219 in FIG. 2 shows that driver 214 signals command queue 222, for example, to instruct command queue 222 to search for a given render (by identifying the command and the specific data buffer that does not need to be written out). Command queue 222 can then search the queue for the identified render and modify the command accordingly. Alternatively, Figure 2 Signal 218 in FIG. 2 shows that the driver 214 signals the command processor 224, for example, to indicate that the command processor 224 stores the rendered identification (by identifying the command and the specific data buffer that does not need to be written out). Therefore, when the command processor 224 receives the relevant command, the command can be modified so that the data buffer is not written out.
[0145] Now refer to Figure 3 The process of controlling the execution of a write operation (eg, by modifying a command) is described with reference to the flowchart in FIG. Figure 3The flowchart in shows the operations that can be performed by the driver. In step 302, input data is received. For example, the input data can be in the form of an API function call (e.g., a draw call, etc.). In step 304, a command is generated to cause the graphics processor to write a data buffer (e.g., a depth buffer) to an external memory. The command can be, for example, a rendering command, which includes setting information for causing the graphics processor to perform rendering, and a part of the setting information includes storing the data buffer in the external memory. In step 306, the command is then submitted to the command queue for processing on the graphics processor later. In step 308, further input data (e.g., in the form of an API function call) is then received. In step 310, it is then determined whether the data buffer for the previously submitted command does not need to be written out. For example, this can include determining whether there is an access request for the data between the execution of the write operation and the clearing or invalidation of the data, or whether the data is cleared or invalidated immediately after the command is submitted (which means that the stored data cannot be accessed). Based on the determination, the execution of the write operation is controlled by sending a signal to the graphics processor to prevent the writing of the data buffer (step 312).
[0146] Figure 3A It is shown in Figure 3 354. The figure shows a first time instance 350 in which input data 352 is received at the driver and command R0 354 is generated therefrom. Command R0 is submitted / flushed to the command queue 222, where it is retained until the graphics processor is able to process it using the command processor and ultimately perform rendering using rendering and shading logic. At a subsequent time instance 356, further input data 358 is received at the driver. The further input data is used to generate rendering command R4 360. The further input data includes a "clear" call indicating that the buffer should be cleared before performing rendering. The driver can then determine (e.g., by using the above-mentioned data structure) whether to utilize one or more data buffers in the previous command R0 before the clear call. If other renderings do not utilize / access one or more data buffers in the previous command R0, writing the data out to external memory can be avoided. The driver signals the graphics processor to modify the command (e.g., by modifying command R0 in the command queue 222 or at the command processor 224). As Figure 3A As shown in , because command R0 still exists in the command queue 222, it has not yet been processed by the graphics processor, so the command can be modified and the writing to the external memory can be avoided.
[0147] Thus, system 200 can avoid writing data to external memory because it is known that the data to be written will not be accessed before the write occurs. Avoiding unnecessary writing of data can save memory bandwidth and power consumption. Therefore, avoiding unnecessary data writing can achieve a faster and / or more efficient system.
[0148] Figure 4 The flowchart of shows the process of controlling the write operation according to the control register (e.g., according to the configuration register value at the control register). At step 402, a command is processed, which requires a write operation (e.g., a write operation that causes data such as buffer data to be written to the external memory 250). The processing of the command causes various control register values to be set, for example, to set up and initialize the operation of the graphics processor for a specific rendering. The graphics processor will then perform the operation (e.g., perform rendering) as indicated by the control register value (plus other data, such as graphics data stored in the memory). While performing the rendering operation, the control register that can store the configuration register value is accessed (step 404). The configuration register value associated with the specific buffer data can be read. For example, the configuration register value can control whether a specific data buffer (e.g., a depth buffer) should be written to the external memory (e.g., at the end of rendering). At step 406, it is determined whether the data at the control register (e.g., the configuration register value) indicates whether a write operation is to be performed on the associated execution data buffer. If the data indicates that a write operation is to be performed, a write operation is performed to cause the buffer data to be written to the external memory (step 408). If the data indicates that a write operation is not to be performed, then the write operation is not performed (step 410).
[0149] In some examples, the write operation may be related to one or more other operations for execution. Therefore, in addition to preventing the completion of the write operation, it is desirable to prevent the execution of one or more other operations. In one example, when buffer data is to be written to an external memory, the data may be compressed or packaged before writing out. In this case, if the data is not to be written, that is, if it is desired to prevent the execution of the write operation, it is not necessary to compress or package the data for writing out. Even if the execution of such an operation may not directly affect the memory bandwidth of the system, it may still unnecessarily take up processing time and power. It has been found that the completion of preventing the execution of these other operations may also be beneficial to the system.
[0150] In some examples, the operations performed can be grouped into tasks. The operations in a task can be related to each other. For example, a compression operation for causing compression of specific data and a write operation for causing the compressed data to be written to an external memory can both constitute part of a compression and write task.
[0151] In some examples, the system (e.g., a driver) is configured to determine whether there is an access request to write data after a write operation. The system can determine whether to execute the task (i.e., the operations constituting the task) accordingly, and control the execution of the entire task accordingly. For example, in the case where it is determined that the write operation is unnecessary and the write operation is part of the task, it can be determined that the remaining operations of the task are also unnecessary. These remaining operations of the task can be prevented from being executed together with the write operation. The method can reduce the storage space required for the control register by aggregating the operations together and associating multiple operations with a single configuration register value. A single configuration register value can be used to control the execution of all operations in the task.
[0152] The above discussion focuses on preventing the completion of an operation such as a write operation by modifying the command that will cause the write operation to be performed before the command is initiated on the graphics processor. For example, the setting that causes the write operation can be disabled / deactivated before the graphics processor begins processing the command. The above techniques can also be used to prevent the completion of the operation after the command is initiated on the graphics processor. For example, the graphics processor may have begun processing the command (e.g., rendering has begun), but it is still desired to stop the write operation. For example, this can be achieved by modifying the contents of the configuration register in the graphics processor at any time before the point in time when the configuration register is read and the write operation is triggered. This can provide additional time for the driver to detect that the buffer does not need to be used subsequently, and can avoid writing the data buffer to the external memory.
[0153] In the above discussion, the data at the control register (e.g., the configuration register value) is used to control whether the graphics processor writes out data (e.g., at the end of rendering). This can be used to control the writing of data by the graphics processor, so that if the register is set, the corresponding data buffer is written out to the external memory when the rendering is completed, and if the register is not set, the data will not be written out to the external memory after the corresponding buffer is rendered. Alternatively or additionally, the data at the control register can be checked during the execution of the operation. For example, the data at the control register can be accessed periodically during the operation. This is very useful for operations that take a long time to execute, such as external memory writes that occur in multiple stages or blocks. The period of checking the control register data (e.g., performed by the rendering logic) can be set so that subsequent checks of the control register value are only performed during the execution of relatively long operations (operations that take (or are expected to take) longer than a threshold time, or processor clock cycles) and / or operations related to a data amount greater than a threshold data amount. This can be achieved by setting the period of the control register check to be longer than the average time to execute a relatively short operation, but less than the average time to execute a longer operation. This allows the system to perform checks that are still useful to the system while executing a longer operation.
[0154] The above techniques are also useful when considering multi-sample rendering. Multi-sample writes can be combined with single-sample writes in the same rendering. This will incur additional bandwidth costs for each write. In some cases, multi-sample data may not be needed; it may be sufficient to retain the single-sample data. In some examples, multi-sample data (e.g., multi-sample surfaces) can be decomposed into single-sample data (e.g., single-sample surfaces). For example, the multi-sample data can be averaged to decompose into single-sample data. In cases where single-sample data is sufficient, additional writes of multi-sample data can be avoided. An example of a situation where multi-sample data does not need to be written is in a system where a single-sample output is required for a particular frame. At some time before the frame is completed, there may be some other access that also requires a single-sample output. At this time, the driver cannot determine whether multi-sample data will be needed in the future, so both the multi-sample and single-sample outputs should be written out to memory. The driver may then see that the end of the frame has occurred without subsequent use of the multi-sample data. Therefore, multi-sample writes are unnecessary. Avoiding multi-sample writes can avoid up to 9 additional write operations. In this way, avoiding at least one multi-sample write allows the required memory bandwidth to be reduced.
[0155] Thus, it can be seen that before the execution of commands submitted for processing (which will result in the execution of one or more operations such as write operations), these operations can be modified. The modification can be performed based on information determined after the command is submitted to the command queue.
[0156] In some examples, the system (e.g., a driver) may be configured to generate an interrupt signal for causing the processing of rendering on the graphics processor (in response to a command) to be interrupted. This may allow the execution of a write operation to be prevented from being completed after the processing of the command has been initiated. An example of a situation where this is useful is when the driver signals that a write operation to the depth buffer data is unnecessary at a time when the rendering in question is being performed. In a tile-based rendering system (e.g., a tile-based deferred rendering system), separate writing of depth data may occur for each tile. If during rendering, some tiles have not yet written their depth data, it is advantageous to at least stop these tiles from writing their depth data unnecessarily. This means that at least some bandwidth can be saved.
[0157] Figure 2 The system is shown as including a plurality of functional blocks. This is merely illustrative, and is not intended to define a strict division between different logical elements of such an entity. Each functional block may be provided in any suitable manner. It should be understood that the intermediate values formed by the system described herein need not be physically generated by the system at any point, and may simply represent logical values that conveniently describe the processing performed by the system between its inputs and outputs.
[0158] The system described herein can be implemented in hardware on an integrated circuit. The system described herein can be configured to perform any method described herein. Generally, any of the above functions, methods, techniques or components can be implemented with software, firmware, hardware (e.g., fixed logic circuits) or any combination thereof. The terms "module", "function", "component", "element", "unit", "block" and "logic" can be used herein to generally represent software, firmware, hardware or any combination thereof. In the case of software implementation, a module, function, component, element, unit, block or logic represents a program code that performs a specified task when executed on a processor. The algorithms and methods described herein can be performed by one or more processors, which execute the code that causes (one or more) processors to perform the algorithm / method. Examples of computer-readable storage media include random access memory (RAM), read-only memory (ROM), optical disk, flash memory, hard disk storage, and other memory devices that can use magnetic, optical and other technologies to store instructions or other data and can be accessed by a machine.
[0159] The terms computer program code and computer readable instructions as used herein refer to any type of executable code for a processor, including code expressed in a machine language, an interpreted language, or a scripting language. Executable code includes binary code, machine code, byte code, code that defines an integrated circuit (e.g., a hardware description language or a netlist), and code expressed in a programming language code such as C, Java, or OpenCL. Executable code can be, for example, any type of software, firmware, script, module, or library that, when properly executed, processed, interpreted, compiled, run in a virtual machine or other software environment, enables a processor of a computer system to perform the tasks specified by the code in support of the executable code.
[0160] A processor, computer or computer system may be any type of device, machine or special purpose circuit, or a collection or portion thereof, that has processing capabilities to execute instructions. A processor may be any type of general or special purpose processor, such as a CPU, GPU, system on chip, state machine, media processor, application specific integrated circuit (ASIC), programmable logic array, field programmable gate array (FPGA), etc. A computer or computer system may include one or more processors.
[0161] It is also intended to cover software that defines the configuration of hardware as described herein, such as HDL (Hardware Description Language) software, for example, for designing integrated circuits or for configuring a programmable chip to perform a desired function. That is, a computer readable storage medium may be provided having encoded thereon computer readable program code in the form of an integrated circuit definition data set that, when processed in an integrated circuit manufacturing system, configures the system to manufacture any of the methods described herein or to manufacture a system that includes any of the manufacturing described herein. The integrated circuit definition data set may be, for example, an integrated circuit description.
[0162] A method for controlling a process performed at an integrated circuit manufacturing system as described herein may be provided. An integrated circuit definition data set may be provided that, when processed in an integrated circuit manufacturing system, causes execution of the method of manufacturing the system.
[0163] An integrated circuit definition data set may be in the form of computer code, such as a netlist, code for configuring a programmable chip, a hardware description language (defining an integrated circuit at any level), including register transfer level (RTL) code, high-level circuit representations (e.g., Verilog, or VHDL), and low-level circuit representations (e.g., OASIS (RTM), and GDSII). A higher-level representation (e.g., RTL) that logically defines an integrated circuit may be executed at a computer system (configured to generate a manufacturing definition of an integrated circuit in the context of a software environment (including definitions of circuit elements and rules for combining such elements)) to generate a manufacturing definition of the integrated circuit defined by the representation. Similar to the case where software is typically executed at a computer system to define a machine, one or more intermediate user steps (e.g., providing commands, variables, etc.) may be required to cause the computer system (configured to generate a manufacturing definition of an integrated circuit) to execute the code that defines the integrated circuit, thereby generating a manufacturing definition of the integrated circuit.
[0164] Now refer to Figure 5 An example of processing an integrated circuit definition data set at an integrated circuit manufacturing system to configure the system to manufacture the system is described.
[0165] Figure 5An example of an integrated circuit (IC) manufacturing system 502 (configured to manufacture the apparatus described in any of the examples herein) is shown. Specifically, the IC manufacturing system 502 includes a layout processing system 504, and an integrated circuit generation system 506. The IC manufacturing system 502 is configured to receive an IC definition data set (e.g., defining the apparatus described in any of the examples herein), process the IC definition data set, and generate an IC (e.g., the IC embodying the apparatus described in any of the examples herein) based on the IC definition data set. The processing of the IC definition data set configures the IC manufacturing system 502 to manufacture an integrated circuit embodying the apparatus described in any of the examples herein.
[0166] The layout processing system 504 is configured to receive and process an IC definition data set to determine a circuit layout. Methods for determining a circuit layout from an IC definition data set are known in the art, and may include, for example, synthesizing RTL code to determine a gate level representation of the circuit to be generated, for example, in terms of logic components (e.g., NAND, NOR, AND, OR, MUX, and FLIP-FLOP components). By determining the location information of the logic components, the circuit layout can be determined from the gate level representation of the circuit. This can be done automatically or with user participation in order to optimize the circuit layout. When the layout processing system 504 has determined the circuit layout, it can output a circuit layout definition to the IC generation system 506. The circuit layout definition can be, for example, a circuit layout description.
[0167] As is known in the art, IC generation system 506 generates an IC according to a circuit layout definition. For example, IC generation system 506 may implement a semiconductor device manufacturing process to generate an IC, which may include a multi-step sequence of photolithography and chemical processing steps during which electronic circuits are gradually formed on a wafer made of semiconductor material. The circuit layout definition may be in the form of a mask that may be used in a photolithography process for generating an IC according to the circuit definition. Alternatively, the circuit layout definition provided to IC generation system 506 may be in the form of a computer-readable code that IC generation system 506 may use to form an appropriate mask for use in generating an IC.
[0168] The different processes performed by IC manufacturing system 502 may all be implemented at one location (e.g., by one party). Alternatively, IC manufacturing system 502 may be a distributed system such that some processes may be performed at different locations and may be performed by different parties. For example, some stages in (i) synthesizing RTL code representing an IC definition data set to form a gate-level representation of a circuit to be generated, (ii) generating a circuit layout based on the gate-level representation, (iii) forming a mask based on the circuit layout, and (iv) using the mask to manufacture an integrated circuit may be performed at different locations and / or by different parties.
[0169] In other examples, processing an integrated circuit definition data set at an integrated circuit manufacturing system may configure the system to manufacture the system (without processing the IC definition data set to determine a circuit layout). For example, the integrated circuit definition data set may define a configuration of a reconfigurable processor (e.g., an FPGA), and processing of the data set may configure the IC manufacturing system to generate a reconfigurable processor having the defined configuration (e.g., by loading the configuration data into the FPGA).
[0170] In some embodiments, when the integrated circuit manufacturing definition data set is processed in the integrated circuit manufacturing system, it can cause the integrated circuit manufacturing system to generate the device as described herein. Figure 5 The described approach uses an integrated circuit manufacturing definition data set to configure an integrated circuit manufacturing system so that the device described herein can be manufactured.
[0171] In some examples, the integrated circuit definition data set may include software that runs on or in conjunction with hardware defined by the data set. Figure 5 In the example shown, the IC generation system can be further configured by the integrated circuit definition dataset to load firmware onto the integrated circuit according to the program code defined in the integrated circuit definition dataset when manufacturing the integrated circuit, or otherwise provide the integrated circuit with program code for use with the integrated circuit.
[0172] Compared with known implementations, the implementation of the concepts set forth in this application in devices, apparatuses, modules, and / or systems (and in the methods implemented herein) can produce performance improvements. Performance improvements can include one or more of increased computing performance, reduced delays, increased throughput, and / or reduced power consumption. During the manufacture of such devices, devices, modules, and systems (e.g., in integrated circuits), performance improvements can be weighed against physical implementations, thereby improving manufacturing methods. For example, performance improvements can be weighed against layout area, thereby matching the performance of known implementations, but using less silicon. This can be accomplished, for example, by reusing functional blocks in a serialized manner, or sharing functional blocks between elements of devices, devices, modules, and / or systems. On the contrary, the concepts proposed in this application that produce improvements (e.g., reduced silicon area) to the physical implementations of devices, devices, modules, and systems can be weighed against performance improvements. This can be accomplished, for example, by manufacturing multiple instances of modules within a predefined area budget.
[0173] The applicant hereby independently discloses each individual feature described herein and any combination of two or more such features, including such features or combinations that can be performed based on this specification as a whole according to the general common sense of a person skilled in the art, regardless of whether such features or combinations of features solve any problem disclosed herein. In view of the foregoing description, it is obvious to a person skilled in the art that various modifications can be made within the scope of the present invention.
Claims
1. A system for controlling command processing at a graphics processor, the system comprising a driver operable to communicate with the graphics processor, the driver being configured to: receiving input data and generating commands from the input data for processing at the graphics processor, in, The command will cause the graphics processor to write out at least one data buffer to external memory; submitting the command to a queue for later processing at the graphics processor; receiving further input data and determining from the further input data that the at least one data buffer to be written to the external memory is not required to be written to the external memory by determining from the further input data that the at least one data buffer to be written to the external memory is invalidated before being accessed; as well as The graphics processor is signaled to prevent execution of at least a portion of a write to external memory for the command.
2. The system according to claim 1, in, The driver is configured to determine that the at least one data buffer does not need to be written to the external memory by being configured to determine that a subsequent command will not use the at least one data buffer stored at the external memory.
3. The system according to claim 2, in, The driver is configured to determine, based on the further input data, that there is no access request to the at least one data buffer before the at least one data buffer is invalidated.
4. The system according to claim 3, in, The driver further includes a data structure, and the driver is configured to determine that there is no access request to the at least one data buffer before the at least one data buffer is invalidated by being configured to: maintaining the data structure to track access requests received in the further input data to the at least one data buffer; as well as When a function to clear the data buffer or invalidate the at least one data buffer is received, the data structure is analyzed to determine whether a previous access request has been made.
5. The system according to claim 4, in, The data structure includes a comparison of an identifier identifying the at least one data buffer and the command and a flag indicating whether an access request has been received.
6. The system according to claim 4 or 5, in, The driver is configured to perform one or more of the following: maintaining the data structure to track access requests by determining whether an application level or driver level access request to the at least one data buffer is received, and Access to the at least one data buffer to be written out by an application layer or a driver layer in a system hierarchy is tracked to determine that there is no access request.
7. The system according to any one of claims 1 to 5, in, The driver is configured to determine that the at least one data buffer does not need to be written to the external memory by being configured to determine whether there is one or both of an implicit invalidation of the at least one data buffer and an explicit invalidation of the at least one data buffer.
8. The system according to any one of claims 1 to 5, in, The command includes at least one configuration register setting that will cause the graphics processor to write out the at least one data buffer to the external memory.
9. The system according to any one of claims 1 to 5, in, The driver is configured to: signal the graphics processor to prevent at least a portion of the write to the external memory from being performed for the command by being configured to perform one or more of: signaling the queue to modify the command held in the queue so that the command does not cause the graphics processor to write out the at least one data buffer to the external memory, signaling the graphics processor to modify the command prior to processing the command so that the command does not cause the graphics processor to write out the at least one data buffer to the external memory, signaling the graphics processor to modify the command when processing the command so that the command does not cause the graphics processor to write out at least a portion of the at least one data buffer to the external memory, and An interrupt signal is generated to cause the graphics processor to stop processing the command.
10. The system according to claim 9, further comprising a command processor, in, The command processor is configured in response to the signal to store identifiers for the command and the at least one data buffer and to modify the command in response to determining that the command received from the queue for processing has a matching identifier.
11. The system according to any one of claims 1 to 5, in, The command includes a pointer to a location in the external memory that includes setup data that will cause the graphics processor to write out the at least one data buffer to the external memory.
12. The system according to claim 11, in, The driver is configured to signal the graphics processor to prevent at least a portion of writing to the external memory from being performed for the command by modifying the setup data.
13. The system according to any one of claims 1 to 5, in, The command includes at least one pointer to graphics data stored in the external memory.
14. The system according to any one of claims 1 to 5, in, The queue is a command queue configured to store commands at the graphics processor until the commands can be processed at the graphics processor.
15. The system according to any one of claims 1 to 5, in, The driver is configured to operate at a higher level in the system hierarchy than the level at which the command is processed.
16. The system according to any one of claims 1 to 5, in, The input data includes a plurality of application programming interface function calls.
17. The system according to any one of claims 1 to 5, in, The further input data comprises a plurality of application programming interface function calls including at least one of the following: a clear function configured to cause the at least one data buffer stored in the external memory to be cleared; and An invalidation function is configured to invalidate the at least one data buffer stored in the external memory.
18. The system according to any one of claims 1 to 5, in, The task to be performed includes a write operation of the at least one data buffer and at least one other operation, wherein the driver is configured to prevent at least a portion of the writing to the external memory for the command by preventing the graphics processor from completing the execution of the at least one other operation.
19. A method for controlling command processing at a graphics processor, include: receiving input data and generating commands from the input data for processing at the graphics processor, wherein the commands will cause the graphics processor to write out at least one data buffer to an external memory; submitting the command to a queue for later processing at the graphics processor; receiving further input data after submitting the command but before completing the write to the external memory, and determining based on the further input data that the at least one data buffer to be written to the external memory does not need to be written to the external memory by determining based on the further input data that the at least one data buffer to be written to the external memory is invalidated before being accessed; and The graphics processor is signaled to prevent execution of at least a portion of a write to external memory for the command.
20. A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed at a computer system, cause the computer system to: receiving input data and generating commands from the input data for processing at a graphics processor, in, The command will cause the graphics processor to write out at least one data buffer to external memory; submitting the command to a queue for later processing at the graphics processor; receiving further input data after submitting the command but before completing the write to the external memory, and determining based on the further input data that the at least one data buffer to be written to the external memory is not required to be written to the external memory by determining based on the further input data that the at least one data buffer to be written to the external memory is invalidated before being accessed; as well as The graphics processor is signaled to prevent execution of at least a portion of a write to external memory for the command.
Citation Information
Patent Citations
Methods and system for managing computational resources of a coprocessor in a computing system
CA2415583A1
Methods and system for managing computational resources of a coprocessor in a computing system
CN101685391A
Fault-tolerant preemption mechanism at arbitrary control points for graphics processing
CN105518742A
Memory device containing multi-buffer zone and method driving same
CN106960412A
Methods, systems, and computer readable media for write classification and aggregation using host memory buffer (HMB)
US20180018101A1
