]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/panthor: introduce job cycle and timestamp accounting
authorAdrián Larumbe <adrian.larumbe@collabora.com>
Mon, 23 Sep 2024 23:06:21 +0000 (00:06 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Wed, 2 Oct 2024 08:55:06 +0000 (10:55 +0200)
commitf8ff51a4708451763e6cfa36cc83dea8513d3318
tree22125900fb54cc782d4406db2851515ab160405c
parenta7b3bcc8e8495ff45128caab7ceee2534d1b8e8d
drm/panthor: introduce job cycle and timestamp accounting

Enable calculations of job submission times in clock cycles and wall
time. This is done by expanding the boilerplate command stream when running
a job to include instructions that compute said times right before and
after a user CS.

A separate kernel BO is created per queue to store those values. Jobs can
access their sampled data through an index different from that of the
queue's ringbuffer. The reason for this is saving memory on the profiling
information kernel BO, since the amount of simultaneous profiled jobs we
can write into the queue's ringbuffer might be much smaller than for
regular jobs, as the former take more CSF instructions.

This commit is done in preparation for enabling DRM fdinfo support in the
Panthor driver, which depends on the numbers calculated herein.

A profile mode mask has been added that will in a future commit allow UM to
toggle performance metric sampling behaviour, which is disabled by default
to save power. When a ringbuffer CS is constructed, timestamp and cycling
sampling instructions are added depending on the enabled flags in the
profiling mask.

A helper was provided that calculates the number of instructions for a
given set of enablement mask, and these are passed as the number of credits
when initialising a DRM scheduler job.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923230912.2207320-2-adrian.larumbe@collabora.com
drivers/gpu/drm/panthor/panthor_device.h
drivers/gpu/drm/panthor/panthor_sched.c