Re: [PATCH 1/2] drm/panfrost: Enable cycle counting when perfcnt is enabled
From: Adrián Larumbe
Date: Tue Nov 03 2026 - 03:11:45 EST
Hi Boris,
On 16.10.2026 09:23, Boris Brezillon wrote:
> On Thu, 15 Oct 2026 19:22:31 +0100
> Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx> wrote:
>
> > From: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> >
> > 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@xxxxxxxxxxxxx>
>
> Let's make sure this is merged in the same release the perfcnt uAPI
> changes are in, so userspace can check the driver version to know if
> the fix is present or not (we have a workaround in mesa for that which
> we can drop when the fix is in).
Sorry about not having handled this at once, but I think I submitted
this series right before going away for a long while. I think it's been
two days since Linus published 7.4-rc1, so I guess we can still submit
fixes for the Panfrost patches that made it into the merge window. In
that case, would I push the commits into drm-misc-fixes or drm-fixes? I
remember we already dealt with a similar controversy some time ago, and
that there's a flowchart somewhere in the docs for either dim or the DRM
subsystem.
Anyway, I'll post v2 at once and figure out the right branch, although
maybe dim will tell me where it should go.
Cheers,
Adrian
> > ---
> > 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 a9def452d5ef..b26da057a1a0 100644
> > --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> > +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c
> > @@ -17,6 +17,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"
> > @@ -52,6 +53,7 @@ static void panfrost_perfcnt_hw_disable(struct panfrost_device *pfdev)
> > gpu_write(pfdev, GPU_PRFCNT_TILER_EN, 0);
> >
> > if (perfcnt->owns_as_ref) {
> > + panfrost_cycle_counter_put(pfdev);
> > panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
> > perfcnt->owns_as_ref = false;
> > }
> > @@ -84,6 +86,7 @@ static int panfrost_perfcnt_hw_enable(struct panfrost_device *pfdev)
> > return ret;
> >
> > perfcnt->owns_as_ref = true;
> > + panfrost_cycle_counter_get(pfdev);
> >
> > as = ret;
> > cfg = GPU_PERFCNT_CFG_AS(as) |
> >
Adrian Larumbe