drm/amdkfd: Cleanup qpd.pqm initialization
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 14 Nov 2017 21:41:17 +0000 (16:41 -0500)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 14 Nov 2017 21:41:17 +0000 (16:41 -0500)
The PQM doesn't change after process creation. So initialize it in
kfd_create_process_device_data.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_process.c
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

index 1f5ccd28bd41464932089e2916535d7152a0e942..1bb9b2643d5af669c83f27fd070c8d212fa9b3af 100644 (file)
@@ -348,6 +348,7 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev,
                INIT_LIST_HEAD(&pdd->qpd.queues_list);
                INIT_LIST_HEAD(&pdd->qpd.priv_queue_list);
                pdd->qpd.dqm = dev->dqm;
+               pdd->qpd.pqm = &p->pqm;
                pdd->process = p;
                pdd->bound = PDD_UNBOUND;
                pdd->already_dequeued = false;
index a3f1e62c60ba9d80b7d0244be3b3e3301a64557c..eeb7726b62991b533e7703427fc673fdcb2a2151 100644 (file)
@@ -178,10 +178,8 @@ int pqm_create_queue(struct process_queue_manager *pqm,
                return retval;
 
        if (list_empty(&pdd->qpd.queues_list) &&
-           list_empty(&pdd->qpd.priv_queue_list)) {
-               pdd->qpd.pqm = pqm;
+           list_empty(&pdd->qpd.priv_queue_list))
                dev->dqm->ops.register_process(dev->dqm, &pdd->qpd);
-       }
 
        pqn = kzalloc(sizeof(*pqn), GFP_KERNEL);
        if (!pqn) {