anv: Add an anv_execbuf helper struct
This commit adds a little helper struct for storing everything we use to build an execbuf2 call. Since the add_bo function really has nothing to do with a command buffer, it makes sense to break it out a bit. This also reduces some of the churn in the next commit. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
@@ -1147,6 +1147,17 @@ enum anv_cmd_buffer_exec_mode {
|
||||
ANV_CMD_BUFFER_EXEC_MODE_COPY_AND_CHAIN,
|
||||
};
|
||||
|
||||
struct anv_execbuf {
|
||||
struct drm_i915_gem_execbuffer2 execbuf;
|
||||
|
||||
struct drm_i915_gem_exec_object2 * objects;
|
||||
uint32_t bo_count;
|
||||
struct anv_bo ** bos;
|
||||
|
||||
/* Allocated length of the 'objects' and 'bos' arrays */
|
||||
uint32_t array_length;
|
||||
};
|
||||
|
||||
struct anv_cmd_buffer {
|
||||
VK_LOADER_DATA _loader_data;
|
||||
|
||||
@@ -1179,20 +1190,7 @@ struct anv_cmd_buffer {
|
||||
uint32_t bt_next;
|
||||
struct anv_reloc_list surface_relocs;
|
||||
|
||||
/* Information needed for execbuf
|
||||
*
|
||||
* These fields are generated by anv_cmd_buffer_prepare_execbuf().
|
||||
*/
|
||||
struct {
|
||||
struct drm_i915_gem_execbuffer2 execbuf;
|
||||
|
||||
struct drm_i915_gem_exec_object2 * objects;
|
||||
uint32_t bo_count;
|
||||
struct anv_bo ** bos;
|
||||
|
||||
/* Allocated length of the 'objects' and 'bos' arrays */
|
||||
uint32_t array_length;
|
||||
} execbuf2;
|
||||
struct anv_execbuf execbuf2;
|
||||
|
||||
/* Serial for tracking buffer completion */
|
||||
uint32_t serial;
|
||||
|
Reference in New Issue
Block a user