dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/v3d: Skip perfmon serialization when it cannot be observed
@ 2026-09-21 21:24 Maíra Canal
  2026-09-21 21:24 ` [PATCH 1/2] drm/v3d: Skip perfmon serialization while the device has no perfmon Maíra Canal
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Maíra Canal @ 2026-09-21 21:24 UTC (permalink / raw)
  To: Melissa Wen, Iago Toral, David Airlie, Simona Vetter
  Cc: kernel-dev, dri-devel, Maíra Canal

The V3D core has a single set of performance counters. So that a perfmon
only counts the jobs it is attached to, a job carrying a non-global
perfmon waits for every job still in flight, and while it is in flight
every later job waits for it. Knowing what is in flight requires every
job to merge its finished fence into a per-queue accumulator.

That accumulator is maintained unconditionally, so a client pays a fence
merge on every job even when no dependency can ever be built out of it.
This series turns the bookkeeping off in the two cases where that holds:

  1. No perfmon is alive on the device, which is the common case since
     perfmons only exist while userspace runs a performance query;

  2. A global perfmon is set and the job carries no perfmon of its own.
     A global perfmon counts concurrent activity from every job, so
     nothing has to wait. Jobs carrying their own perfmon stay tracked,
     since the global perfmon may be cleared before they run and only
     one of them can be programmed in the HW at a time.

Both share the same trade-off: a job that goes unrecorded never carries a
perfmon, so the only cost is that the first job measured after tracking
resumes may overlap it. Considering the use cases of performance monitors
and that it will only affect the first job, it's a reasonable compromise
to make for the average case.

Best regards,
- Maíra

---
Maíra Canal (2):
      drm/v3d: Skip perfmon serialization while the device has no perfmon
      drm/v3d: Skip perfmon serialization while a global perfmon is set

 drivers/gpu/drm/v3d/v3d_drv.h     |  7 +++++++
 drivers/gpu/drm/v3d/v3d_perfmon.c |  8 ++++++--
 drivers/gpu/drm/v3d/v3d_submit.c  | 19 ++++++++++++-------
 3 files changed, 25 insertions(+), 9 deletions(-)
---
base-commit: 402491eefc5ea9a40e19b08dccf0c045aec4efc2
change-id: 20260921-v3d-quick-exit-perfmon-serialize-9e9e8ceac587


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-22  7:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 21:24 [PATCH 0/2] drm/v3d: Skip perfmon serialization when it cannot be observed Maíra Canal
2026-09-21 21:24 ` [PATCH 1/2] drm/v3d: Skip perfmon serialization while the device has no perfmon Maíra Canal
2026-09-22  6:35   ` Iago Toral
2026-09-21 21:24 ` [PATCH 2/2] drm/v3d: Skip perfmon serialization while a global perfmon is set Maíra Canal
2026-09-21 21:35   ` sashiko-bot
2026-09-22  7:11   ` Iago Toral
2026-09-22  7:11 ` [PATCH 0/2] drm/v3d: Skip perfmon serialization when it cannot be observed Iago Toral

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox