Re: [PATCH 6/7] drm/i915/pmu: Lazy unregister

2024-07-23 Thread Tvrtko Ursulin
On 22/07/2024 22:06, Lucas De Marchi wrote: Instead of calling perf_pmu_unregister() when unbinding, defer that to the destruction of i915 object. Since perf itself holds a reference in the event, this only happens when all events are gone, which guarantees i915 is not unregistering the pmu wit

Re: [PATCH 5/7] drm/i915/pmu: Let resource survive unbind

2024-07-23 Thread Tvrtko Ursulin
On 22/07/2024 22:06, Lucas De Marchi wrote: There's no need to free the resources during unbind. Since perf events may still access them due to open events, it's safer to free them when dropping the last i915 reference. Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_pmu.c | 21

Re: [PATCH 4/7] drm/i915/pmu: Drop is_igp()

2024-07-23 Thread Tvrtko Ursulin
ommit 05488673a4d41383f9dd537f298e525e6b00fb93 Author: Tvrtko Ursulin AuthorDate: Wed Oct 16 10:38:02 2019 +0100 Commit: Tvrtko Ursulin CommitDate: Thu Oct 17 10:50:47 2019 +0100 drm/i915/pmu: Support multiple GPUs Added IS_DGFX: commit dc90fe3fd219c7693617ba09a9467e4aadc2e039 Author: José Roberto de

Re: [PATCH] drm/scheduler: Fix drm_sched_entity_set_priority()

2024-07-22 Thread Tvrtko Ursulin
On 22/07/2024 15:06, Christian König wrote: Am 22.07.24 um 15:52 schrieb Tvrtko Ursulin: On 19/07/2024 16:18, Christian König wrote: Am 19.07.24 um 15:02 schrieb Christian König: Am 19.07.24 um 11:47 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Long time ago in commit b3ac17667f11 (&quo

Re: [PATCH] drm/scheduler: Fix drm_sched_entity_set_priority()

2024-07-22 Thread Tvrtko Ursulin
On 19/07/2024 16:18, Christian König wrote: Am 19.07.24 um 15:02 schrieb Christian König: Am 19.07.24 um 11:47 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Long time ago in commit b3ac17667f11 ("drm/scheduler: rework entity creation") a change was made which prevented priority c

[PATCH] drm/scheduler: Fix drm_sched_entity_set_priority()

2024-07-19 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Long time ago in commit b3ac17667f11 ("drm/scheduler: rework entity creation") a change was made which prevented priority changes for entities with only one assigned scheduler. The commit reduced drm_sched_entity_set_priority() to simply update the entities pri

[PULL] drm-intel-next-fixes

2024-07-18 Thread Tvrtko Ursulin
Hi Dave, Sima, One display fix for the merge window relating to DisplayPort LTTPR. It fixes at least Dell UD22 dock when used on Intel N100 systems. Regards, Tvrtko drm-intel-next-fixes-2024-07-18: - Reset intel_dp->link_trained before retraining the link [dp] (Imre Deak) - Don't switch the L

Re: [PATCH] drm/v3d: Expose memory stats through fdinfo

2024-07-11 Thread Tvrtko Ursulin
o this could be just "return DRM_GEM_OBJECT_RESIDENT", although granted, like you have it is more future proof. Either way: Reviewed-by: Tvrtko Ursulin Regards, Tvrtko + + return res; +} + /* Called DRM core on the last userspace/kernel unreference of the * BO. */

[PATCH 11/11] drm/v3d: Add some local variables in queries/extensions

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Add some local variables to make the code a bit less verbose, with the main benefit being pulling some lines to under 80 columns wide. Signed-off-by: Tvrtko Ursulin Reviewed-by: Maíra Canal --- drivers/gpu/drm/v3d/v3d_submit.c | 88 ++-- 1

[PATCH 05/11] drm/v3d: Validate passed in drm syncobj handles in the performance extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfully or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 09/11] drm/v3d: Move perfmon init completely into own unit

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Now that the build time dependencies on various array sizes have been removed, we can move the perfmon init completely into its own compilation unit and remove the hardcoded defines. This improves on the temporary fix quickly delivered in commit 9c3951ec27b9 ("drm/v3d

[PATCH 08/11] drm/v3d: Do not use intermediate storage when copying performance query results

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Removing the intermediate buffer removes the last use of the V3D_MAX_COUNTERS define, which will enable further driver cleanup. While at it pull the 32 vs 64 bit copying decision outside the loop in order to reduce the number of conditional instructions. Signed-off-by

[PATCH 07/11] drm/v3d: Size the kperfmon_ids array at runtime

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Instead of statically reserving pessimistic space for the kperfmon_ids array, make the userspace extension code allocate the exactly required amount of space. Apart from saving some memory at runtime, this also removes the need for the V3D_MAX_PERFMONS macro whose removal

[PATCH 06/11] drm/v3d: Move part of copying of reset/copy performance extension to a helper

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin The loop which looks up the syncobj and copies the kperfmon ids is identical so lets move it to a helper. The only change is replacing copy_from_user with get_user when copying a scalar. Signed-off-by: Tvrtko Ursulin Reviewed-by: Maíra Canal --- drivers/gpu/drm/v3d

[PATCH 04/11] drm/v3d: Validate passed in drm syncobj handles in the timestamp extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfully or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 10/11] drm/v3d: Prefer get_user for scalar types

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin It makes it just a tiny bit more obvious what is going on. Signed-off-by: Tvrtko Ursulin Reviewed-by: Maíra Canal --- drivers/gpu/drm/v3d/v3d_submit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b

[PATCH 03/11] drm/v3d: Fix potential memory leak in the performance extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 (&quo

[PATCH 02/11] drm/v3d: Fix potential memory leak in the timestamp extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: 9ba0ff3e083f (&quo

[PATCH 01/11] drm/v3d: Prevent out of bounds access in performance query extensions

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Check that the number of perfmons userspace is passing in the copy and reset extensions is not greater than the internal kernel storage where the ids will be copied into. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 ("drm/v3d: Create a CPU job extension for the

[PATCH v4 00/11] v3d: Perfmon cleanup

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin When we had to quickly deal with a tree build issue via merging 792d16b5375d ("drm/v3d: Move perfmon init completely into own unit"), we promised to follow up with a nicer solution. As in the process of eliminating the hardcoded defines we have discovered a few

Re: [PATCH 03/11] drm/v3d: Fix potential memory leak in the performance extension

2024-07-11 Thread Tvrtko Ursulin
On 11/07/2024 14:00, Maíra Canal wrote: On 7/11/24 06:15, Tvrtko Ursulin wrote: From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using

Re: [PATCH 11/12] drm/v3d: Do not use intermediate storage when copying performance query results

2024-07-11 Thread Tvrtko Ursulin
On 11/07/2024 13:31, Iago Toral wrote: El mar, 09-07-2024 a las 17:34 +0100, Tvrtko Ursulin escribió: From: Tvrtko Ursulin Removing the intermediate buffer removes the last use of the V3D_MAX_COUNTERS define, which will enable further driver cleanup. While at it pull the 32 vs 64 bit

Re: [PATCH] drm/i915/gt: Do not consider preemption during execlists_dequeue for gen8

2024-07-11 Thread Tvrtko Ursulin
27; error and make can_preempt() function param as const to resolve error: passing argument 1 of ‘can_preempt’ discards ‘const’ qualifier from the pointer target type. v2: Simplify can_preemt() function (Tvrtko Ursulin) Yeah sorry for that yesterday when I thought gen8 emit bb was dead code, some

[PATCH 10/11] drm/v3d: Prefer get_user for scalar types

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin It makes it just a tiny bit more obvious what is going on. Signed-off-by: Tvrtko Ursulin Reviewed-by: Maíra Canal --- drivers/gpu/drm/v3d/v3d_submit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b

[PATCH 11/11] drm/v3d: Add some local variables in queries/extensions

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Add some local variables to make the code a bit less verbose, with the main benefit being pulling some lines to under 80 columns wide. Signed-off-by: Tvrtko Ursulin Reviewed-by: Maíra Canal --- drivers/gpu/drm/v3d/v3d_submit.c | 88 ++-- 1

[PATCH 06/11] drm/v3d: Move part of copying of reset/copy performance extension to a helper

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin The loop which looks up the syncobj and copies the kperfmon ids is identical so lets move it to a helper. The only change is replacing copy_from_user with get_user when copying a scalar. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 152

[PATCH 09/11] drm/v3d: Move perfmon init completely into own unit

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Now that the build time dependencies on various array sizes have been removed, we can move the perfmon init completely into its own compilation unit and remove the hardcoded defines. This improves on the temporary fix quickly delivered in 9c3951ec27b9 ("drm/v3d: Fix pe

[PATCH 08/11] drm/v3d: Do not use intermediate storage when copying performance query results

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Removing the intermediate buffer removes the last use of the V3D_MAX_COUNTERS define, which will enable further driver cleanup. While at it pull the 32 vs 64 bit copying decision outside the loop in order to reduce the number of conditional instructions. Signed-off-by

[PATCH 07/11] drm/v3d: Size the kperfmon_ids array at runtime

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Instead of statically reserving pessimistic space for the kperfmon_ids array, make the userspace extension code allocate the exactly required amount of space. Apart from saving some memory at runtime, this also removes the need for the V3D_MAX_PERFMONS macro whose removal

[PATCH 05/11] drm/v3d: Validate passed in drm syncobj handles in the performance extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH v3 00/11] v3d: Perfmon cleanup

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin When we had to quickly deal with a tree build issue via merging 792d16b5375d ("drm/v3d: Move perfmon init completely into own unit"), we promised to follow up with a nicer solution. As in the process of eliminating the hardcoded defines we have discovered a few

[PATCH 03/11] drm/v3d: Fix potential memory leak in the performance extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 (&quo

[PATCH 02/11] drm/v3d: Fix potential memory leak in the timestamp extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: 9ba0ff3e083f (&quo

[PATCH 04/11] drm/v3d: Validate passed in drm syncobj handles in the timestamp extension

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfully or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 01/11] drm/v3d: Prevent out of bounds access in performance query extensions

2024-07-11 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Check that the number of perfmons userspace is passing in the copy and reset extensions is not greater than the internal kernel storage where the ids will be copied into. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 ("drm/v3d: Create a CPU job extension for the

Re: [PATCH 11/12] drm/v3d: Add some local variables in queries/extensions

2024-07-11 Thread Tvrtko Ursulin
On 10/07/2024 18:43, Maíra Canal wrote: On 7/10/24 10:41, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Add some local variables to make the code a bit less verbose, with the main benefit being pulling some lines to under 80 columns wide. Signed-off-by: Tvrtko Ursulin I'd p

Re: [PATCH 09/12] drm/v3d: Move perfmon init completely into own unit

2024-07-11 Thread Tvrtko Ursulin
On 10/07/2024 18:38, Maíra Canal wrote: On 7/10/24 10:41, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Now that the build time dependencies on various array sizes have been removed, we can move the perfmon init completely into its own compilation unit and remove the hardcoded defines. This

Re: [PATCH 04/12] drm/v3d: Validate passed in drm syncobj handles in the timestamp extension

2024-07-11 Thread Tvrtko Ursulin
On 10/07/2024 18:06, Maíra Canal wrote: On 7/10/24 10:41, Tvrtko Ursulin wrote: From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or

Re: [PATCH 01/12] drm/v3d: Prevent out of bounds access in performance query extensions

2024-07-10 Thread Tvrtko Ursulin
On 10/07/2024 14:41, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Check that the number of perfmons userspace is passing in the copy and reset extensions is not greater than the internal kernel storage where the ids will be copied into. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 (&quo

Re: [PATCH 00/12] v3d: Perfmon cleanup

2024-07-10 Thread Tvrtko Ursulin
Hi Iago, On 10/07/2024 07:06, Iago Toral wrote: El mar, 09-07-2024 a las 17:34 +0100, Tvrtko Ursulin escribió: From: Tvrtko Ursulin When we had to quickly deal with a tree build issue via merging 792d16b5375d ("drm/v3d: Move perfmon init completely into own unit"), we promised to

[PATCH 09/12] drm/v3d: Move perfmon init completely into own unit

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Now that the build time dependencies on various array sizes have been removed, we can move the perfmon init completely into its own compilation unit and remove the hardcoded defines. This improves on the temporary fix quickly delivered in 792d16b5375d ("drm/v3d:

[PATCH 12/12] drm/v3d: Prefer get_user for scalar types

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin It makes it just a tiny bit more obvious what is going on. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c

[PATCH 05/12] drm/v3d: Validate passed in drm syncobj handles in the performance extension

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 10/12] drm/v3d: Align data types of internal and uapi counts

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin In the timestamp and performance extensions userspace type for counts is u32 so lets use unsigned in the kernel too. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu

[PATCH 08/12] drm/v3d: Do not use intermediate storage when copying performance query results

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Removing the intermediate buffer removes the last use of the V3D_MAX_COUNTERS define, which will enable further driver cleanup. While at it pull the 32 vs 64 bit copying decision outside the loop in order to reduce the number of conditional instructions. Signed-off-by

[PATCH 06/12] drm/v3d: Move part of copying of reset/copy performance extension to a helper

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin The loop which looks up the syncobj and copies the kperfmon ids is identical so lets move it to a helper. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 148 +-- 1 file changed, 64 insertions(+), 84 deletions(-) diff

[PATCH 07/12] drm/v3d: Size the kperfmon_ids array at runtime

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Instead of statically reserving pessimistic space for the kperfmon_ids array, make the userspace extension code allocate the exactly required amount of space. Apart from saving some memory at runtime, this also removes the need for the V3D_MAX_PERFMONS macro whose removal

[PATCH 11/12] drm/v3d: Add some local variables in queries/extensions

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Add some local variables to make the code a bit less verbose, with the main benefit being pulling some lines to under 80 columns wide. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 79 +--- 1 file changed, 42 insertions

[PATCH 04/12] drm/v3d: Validate passed in drm syncobj handles in the timestamp extension

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH v2 00/12] v3d: Perfmon cleanup

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin When we had to quickly deal with a tree build issue via merging 792d16b5375d ("drm/v3d: Move perfmon init completely into own unit"), we promised to follow up with a nicer solution. As in the process of eliminating the hardcoded defines we have discovered a few

[PATCH 02/12] drm/v3d: Fix potential memory leak in the timestamp extension

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: 9ba0ff3e083f (&quo

[PATCH 01/12] drm/v3d: Prevent out of bounds access in performance query extensions

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Check that the number of perfmons userspace is passing in the copy and reset extensions is not greater than the internal kernel storage where the ids will be copied into. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 ("drm/v3d: Create a CPU job extension for the

[PATCH 03/12] drm/v3d: Fix potential memory leak in the performance extension

2024-07-10 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 (&quo

Re: [PATCH] drm/i915/gt: Do not consider preemption during execlists_dequeue for gen8

2024-07-10 Thread Tvrtko Ursulin
On 09/07/2024 15:02, Tvrtko Ursulin wrote: On 09/07/2024 13:53, Nitin Gote wrote: We're seeing a GPU HANG issue on a CHV platform, which was caused by bac24f59f454 ("drm/i915/execlists: Enable coarse preemption boundaries for gen8"). Gen8 platform has only timeslice and do

[PATCH 12/12] drm/v3d: Move perfmon init completely into own unit

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Now that the build time dependencies on various array sizes have been removed, we can move the perfmon init completely into its own compilation unit and remove the hardcoded defines. This improves on the temporary fix quickly delivered in 792d16b5375d ("drm/v3d:

[PATCH 11/12] drm/v3d: Do not use intermediate storage when copying performance query results

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Removing the intermediate buffer removes the last use of the V3D_MAX_COUNTERS define, which will enable further driver cleanup. While at it pull the 32 vs 64 bit copying decision outside the loop in order to reduce the number of conditional instructions. Signed-off-by

[PATCH 10/12] drm/v3d: Size the kperfmon_ids array at runtime

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Instead of statically reserving pessimistic space for the kperfmon_ids array, make the userspace extension code allocate the exactly required amount of space. Apart from saving some memory at runtime, this also removes the need for the V3D_MAX_PERFMONS macro whose removal

[PATCH 09/12] drm/v3d: Move part of copying of reset/copy performance extension to a helper

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin The loop which looks up the syncobj and copies the kperfmon ids is identical so lets move it to a helper. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 148 +-- 1 file changed, 64 insertions(+), 84 deletions(-) diff

[PATCH 07/12] drm/v3d: Validate passed in drm syncobj handles in the timestamp extension

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 05/12] drm/v3d: Fix potential memory leak in the timestamp extension

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: 9ba0ff3e083f (&quo

[PATCH 08/12] drm/v3d: Validate passed in drm syncobj handles in the performance extension

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If userspace provides an unknown or invalid handle anywhere in the handle array the rest of the driver will not handle that well. Fix it by checking handle was looked up successfuly or otherwise fail the extension by jumping into the existing unwind. Signed-off-by: Tvrtko

[PATCH 06/12] drm/v3d: Fix potential memory leak in the performance extension

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin If fetching of userspace memory fails during the main loop, all drm sync objs looked up until that point will be leaked because of the missing drm_syncobj_put. Fix it by exporting and using a common cleanup helper. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 (&quo

[PATCH 04/12] drm/v3d: Align data types of internal and uapi counts

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin In the timestamp and performance extensions userspace type for counts is u32 so lets use unsigned in the kernel too. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a

[PATCH 03/12] drm/v3d: Add some local variables in queries/extensions

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Add some local variables to make the code a bit less verbose, with the main benefit being pulling some lines to under 80 columns wide. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 103 --- 1 file changed, 54 insertions

[PATCH 02/12] drm/v3d: Prefer get_user for scalar types

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin It makes it just a tiny bit more obvious what is going on. Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/v3d/v3d_submit.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm

[PATCH 00/12] v3d: Perfmon cleanup

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin When we had to quickly deal with a tree build issue via merging 792d16b5375d ("drm/v3d: Move perfmon init completely into own unit"), we promised to follow up with a nicer solution. As in the process of eliminating the hardcoded defines we have discovered a few

[PATCH 01/12] drm/v3d: Prevent out of bounds access in performance query extensions

2024-07-09 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Check that the number of perfmons userspace is passing in the copy and reset extensions is not greater than the internal kernel storage where the ids will be copied into. Signed-off-by: Tvrtko Ursulin Fixes: bae7cb5d6800 ("drm/v3d: Create a CPU job extension for the

Re: [PATCH] drm/i915/gt: Do not consider preemption during execlists_dequeue for gen8

2024-07-09 Thread Tvrtko Ursulin
On 09/07/2024 13:53, Nitin Gote wrote: We're seeing a GPU HANG issue on a CHV platform, which was caused by bac24f59f454 ("drm/i915/execlists: Enable coarse preemption boundaries for gen8"). Gen8 platform has only timeslice and doesn't support a preemption mechanism as engines do not have a p

[PULL] drm-intel-gt-next

2024-07-04 Thread Tvrtko Ursulin
Hi Dave, Sima, The final pull for 6.11 is quite small and only contains a handful of fixes in areas such as stolen memory probing on ATS-M, GuC priority handling, out of memory reporting noise downgrade and fence register hanlding race condition reported by CI. Regards, Tvrtko drm-intel-gt-ne

Re: [PATCH 1/4] drm/scheduler: implement hardware time accounting

2024-07-02 Thread Tvrtko Ursulin
Hi, I few questions below. On 01/07/2024 18:14, Lucas Stach wrote: From: Christian König Multiple drivers came up with the requirement to measure how much runtime each entity accumulated on the HW. A previous attempt of accounting this had to be reverted because HW submissions can have a l

Re: [RFC PATCH 2/6] drm/cgroup: Add memory accounting DRM cgroup

2024-07-01 Thread Tvrtko Ursulin
On 01/07/2024 10:25, Maarten Lankhorst wrote: Den 2024-06-28 kl. 16:04, skrev Maxime Ripard: Hi, On Thu, Jun 27, 2024 at 09:22:56PM GMT, Maarten Lankhorst wrote: Den 2024-06-27 kl. 19:16, skrev Maxime Ripard: Hi, Thanks for working on this! On Thu, Jun 27, 2024 at 05:47:21PM GMT, Maarten

Re: [PATCH 5/6] drm/amdgpu: always enable move threshold for BOs

2024-06-28 Thread Tvrtko Ursulin
Hey Christian, Any thoughts on the below reply? Did I get it wrong or I found a legitimate issue? Regards, Tvrtko On 14/06/2024 17:06, Tvrtko Ursulin wrote: On 14/06/2024 10:53, Christian König wrote:   if (domain & abo->preferred_domains & AMDGPU_GEM_

Re: [PATCH] dma-buf/sw_sync: Add a reference when adding fence to timeline list

2024-06-19 Thread Tvrtko Ursulin
On 14/06/2024 19:00, Thadeu Lima de Souza Cascardo wrote: On Fri, Jun 14, 2024 at 11:52:03AM +0100, Tvrtko Ursulin wrote: On 24/03/2024 10:15, Thadeu Lima de Souza Cascardo wrote: commit e531fdb5cd5e ("dma-buf/sw_sync: Avoid recursive lock during fence signal") fixed a recursi

Re: [PATCH 5/6] drm/amdgpu: always enable move threshold for BOs

2024-06-14 Thread Tvrtko Ursulin
On 14/06/2024 10:53, Christian König wrote:   if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM && -    !(adev->flags & AMD_IS_APU)) -    places[c].flags |= TTM_PL_FLAG_FALLBACK; +    !(adev->flags & AMD_IS_APU)) { +    /* + * Wh

Re: [PATCH] dma-buf/sw_sync: Add a reference when adding fence to timeline list

2024-06-14 Thread Tvrtko Ursulin
On 24/03/2024 10:15, Thadeu Lima de Souza Cascardo wrote: commit e531fdb5cd5e ("dma-buf/sw_sync: Avoid recursive lock during fence signal") fixed a recursive locking when a signal callback released a fence. It did it by taking an extra reference while traversing it on the list and holding the t

[PULL] drm-intel-gt-next

2024-06-12 Thread Tvrtko Ursulin
the timeout used. A couple tiny cleanups here and there and finally one back-merge which was required to land some display code base refactoring. Regards, Tvrtko drm-intel-gt-next-2024-06-12: UAPI Changes: - Support replaying GPU hangs with captured context image (Tvrtko Ursulin) Driver

Re: [PATCH 5/6] drm/amdgpu: always enable move threshold for BOs

2024-06-11 Thread Tvrtko Ursulin
Hi Christian, On 04/06/2024 17:05, Christian König wrote: This should prevent buffer moves when the threshold is reached during CS. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 36 -- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 22 ++

Re: [PATCH] drm/i915/gt: debugfs: Evaluate forcewake usage within locks

2024-06-11 Thread Tvrtko Ursulin
On 10/06/2024 10:24, Nirmoy Das wrote: Hi Andi, On 6/7/2024 4:51 PM, Andi Shyti wrote: The forcewake count and domains listing is multi process critical and the uncore provides a spinlock for such cases. Lock the forcewake evaluation section in the fw_domains_show() debugfs interface. Signe

Re: [PATCH] drm/i915/gt: Delete the live_hearbeat_fast selftest

2024-06-10 Thread Tvrtko Ursulin
Hi Andi, On 10/06/2024 13:10, Andi Shyti wrote: Hi Tvrtko, On Mon, Jun 10, 2024 at 12:42:31PM +0100, Tvrtko Ursulin wrote: On 03/06/2024 17:20, Niemiec, Krzysztof wrote: The test is trying to push the heartbeat frequency to the limit, which might sometimes fail. Such a failure does not

Re: [PATCH] drm/i915/gt: Delete the live_hearbeat_fast selftest

2024-06-10 Thread Tvrtko Ursulin
On 03/06/2024 17:20, Niemiec, Krzysztof wrote: The test is trying to push the heartbeat frequency to the limit, which might sometimes fail. Such a failure does not provide valuable information, because it does not indicate that there is something necessarily wrong with either the driver or the

Re: [PATCH] drm/v3d: Fix perfmon build error/warning

2024-06-07 Thread Tvrtko Ursulin
On 05/06/2024 08:19, Iago Toral wrote: Thanks for looking at ixing this Tvrtko. El mar, 04-06-2024 a las 17:02 +0100, Tvrtko Ursulin escribió: From: Tvrtko Ursulin Move static const array into the source file to fix the "defined but not used" errors. The fix is perhaps not the

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

2024-06-06 Thread Tvrtko Ursulin
On 06/06/2024 02:49, Adrián Larumbe wrote: Some drivers must allocate a considerable amount of memory for bookkeeping structures and GPU's MCU-kernel shared communication regions. These are often created as a result of the invocation of the driver's ioctl() interface functions, so it is sensib

[PATCH] drm/v3d: Fix perfmon build error/warning

2024-06-04 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Move static const array into the source file to fix the "defined but not used" errors. The fix is perhaps not the prettiest due hand crafting the array sizes in v3d_performance_counters.h, but I did add some build time asserts to validate the counts look se

Re: [PATCH 2/2] drm/amdgpu: Use drm_print_memory_stats helper from fdinfo

2024-05-30 Thread Tvrtko Ursulin
Hi, On 20/05/2024 12:13, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Convert fdinfo memory stats to use the common drm_print_memory_stats helper. This achieves alignment with the common keys as documented in drm-usage-stats.rst, adding specifically drm-total- key the driver was missing

Re: [RFC v2 0/2] Discussion around eviction improvements

2024-05-30 Thread Tvrtko Ursulin
Hi, On 16/05/2024 13:18, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Reduced re-spin of my previous series after Christian corrected a few misconceptions that I had. So lets see if what remains makes sense or is still misguided. To summarise, the series address the following two issues

[PATCH] drm/i915: 2 GiB of relocations ought to be enough for anybody*

2024-05-21 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Kernel test robot reports i915 can hit a warn in kvmalloc_node which has a purpose of dissalowing crazy size kernel allocations. This was added in 7661809d493b ("mm: don't allow oversized kvmalloc() calls"): /* Don't even allow crazy sizes */

[PATCH 2/2] drm/amdgpu: Use drm_print_memory_stats helper from fdinfo

2024-05-20 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Convert fdinfo memory stats to use the common drm_print_memory_stats helper. This achieves alignment with the common keys as documented in drm-usage-stats.rst, adding specifically drm-total- key the driver was missing until now. Additionally I made the code stop skipping

[PATCH 1/2] Documentation/gpu: Document the situation with unqualified drm-memory-

2024-05-20 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Currently it is not well defined what is drm-memory- compared to other categories. In practice the only driver which emits these keys is amdgpu and in them exposes the current resident buffer object memory (including shared). To prevent any confusion, document that drm

Re: [RFC v2 0/2] Discussion around eviction improvements

2024-05-17 Thread Tvrtko Ursulin
On 16/05/2024 20:21, Alex Deucher wrote: On Thu, May 16, 2024 at 8:18 AM Tvrtko Ursulin wrote: From: Tvrtko Ursulin Reduced re-spin of my previous series after Christian corrected a few misconceptions that I had. So lets see if what remains makes sense or is still misguided. To summarise

[RFC v2 0/2] Discussion around eviction improvements

2024-05-16 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Reduced re-spin of my previous series after Christian corrected a few misconceptions that I had. So lets see if what remains makes sense or is still misguided. To summarise, the series address the following two issues: * Migration rate limiting does not work, at least not

[RFC 2/2] drm/amdgpu: Actually respect buffer migration budget

2024-05-16 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Current code appears to live in a misconception that playing with buffer allowed and preferred placements can always control the decision on whether backing store migration will be attempted or not. That is however not the case when userspace sets buffer placements of VRAM

[RFC 1/2] drm/amdgpu: Re-validate evicted buffers

2024-05-16 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Currently the driver appears to be thinking that it will be attempting to re-validate the evicted buffers on the next submission if they are not in their preferred placement. That however appears not to be true for the very common case of buffers with allowed placements of

Re: [PATCH v4 8/8] drm/xe/client: Print runtime to fdinfo

2024-05-16 Thread Tvrtko Ursulin
driver may implement either this key or drm-total-cycles-, but not +both. + For the spec part: Acked-by: Tvrtko Ursulin Some minor comments and questions below. Memory ^^ @@ -168,5 +184,6 @@ be documented above and where possible, aligned with other dri

Re: [RFC 2/5] drm/amdgpu: Actually respect buffer migration budget

2024-05-15 Thread Tvrtko Ursulin
On 15/05/2024 15:31, Christian König wrote: Am 15.05.24 um 12:59 schrieb Tvrtko Ursulin: On 15/05/2024 08:20, Christian König wrote: Am 08.05.24 um 20:09 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Current code appears to live in a misconception that playing with buffer allowed and

Re: [RFC 2/5] drm/amdgpu: Actually respect buffer migration budget

2024-05-15 Thread Tvrtko Ursulin
On 15/05/2024 08:20, Christian König wrote: Am 08.05.24 um 20:09 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin Current code appears to live in a misconception that playing with buffer allowed and preferred placements can control the decision on whether backing store migration will be

Re: [RFC 1/5] drm/amdgpu: Fix migration rate limiting accounting

2024-05-15 Thread Tvrtko Ursulin
On 15/05/2024 08:14, Christian König wrote: Am 08.05.24 um 20:09 schrieb Tvrtko Ursulin: From: Tvrtko Ursulin The logic assumed any migration attempt worked and therefore would over- account the amount of data migrated during buffer re-validation. As a consequence client can be unfairly

Re: [RFC 0/5] Discussion around eviction improvements

2024-05-14 Thread Tvrtko Ursulin
On 13/05/2024 14:49, Tvrtko Ursulin wrote: On 09/05/2024 13:40, Tvrtko Ursulin wrote: On 08/05/2024 19:09, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Last few days I was looking at the situation with VRAM over subscription, what happens versus what perhaps should happen. Browsing

Re: [RFC 0/5] Discussion around eviction improvements

2024-05-13 Thread Tvrtko Ursulin
On 09/05/2024 13:40, Tvrtko Ursulin wrote: On 08/05/2024 19:09, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Last few days I was looking at the situation with VRAM over subscription, what happens versus what perhaps should happen. Browsing through the driver and running some simple

Re: [PATCH 12/12] accel/ivpu: Share NPU busy time in sysfs

2024-05-13 Thread Tvrtko Ursulin
On 13/05/2024 11:22, Jacek Lawrynowicz wrote: Hi, On 10.05.2024 18:55, Jeffrey Hugo wrote: On 5/8/2024 7:29 AM, Jacek Lawrynowicz wrote: From: Tomasz Rusinowicz The driver tracks the time spent by NPU executing jobs and shares it through sysfs `npu_busy_time_us` file. It can be then used b

Re: [RFC 0/5] Discussion around eviction improvements

2024-05-09 Thread Tvrtko Ursulin
On 08/05/2024 19:09, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Last few days I was looking at the situation with VRAM over subscription, what happens versus what perhaps should happen. Browsing through the driver and running some simple experiments. I ended up with this patch series which

<    1   2   3   4   5   6   7   8   9   10   >