Now that the dynamic pwrup reglist has SEL reg values to restore
appended, so that SEL regs are restored on IFPC exit, we can stop
completely disabling IFPC while global counter sampling is active.
To accomplish this, we re-use sysprof_setup() with a force_on param
to inhibit IFPC specifically while the counter regs are being read,
while leaving IFPC enabled the rest of the time.
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Anna Maniscalco <anna.maniscalco2000@gmail.com>
Reviewed-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/728219/
Message-ID: <
20260526145137.160554-17-robin.clark@oss.qualcomm.com>
return irq;
}
-void a6xx_gmu_sysprof_setup(struct msm_gpu *gpu)
+void a6xx_gmu_sysprof_setup(struct msm_gpu *gpu, bool force_on)
{
- bool sysprof = msm_gpu_sysprof_no_ifpc(gpu);
+ bool sysprof = msm_gpu_sysprof_no_ifpc(gpu) || force_on;
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node);
int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node);
void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu);
-void a6xx_gmu_sysprof_setup(struct msm_gpu *gpu);
+void a6xx_gmu_sysprof_setup(struct msm_gpu *gpu, bool force_on);
void a6xx_preempt_init(struct msm_gpu *gpu);
void a6xx_preempt_hw_init(struct msm_gpu *gpu);
* for cmdstream that is buffered in this FIFO upstream of the CP fw.
*/
bool (*progress)(struct msm_gpu *gpu, struct msm_ringbuffer *ring);
- void (*sysprof_setup)(struct msm_gpu *gpu);
+ void (*sysprof_setup)(struct msm_gpu *gpu, bool force_on);
/* Configure perfcntr SELect regs: */
void (*perfcntr_configure)(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
static inline bool
msm_gpu_sysprof_no_ifpc(struct msm_gpu *gpu)
{
- /*
- * For now, this is the same condition as disabling perfcntr clears
- * on context switch. But once kernel perfcntr IFPC support is in
- * place, we will only need to disable IFPC for legacy userspace
- * setting SYSPROF param.
- */
- return msm_gpu_sysprof_no_perfcntr_zap(gpu);
+ return refcount_read(&gpu->sysprof_active) > 1;
}
/*
return;
}
+ /* Inhibit IFPC while accessing registers: */
+ if (gpu->funcs->sysprof_setup)
+ gpu->funcs->sysprof_setup(gpu, true);
+
if (gpu->funcs->perfcntr_flush)
gpu->funcs->perfcntr_flush(gpu);
}
}
+ /* Re-enable IFPC: */
+ if (gpu->funcs->sysprof_setup)
+ gpu->funcs->sysprof_setup(gpu, false);
+
smp_store_release(&stream->fifo.head, head);
wake_up_all(&stream->poll_wq);
}
/* Some gpu families require additional setup for sysprof */
if (gpu->funcs->sysprof_setup)
- gpu->funcs->sysprof_setup(gpu);
+ gpu->funcs->sysprof_setup(gpu, false);
ctx->sysprof = sysprof;