[PATCH v3 7/7] drm/panthor: register size of internal objects through fdinfo

2024-06-05 Thread Adrián Larumbe
at driver's initialisation time. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_device.c | 2 + drivers/gpu/drm/panthor/panthor_device.h | 13 +- drivers/gpu/drm/panthor/panthor_drv.c| 20 ++--- drivers/gpu/drm/panthor/panthor_fw.c | 16 +-- drivers/gpu/drm

[PATCH v3 6/7] drm/drm_file: add display of driver's internal memory size

2024-06-05 Thread Adrián Larumbe
have no interest in exposing the size of internal memory objects can keep passing NULL for unaltered behaviour. Signed-off-by: Adrián Larumbe --- Documentation/gpu/drm-usage-stats.rst | 4 drivers/gpu/drm/drm_file.c | 9 +++-- drivers/gpu/drm/msm/msm_drv.c | 2

[PATCH v3 5/7] drm/panthor: support job accounting

2024-06-05 Thread Adrián Larumbe
. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_sched.c | 95 ++--- 1 file changed, 86 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c index bbd20db40e7b..4fb6fc5c2314 100644

[PATCH v3 2/7] drm/panthor: add DRM fdinfo support

2024-06-05 Thread Adrián Larumbe
Drawing from the FW-calculated values in the previous commit, we can increase the numbers for an open file by collecting them from finished jobs when updating their group synchronisation objects. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_devfreq.c | 10 + drivers/gpu

[PATCH v3 1/7] drm/panthor: introduce job cycle and timestamp accounting

2024-06-05 Thread Adrián Larumbe
for storing and subtracting the cycle counter and timestamp register, and it must always remain a power of two. This commit is done in preparation for enabling DRM fdinfo support in the Panthor driver, which depends on the numbers calculated herein. Signed-off-by: Adrián Larumbe Reviewed-by: Liviu

[PATCH v3 4/7] drm/panthor: add sysfs knob for enabling job profiling

2024-06-05 Thread Adrián Larumbe
accounting will be the matter of a later commit. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_device.h | 1 + drivers/gpu/drm/panthor/panthor_drv.c| 46 +--- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panthor

[PATCH v3 3/7] drm/panthor: enable fdinfo for memory stats

2024-06-05 Thread Adrián Larumbe
Implement drm object's status callback. Also, we consider a PRIME imported BO to be resident if its matching dma_buf has an open attachment, which means its backing storage had already been allocated. Signed-off-by: Adrián Larumbe Reviewed-by: Liviu Dudau --- drivers/gpu/drm/panthor

[PATCH v3 0/7] Support fdinfo runtime and memory stats on Panthor

2024-06-05 Thread Adrián Larumbe
and job accounting memory management, and a second one that enables fdinfo. - Moved NUM_INSTRS_PER_SLOT to the file prelude - Removed nelem variable from the group's struct definition. - Precompute size of group's syncobj BO to avoid code duplication. - Some minor nits. Adrián Larumbe (7): drm

[PATCH v4 2/3] drm/lima: Fix dma_resv deadlock at drm object pin time

2024-05-23 Thread Adrián Larumbe
situation. As was already done for Panfrost in the previous commit, fix it by replacing drm_gem_shmem_pin() with its locked variant. Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Cc: Steven Price Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") S

[PATCH v4 3/3] drm/gem-shmem: Add import attachment warning to locked pin function

2024-05-23 Thread Adrián Larumbe
Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --g

[PATCH v4 0/3] drm: Fix dma_resv deadlock at drm object pin time

2024-05-23 Thread Adrián Larumbe
function replaced the locked variant inside Panfrost's object pin callback. - Moved already-assigned attachment warning into generic already-locked gem object pin function Adrián Larumbe (3): drm/panfrost: Fix dma_resv deadlock at drm object pin time drm/lima: Fix dma_resv deadlock at drm object pin

[PATCH v4 1/3] drm/panfrost: Fix dma_resv deadlock at drm object pin time

2024-05-23 Thread Adrián Larumbe
by drm_gem_pin(). Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Cc: Steven Price Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +- 1 file changed, 1

Re: [PATCH v3 0/2] drm: Fix dma_resv deadlock at drm object pin time

2024-05-17 Thread Adrián Larumbe
Hi Boris and Thomas, On 02.05.2024 14:18, Thomas Zimmermann wrote: > Hi > > Am 02.05.24 um 14:00 schrieb Boris Brezillon: > > On Thu, 2 May 2024 13:59:41 +0200 > > Boris Brezillon wrote: > > > > > Hi Thomas, > > > > > > On Thu, 2 May 2024 13:51:16 +0200 > > > Thomas Zimmermann wrote: > > >

Re: [PATCH v2 3/3] drm/panthor: Enable fdinfo for memory stats

2024-05-16 Thread Adrián Larumbe
On 24.04.2024 18:34, Liviu Dudau wrote: > Hello, > > On Tue, Apr 23, 2024 at 10:32:36PM +0100, Adrián Larumbe wrote: > > When vm-binding an already-created BO, the entirety of its virtual size is > > then backed by system memory, so its RSS is always the same as its virtu

Re: [PATCH v2 1/1] drm: Add ioctl for querying a DRM device's list of open client PIDs

2024-05-16 Thread Adrián Larumbe
Hi Daniel, On 02.05.2024 10:09, Daniel Vetter wrote: > On Wed, May 01, 2024 at 07:50:43PM +0100, Adrián Larumbe wrote: > > Up to this day, all fdinfo-based GPU profilers must traverse the entire > > /proc directory structure to find open DRM clients with fdinfo file

[PATCH v2 1/1] drm: Add ioctl for querying a DRM device's list of open client PIDs

2024-05-01 Thread Adrián Larumbe
the DRM device. Output from the ioctl isn't human-readable, and it's meant to be retrieved only by GPU profilers like gputop and nvtop. Cc: Rob Clark Cc: Tvrtko Ursulin Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_internal.h | 1 + drivers/gpu/drm/drm_ioctl.c| 89

[PATCH v2 0/1] drm: Add ioctl for querying a DRM device's list of open client PIDs

2024-05-01 Thread Adrián Larumbe
?ref_type=heads https://gitlab.freedesktop.org/larumbe/drm/-/tree/drm-clients-ioctl?ref_type=heads I've only tested it with gputop, but intel-gputop should work also. Adrián Larumbe (1): drm: Add ioctl for querying a DRM device's list of open client PIDs drivers/gpu/drm/drm_internal.h | 1

[PATCH v3 2/2] drm/gem-shmem: Add import attachment warning to locked pin function

2024-05-01 Thread Adrián Larumbe
Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 13bcdbfd..ad5d9f704e15 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/d

[PATCH v3 0/2] drm: Fix dma_resv deadlock at drm object pin time

2024-05-01 Thread Adrián Larumbe
an already-locked pin function replaced the locked variant inside Panfrost's object pin callback. - Moved already-assigned attachment warning into generic already-locked gem object pin function Adrián Larumbe (2): drm/panfrost: Fix dma_resv deadlock at drm object pin time drm/gem-shmem: Add

[PATCH v3 1/2] drm/panfrost: Fix dma_resv deadlock at drm object pin time

2024-05-01 Thread Adrián Larumbe
panfrost_gem_pin. Do the same thing for the Lima driver, as it most likely suffers from the same issue. Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Cc: Steven Price Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adri

Re: [PATCH v2 3/4] drm/panthor: Relax the constraints on the tiler chunk size

2024-04-30 Thread Adrián Larumbe
Hi Boris, On 30.04.2024 13:28, Boris Brezillon wrote: > The field used to store the chunk size if 12 bits wide, and the encoding > is chunk_size = chunk_header.chunk_size << 12, which gives us a > theoretical [4k:8M] range. This range is further limited by > implementation constraints, and all

Re: [PATCH] drm/sysfs: Add drm class-wide attribute to get active device clients

2024-04-24 Thread Adrián Larumbe
Hi Tvrtko, On 15.04.2024 13:50, Tvrtko Ursulin wrote: > > On 05/04/2024 18:59, Rob Clark wrote: > > On Wed, Apr 3, 2024 at 11:37 AM Adrián Larumbe > > wrote: > > > > > > Up to this day, all fdinfo-based GPU profilers must traverse the entire > > &g

[PATCH v2] drm/panfrost: Fix dma_resv deadlock at drm object pin time

2024-04-23 Thread Adrián Larumbe
Brezillon Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/lima/lima_gem.c | 9 +++-- drivers/gpu/drm/panfrost/panfrost_gem.c | 8 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 7e

[PATCH v2 3/3] drm/panthor: Enable fdinfo for memory stats

2024-04-23 Thread Adrián Larumbe
already been allocated. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_gem.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c index d6483266d0c2..386c0dfeeb5f 100644 --- a/drivers/gpu

[PATCH v2 2/3] drm/panthor: Add DRM fdinfo support

2024-04-23 Thread Adrián Larumbe
Drawing from the FW-calculated values in the previous commit, we can increase the numbers for an open file by collecting them from finished jobs when updating their group synchronisation objects. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_devfreq.c | 10 + drivers/gpu

[PATCH v2 0/3] Support fdinfo runtime and memory stats on Panthor

2024-04-23 Thread Adrián Larumbe
management, and a second one that enables fdinfo. - Moved NUM_INSTRS_PER_SLOT to the file prelude - Removed nelem variable from the group's struct definition. - Precompute size of group's syncobj BO to avoid code duplication. - Some minor nits. Adrián Larumbe (3): drm/panthor: introduce job cycle

[PATCH v2 1/3] drm/panthor: introduce job cycle and timestamp accounting

2024-04-23 Thread Adrián Larumbe
for storing and subtracting the cycle counter and timestamp register, and it must always remain a power of two. This commit is done in preparation for enabling DRM fdinfo support in the Panthor driver, which depends on the numbers calculated herein. Signed-off-by: Adrián Larumbe --- drivers/gpu

Re: [PATCH 1/2] drm/panthor: Enable fdinfo for cycle and time measurements

2024-04-23 Thread Adrián Larumbe
On Tue, Mar 05, 2024 at 09:05:49PM +, Adrián Larumbe wrote: > > These values are sampled by the firmware right before jumping into the UM > > command stream and immediately after returning from it, and then kept > > inside a > > per-job accounting structure. Th

[PATCH] drm/panfrost: Fix dma_resv deadlock at drm object pin time

2024-04-21 Thread Adrián Larumbe
panfrost_gem_pin. Cc: Thomas Zimmermann Cc: Dmitry Osipenko Cc: Boris Brezillon Cc: Steven Price Fixes: a78027847226 ("drm/gem: Acquire reservation lock in drm_gem_{pin/unpin}()") Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_gem.c | 7 ++- 1 file changed, 6

Re: [PATCH] drm/panfrost: Show overall GPU usage stats through sysfs knob

2024-04-04 Thread Adrián Larumbe
On 04.04.2024 11:31, Maíra Canal wrote: > On 4/4/24 11:00, Adrián Larumbe wrote: > > This changeset is heavily inspired by commit 509433d8146c ("drm/v3d: Expose > > the total GPU usage stats on sysfs"). The point is making broader GPU > > occupancy numbers available

[PATCH] drm/panfrost: Show overall GPU usage stats through sysfs knob

2024-04-04 Thread Adrián Larumbe
ssing time are displayed. Cc: Boris Brezillon Cc: Christopher Healy Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_device.h | 5 +++ drivers/gpu/drm/panfrost/panfrost_drv.c| 49 -- drivers/gpu/drm/panfrost/panfrost_job.c| 17 +++- drivers/gpu/dr

[PATCH] drm/sysfs: Add drm class-wide attribute to get active device clients

2024-04-03 Thread Adrián Larumbe
be queried by profilers to get a list of PIDs for their open clients. This file isn't human-readable, and it's meant to be queried only by GPU profilers like gputop and nvtop. Cc: Boris Brezillon Cc: Tvrtko Ursulin Cc: Christopher Healy Signed-off-by: Adrián Larumbe --- drivers/gpu/drm

[PATCH] drm/panfrost: Only display fdinfo's engine and cycle tags when profiling is on

2024-03-16 Thread Adrián Larumbe
If job accounting is disabled, then both fdinfo's drm-engine and drm-cycle key values will remain immutable. In that case, it makes more sense not to display them at all to avoid confusing user space profiling tools. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_drv.c | 10

Re: [PATCH v3 1/1] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-03-11 Thread Adrián Larumbe
On 11.03.2024 11:02, Boris Brezillon wrote: > On Wed, 6 Mar 2024 08:33:47 + > Tvrtko Ursulin wrote: > > > On 06/03/2024 01:56, Adrián Larumbe wrote: > > > Debugfs isn't always available in production builds that try to squeeze > > > every single byte out

[PATCH v3 0/1] drm/panfrost: Replace fdinfo's profiling debugfs knob

2024-03-05 Thread Adrián Larumbe
...@collabora.com/ Adrián Larumbe (1): drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs .../testing/sysfs-driver-panfrost-profiling | 10 + Documentation/gpu/panfrost.rst| 9 drivers/gpu/drm/panfrost/Makefile | 2 - drivers/gpu/drm

[PATCH v3 1/1] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-03-05 Thread Adrián Larumbe
and replace it with a sysfs file that accomplishes the same functionality, and document its ABI in a separate file. Signed-off-by: Adrián Larumbe --- .../testing/sysfs-driver-panfrost-profiling | 10 + Documentation/gpu/panfrost.rst| 9 drivers/gpu/drm/panfrost/Makefile

[PATCH 0/2] Support fdinfo runtime and memory stats on Panthor

2024-03-05 Thread Adrián Larumbe
This patch series enables userspace utilities like gputop and nvtop to query a render context's fdinfo file and figure out rates of engine and memory utilisation. Adrián Larumbe (2): drm/panthor: Enable fdinfo for cycle and time measurements drm/panthor: Enable fdinfo for memory stats

[PATCH 1/2] drm/panthor: Enable fdinfo for cycle and time measurements

2024-03-05 Thread Adrián Larumbe
number and the queue's index within the group. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_devfreq.c | 10 + drivers/gpu/drm/panthor/panthor_device.h | 11 ++ drivers/gpu/drm/panthor/panthor_drv.c | 31 drivers/gpu/drm/panthor/panthor_sched.c | 217

[PATCH 2/2] drm/panthor: Enable fdinfo for memory stats

2024-03-05 Thread Adrián Larumbe
When vm-binding an already-created BO, the entirety of its virtual size is then backed by system memory, so its RSS is always the same as its virtual size. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/panthor_drv.c | 1 + drivers/gpu/drm/panthor/panthor_gem.c | 12 2

[PATCH] drm/panthor: Add support for performance counters

2024-03-05 Thread Adrián Larumbe
the current one implies a counter reset, which also messes up with the ring buffer's extraction and insertion pointers. This is an unfortunate hardware limitation. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panthor/Makefile | 3 +- drivers/gpu/drm/panthor/panthor_device.c | 6

[PATCH v2 1/1] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-03-02 Thread Adrián Larumbe
and replace it with a sysfs file that accomplishes the same functionality, and document its ABI in a separate file. Signed-off-by: Adrián Larumbe --- .../testing/sysfs-driver-panfrost-profiling | 10 +++ Documentation/gpu/panfrost.rst| 9 +++ drivers/gpu/drm/panfrost/Makefile

[PATCH v2 0/1] drm/panfrost: Replace fdinfo's profiling debugfs knob

2024-03-02 Thread Adrián Larumbe
://lore.kernel.org/dri-devel/20240221161237.2478193-1-adrian.laru...@collabora.com/ Adrián Larumbe (1): drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs .../testing/sysfs-driver-panfrost-profiling | 10 +++ Documentation/gpu/panfrost.rst| 9 +++ drivers/gpu/drm/panfrost

Re: [PATCH] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-02-27 Thread Adrián Larumbe
Hi Boris, On 26.02.2024 09:51, Boris Brezillon wrote: > On Wed, 21 Feb 2024 16:12:32 + > Adrián Larumbe wrote: > > > Debugfs isn't always available in production builds that try to squeeze > > every single byte out of the kernel image, but we still need a way to >

Re: [PATCH] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-02-27 Thread Adrián Larumbe
Hi Steve, On 21.02.2024 16:52, Steven Price wrote: > On 21/02/2024 16:12, Adrián Larumbe wrote: > > Debugfs isn't always available in production builds that try to squeeze > > every single byte out of the kernel image, but we still need a way to > > toggle the timest

[PATCH] drm/panfrost: Replace fdinfo's profiling debugfs knob with sysfs

2024-02-21 Thread Adrián Larumbe
and replace it with a sysfs file that accomplishes the same functionality, and document its ABI in a separate file. Signed-off-by: Adrián Larumbe --- .../testing/sysfs-driver-panfrost-profiling | 10 +++ Documentation/gpu/panfrost.rst| 9 +++ drivers/gpu/drm/panfrost/Makefile

Re: [PATCH 0/1] Always record job cycle and timestamp information

2024-02-21 Thread Adrián Larumbe
> On 21.02.2024 14:34, Tvrtko Ursulin wrote: > > On 21/02/2024 09:40, Adrián Larumbe wrote: > > Hi, > > > > I just wanted to make sure we're on the same page on this matter. So in > > Panfrost, and I guess in almost every other single driver out there, HW

Re: [PATCH 0/1] Always record job cycle and timestamp information

2024-02-21 Thread Adrián Larumbe
to generalise this onto other drivers. Adrian On 16.02.2024 17:43, Tvrtko Ursulin wrote: > > On 16/02/2024 16:57, Daniel Vetter wrote: > > On Wed, Feb 14, 2024 at 01:52:05PM +, Steven Price wrote: > > > Hi Adrián, > > > > > > On 14/02/2024 12:14, Adri

[PATCH 0/1] Always record job cycle and timestamp information

2024-02-14 Thread Adrián Larumbe
in additional power consumption, so both were kept disabled until toggled through debugfs. A second read of the TRM made me think otherwise, but this is something that would be best clarified by someone from ARM's side. Adrián Larumbe (1): drm/panfrost: Always record job cycle and timestamp

[PATCH 1/1] drm/panfrost: Always record job cycle and timestamp information

2024-02-14 Thread Adrián Larumbe
is running and there are inflight jobs, so there's no reason to let user space toggle profiling. Remove the profiling debugfs knob altogether so that cycle and timestamp counting is always enabled for inflight jobs. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/Makefile

[PATCH 2/2] drm/panfrost: Fix incorrect updating of current device frequency

2023-11-25 Thread Adrián Larumbe
device probe(). - Updating said variable in Panfrost devfreq's get_dev_status() rather than after the new OPP's frequency had been retrieved in target(), which meant the old frequency would be assigned instead. Signed-off-by: Adrián Larumbe Fixes: f11b0417eec2 ("drm/panfrost: Add fdinfo suppor

[PATCH 0/2] Panfrost devfreq and GEM status fixes

2023-11-25 Thread Adrián Larumbe
a dma-buf import as being resident in system memory, so that this can be reflected on fdinfo. Adrián Larumbe (2): drm/panfrost: Consider dma-buf imported objects as resident drm/panfrost: Fix incorrect updating of current device frequency drivers/gpu/drm/panfrost/panfrost_devfreq.c | 17

[PATCH 1/2] drm/panfrost: Consider dma-buf imported objects as resident

2023-11-25 Thread Adrián Larumbe
A GEM object constructed from a dma-buf imported sgtable should be regarded as being memory resident, because the dma-buf API mandates backing storage to be allocated when attachment succeeds. Signed-off-by: Adrián Larumbe Fixes: 9ccdac7aa822 ("drm/panfrost: Add fdinfo support for memory

Re: [PATCH] drm/panfrost: Remove incorrect IS_ERR() check

2023-10-21 Thread Adrián Larumbe
On 20.10.2023 11:44, Steven Price wrote: > sg_page_iter_page() doesn't return an error code, so the IS_ERR() check > is wrong and the error path will never be executed. This also allows > simplifying the code to remove the local variable 'page'. > > CC: Adrián Larumbe >

[PATCH] Documentation/gpu: fix Panfrost documentation build warnings

2023-10-05 Thread Adrián Larumbe
Fix issues revealed by `make htmldocs` after adding Panfrost DRM documentation file. Signed-off-by: Adrián Larumbe Fixes: d124dac2089c ("drm/panfrost: Add fdinfo support GPU load metrics") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/20231003091

[PATCH v8 3/5] drm/panfrost: Add fdinfo support for memory stats

2023-09-29 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_gem.c | 15

[PATCH v8 5/5] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-29 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven

[PATCH v8 4/5] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-29 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS and purgeable sizes for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino

[PATCH v8 1/5] drm/panfrost: Add cycle count GPU register definitions

2023-09-29 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm

[PATCH v8 2/5] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-29 Thread Adrián Larumbe
waste in case no engine usage measuring is necessary. Also add a documentation file explaining the possible values for fdinfo's engine keystrings and Panfrost-specific drm-curfreq- pairs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed

[PATCH v8 0/5] Add fdinfo support to Panfrost

2023-09-29 Thread Adrián Larumbe
essing nitpicks. Adrián Larumbe (5): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics drm/panfrost: Add fdinfo support for memory stats drm/drm_file: Add DRM obj's RSS reporting function for fdinfo drm/panfrost: Implement gener

[PATCH v7 2/5] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-27 Thread Adrián Larumbe
waste in case no engine usage measuring is necessary. Add also documentation file explaining the possible values for fdinfo's engine keystrings and Panfrost-specific drm-curfreq- pairs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- Documentation/gpu

[PATCH v7 4/5] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-27 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS and purgeable sizes for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/drm_file.c

[PATCH v7 5/5] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-27 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven

[PATCH v7 0/5] Add fdinfo support to Panfrost

2023-09-27 Thread Adrián Larumbe
ecking the engine name array size for fdinfo. - Added copyright notices for Amazon in Panfrost's new debugfs files. - Discarded fdinfo memory stats unit size selection patch. Adrián Larumbe (5): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics

[PATCH v7 1/5] drm/panfrost: Add cycle count GPU register definitions

2023-09-27 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_regs.h | 5 + 1 file

[PATCH v7 3/5] drm/panfrost: Add fdinfo support for memory stats

2023-09-27 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++ 2 files changed, 16

Re: [PATCH v6 6/6] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-22 Thread Adrián Larumbe
On 21.09.2023 11:14, Tvrtko Ursulin wrote: > >On 20/09/2023 16:32, Tvrtko Ursulin wrote: >> >> On 20/09/2023 00:34, Adrián Larumbe wrote: >> > The current implementation will try to pick the highest available size >> > display unit as soon as the

Re: [PATCH v6 6/6] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-22 Thread Adrián Larumbe
On 20.09.2023 16:32, Tvrtko Ursulin wrote: > >On 20/09/2023 00:34, Adrián Larumbe wrote: >> The current implementation will try to pick the highest available size >> display unit as soon as the BO size exceeds that of the previous >> multiplier. That can lead to loss

Re: [PATCH v6 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-22 Thread Adrián Larumbe
On 20.09.2023 16:53, Tvrtko Ursulin wrote: > >On 20/09/2023 00:34, Adrián Larumbe wrote: >> Some BO's might be mapped onto physical memory chunkwise and on demand, >> like Panfrost's tiler heap. In this case, even though the >> drm_gem_shmem_object page array might al

Re: [PATCH v6 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-22 Thread Adrián Larumbe
On 20.09.2023 16:40, Tvrtko Ursulin wrote: >On 20/09/2023 00:34, Adrián Larumbe wrote: >> The drm-stats fdinfo tags made available to user space are drm-engine, >> drm-cycles, drm-max-freq and drm-curfreq, one per job slot. >> >> This deviates from standard practice

[PATCH v6 0/6] Add fdinfo support to Panfrost

2023-09-19 Thread Adrián Larumbe
e read over in case of requeuing. - Moved putting of cycle counting refcnt into panfrost job dequeue function to avoid repetition. v6: - Fix wrong swapped-round engine time and cycle values in fdinfo drm print statements. Adrián Larumbe (6): drm/panfrost: Add cycle count GPU register defin

[PATCH v6 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-19 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS size for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/drm_file.c | 5

[PATCH v6 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-19 Thread Adrián Larumbe
waste in case no engine usage measuring is necessary. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/Makefile | 2 + drivers/gpu/drm/panfrost/panfrost_debugfs.c | 20 drivers/gpu/drm/panfrost

[PATCH v6 6/6] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-19 Thread Adrián Larumbe
the display unit selection threshold to render more accurate values. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/drm_file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu

[PATCH v6 5/6] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-19 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven

[PATCH v6 1/6] drm/panfrost: Add cycle count GPU register definitions

2023-09-19 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_regs.h | 5 + 1 file

[PATCH v6 3/6] drm/panfrost: Add fdinfo support for memory stats

2023-09-19 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++ 2 files changed, 16

[PATCH v5 5/6] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-14 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm

[PATCH v5 6/6] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-14 Thread Adrián Larumbe
the display unit selection threshold to render more accurate values. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 762965e3d503..34cfa128ffe5 100644

[PATCH v5 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-14 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS size for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm/drm_file.c | 5 - include/drm/drm_gem.h | 9

[PATCH v5 1/6] drm/panfrost: Add cycle count GPU register definitions

2023-09-14 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_regs.h | 5 + 1 file

[PATCH v5 3/6] drm/panfrost: Add fdinfo support for memory stats

2023-09-14 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++ 2 files changed, 16 insertions(+) diff --git

[PATCH v5 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-14 Thread Adrián Larumbe
waste in case no engine usage measuring is necessary. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm/panfrost/Makefile | 2 + drivers/gpu/drm/panfrost/panfrost_debugfs.c | 20 drivers/gpu/drm/panfrost/panfrost_debugfs.h | 13 + drivers/gpu

[PATCH v5 0/6] Add fdinfo support to Panfrost

2023-09-14 Thread Adrián Larumbe
st job dequeue function to avoid repetition. Adrián Larumbe (6): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics drm/panfrost: Add fdinfo support for memory stats drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

[PATCH v4 3/6] drm/panfrost: Add fdinfo support for memory stats

2023-09-12 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_drv.c | 2 ++ drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/panfrost

[PATCH v4 6/6] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-12 Thread Adrián Larumbe
BO's, their size will naturally be aligned on something bigger than a 4 KiB page, so in practice it is very unlikely their display unit would default to KiB. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu

[PATCH v4 4/6] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-12 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS size for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm/drm_file.c | 5 - include/drm/drm_gem.h | 9

[PATCH v4 2/6] drm/panfrost: Add fdinfo support GPU load metrics

2023-09-12 Thread Adrián Larumbe
waste in case no engine usage measuring is necessary. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/Makefile | 2 + drivers/gpu/drm/panfrost/panfrost_debugfs.c | 20 drivers/gpu/drm/panfrost/panfrost_debugfs.h | 13 + drivers/gpu/drm/panfrost

[PATCH v4 0/6] Add fdinfo support to Panfrost

2023-09-12 Thread Adrián Larumbe
fdinfo memory object size unit that doesn't lose precision. Adrián Larumbe (6): drm/panfrost: Add cycle count GPU register definitions drm/panfrost: Add fdinfo support GPU load metrics drm/panfrost: Add fdinfo support for memory stats drm/drm_file: Add DRM obj's RSS reporting function for

[PATCH v4 5/6] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-12 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_gem.c | 15

[PATCH v4 1/6] drm/panfrost: Add cycle count GPU register definitions

2023-09-12 Thread Adrián Larumbe
These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_regs.h | 5 + 1 file

Re: [PATCH v3 8/8] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-09 Thread Adrián Larumbe
On 06.09.2023 10:11, Boris Brezillon wrote: >On Tue, 5 Sep 2023 19:45:24 +0100 >Adrián Larumbe wrote: > >> The current implementation will try to pick the highest available size >> display unit as soon as the BO size exceeds that of the previous >> multiplier. &

Re: [PATCH v3 7/8] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-09 Thread Adrián Larumbe
On 06.09.2023 10:01, Boris Brezillon wrote: >On Tue, 5 Sep 2023 19:45:23 +0100 >Adrián Larumbe wrote: > >> BO's RSS is updated every time new pages are allocated on demand and mapped >> for the object at GPU page fault's IRQ handler, but only for heap buffers. >> The

Re: [PATCH v3 2/8] drm/panfrost: Enable cycle counter register upon job submission

2023-09-09 Thread Adrián Larumbe
On 06.09.2023 09:21, Boris Brezillon wrote: >On Tue, 5 Sep 2023 19:45:18 +0100 >Adrián Larumbe wrote: > >> In a future development, we will want to keep track of the number of GPU >> cycles spent on a given job. That means we should enable it only when the >> GPU

Re: [PATCH v3 2/8] drm/panfrost: Enable cycle counter register upon job submission

2023-09-09 Thread Adrián Larumbe
On 06.09.2023 09:57, Boris Brezillon wrote: >On Tue, 5 Sep 2023 19:45:18 +0100 >Adrián Larumbe wrote: > >> diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c >> b/drivers/gpu/drm/panfrost/panfrost_job.c >> index 033f5e684707..8b1bf6ac48f8 100644 >&g

[PATCH v3 6/8] drm/drm_file: Add DRM obj's RSS reporting function for fdinfo

2023-09-05 Thread Adrián Larumbe
by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS size for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon --- drivers/gpu/drm/drm_file.c | 5 - include/drm/drm_gem.h | 9

[PATCH v3 8/8] drm/drm-file: Show finer-grained BO sizes in drm_show_memory_stats

2023-09-05 Thread Adrián Larumbe
The current implementation will try to pick the highest available size display unit as soon as the BO size exceeds that of the previous multiplier. By selecting a higher threshold, we could show more accurate size numbers. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/drm_file.c | 2 +- 1

[PATCH v3 7/8] drm/panfrost: Implement generic DRM object RSS reporting function

2023-09-05 Thread Adrián Larumbe
at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_gem.c | 14

[PATCH v3 3/8] drm/panfrost: Enable debugfs toggling of cycle counter register

2023-09-05 Thread Adrián Larumbe
Allow user space to decide whether the cycle counting register should be enabled. The main goal is letting tools like nvtop or IGT's gputop access this information in debug builds to obtain engine utilisation numbers. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/Makefile

[PATCH v3 5/8] drm/panfrost: Add fdinfo support for memory stats

2023-09-05 Thread Adrián Larumbe
handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/panfrost

  1   2   >