public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Mary Guillemard <mary.guillemard@collabora.com>,
	linux-kernel@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org,
	Boris Brezillon <boris.brezillon@collabora.com>,
	Christopher Healy <healych@amazon.com>,
	kernel@collabora.com, Liviu Dudau <liviu.dudau@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH 1/2] drm/panthor: Add csg_priority to panthor_group
Date: Mon, 23 Sep 2024 10:51:48 +0100	[thread overview]
Message-ID: <537f5ff6-deb7-404a-8159-e544e5701ff3@arm.com> (raw)
In-Reply-To: <20240918085056.24422-3-mary.guillemard@collabora.com>

On 18/09/2024 09:50, Mary Guillemard wrote:
> Keep track of the csg priority in panthor_group when the group is
> scheduled/active.
> 
> This is useful to know the actual priority in use in the firmware
> group slot.
> 
> Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
> ---
>  drivers/gpu/drm/panthor/panthor_sched.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 86908ada7335..f15abeef4ece 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -574,6 +574,13 @@ struct panthor_group {
>  	 */
>  	int csg_id;
>  
> +	/**
> +	 * @csg_id: Priority of the FW group slot.

kerneldoc name is wrong: s/csg_id/csg_priority/

Otherwise this looks reasonable, but see my reply to the second patch.

Thanks,
Steve

> +	 *
> +	 * -1 when the group is not scheduled/active.
> +	 */
> +	int csg_priority;
> +
>  	/**
>  	 * @destroyed: True when the group has been destroyed.
>  	 *
> @@ -894,11 +901,12 @@ group_get(struct panthor_group *group)
>   * group_bind_locked() - Bind a group to a group slot
>   * @group: Group.
>   * @csg_id: Slot.
> + * @csg_priority: Priority of the slot.
>   *
>   * Return: 0 on success, a negative error code otherwise.
>   */
>  static int
> -group_bind_locked(struct panthor_group *group, u32 csg_id)
> +group_bind_locked(struct panthor_group *group, u32 csg_id, u32 csg_priority)
>  {
>  	struct panthor_device *ptdev = group->ptdev;
>  	struct panthor_csg_slot *csg_slot;
> @@ -917,6 +925,7 @@ group_bind_locked(struct panthor_group *group, u32 csg_id)
>  	csg_slot = &ptdev->scheduler->csg_slots[csg_id];
>  	group_get(group);
>  	group->csg_id = csg_id;
> +	group->csg_priority = csg_priority;
>  
>  	/* Dummy doorbell allocation: doorbell is assigned to the group and
>  	 * all queues use the same doorbell.
> @@ -956,6 +965,7 @@ group_unbind_locked(struct panthor_group *group)
>  	slot = &ptdev->scheduler->csg_slots[group->csg_id];
>  	panthor_vm_idle(group->vm);
>  	group->csg_id = -1;
> +	group->csg_priority = -1;
>  
>  	/* Tiler OOM events will be re-issued next time the group is scheduled. */
>  	atomic_set(&group->tiler_oom, 0);
> @@ -2193,8 +2203,9 @@ tick_ctx_apply(struct panthor_scheduler *sched, struct panthor_sched_tick_ctx *c
>  
>  			csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id);
>  			csg_slot = &sched->csg_slots[csg_id];
> -			group_bind_locked(group, csg_id);
> -			csg_slot_prog_locked(ptdev, csg_id, new_csg_prio--);
> +			group_bind_locked(group, csg_id, new_csg_prio);
> +			csg_slot_prog_locked(ptdev, csg_id, new_csg_prio);
> +			new_csg_prio--;
>  			csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id,
>  						group->state == PANTHOR_CS_GROUP_SUSPENDED ?
>  						CSG_STATE_RESUME : CSG_STATE_START,
> @@ -3111,6 +3122,7 @@ int panthor_group_create(struct panthor_file *pfile,
>  	kref_init(&group->refcount);
>  	group->state = PANTHOR_CS_GROUP_CREATED;
>  	group->csg_id = -1;
> +	group->csg_priority = -1;
>  
>  	group->ptdev = ptdev;
>  	group->max_compute_cores = group_args->max_compute_cores;


  parent reply	other threads:[~2024-09-23  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  8:50 [PATCH 0/2] drm/panthor: Expose scheduler groups info in debugfs Mary Guillemard
2024-09-18  8:50 ` [PATCH 1/2] drm/panthor: Add csg_priority to panthor_group Mary Guillemard
2024-09-21 16:57   ` kernel test robot
2024-09-23  9:51   ` Steven Price [this message]
2024-09-18  8:50 ` [PATCH 2/2] drm/panthor: Expose scheduler groups info in debugfs Mary Guillemard
2024-09-23  9:51   ` Steven Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537f5ff6-deb7-404a-8159-e544e5701ff3@arm.com \
    --to=steven.price@arm.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=healych@amazon.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mary.guillemard@collabora.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox