mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: "Rob Herring" <robh@kernel.org>,
	"Steven Price" <steven.price@arm.com>,
	"Adrián Larumbe" <adrian.larumbe@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/panfrost: Enable cycle counting when perfcnt is enabled
Date: Wed, 17 Jun 2026 17:06:24 +0200	[thread overview]
Message-ID: <20260617170624.344e6924@fedora-2.home> (raw)
In-Reply-To: <20260617-panfrost-perfcnt-timestamp-fix-v1-1-f215f44b55c0@collabora.com>

On Wed, 17 Jun 2026 16:29:46 +0200
Boris Brezillon <boris.brezillon@collabora.com> wrote:

> If we don't do that, we end up with invalid timestamps in the
> block headers.
> 
> Fixes: 7786fd108777 ("drm/panfrost: Expose performance counters through unstable ioctls")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
> Found while reworking the userside of the perfcnt logic.
> Up until now, we were not using the GPU timestamps in the dumps,
> but this is going to change, so we need that fix in, and
> backported to all stable releases, ideally.
> ---
>  drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> index 7020c0192e18..63861b4c7d95 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> @@ -15,6 +15,7 @@
>  #include "panfrost_device.h"
>  #include "panfrost_features.h"
>  #include "panfrost_gem.h"
> +#include "panfrost_gpu.h"
>  #include "panfrost_issues.h"
>  #include "panfrost_job.h"
>  #include "panfrost_mmu.h"
> @@ -166,6 +167,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev,
>  	/* The BO ref is retained by the mapping. */
>  	drm_gem_object_put(&bo->base);
>  
> +	panfrost_cycle_counter_get(pfdev);

As shashiko pointed out, the reset logic messes up with the
cycle_counter refcounting. Adrian, I believe this is something we can
address as part of the perfcnt fixes series you're working on (pre/post
reset hooks for perfcnt so we can release/reacquire resources properly).

>  	perfcnt->user = user;
>  
>  	return 0;
> @@ -207,6 +209,7 @@ static int panfrost_perfcnt_disable_locked(struct panfrost_device *pfdev,
>  	panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
>  	panfrost_gem_mapping_put(perfcnt->mapping);
>  	perfcnt->mapping = NULL;
> +	panfrost_cycle_counter_put(pfdev);
>  	pm_runtime_put_autosuspend(pfdev->base.dev);
>  
>  	return 0;
> 
> ---
> base-commit: 7caf2a2351d4053075670ff3e26a6815da0a9e1e
> change-id: 20260617-panfrost-perfcnt-timestamp-fix-51e04002f494
> 
> Best regards,


      reply	other threads:[~2026-06-17 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 14:29 Boris Brezillon
2026-06-17 15:06 ` Boris Brezillon [this message]

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=20260617170624.344e6924@fedora-2.home \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --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

all inboxes | Powered by JetHome®