Skip to content

Commit f567656

Browse files
dayatsin-amdalexdeucher
authored andcommitted
drm/amdkfd: CRIU add support for GWS queues
Add support to checkpoint/restore GWS (Global Wave Sync) queues. Signed-off-by: David Yat Sin <david.yatsin@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 7c6b6e1 commit f567656

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ struct kfd_criu_queue_priv_data {
11031103
uint32_t priority;
11041104
uint32_t q_percent;
11051105
uint32_t doorbell_id;
1106-
uint32_t is_gws;
1106+
uint32_t gws;
11071107
uint32_t sdma_id;
11081108
uint32_t eop_ring_buffer_size;
11091109
uint32_t ctx_save_restore_area_size;

drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ static int criu_checkpoint_queue(struct kfd_process_device *pdd,
636636
q_data->ctx_save_restore_area_size =
637637
q->properties.ctx_save_restore_area_size;
638638

639+
q_data->gws = !!q->gws;
640+
639641
ret = pqm_checkpoint_mqd(&pdd->process->pqm, q->properties.queue_id, mqd, ctl_stack);
640642
if (ret) {
641643
pr_err("Failed checkpoint queue_mqd (%d)\n", ret);
@@ -743,7 +745,6 @@ static void set_queue_properties_from_criu(struct queue_properties *qp,
743745
struct kfd_criu_queue_priv_data *q_data)
744746
{
745747
qp->is_interop = false;
746-
qp->is_gws = q_data->is_gws;
747748
qp->queue_percent = q_data->q_percent;
748749
qp->priority = q_data->priority;
749750
qp->queue_address = q_data->q_address;
@@ -826,12 +827,15 @@ int kfd_criu_restore_queue(struct kfd_process *p,
826827
NULL);
827828
if (ret) {
828829
pr_err("Failed to create new queue err:%d\n", ret);
829-
ret = -EINVAL;
830+
goto exit;
830831
}
831832

833+
if (q_data->gws)
834+
ret = pqm_set_gws(&p->pqm, q_data->q_id, pdd->dev->gws);
835+
832836
exit:
833837
if (ret)
834-
pr_err("Failed to create queue (%d)\n", ret);
838+
pr_err("Failed to restore queue (%d)\n", ret);
835839
else
836840
pr_debug("Queue id %d was restored successfully\n", queue_id);
837841

0 commit comments

Comments
 (0)