winsys/amdgpu: userqueue multi ctx jobs are guaranteed to be in sequence

Jobs from multiple context are submitted to aws->cs_queue are executed in order. Jobs
in aws->cs_queue are directly added to userqueue ring, hence userqueue execution order
between context is guaranteed in case of userqueue.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33661>
This commit is contained in:
Yogesh Mohan Marimuthu 2025-02-21 09:47:09 +05:30 committed by Marge Bot
parent 659a41293b
commit 224c0cfbdd

View file

@ -1637,7 +1637,7 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index)
struct amdgpu_seq_no_fences seq_no_dependencies;
memcpy(&seq_no_dependencies, &csc->seq_no_dependencies, sizeof(seq_no_dependencies));
if (queue_type != KERNELQ_ALT_FENCE) {
if (queue_type == KERNELQ) {
/* Add a fence dependency on the previous IB if the IP has multiple physical queues to
* make it appear as if it had only 1 queue, or if the previous IB comes from a different
* context. The reasons are:
@ -1652,8 +1652,7 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index)
*/
if (prev_fence) {
bool same_ctx = queue->last_ctx == acs->ctx;
/* userqueue submission mode uses a single queue per process. */
bool same_queue = queue_type == USERQ || aws->info.ip[acs->ip_type].num_queues == 1;
bool same_queue = aws->info.ip[acs->ip_type].num_queues == 1;
if (!same_ctx || !same_queue)
add_seq_no_to_list(aws, &seq_no_dependencies, queue_index, prev_seq_no);