From 9373cdddb569e43e6cffbba6094db734ff7c59f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Larumbe?= Date: Mon, 12 Oct 2026 15:48:05 +0100 Subject: [PATCH] drm/panfrost: Avoid cache flush after perfcnt sample in fully coherent systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the GPU and CPU are fully coherent, then there's no need to flush the GPU caches after a perfcnt sample is made available. Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patch.msgid.link/20261012-claude-fixes-v15-13-bc0a6c498553@collabora.com Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c index ffc77121070e..b3f71d7fd82a 100644 --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c @@ -52,7 +52,10 @@ void panfrost_perfcnt_clean_cache_done(struct panfrost_device *pfdev) void panfrost_perfcnt_sample_done(struct panfrost_device *pfdev) { - gpu_write(pfdev, GPU_CMD, GPU_CMD_CLEAN_CACHES); + if (pfdev->features.selected_coherency != COHERENCY_ACE) + gpu_write(pfdev, GPU_CMD, GPU_CMD_CLEAN_CACHES); + else + complete(&pfdev->perfcnt->dump_comp); } static int panfrost_perfcnt_dump_locked(struct panfrost_device *pfdev)