v3dv: create a CPU queue type

We will be introducing a new type of queue, a CPU queue. This queue will
be responsible for handling the CPU jobs, such as timestamp queries and
indirect CSD dispatch.

Therefore, add a CPU queue to the enum v3dv_queue_type and its
respective barrier.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26448>
This commit is contained in:
Maíra Canal
2023-07-17 11:17:08 -03:00
committed by Marge Bot
parent e162308298
commit b1134775e0
2 changed files with 14 additions and 4 deletions
+4 -1
View File
@@ -250,6 +250,7 @@ enum v3dv_queue_type {
V3DV_QUEUE_CL = 0,
V3DV_QUEUE_CSD,
V3DV_QUEUE_TFU,
V3DV_QUEUE_CPU,
V3DV_QUEUE_ANY,
V3DV_QUEUE_COUNT,
};
@@ -1440,10 +1441,12 @@ enum {
V3DV_BARRIER_GRAPHICS_BIT = (1 << 0),
V3DV_BARRIER_COMPUTE_BIT = (1 << 1),
V3DV_BARRIER_TRANSFER_BIT = (1 << 2),
V3DV_BARRIER_CPU_BIT = (1 << 3),
};
#define V3DV_BARRIER_ALL (V3DV_BARRIER_GRAPHICS_BIT | \
V3DV_BARRIER_TRANSFER_BIT | \
V3DV_BARRIER_COMPUTE_BIT);
V3DV_BARRIER_COMPUTE_BIT | \
V3DV_BARRIER_CPU_BIT);
struct v3dv_barrier_state {
/* Mask of V3DV_BARRIER_* indicating where we consume a barrier. */
+10 -3
View File
@@ -76,7 +76,7 @@ queue_wait_idle(struct v3dv_queue *queue,
{
if (queue->device->pdevice->caps.multisync) {
int ret = drmSyncobjWait(queue->device->pdevice->render_fd,
queue->last_job_syncs.syncs, 3,
queue->last_job_syncs.syncs, 4,
INT64_MAX, DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL,
NULL);
if (ret) {
@@ -85,7 +85,7 @@ queue_wait_idle(struct v3dv_queue *queue,
}
bool first = true;
for (int i = 0; i < 3; i++) {
for (int i = 0; i < 4; i++) {
if (!queue->last_job_syncs.first[i])
first = false;
}
@@ -117,7 +117,7 @@ queue_wait_idle(struct v3dv_queue *queue,
}
}
for (int i = 0; i < 3; i++)
for (int i = 0; i < 4; i++)
queue->last_job_syncs.first[i] = false;
return VK_SUCCESS;
@@ -160,6 +160,8 @@ set_in_syncs(struct v3dv_queue *queue,
bool sync_tfu = job->serialize & V3DV_BARRIER_TRANSFER_BIT;
bool sync_cl = job->serialize & (V3DV_BARRIER_GRAPHICS_BIT |
V3DV_BARRIER_TRANSFER_BIT);
bool sync_cpu = job->serialize & V3DV_BARRIER_CPU_BIT;
*count = n_syncs;
if (sync_cl)
(*count)++;
@@ -167,6 +169,8 @@ set_in_syncs(struct v3dv_queue *queue,
(*count)++;
if (sync_csd)
(*count)++;
if (sync_cpu)
(*count)++;
*count += wait_count;
@@ -199,6 +203,9 @@ set_in_syncs(struct v3dv_queue *queue,
if (sync_tfu)
syncs[n_syncs++].handle = queue->last_job_syncs.syncs[V3DV_QUEUE_TFU];
if (sync_cpu)
syncs[n_syncs++].handle = queue->last_job_syncs.syncs[V3DV_QUEUE_CPU];
assert(n_syncs == *count);
return syncs;
}