[PATCH 5/8] drm/amdkfd: Register/Deregister process on qpd resolution

Oded Gabbay oded.gabbay at gmail.com
Wed Nov 1 09:59:24 UTC 2017


On Thu, Oct 26, 2017 at 1:41 AM, Felix Kuehling <Felix.Kuehling at amd.com> wrote:
> From: Ben Goz <ben.goz at amd.com>
>
> Process registration needs to happen on each device. So use per-device
> queue lists to determine when to register/deregister the process.
>
> Signed-off-by: Ben Goz <ben.goz at amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling at amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> index 5129dc1..2bec902 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -177,7 +177,8 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>         if (retval != 0)
>                 return retval;
>
> -       if (list_empty(&pqm->queues)) {
> +       if (list_empty(&pdd->qpd.queues_list) &&
> +           list_empty(&pdd->qpd.priv_queue_list)) {
>                 pdd->qpd.pqm = pqm;
>                 dev->dqm->ops.register_process(dev->dqm, &pdd->qpd);
>         }
> @@ -248,7 +249,8 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>  err_allocate_pqn:
>         /* check if queues list is empty unregister process from device */
>         clear_bit(*qid, pqm->queue_slot_bitmap);
> -       if (list_empty(&pqm->queues))
> +       if (list_empty(&pdd->qpd.queues_list) &&
> +           list_empty(&pdd->qpd.priv_queue_list))
>                 dev->dqm->ops.unregister_process(dev->dqm, &pdd->qpd);
>         return retval;
>  }
> @@ -302,7 +304,8 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
>         kfree(pqn);
>         clear_bit(qid, pqm->queue_slot_bitmap);
>
> -       if (list_empty(&pqm->queues))
> +       if (list_empty(&pdd->qpd.queues_list) &&
> +           list_empty(&pdd->qpd.priv_queue_list))
>                 dqm->ops.unregister_process(dqm, &pdd->qpd);
>
>         return retval;
> --
> 2.7.4
>
This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay at gmail.com>


More information about the amd-gfx mailing list