Skip to content

Commit 2e6ea5a

Browse files
mairacanalmehmetb0
authored andcommitted
drm/v3d: Enable Performance Counters before clearing them
BugLink: https://bugs.launchpad.net/bugs/2095283 [ Upstream commit c98b104 ] On the Raspberry Pi 5, performance counters are not being cleared when `v3d_perfmon_start()` is called, even though we write to the CLR register. As a result, their values accumulate until they overflow. The expected behavior is for performance counters to reset to zero at the start of a job. When the job finishes and the perfmon is stopped, the counters should accurately reflect the values for that specific job. To ensure this behavior, the performance counters are now enabled before being cleared. This allows the CLR register to function as intended, zeroing the counter values when the job begins. Fixes: 26a4dc2 ("drm/v3d: Expose performance counters to userspace") Signed-off-by: Maíra Canal <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent 00fac23 commit 2e6ea5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/v3d/v3d_perfmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ void v3d_perfmon_start(struct v3d_dev *v3d, struct v3d_perfmon *perfmon)
4949
V3D_CORE_WRITE(0, V3D_V4_PCTR_0_SRC_X(source), channel);
5050
}
5151

52+
V3D_CORE_WRITE(0, V3D_V4_PCTR_0_EN, mask);
5253
V3D_CORE_WRITE(0, V3D_V4_PCTR_0_CLR, mask);
5354
V3D_CORE_WRITE(0, V3D_PCTR_0_OVERFLOW, mask);
54-
V3D_CORE_WRITE(0, V3D_V4_PCTR_0_EN, mask);
5555

5656
v3d->active_perfmon = perfmon;
5757
}

0 commit comments

Comments
 (0)