case PVR_SUB_CMD_TYPE_TRANSFER:
list_for_each_entry_safe (struct pvr_transfer_cmd,
transfer_cmd,
- &sub_cmd->transfer.transfer_cmds,
+ sub_cmd->transfer.transfer_cmds,
link) {
list_del(&transfer_cmd->link);
if (!transfer_cmd->is_deferred_clear)
break;
case PVR_SUB_CMD_TYPE_TRANSFER:
- list_inithead(&sub_cmd->transfer.transfer_cmds);
+ sub_cmd->transfer.transfer_cmds = &sub_cmd->transfer.transfer_cmds_priv;
+ list_inithead(sub_cmd->transfer.transfer_cmds);
break;
case PVR_SUB_CMD_TYPE_EVENT:
sub_cmd = &cmd_buffer->state.current_sub_cmd->transfer;
- list_addtail(&transfer_cmd->link, &sub_cmd->transfer_cmds);
+ list_addtail(&transfer_cmd->link, sub_cmd->transfer_cmds);
return VK_SUCCESS;
}
{
list_for_each_entry_safe (struct pvr_transfer_cmd,
transfer_cmd,
- &sub_cmd->transfer_cmds,
+ sub_cmd->transfer_cmds,
link) {
/* The fw guarantees that any kick on the same context will be
* synchronized in submission order. This means only the first kick must
struct vk_sync *last_cmd_signal_sync = NULL;
VkResult result;
- if (list_first_entry(&sub_cmd->transfer_cmds,
- struct pvr_transfer_cmd,
- link) == transfer_cmd) {
+ if (list_first_entry(sub_cmd->transfer_cmds,
+ struct pvr_transfer_cmd,
+ link) == transfer_cmd) {
first_cmd_wait_sync = wait_sync;
}
- if (list_last_entry(&sub_cmd->transfer_cmds,
+ if (list_last_entry(sub_cmd->transfer_cmds,
struct pvr_transfer_cmd,
link) == transfer_cmd) {
last_cmd_signal_sync = signal_sync;
struct pvr_sub_cmd_transfer {
bool serialize_with_frag;
- /* List of pvr_transfer_cmd type structures. */
- struct list_head transfer_cmds;
+ /* Pointer to the actual transfer command list, allowing primary and
+ * secondary sub-commands to share the same list.
+ */
+ struct list_head *transfer_cmds;
+
+ /* List of pvr_transfer_cmd type structures. Do not access the list
+ * directly, but always use the transfer_cmds pointer above.
+ */
+ struct list_head transfer_cmds_priv;
};
struct pvr_sub_cmd_event {