All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
@ 2017-11-24 23:10 Yong Zhao
       [not found] ` <1511565054-25530-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Yong Zhao @ 2017-11-24 23:10 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w
  Cc: Yong Zhao

Signed-off-by: Yong Zhao <yong.zhao@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 13 +++----------
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  6 ++----
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 8447810..81ec7bb 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -149,8 +149,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
 
 static int create_queue_nocpsch(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocated_vmid)
+				struct qcm_process_device *qpd)
 {
 	int retval;
 
@@ -170,7 +169,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		if (retval)
 			goto out_unlock;
 	}
-	*allocated_vmid = qpd->vmid;
 	q->properties.vmid = qpd->vmid;
 
 	q->properties.tba_addr = qpd->tba_addr;
@@ -184,10 +182,8 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		retval = -EINVAL;
 
 	if (retval) {
-		if (list_empty(&qpd->queues_list)) {
+		if (list_empty(&qpd->queues_list))
 			deallocate_vmid(dqm, qpd, q);
-			*allocated_vmid = 0;
-		}
 		goto out_unlock;
 	}
 
@@ -812,16 +808,13 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
 }
 
 static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
-			struct qcm_process_device *qpd, int *allocate_vmid)
+			struct qcm_process_device *qpd)
 {
 	int retval;
 	struct mqd_manager *mqd;
 
 	retval = 0;
 
-	if (allocate_vmid)
-		*allocate_vmid = 0;
-
 	mutex_lock(&dqm->lock);
 
 	if (dqm->total_queue_count >= max_num_of_queues_per_device) {
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
index 8752edf..c61b693 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
@@ -84,8 +84,7 @@ struct device_process_node {
 struct device_queue_manager_ops {
 	int	(*create_queue)(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocate_vmid);
+				struct qcm_process_device *qpd);
 
 	int	(*destroy_queue)(struct device_queue_manager *dqm,
 				struct qcm_process_device *qpd,
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 eeb7726..fbfa274 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -201,8 +201,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
 			goto err_create_queue;
 		pqn->q = q;
 		pqn->kq = NULL;
-		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
-						&q->properties.vmid);
+		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
 		pr_debug("DQM returned %d for create_queue\n", retval);
 		print_queue(q);
 		break;
@@ -222,8 +221,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
 			goto err_create_queue;
 		pqn->q = q;
 		pqn->kq = NULL;
-		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
-						&q->properties.vmid);
+		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
 		pr_debug("DQM returned %d for create_queue\n", retval);
 		print_queue(q);
 		break;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
       [not found] ` <1511565054-25530-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
@ 2017-11-30 15:54   ` Oded Gabbay
  0 siblings, 0 replies; 7+ messages in thread
From: Oded Gabbay @ 2017-11-30 15:54 UTC (permalink / raw)
  To: Yong Zhao; +Cc: amd-gfx list

On Wed, Sep 27, 2017 at 7:09 AM, Felix Kuehling <Felix.Kuehling@amd.com> wrote:
> From: shaoyunl <Shaoyun.Liu@amd.com>
>
> HWS does not support over-subscription and the scheduler can not internally
> modify the engine. Driver needs to program the correct engine ID.
>
> Fix the queue and engine selection to create queues on alternating SDMA
> engines. This allows concurrent bi-directional DMA transfers in a process
> that creates two SDMA queues.
>
> Signed-off-by: shaoyun liu <shaoyun.liu@amd.com>
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
>  .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 29 +++++++++++-----------
>  drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c    |  2 +-
>  2 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index a7455db..64878b9 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -621,8 +621,8 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm,
>         if (retval)
>                 return retval;
>
> -       q->properties.sdma_queue_id = q->sdma_id % CIK_SDMA_QUEUES_PER_ENGINE;
> -       q->properties.sdma_engine_id = q->sdma_id / CIK_SDMA_ENGINE_NUM;
> +       q->properties.sdma_queue_id = q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;
> +       q->properties.sdma_engine_id = q->sdma_id % CIK_SDMA_QUEUES_PER_ENGINE;
>
>         pr_debug("SDMA id is:    %d\n", q->sdma_id);
>         pr_debug("SDMA queue id: %d\n", q->properties.sdma_queue_id);
> @@ -704,6 +704,7 @@ static int initialize_cpsch(struct device_queue_manager *dqm)
>         dqm->queue_count = dqm->processes_count = 0;
>         dqm->sdma_queue_count = 0;
>         dqm->active_runlist = false;
> +       dqm->sdma_bitmap = (1 << CIK_SDMA_QUEUES) - 1;
>         retval = dqm->ops_asic_specific.initialize(dqm);
>         if (retval)
>                 mutex_destroy(&dqm->lock);
> @@ -811,14 +812,6 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
>         mutex_unlock(&dqm->lock);
>  }
>
> -static void select_sdma_engine_id(struct queue *q)
> -{
> -       static int sdma_id;
> -
> -       q->sdma_id = sdma_id;
> -       sdma_id = (sdma_id + 1) % 2;
> -}
> -
>  static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
>                         struct qcm_process_device *qpd, int *allocate_vmid)
>  {
> @@ -839,9 +832,15 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
>                 goto out;
>         }
>
> -       if (q->properties.type == KFD_QUEUE_TYPE_SDMA)
> -               select_sdma_engine_id(q);
> -
> +       if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
> +               retval = allocate_sdma_queue(dqm, &q->sdma_id);
> +               if (retval != 0)
> +                       goto out;
> +               q->properties.sdma_queue_id =
> +                       q->sdma_id / CIK_SDMA_QUEUES_PER_ENGINE;
> +               q->properties.sdma_engine_id =
> +                       q->sdma_id % CIK_SDMA_QUEUES_PER_ENGINE;
> +       }
>         mqd = dqm->ops.get_mqd_manager(dqm,
>                         get_mqd_type_from_queue_type(q->properties.type));
>
> @@ -1015,8 +1014,10 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
>                 goto failed;
>         }
>
> -       if (q->properties.type == KFD_QUEUE_TYPE_SDMA)
> +       if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
>                 dqm->sdma_queue_count--;
> +               deallocate_sdma_queue(dqm, q->sdma_id);
> +       }
>
>         list_del(&q->list);
>         qpd->queue_count--;
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> index 5d1770e..16da8ad 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
> @@ -203,7 +203,7 @@ static int pm_create_map_queue(struct packet_manager *pm, uint32_t *buffer,
>                         queue_type__mes_map_queues__debug_interface_queue_vi;
>                 break;
>         case KFD_QUEUE_TYPE_SDMA:
> -               packet->bitfields2.engine_sel =
> +               packet->bitfields2.engine_sel = q->properties.sdma_engine_id +
>                                 engine_sel__mes_map_queues__sdma0_vi;
>                 use_static = false; /* no static queues under SDMA */
>                 break;
> --
> 2.7.4
>

Applied to -next
Thanks,
Oded


On Sat, Nov 25, 2017 at 1:10 AM, Yong Zhao <yong.zhao@amd.com> wrote:
> Signed-off-by: Yong Zhao <yong.zhao@amd.com>
> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 13 +++----------
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
>  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  6 ++----
>  3 files changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 8447810..81ec7bb 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -149,8 +149,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
>
>  static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                                 struct queue *q,
> -                               struct qcm_process_device *qpd,
> -                               int *allocated_vmid)
> +                               struct qcm_process_device *qpd)
>  {
>         int retval;
>
> @@ -170,7 +169,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                 if (retval)
>                         goto out_unlock;
>         }
> -       *allocated_vmid = qpd->vmid;
>         q->properties.vmid = qpd->vmid;
>
>         q->properties.tba_addr = qpd->tba_addr;
> @@ -184,10 +182,8 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                 retval = -EINVAL;
>
>         if (retval) {
> -               if (list_empty(&qpd->queues_list)) {
> +               if (list_empty(&qpd->queues_list))
>                         deallocate_vmid(dqm, qpd, q);
> -                       *allocated_vmid = 0;
> -               }
>                 goto out_unlock;
>         }
>
> @@ -812,16 +808,13 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
>  }
>
>  static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
> -                       struct qcm_process_device *qpd, int *allocate_vmid)
> +                       struct qcm_process_device *qpd)
>  {
>         int retval;
>         struct mqd_manager *mqd;
>
>         retval = 0;
>
> -       if (allocate_vmid)
> -               *allocate_vmid = 0;
> -
>         mutex_lock(&dqm->lock);
>
>         if (dqm->total_queue_count >= max_num_of_queues_per_device) {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> index 8752edf..c61b693 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> @@ -84,8 +84,7 @@ struct device_process_node {
>  struct device_queue_manager_ops {
>         int     (*create_queue)(struct device_queue_manager *dqm,
>                                 struct queue *q,
> -                               struct qcm_process_device *qpd,
> -                               int *allocate_vmid);
> +                               struct qcm_process_device *qpd);
>
>         int     (*destroy_queue)(struct device_queue_manager *dqm,
>                                 struct qcm_process_device *qpd,
> 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 eeb7726..fbfa274 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -201,8 +201,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>                         goto err_create_queue;
>                 pqn->q = q;
>                 pqn->kq = NULL;
> -               retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
> -                                               &q->properties.vmid);
> +               retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
>                 pr_debug("DQM returned %d for create_queue\n", retval);
>                 print_queue(q);
>                 break;
> @@ -222,8 +221,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>                         goto err_create_queue;
>                 pqn->q = q;
>                 pqn->kq = NULL;
> -               retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
> -                                               &q->properties.vmid);
> +               retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
>                 pr_debug("DQM returned %d for create_queue\n", retval);
>                 print_queue(q);
>                 break;
> --
> 2.7.4
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
       [not found]     ` <bf0d440f-b554-b366-afe2-7d237fdc1833-5C7GfCeVMHo@public.gmane.org>
  2017-11-24 22:17       ` Zhao, Yong
@ 2017-11-30 15:26       ` Oded Gabbay
  1 sibling, 0 replies; 7+ messages in thread
From: Oded Gabbay @ 2017-11-30 15:26 UTC (permalink / raw)
  To: Felix Kuehling; +Cc: Yong Zhao, amd-gfx list

On Fri, Nov 24, 2017 at 11:44 PM, Felix Kuehling <felix.kuehling@amd.com> wrote:
>
> Hi Oded,
>
> Yong made this patch against our internal KFD branch. I asked him to
> send it to upstream as well, since it applies to code I have already
> upstreamed. I'm going to do this for more patches in the future as more
> KFD code is upstream and more of our internal changes are applicable
> upstream directly.
>
> Is this OK with you, or do you prefer getting all patches through me, in
> roughly bi-weekly batches as part of my on-going upstreaming effort?

Both ways are perfectly fine with me. Whatever works for you guys.

Oded

>
> Hi Yong,
>
> Which branch is this patch against? For upstream KFD commits, they
> should be applied against amdkfd-next on
> git://people.freedesktop.org/~gabbayo/linux. Oded will apply the patch
> if he accepts it, so you only need read access to this repository.
>
> Also, please remove the Change-Id from the commit message. It is
> meaningless for upstream submissions outside of our Gerrit server.
>
> Other than that, this patch is Reviewed-by: Felix Kuehling <Felix
> Kuehling@amd.com>
>
> Regards,
>   Felix
>
>
> On 2017-11-24 03:57 PM, Yong Zhao wrote:
> > Change-Id: Ia5c74ad567c30e206ed804b204fdf8a0f8a75a19
> > Signed-off-by: Yong Zhao <yong.zhao@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 14 ++++----------
> >  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
> >  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  3 +--
> >  3 files changed, 6 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> > index 53a66e8..1df1123 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> > @@ -144,8 +144,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
> >
> >  static int create_queue_nocpsch(struct device_queue_manager *dqm,
> >                               struct queue *q,
> > -                             struct qcm_process_device *qpd,
> > -                             int *allocated_vmid)
> > +                             struct qcm_process_device *qpd)
> >  {
> >       int retval;
> >
> > @@ -165,7 +164,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
> >               if (retval)
> >                       goto out_unlock;
> >       }
> > -     *allocated_vmid = qpd->vmid;
> >       q->properties.vmid = qpd->vmid;
> >
> >       if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE)
> > @@ -176,10 +174,9 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
> >               retval = -EINVAL;
> >
> >       if (retval) {
> > -             if (list_empty(&qpd->queues_list)) {
> > +             if (list_empty(&qpd->queues_list))
> >                       deallocate_vmid(dqm, qpd, q);
> > -                     *allocated_vmid = 0;
> > -             }
> > +
> >               goto out_unlock;
> >       }
> >
> > @@ -788,16 +785,13 @@ static void select_sdma_engine_id(struct queue *q)
> >  }
> >
> >  static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
> > -                     struct qcm_process_device *qpd, int *allocate_vmid)
> > +                     struct qcm_process_device *qpd)
> >  {
> >       int retval;
> >       struct mqd_manager *mqd;
> >
> >       retval = 0;
> >
> > -     if (allocate_vmid)
> > -             *allocate_vmid = 0;
> > -
> >       mutex_lock(&dqm->lock);
> >
> >       if (dqm->total_queue_count >= max_num_of_queues_per_device) {
> > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> > index faf820a..449407a 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> > @@ -84,8 +84,7 @@ struct device_process_node {
> >  struct device_queue_manager_ops {
> >       int     (*create_queue)(struct device_queue_manager *dqm,
> >                               struct queue *q,
> > -                             struct qcm_process_device *qpd,
> > -                             int *allocate_vmid);
> > +                             struct qcm_process_device *qpd);
> >
> >       int     (*destroy_queue)(struct device_queue_manager *dqm,
> >                               struct qcm_process_device *qpd,
> > 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 03bec76..1e7bcae 100644
> > --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> > @@ -199,8 +199,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
> >                       goto err_create_queue;
> >               pqn->q = q;
> >               pqn->kq = NULL;
> > -             retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
> > -                                             &q->properties.vmid);
> > +             retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
> >               pr_debug("DQM returned %d for create_queue\n", retval);
> >               print_queue(q);
> >               break;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
       [not found]     ` <bf0d440f-b554-b366-afe2-7d237fdc1833-5C7GfCeVMHo@public.gmane.org>
@ 2017-11-24 22:17       ` Zhao, Yong
  2017-11-30 15:26       ` Oded Gabbay
  1 sibling, 0 replies; 7+ messages in thread
From: Zhao, Yong @ 2017-11-24 22:17 UTC (permalink / raw)
  To: Kuehling, Felix, oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 5604 bytes --]

I based it on amd-staging-drm-next. I will pull from amdkfd-next, remove Change-Id from and add you in commit message.


Regards,

Yong

________________________________
From: Kuehling, Felix
Sent: Friday, November 24, 2017 4:44:48 PM
To: Zhao, Yong; oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer

Hi Oded,

Yong made this patch against our internal KFD branch. I asked him to
send it to upstream as well, since it applies to code I have already
upstreamed. I'm going to do this for more patches in the future as more
KFD code is upstream and more of our internal changes are applicable
upstream directly.

Is this OK with you, or do you prefer getting all patches through me, in
roughly bi-weekly batches as part of my on-going upstreaming effort?

Hi Yong,

Which branch is this patch against? For upstream KFD commits, they
should be applied against amdkfd-next on
git://people.freedesktop.org/~gabbayo/linux. Oded will apply the patch
if he accepts it, so you only need read access to this repository.

Also, please remove the Change-Id from the commit message. It is
meaningless for upstream submissions outside of our Gerrit server.

Other than that, this patch is Reviewed-by: Felix Kuehling <Felix
Kuehling-5C7GfCeVMHo@public.gmane.org>

Regards,
  Felix


On 2017-11-24 03:57 PM, Yong Zhao wrote:
> Change-Id: Ia5c74ad567c30e206ed804b204fdf8a0f8a75a19
> Signed-off-by: Yong Zhao <yong.zhao-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 14 ++++----------
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
>  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  3 +--
>  3 files changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 53a66e8..1df1123 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -144,8 +144,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
>
>  static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                                struct queue *q,
> -                             struct qcm_process_device *qpd,
> -                             int *allocated_vmid)
> +                             struct qcm_process_device *qpd)
>  {
>        int retval;
>
> @@ -165,7 +164,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                if (retval)
>                        goto out_unlock;
>        }
> -     *allocated_vmid = qpd->vmid;
>        q->properties.vmid = qpd->vmid;
>
>        if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE)
> @@ -176,10 +174,9 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>                retval = -EINVAL;
>
>        if (retval) {
> -             if (list_empty(&qpd->queues_list)) {
> +             if (list_empty(&qpd->queues_list))
>                        deallocate_vmid(dqm, qpd, q);
> -                     *allocated_vmid = 0;
> -             }
> +
>                goto out_unlock;
>        }
>
> @@ -788,16 +785,13 @@ static void select_sdma_engine_id(struct queue *q)
>  }
>
>  static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
> -                     struct qcm_process_device *qpd, int *allocate_vmid)
> +                     struct qcm_process_device *qpd)
>  {
>        int retval;
>        struct mqd_manager *mqd;
>
>        retval = 0;
>
> -     if (allocate_vmid)
> -             *allocate_vmid = 0;
> -
>        mutex_lock(&dqm->lock);
>
>        if (dqm->total_queue_count >= max_num_of_queues_per_device) {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> index faf820a..449407a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> @@ -84,8 +84,7 @@ struct device_process_node {
>  struct device_queue_manager_ops {
>        int     (*create_queue)(struct device_queue_manager *dqm,
>                                struct queue *q,
> -                             struct qcm_process_device *qpd,
> -                             int *allocate_vmid);
> +                             struct qcm_process_device *qpd);
>
>        int     (*destroy_queue)(struct device_queue_manager *dqm,
>                                struct qcm_process_device *qpd,
> 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 03bec76..1e7bcae 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -199,8 +199,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>                        goto err_create_queue;
>                pqn->q = q;
>                pqn->kq = NULL;
> -             retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
> -                                             &q->properties.vmid);
> +             retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
>                pr_debug("DQM returned %d for create_queue\n", retval);
>                print_queue(q);
>                break;


[-- Attachment #1.2: Type: text/html, Size: 11551 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
       [not found] ` <1511557060-3552-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
@ 2017-11-24 21:44   ` Felix Kuehling
       [not found]     ` <bf0d440f-b554-b366-afe2-7d237fdc1833-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Felix Kuehling @ 2017-11-24 21:44 UTC (permalink / raw)
  To: Yong Zhao, oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Oded,

Yong made this patch against our internal KFD branch. I asked him to
send it to upstream as well, since it applies to code I have already
upstreamed. I'm going to do this for more patches in the future as more
KFD code is upstream and more of our internal changes are applicable
upstream directly.

Is this OK with you, or do you prefer getting all patches through me, in
roughly bi-weekly batches as part of my on-going upstreaming effort?

Hi Yong,

Which branch is this patch against? For upstream KFD commits, they
should be applied against amdkfd-next on
git://people.freedesktop.org/~gabbayo/linux. Oded will apply the patch
if he accepts it, so you only need read access to this repository.

Also, please remove the Change-Id from the commit message. It is
meaningless for upstream submissions outside of our Gerrit server.

Other than that, this patch is Reviewed-by: Felix Kuehling <Felix
Kuehling@amd.com>

Regards,
  Felix


On 2017-11-24 03:57 PM, Yong Zhao wrote:
> Change-Id: Ia5c74ad567c30e206ed804b204fdf8a0f8a75a19
> Signed-off-by: Yong Zhao <yong.zhao@amd.com>
> ---
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 14 ++++----------
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
>  drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  3 +--
>  3 files changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 53a66e8..1df1123 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -144,8 +144,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
>  
>  static int create_queue_nocpsch(struct device_queue_manager *dqm,
>  				struct queue *q,
> -				struct qcm_process_device *qpd,
> -				int *allocated_vmid)
> +				struct qcm_process_device *qpd)
>  {
>  	int retval;
>  
> @@ -165,7 +164,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>  		if (retval)
>  			goto out_unlock;
>  	}
> -	*allocated_vmid = qpd->vmid;
>  	q->properties.vmid = qpd->vmid;
>  
>  	if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE)
> @@ -176,10 +174,9 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
>  		retval = -EINVAL;
>  
>  	if (retval) {
> -		if (list_empty(&qpd->queues_list)) {
> +		if (list_empty(&qpd->queues_list))
>  			deallocate_vmid(dqm, qpd, q);
> -			*allocated_vmid = 0;
> -		}
> +
>  		goto out_unlock;
>  	}
>  
> @@ -788,16 +785,13 @@ static void select_sdma_engine_id(struct queue *q)
>  }
>  
>  static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
> -			struct qcm_process_device *qpd, int *allocate_vmid)
> +			struct qcm_process_device *qpd)
>  {
>  	int retval;
>  	struct mqd_manager *mqd;
>  
>  	retval = 0;
>  
> -	if (allocate_vmid)
> -		*allocate_vmid = 0;
> -
>  	mutex_lock(&dqm->lock);
>  
>  	if (dqm->total_queue_count >= max_num_of_queues_per_device) {
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> index faf820a..449407a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
> @@ -84,8 +84,7 @@ struct device_process_node {
>  struct device_queue_manager_ops {
>  	int	(*create_queue)(struct device_queue_manager *dqm,
>  				struct queue *q,
> -				struct qcm_process_device *qpd,
> -				int *allocate_vmid);
> +				struct qcm_process_device *qpd);
>  
>  	int	(*destroy_queue)(struct device_queue_manager *dqm,
>  				struct qcm_process_device *qpd,
> 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 03bec76..1e7bcae 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
> @@ -199,8 +199,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
>  			goto err_create_queue;
>  		pqn->q = q;
>  		pqn->kq = NULL;
> -		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
> -						&q->properties.vmid);
> +		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
>  		pr_debug("DQM returned %d for create_queue\n", retval);
>  		print_queue(q);
>  		break;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
@ 2017-11-24 20:57 Yong Zhao
       [not found] ` <1511557060-3552-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Yong Zhao @ 2017-11-24 20:57 UTC (permalink / raw)
  To: oded.gabbay-Re5JQEeQqe8AvxtiuMwx3w,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Yong Zhao

Change-Id: Ia5c74ad567c30e206ed804b204fdf8a0f8a75a19
Signed-off-by: Yong Zhao <yong.zhao@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 14 ++++----------
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  3 +--
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 53a66e8..1df1123 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -144,8 +144,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
 
 static int create_queue_nocpsch(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocated_vmid)
+				struct qcm_process_device *qpd)
 {
 	int retval;
 
@@ -165,7 +164,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		if (retval)
 			goto out_unlock;
 	}
-	*allocated_vmid = qpd->vmid;
 	q->properties.vmid = qpd->vmid;
 
 	if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE)
@@ -176,10 +174,9 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		retval = -EINVAL;
 
 	if (retval) {
-		if (list_empty(&qpd->queues_list)) {
+		if (list_empty(&qpd->queues_list))
 			deallocate_vmid(dqm, qpd, q);
-			*allocated_vmid = 0;
-		}
+
 		goto out_unlock;
 	}
 
@@ -788,16 +785,13 @@ static void select_sdma_engine_id(struct queue *q)
 }
 
 static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
-			struct qcm_process_device *qpd, int *allocate_vmid)
+			struct qcm_process_device *qpd)
 {
 	int retval;
 	struct mqd_manager *mqd;
 
 	retval = 0;
 
-	if (allocate_vmid)
-		*allocate_vmid = 0;
-
 	mutex_lock(&dqm->lock);
 
 	if (dqm->total_queue_count >= max_num_of_queues_per_device) {
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
index faf820a..449407a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
@@ -84,8 +84,7 @@ struct device_process_node {
 struct device_queue_manager_ops {
 	int	(*create_queue)(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocate_vmid);
+				struct qcm_process_device *qpd);
 
 	int	(*destroy_queue)(struct device_queue_manager *dqm,
 				struct qcm_process_device *qpd,
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 03bec76..1e7bcae 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -199,8 +199,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
 			goto err_create_queue;
 		pqn->q = q;
 		pqn->kq = NULL;
-		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
-						&q->properties.vmid);
+		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
 		pr_debug("DQM returned %d for create_queue\n", retval);
 		print_queue(q);
 		break;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer
@ 2017-11-24 20:56 Yong Zhao
  0 siblings, 0 replies; 7+ messages in thread
From: Yong Zhao @ 2017-11-24 20:56 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Yong Zhao

Change-Id: Ia5c74ad567c30e206ed804b204fdf8a0f8a75a19
Signed-off-by: Yong Zhao <yong.zhao@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 14 ++++----------
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  3 +--
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c |  3 +--
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 53a66e8..1df1123 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -144,8 +144,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
 
 static int create_queue_nocpsch(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocated_vmid)
+				struct qcm_process_device *qpd)
 {
 	int retval;
 
@@ -165,7 +164,6 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		if (retval)
 			goto out_unlock;
 	}
-	*allocated_vmid = qpd->vmid;
 	q->properties.vmid = qpd->vmid;
 
 	if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE)
@@ -176,10 +174,9 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
 		retval = -EINVAL;
 
 	if (retval) {
-		if (list_empty(&qpd->queues_list)) {
+		if (list_empty(&qpd->queues_list))
 			deallocate_vmid(dqm, qpd, q);
-			*allocated_vmid = 0;
-		}
+
 		goto out_unlock;
 	}
 
@@ -788,16 +785,13 @@ static void select_sdma_engine_id(struct queue *q)
 }
 
 static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
-			struct qcm_process_device *qpd, int *allocate_vmid)
+			struct qcm_process_device *qpd)
 {
 	int retval;
 	struct mqd_manager *mqd;
 
 	retval = 0;
 
-	if (allocate_vmid)
-		*allocate_vmid = 0;
-
 	mutex_lock(&dqm->lock);
 
 	if (dqm->total_queue_count >= max_num_of_queues_per_device) {
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
index faf820a..449407a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
@@ -84,8 +84,7 @@ struct device_process_node {
 struct device_queue_manager_ops {
 	int	(*create_queue)(struct device_queue_manager *dqm,
 				struct queue *q,
-				struct qcm_process_device *qpd,
-				int *allocate_vmid);
+				struct qcm_process_device *qpd);
 
 	int	(*destroy_queue)(struct device_queue_manager *dqm,
 				struct qcm_process_device *qpd,
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 03bec76..1e7bcae 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -199,8 +199,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
 			goto err_create_queue;
 		pqn->q = q;
 		pqn->kq = NULL;
-		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd,
-						&q->properties.vmid);
+		retval = dev->dqm->ops.create_queue(dev->dqm, q, &pdd->qpd);
 		pr_debug("DQM returned %d for create_queue\n", retval);
 		print_queue(q);
 		break;
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-30 15:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 23:10 [PATCH] drm/amdkfd: Delete a useless parameter from create_queue function pointer Yong Zhao
     [not found] ` <1511565054-25530-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
2017-11-30 15:54   ` Oded Gabbay
  -- strict thread matches above, loose matches on Subject: below --
2017-11-24 20:57 Yong Zhao
     [not found] ` <1511557060-3552-1-git-send-email-yong.zhao-5C7GfCeVMHo@public.gmane.org>
2017-11-24 21:44   ` Felix Kuehling
     [not found]     ` <bf0d440f-b554-b366-afe2-7d237fdc1833-5C7GfCeVMHo@public.gmane.org>
2017-11-24 22:17       ` Zhao, Yong
2017-11-30 15:26       ` Oded Gabbay
2017-11-24 20:56 Yong Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.