Lines Matching refs:mcs_data
2719 static int hl_cs_poll_fences(struct multi_cs_data *mcs_data, struct multi_cs_completion *mcs_compl) in hl_cs_poll_fences() argument
2721 struct hl_fence **fence_ptr = mcs_data->fence_arr; in hl_cs_poll_fences()
2722 struct hl_device *hdev = mcs_data->ctx->hdev; in hl_cs_poll_fences()
2723 int i, rc, arr_len = mcs_data->arr_len; in hl_cs_poll_fences()
2724 u64 *seq_arr = mcs_data->seq_arr; in hl_cs_poll_fences()
2731 rc = hl_ctx_get_fences(mcs_data->ctx, seq_arr, fence_ptr, arr_len); in hl_cs_poll_fences()
2773 rc = hl_wait_for_fence(mcs_data->ctx, seq_arr[i], fence, &status, 0, NULL); in hl_cs_poll_fences()
2805 mcs_data->completion_bitmap |= BIT(i); in hl_cs_poll_fences()
2811 if (fence && mcs_data->update_ts && in hl_cs_poll_fences()
2816 mcs_data->update_ts = false; in hl_cs_poll_fences()
2817 mcs_data->gone_cs = true; in hl_cs_poll_fences()
2824 mcs_data->completion_bitmap |= BIT(i); in hl_cs_poll_fences()
2834 hl_fences_put(mcs_data->fence_arr, arr_len); in hl_cs_poll_fences()
2836 if (mcs_data->update_ts && in hl_cs_poll_fences()
2838 mcs_data->timestamp = ktime_to_ns(first_cs_time); in hl_cs_poll_fences()
2946 static int hl_wait_multi_cs_completion(struct multi_cs_data *mcs_data, in hl_wait_multi_cs_completion() argument
2952 mcs_data->timeout_jiffies); in hl_wait_multi_cs_completion()
2956 mcs_data->timestamp = mcs_compl->timestamp; in hl_wait_multi_cs_completion()
2961 mcs_data->wait_status = completion_rc; in hl_wait_multi_cs_completion()
2995 struct multi_cs_data mcs_data = {}; in hl_multi_cs_wait_ioctl() local
3047 mcs_data.ctx = ctx; in hl_multi_cs_wait_ioctl()
3048 mcs_data.seq_arr = cs_seq_arr; in hl_multi_cs_wait_ioctl()
3049 mcs_data.fence_arr = fence_arr; in hl_multi_cs_wait_ioctl()
3050 mcs_data.arr_len = seq_arr_len; in hl_multi_cs_wait_ioctl()
3055 mcs_data.timeout_jiffies = hl_usecs64_to_jiffies(args->in.timeout_us); in hl_multi_cs_wait_ioctl()
3063 mcs_data.update_ts = true; in hl_multi_cs_wait_ioctl()
3064 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3071 if (rc || mcs_data.completion_bitmap || !args->in.timeout_us) in hl_multi_cs_wait_ioctl()
3075 rc = hl_wait_multi_cs_completion(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3076 if (rc || (mcs_data.wait_status == 0)) in hl_multi_cs_wait_ioctl()
3083 mcs_data.update_ts = false; in hl_multi_cs_wait_ioctl()
3084 rc = hl_cs_poll_fences(&mcs_data, mcs_compl); in hl_multi_cs_wait_ioctl()
3086 if (rc || mcs_data.completion_bitmap) in hl_multi_cs_wait_ioctl()
3098 mcs_data.timeout_jiffies = mcs_data.wait_status; in hl_multi_cs_wait_ioctl()
3124 if (mcs_data.completion_bitmap) { in hl_multi_cs_wait_ioctl()
3126 args->out.cs_completion_map = mcs_data.completion_bitmap; in hl_multi_cs_wait_ioctl()
3129 if (mcs_data.timestamp) { in hl_multi_cs_wait_ioctl()
3130 args->out.timestamp_nsec = mcs_data.timestamp; in hl_multi_cs_wait_ioctl()
3135 if (!mcs_data.timestamp) in hl_multi_cs_wait_ioctl()